maxsimcli 3.8.1 → 3.10.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.
Files changed (27) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/assets/CHANGELOG.md +22 -0
  3. package/dist/assets/dashboard/client/assets/index-DzJChB-D.css +32 -0
  4. package/dist/assets/dashboard/client/assets/index-c2U_AZL9.js +231 -0
  5. package/dist/assets/dashboard/client/index.html +2 -2
  6. package/dist/assets/dashboard/server.js +20558 -426
  7. package/dist/assets/templates/references/dashboard-bridge.md +59 -0
  8. package/dist/assets/templates/workflows/add-tests.md +1 -0
  9. package/dist/assets/templates/workflows/add-todo.md +1 -0
  10. package/dist/assets/templates/workflows/check-todos.md +1 -0
  11. package/dist/assets/templates/workflows/cleanup.md +1 -0
  12. package/dist/assets/templates/workflows/complete-milestone.md +1 -0
  13. package/dist/assets/templates/workflows/discovery-phase.md +4 -0
  14. package/dist/assets/templates/workflows/discuss-phase.md +12 -4
  15. package/dist/assets/templates/workflows/execute-phase.md +40 -2
  16. package/dist/assets/templates/workflows/execute-plan.md +6 -0
  17. package/dist/assets/templates/workflows/init-existing.md +1 -0
  18. package/dist/assets/templates/workflows/new-milestone.md +1 -0
  19. package/dist/assets/templates/workflows/new-project.md +1 -0
  20. package/dist/assets/templates/workflows/plan-phase.md +1 -0
  21. package/dist/assets/templates/workflows/quick.md +1 -0
  22. package/dist/assets/templates/workflows/settings.md +1 -0
  23. package/dist/assets/templates/workflows/update.md +1 -0
  24. package/dist/assets/templates/workflows/verify-work.md +18 -1
  25. package/package.json +1 -1
  26. package/dist/assets/dashboard/client/assets/index-BsuHkXQ_.css +0 -32
  27. package/dist/assets/dashboard/client/assets/index-DaoQD7tI.js +0 -217
@@ -0,0 +1,231 @@
1
+ (function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const r of s)if(r.type==="childList")for(const o of r.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function i(s){const r={};return s.integrity&&(r.integrity=s.integrity),s.referrerPolicy&&(r.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?r.credentials="include":s.crossOrigin==="anonymous"?r.credentials="omit":r.credentials="same-origin",r}function n(s){if(s.ep)return;s.ep=!0;const r=i(s);fetch(s.href,r)}})();function WS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Hv={exports:{}},Su={};/**
2
+ * @license React
3
+ * react-jsx-runtime.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 K5;function jj(){if(K5)return Su;K5=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function i(n,s,r){var o=null;if(r!==void 0&&(o=""+r),s.key!==void 0&&(o=""+s.key),"key"in s){r={};for(var l in s)l!=="key"&&(r[l]=s[l])}else r=s;return s=r.ref,{$$typeof:t,type:n,key:o,ref:s!==void 0?s:null,props:r}}return Su.Fragment=e,Su.jsx=i,Su.jsxs=i,Su}var J5;function Ij(){return J5||(J5=1,Hv.exports=jj()),Hv.exports}var S=Ij(),Fv={exports:{}},je={};/**
10
+ * @license React
11
+ * react.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 eT;function Vj(){if(eT)return je;eT=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),r=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),g=Symbol.iterator;function O(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,x={};function w(I,K,Q){this.props=I,this.context=K,this.refs=x,this.updater=Q||_}w.prototype.isReactComponent={},w.prototype.setState=function(I,K){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,K,"setState")},w.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function k(){}k.prototype=w.prototype;function T(I,K,Q){this.props=I,this.context=K,this.refs=x,this.updater=Q||_}var A=T.prototype=new k;A.constructor=T,b(A,w.prototype),A.isPureReactComponent=!0;var L=Array.isArray;function E(){}var z={H:null,A:null,T:null,S:null},N=Object.prototype.hasOwnProperty;function q(I,K,Q){var ue=Q.ref;return{$$typeof:t,type:I,key:K,ref:ue!==void 0?ue:null,props:Q}}function J(I,K){return q(I.type,K,I.props)}function U(I){return typeof I=="object"&&I!==null&&I.$$typeof===t}function R(I){var K={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Q){return K[Q]})}var B=/\/+/g;function D(I,K){return typeof I=="object"&&I!==null&&I.key!=null?R(""+I.key):K.toString(36)}function j(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(E,E):(I.status="pending",I.then(function(K){I.status==="pending"&&(I.status="fulfilled",I.value=K)},function(K){I.status==="pending"&&(I.status="rejected",I.reason=K)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function $(I,K,Q,ue,he){var fe=typeof I;(fe==="undefined"||fe==="boolean")&&(I=null);var Oe=!1;if(I===null)Oe=!0;else switch(fe){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(I.$$typeof){case t:case e:Oe=!0;break;case d:return Oe=I._init,$(Oe(I._payload),K,Q,ue,he)}}if(Oe)return he=he(I),Oe=ue===""?"."+D(I,0):ue,L(he)?(Q="",Oe!=null&&(Q=Oe.replace(B,"$&/")+"/"),$(he,K,Q,"",function(nt){return nt})):he!=null&&(U(he)&&(he=J(he,Q+(he.key==null||I&&I.key===he.key?"":(""+he.key).replace(B,"$&/")+"/")+Oe)),K.push(he)),1;Oe=0;var Ce=ue===""?".":ue+":";if(L(I))for(var ye=0;ye<I.length;ye++)ue=I[ye],fe=Ce+D(ue,ye),Oe+=$(ue,K,Q,fe,he);else if(ye=O(I),typeof ye=="function")for(I=ye.call(I),ye=0;!(ue=I.next()).done;)ue=ue.value,fe=Ce+D(ue,ye++),Oe+=$(ue,K,Q,fe,he);else if(fe==="object"){if(typeof I.then=="function")return $(j(I),K,Q,ue,he);throw K=String(I),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function X(I,K,Q){if(I==null)return I;var ue=[],he=0;return $(I,ue,"","",function(fe){return K.call(Q,fe,he++)}),ue}function H(I){if(I._status===-1){var K=I._result;K=K(),K.then(function(Q){(I._status===0||I._status===-1)&&(I._status=1,I._result=Q)},function(Q){(I._status===0||I._status===-1)&&(I._status=2,I._result=Q)}),I._status===-1&&(I._status=0,I._result=K)}if(I._status===1)return I._result.default;throw I._result}var F=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var K=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(K))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)},M={map:X,forEach:function(I,K,Q){X(I,function(){K.apply(this,arguments)},Q)},count:function(I){var K=0;return X(I,function(){K++}),K},toArray:function(I){return X(I,function(K){return K})||[]},only:function(I){if(!U(I))throw Error("React.Children.only expected to receive a single React element child.");return I}};return je.Activity=p,je.Children=M,je.Component=w,je.Fragment=i,je.Profiler=s,je.PureComponent=T,je.StrictMode=n,je.Suspense=c,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,je.__COMPILER_RUNTIME={__proto__:null,c:function(I){return z.H.useMemoCache(I)}},je.cache=function(I){return function(){return I.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(I,K,Q){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var ue=b({},I.props),he=I.key;if(K!=null)for(fe in K.key!==void 0&&(he=""+K.key),K)!N.call(K,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&K.ref===void 0||(ue[fe]=K[fe]);var fe=arguments.length-2;if(fe===1)ue.children=Q;else if(1<fe){for(var Oe=Array(fe),Ce=0;Ce<fe;Ce++)Oe[Ce]=arguments[Ce+2];ue.children=Oe}return q(I.type,he,ue)},je.createContext=function(I){return I={$$typeof:o,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:r,_context:I},I},je.createElement=function(I,K,Q){var ue,he={},fe=null;if(K!=null)for(ue in K.key!==void 0&&(fe=""+K.key),K)N.call(K,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(he[ue]=K[ue]);var Oe=arguments.length-2;if(Oe===1)he.children=Q;else if(1<Oe){for(var Ce=Array(Oe),ye=0;ye<Oe;ye++)Ce[ye]=arguments[ye+2];he.children=Ce}if(I&&I.defaultProps)for(ue in Oe=I.defaultProps,Oe)he[ue]===void 0&&(he[ue]=Oe[ue]);return q(I,fe,he)},je.createRef=function(){return{current:null}},je.forwardRef=function(I){return{$$typeof:l,render:I}},je.isValidElement=U,je.lazy=function(I){return{$$typeof:d,_payload:{_status:-1,_result:I},_init:H}},je.memo=function(I,K){return{$$typeof:u,type:I,compare:K===void 0?null:K}},je.startTransition=function(I){var K=z.T,Q={};z.T=Q;try{var ue=I(),he=z.S;he!==null&&he(Q,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(E,F)}catch(fe){F(fe)}finally{K!==null&&Q.types!==null&&(K.types=Q.types),z.T=K}},je.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},je.use=function(I){return z.H.use(I)},je.useActionState=function(I,K,Q){return z.H.useActionState(I,K,Q)},je.useCallback=function(I,K){return z.H.useCallback(I,K)},je.useContext=function(I){return z.H.useContext(I)},je.useDebugValue=function(){},je.useDeferredValue=function(I,K){return z.H.useDeferredValue(I,K)},je.useEffect=function(I,K){return z.H.useEffect(I,K)},je.useEffectEvent=function(I){return z.H.useEffectEvent(I)},je.useId=function(){return z.H.useId()},je.useImperativeHandle=function(I,K,Q){return z.H.useImperativeHandle(I,K,Q)},je.useInsertionEffect=function(I,K){return z.H.useInsertionEffect(I,K)},je.useLayoutEffect=function(I,K){return z.H.useLayoutEffect(I,K)},je.useMemo=function(I,K){return z.H.useMemo(I,K)},je.useOptimistic=function(I,K){return z.H.useOptimistic(I,K)},je.useReducer=function(I,K,Q){return z.H.useReducer(I,K,Q)},je.useRef=function(I){return z.H.useRef(I)},je.useState=function(I){return z.H.useState(I)},je.useSyncExternalStore=function(I,K,Q){return z.H.useSyncExternalStore(I,K,Q)},je.useTransition=function(){return z.H.useTransition()},je.version="19.2.4",je}var tT;function US(){return tT||(tT=1,Fv.exports=Vj()),Fv.exports}var Z=US(),Gv={exports:{}},xu={},Kv={exports:{}},Jv={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var iT;function Xj(){return iT||(iT=1,(function(t){function e($,X){var H=$.length;$.push(X);e:for(;0<H;){var F=H-1>>>1,M=$[F];if(0<s(M,X))$[F]=X,$[H]=M,H=F;else break e}}function i($){return $.length===0?null:$[0]}function n($){if($.length===0)return null;var X=$[0],H=$.pop();if(H!==X){$[0]=H;e:for(var F=0,M=$.length,I=M>>>1;F<I;){var K=2*(F+1)-1,Q=$[K],ue=K+1,he=$[ue];if(0>s(Q,H))ue<M&&0>s(he,Q)?($[F]=he,$[ue]=H,F=ue):($[F]=Q,$[K]=H,F=K);else if(ue<M&&0>s(he,H))$[F]=he,$[ue]=H,F=ue;else break e}}return X}function s($,X){var H=$.sortIndex-X.sortIndex;return H!==0?H:$.id-X.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var r=performance;t.unstable_now=function(){return r.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,p=null,g=3,O=!1,_=!1,b=!1,x=!1,w=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function A($){for(var X=i(u);X!==null;){if(X.callback===null)n(u);else if(X.startTime<=$)n(u),X.sortIndex=X.expirationTime,e(c,X);else break;X=i(u)}}function L($){if(b=!1,A($),!_)if(i(c)!==null)_=!0,E||(E=!0,R());else{var X=i(u);X!==null&&j(L,X.startTime-$)}}var E=!1,z=-1,N=5,q=-1;function J(){return x?!0:!(t.unstable_now()-q<N)}function U(){if(x=!1,E){var $=t.unstable_now();q=$;var X=!0;try{e:{_=!1,b&&(b=!1,k(z),z=-1),O=!0;var H=g;try{t:{for(A($),p=i(c);p!==null&&!(p.expirationTime>$&&J());){var F=p.callback;if(typeof F=="function"){p.callback=null,g=p.priorityLevel;var M=F(p.expirationTime<=$);if($=t.unstable_now(),typeof M=="function"){p.callback=M,A($),X=!0;break t}p===i(c)&&n(c),A($)}else n(c);p=i(c)}if(p!==null)X=!0;else{var I=i(u);I!==null&&j(L,I.startTime-$),X=!1}}break e}finally{p=null,g=H,O=!1}X=void 0}}finally{X?R():E=!1}}}var R;if(typeof T=="function")R=function(){T(U)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,D=B.port2;B.port1.onmessage=U,R=function(){D.postMessage(null)}}else R=function(){w(U,0)};function j($,X){z=w(function(){$(t.unstable_now())},X)}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($){$.callback=null},t.unstable_forceFrameRate=function($){0>$||125<$?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<$?Math.floor(1e3/$):5},t.unstable_getCurrentPriorityLevel=function(){return g},t.unstable_next=function($){switch(g){case 1:case 2:case 3:var X=3;break;default:X=g}var H=g;g=X;try{return $()}finally{g=H}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function($,X){switch($){case 1:case 2:case 3:case 4:case 5:break;default:$=3}var H=g;g=$;try{return X()}finally{g=H}},t.unstable_scheduleCallback=function($,X,H){var F=t.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?F+H:F):H=F,$){case 1:var M=-1;break;case 2:M=250;break;case 5:M=1073741823;break;case 4:M=1e4;break;default:M=5e3}return M=H+M,$={id:d++,callback:X,priorityLevel:$,startTime:H,expirationTime:M,sortIndex:-1},H>F?($.sortIndex=H,e(u,$),i(c)===null&&$===i(u)&&(b?(k(z),z=-1):b=!0,j(L,H-F))):($.sortIndex=M,e(c,$),_||O||(_=!0,E||(E=!0,R()))),$},t.unstable_shouldYield=J,t.unstable_wrapCallback=function($){var X=g;return function(){var H=g;g=X;try{return $.apply(this,arguments)}finally{g=H}}}})(Jv)),Jv}var nT;function Zj(){return nT||(nT=1,Kv.exports=Xj()),Kv.exports}var e_={exports:{}},Ji={};/**
26
+ * @license React
27
+ * react-dom.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 sT;function qj(){if(sT)return Ji;sT=1;var t=US();function e(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)u+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var n={d:{f:i,r:function(){throw Error(e(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},s=Symbol.for("react.portal");function r(c,u,d){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:c,containerInfo:u,implementation:d}}var o=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return Ji.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Ji.createPortal=function(c,u){var d=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return r(c,u,null,d)},Ji.flushSync=function(c){var u=o.T,d=n.p;try{if(o.T=null,n.p=2,c)return c()}finally{o.T=u,n.p=d,n.d.f()}},Ji.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,n.d.C(c,u))},Ji.prefetchDNS=function(c){typeof c=="string"&&n.d.D(c)},Ji.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var d=u.as,p=l(d,u.crossOrigin),g=typeof u.integrity=="string"?u.integrity:void 0,O=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;d==="style"?n.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:p,integrity:g,fetchPriority:O}):d==="script"&&n.d.X(c,{crossOrigin:p,integrity:g,fetchPriority:O,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},Ji.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var d=l(u.as,u.crossOrigin);n.d.M(c,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&n.d.M(c)},Ji.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var d=u.as,p=l(d,u.crossOrigin);n.d.L(c,d,{crossOrigin:p,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},Ji.preloadModule=function(c,u){if(typeof c=="string")if(u){var d=l(u.as,u.crossOrigin);n.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else n.d.m(c)},Ji.requestFormReset=function(c){n.d.r(c)},Ji.unstable_batchedUpdates=function(c,u){return c(u)},Ji.useFormState=function(c,u,d){return o.H.useFormState(c,u,d)},Ji.useFormStatus=function(){return o.H.useHostTransitionStatus()},Ji.version="19.2.4",Ji}var rT;function Wj(){if(rT)return e_.exports;rT=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(),e_.exports=qj(),e_.exports}/**
34
+ * @license React
35
+ * react-dom-client.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 oT;function Uj(){if(oT)return xu;oT=1;var t=Zj(),e=US(),i=Wj();function n(a){var h="https://react.dev/errors/"+a;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)h+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+a+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function r(a){var h=a,f=a;if(a.alternate)for(;h.return;)h=h.return;else{a=h;do h=a,(h.flags&4098)!==0&&(f=h.return),a=h.return;while(a)}return h.tag===3?f:null}function o(a){if(a.tag===13){var h=a.memoizedState;if(h===null&&(a=a.alternate,a!==null&&(h=a.memoizedState)),h!==null)return h.dehydrated}return null}function l(a){if(a.tag===31){var h=a.memoizedState;if(h===null&&(a=a.alternate,a!==null&&(h=a.memoizedState)),h!==null)return h.dehydrated}return null}function c(a){if(r(a)!==a)throw Error(n(188))}function u(a){var h=a.alternate;if(!h){if(h=r(a),h===null)throw Error(n(188));return h!==a?null:a}for(var f=a,m=h;;){var v=f.return;if(v===null)break;var y=v.alternate;if(y===null){if(m=v.return,m!==null){f=m;continue}break}if(v.child===y.child){for(y=v.child;y;){if(y===f)return c(v),a;if(y===m)return c(v),h;y=y.sibling}throw Error(n(188))}if(f.return!==m.return)f=v,m=y;else{for(var C=!1,P=v.child;P;){if(P===f){C=!0,f=v,m=y;break}if(P===m){C=!0,m=v,f=y;break}P=P.sibling}if(!C){for(P=y.child;P;){if(P===f){C=!0,f=y,m=v;break}if(P===m){C=!0,m=y,f=v;break}P=P.sibling}if(!C)throw Error(n(189))}}if(f.alternate!==m)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?a:h}function d(a){var h=a.tag;if(h===5||h===26||h===27||h===6)return a;for(a=a.child;a!==null;){if(h=d(a),h!==null)return h;a=a.sibling}return null}var p=Object.assign,g=Symbol.for("react.element"),O=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),T=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),z=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),J=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function R(a){return a===null||typeof a!="object"?null:(a=U&&a[U]||a["@@iterator"],typeof a=="function"?a:null)}var B=Symbol.for("react.client.reference");function D(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===B?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case b:return"Fragment";case w:return"Profiler";case x:return"StrictMode";case L:return"Suspense";case E:return"SuspenseList";case q:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case _:return"Portal";case T:return a.displayName||"Context";case k:return(a._context.displayName||"Context")+".Consumer";case A:var h=a.render;return a=a.displayName,a||(a=h.displayName||h.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case z:return h=a.displayName||null,h!==null?h:D(a.type)||"Memo";case N:h=a._payload,a=a._init;try{return D(a(h))}catch{}}return null}var j=Array.isArray,$=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},F=[],M=-1;function I(a){return{current:a}}function K(a){0>M||(a.current=F[M],F[M]=null,M--)}function Q(a,h){M++,F[M]=a.current,a.current=h}var ue=I(null),he=I(null),fe=I(null),Oe=I(null);function Ce(a,h){switch(Q(fe,h),Q(he,a),Q(ue,null),h.nodeType){case 9:case 11:a=(a=h.documentElement)&&(a=a.namespaceURI)?b5(a):0;break;default:if(a=h.tagName,h=h.namespaceURI)h=b5(h),a=S5(h,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}K(ue),Q(ue,a)}function ye(){K(ue),K(he),K(fe)}function nt(a){a.memoizedState!==null&&Q(Oe,a);var h=ue.current,f=S5(h,a.type);h!==f&&(Q(he,a),Q(ue,f))}function Qt(a){he.current===a&&(K(ue),K(he)),Oe.current===a&&(K(Oe),vu._currentValue=H)}var Yt,ei;function Le(a){if(Yt===void 0)try{throw Error()}catch(f){var h=f.stack.trim().match(/\n( *(at )?)/);Yt=h&&h[1]||"",ei=-1<f.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Yt+a+ei}var as=!1;function Co(a,h){if(!a||as)return"";as=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(h){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(ne){var ie=ne}Reflect.construct(a,[],le)}else{try{le.call()}catch(ne){ie=ne}a.call(le.prototype)}}else{try{throw Error()}catch(ne){ie=ne}(le=a())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(ne){if(ne&&ie&&typeof ne.stack=="string")return[ne.stack,ie.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=m.DetermineComponentFrameRoot(),C=y[0],P=y[1];if(C&&P){var W=C.split(`
44
+ `),te=P.split(`
45
+ `);for(v=m=0;m<W.length&&!W[m].includes("DetermineComponentFrameRoot");)m++;for(;v<te.length&&!te[v].includes("DetermineComponentFrameRoot");)v++;if(m===W.length||v===te.length)for(m=W.length-1,v=te.length-1;1<=m&&0<=v&&W[m]!==te[v];)v--;for(;1<=m&&0<=v;m--,v--)if(W[m]!==te[v]){if(m!==1||v!==1)do if(m--,v--,0>v||W[m]!==te[v]){var se=`
46
+ `+W[m].replace(" at new "," at ");return a.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",a.displayName)),se}while(1<=m&&0<=v);break}}}finally{as=!1,Error.prepareStackTrace=f}return(f=a?a.displayName||a.name:"")?Le(f):""}function ko(a,h){switch(a.tag){case 26:case 27:case 5:return Le(a.type);case 16:return Le("Lazy");case 13:return a.child!==h&&h!==null?Le("Suspense Fallback"):Le("Suspense");case 19:return Le("SuspenseList");case 0:case 15:return Co(a.type,!1);case 11:return Co(a.type.render,!1);case 1:return Co(a.type,!0);case 31:return Le("Activity");default:return""}}function La(a){try{var h="",f=null;do h+=ko(a,f),f=a,a=a.return;while(a);return h}catch(m){return`
47
+ Error generating stack: `+m.message+`
48
+ `+m.stack}}var Dr=Object.prototype.hasOwnProperty,To=t.unstable_scheduleCallback,Mh=t.unstable_cancelCallback,LO=t.unstable_shouldYield,DO=t.unstable_requestPaint,cn=t.unstable_now,BO=t.unstable_getCurrentPriorityLevel,oe=t.unstable_ImmediatePriority,ge=t.unstable_UserBlockingPriority,De=t.unstable_NormalPriority,Ue=t.unstable_LowPriority,ht=t.unstable_IdlePriority,In=t.log,Br=t.unstable_setDisableYieldValue,hn=null,fi=null;function Sn(a){if(typeof In=="function"&&Br(a),fi&&typeof fi.setStrictMode=="function")try{fi.setStrictMode(hn,a)}catch{}}var _t=Math.clz32?Math.clz32:kN,Ao=Math.log,Bs=Math.LN2;function kN(a){return a>>>=0,a===0?32:31-(Ao(a)/Bs|0)|0}var Td=256,Ad=262144,Ed=4194304;function Da(a){var h=a&42;if(h!==0)return h;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function Md(a,h,f){var m=a.pendingLanes;if(m===0)return 0;var v=0,y=a.suspendedLanes,C=a.pingedLanes;a=a.warmLanes;var P=m&134217727;return P!==0?(m=P&~y,m!==0?v=Da(m):(C&=P,C!==0?v=Da(C):f||(f=P&~a,f!==0&&(v=Da(f))))):(P=m&~y,P!==0?v=Da(P):C!==0?v=Da(C):f||(f=m&~a,f!==0&&(v=Da(f)))),v===0?0:h!==0&&h!==v&&(h&y)===0&&(y=v&-v,f=h&-h,y>=f||y===32&&(f&4194048)!==0)?h:v}function Ph(a,h){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&h)===0}function TN(a,h){switch(a){case 1:case 2:case 4:case 8:case 64:return h+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 h+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 iC(){var a=Ed;return Ed<<=1,(Ed&62914560)===0&&(Ed=4194304),a}function $O(a){for(var h=[],f=0;31>f;f++)h.push(a);return h}function Rh(a,h){a.pendingLanes|=h,h!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function AN(a,h,f,m,v,y){var C=a.pendingLanes;a.pendingLanes=f,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=f,a.entangledLanes&=f,a.errorRecoveryDisabledLanes&=f,a.shellSuspendCounter=0;var P=a.entanglements,W=a.expirationTimes,te=a.hiddenUpdates;for(f=C&~f;0<f;){var se=31-_t(f),le=1<<se;P[se]=0,W[se]=-1;var ie=te[se];if(ie!==null)for(te[se]=null,se=0;se<ie.length;se++){var ne=ie[se];ne!==null&&(ne.lane&=-536870913)}f&=~le}m!==0&&nC(a,m,0),y!==0&&v===0&&a.tag!==0&&(a.suspendedLanes|=y&~(C&~h))}function nC(a,h,f){a.pendingLanes|=h,a.suspendedLanes&=~h;var m=31-_t(h);a.entangledLanes|=h,a.entanglements[m]=a.entanglements[m]|1073741824|f&261930}function sC(a,h){var f=a.entangledLanes|=h;for(a=a.entanglements;f;){var m=31-_t(f),v=1<<m;v&h|a[m]&h&&(a[m]|=h),f&=~v}}function rC(a,h){var f=h&-h;return f=(f&42)!==0?1:zO(f),(f&(a.suspendedLanes|h))!==0?0:f}function zO(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function NO(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function oC(){var a=X.p;return a!==0?a:(a=window.event,a===void 0?32:q5(a.type))}function aC(a,h){var f=X.p;try{return X.p=a,h()}finally{X.p=f}}var Eo=Math.random().toString(36).slice(2),zi="__reactFiber$"+Eo,xn="__reactProps$"+Eo,Nl="__reactContainer$"+Eo,jO="__reactEvents$"+Eo,EN="__reactListeners$"+Eo,MN="__reactHandles$"+Eo,lC="__reactResources$"+Eo,Qh="__reactMarker$"+Eo;function IO(a){delete a[zi],delete a[xn],delete a[jO],delete a[EN],delete a[MN]}function jl(a){var h=a[zi];if(h)return h;for(var f=a.parentNode;f;){if(h=f[Nl]||f[zi]){if(f=h.alternate,h.child!==null||f!==null&&f.child!==null)for(a=E5(a);a!==null;){if(f=a[zi])return f;a=E5(a)}return h}a=f,f=a.parentNode}return null}function Il(a){if(a=a[zi]||a[Nl]){var h=a.tag;if(h===5||h===6||h===13||h===31||h===26||h===27||h===3)return a}return null}function Lh(a){var h=a.tag;if(h===5||h===26||h===27||h===6)return a.stateNode;throw Error(n(33))}function Vl(a){var h=a[lC];return h||(h=a[lC]={hoistableStyles:new Map,hoistableScripts:new Map}),h}function bi(a){a[Qh]=!0}var cC=new Set,hC={};function Ba(a,h){Xl(a,h),Xl(a+"Capture",h)}function Xl(a,h){for(hC[a]=h,a=0;a<h.length;a++)cC.add(h[a])}var PN=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]*$"),uC={},fC={};function RN(a){return Dr.call(fC,a)?!0:Dr.call(uC,a)?!1:PN.test(a)?fC[a]=!0:(uC[a]=!0,!1)}function Pd(a,h,f){if(RN(h))if(f===null)a.removeAttribute(h);else{switch(typeof f){case"undefined":case"function":case"symbol":a.removeAttribute(h);return;case"boolean":var m=h.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(h);return}}a.setAttribute(h,""+f)}}function Rd(a,h,f){if(f===null)a.removeAttribute(h);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(h);return}a.setAttribute(h,""+f)}}function $r(a,h,f,m){if(m===null)a.removeAttribute(f);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(f);return}a.setAttributeNS(h,f,""+m)}}function ls(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function dC(a){var h=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(h==="checkbox"||h==="radio")}function QN(a,h,f){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,h);if(!a.hasOwnProperty(h)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var v=m.get,y=m.set;return Object.defineProperty(a,h,{configurable:!0,get:function(){return v.call(this)},set:function(C){f=""+C,y.call(this,C)}}),Object.defineProperty(a,h,{enumerable:m.enumerable}),{getValue:function(){return f},setValue:function(C){f=""+C},stopTracking:function(){a._valueTracker=null,delete a[h]}}}}function VO(a){if(!a._valueTracker){var h=dC(a)?"checked":"value";a._valueTracker=QN(a,h,""+a[h])}}function pC(a){if(!a)return!1;var h=a._valueTracker;if(!h)return!0;var f=h.getValue(),m="";return a&&(m=dC(a)?a.checked?"true":"false":a.value),a=m,a!==f?(h.setValue(a),!0):!1}function Qd(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var LN=/[\n"\\]/g;function cs(a){return a.replace(LN,function(h){return"\\"+h.charCodeAt(0).toString(16)+" "})}function XO(a,h,f,m,v,y,C,P){a.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?a.type=C:a.removeAttribute("type"),h!=null?C==="number"?(h===0&&a.value===""||a.value!=h)&&(a.value=""+ls(h)):a.value!==""+ls(h)&&(a.value=""+ls(h)):C!=="submit"&&C!=="reset"||a.removeAttribute("value"),h!=null?ZO(a,C,ls(h)):f!=null?ZO(a,C,ls(f)):m!=null&&a.removeAttribute("value"),v==null&&y!=null&&(a.defaultChecked=!!y),v!=null&&(a.checked=v&&typeof v!="function"&&typeof v!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?a.name=""+ls(P):a.removeAttribute("name")}function mC(a,h,f,m,v,y,C,P){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(a.type=y),h!=null||f!=null){if(!(y!=="submit"&&y!=="reset"||h!=null)){VO(a);return}f=f!=null?""+ls(f):"",h=h!=null?""+ls(h):f,P||h===a.value||(a.value=h),a.defaultValue=h}m=m??v,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=P?a.checked:!!m,a.defaultChecked=!!m,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(a.name=C),VO(a)}function ZO(a,h,f){h==="number"&&Qd(a.ownerDocument)===a||a.defaultValue===""+f||(a.defaultValue=""+f)}function Zl(a,h,f,m){if(a=a.options,h){h={};for(var v=0;v<f.length;v++)h["$"+f[v]]=!0;for(f=0;f<a.length;f++)v=h.hasOwnProperty("$"+a[f].value),a[f].selected!==v&&(a[f].selected=v),v&&m&&(a[f].defaultSelected=!0)}else{for(f=""+ls(f),h=null,v=0;v<a.length;v++){if(a[v].value===f){a[v].selected=!0,m&&(a[v].defaultSelected=!0);return}h!==null||a[v].disabled||(h=a[v])}h!==null&&(h.selected=!0)}}function gC(a,h,f){if(h!=null&&(h=""+ls(h),h!==a.value&&(a.value=h),f==null)){a.defaultValue!==h&&(a.defaultValue=h);return}a.defaultValue=f!=null?""+ls(f):""}function OC(a,h,f,m){if(h==null){if(m!=null){if(f!=null)throw Error(n(92));if(j(m)){if(1<m.length)throw Error(n(93));m=m[0]}f=m}f==null&&(f=""),h=f}f=ls(h),a.defaultValue=f,m=a.textContent,m===f&&m!==""&&m!==null&&(a.value=m),VO(a)}function ql(a,h){if(h){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=h;return}}a.textContent=h}var DN=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 vC(a,h,f){var m=h.indexOf("--")===0;f==null||typeof f=="boolean"||f===""?m?a.setProperty(h,""):h==="float"?a.cssFloat="":a[h]="":m?a.setProperty(h,f):typeof f!="number"||f===0||DN.has(h)?h==="float"?a.cssFloat=f:a[h]=(""+f).trim():a[h]=f+"px"}function _C(a,h,f){if(h!=null&&typeof h!="object")throw Error(n(62));if(a=a.style,f!=null){for(var m in f)!f.hasOwnProperty(m)||h!=null&&h.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var v in h)m=h[v],h.hasOwnProperty(v)&&f[v]!==m&&vC(a,v,m)}else for(var y in h)h.hasOwnProperty(y)&&vC(a,y,h[y])}function qO(a){if(a.indexOf("-")===-1)return!1;switch(a){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 BN=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"]]),$N=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ld(a){return $N.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function zr(){}var WO=null;function UO(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Wl=null,Ul=null;function yC(a){var h=Il(a);if(h&&(a=h.stateNode)){var f=a[xn]||null;e:switch(a=h.stateNode,h.type){case"input":if(XO(a,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name),h=f.name,f.type==="radio"&&h!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll('input[name="'+cs(""+h)+'"][type="radio"]'),h=0;h<f.length;h++){var m=f[h];if(m!==a&&m.form===a.form){var v=m[xn]||null;if(!v)throw Error(n(90));XO(m,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(h=0;h<f.length;h++)m=f[h],m.form===a.form&&pC(m)}break e;case"textarea":gC(a,f.value,f.defaultValue);break e;case"select":h=f.value,h!=null&&Zl(a,!!f.multiple,h,!1)}}}var YO=!1;function bC(a,h,f){if(YO)return a(h,f);YO=!0;try{var m=a(h);return m}finally{if(YO=!1,(Wl!==null||Ul!==null)&&(bp(),Wl&&(h=Wl,a=Ul,Ul=Wl=null,yC(h),a)))for(h=0;h<a.length;h++)yC(a[h])}}function Dh(a,h){var f=a.stateNode;if(f===null)return null;var m=f[xn]||null;if(m===null)return null;f=m[h];e:switch(h){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,h,typeof f));return f}var Nr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),HO=!1;if(Nr)try{var Bh={};Object.defineProperty(Bh,"passive",{get:function(){HO=!0}}),window.addEventListener("test",Bh,Bh),window.removeEventListener("test",Bh,Bh)}catch{HO=!1}var Mo=null,FO=null,Dd=null;function SC(){if(Dd)return Dd;var a,h=FO,f=h.length,m,v="value"in Mo?Mo.value:Mo.textContent,y=v.length;for(a=0;a<f&&h[a]===v[a];a++);var C=f-a;for(m=1;m<=C&&h[f-m]===v[y-m];m++);return Dd=v.slice(a,1<m?1-m:void 0)}function Bd(a){var h=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&h===13&&(a=13)):a=h,a===10&&(a=13),32<=a||a===13?a:0}function $d(){return!0}function xC(){return!1}function wn(a){function h(f,m,v,y,C){this._reactName=f,this._targetInst=v,this.type=m,this.nativeEvent=y,this.target=C,this.currentTarget=null;for(var P in a)a.hasOwnProperty(P)&&(f=a[P],this[P]=f?f(y):y[P]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?$d:xC,this.isPropagationStopped=xC,this}return p(h.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=$d)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=$d)},persist:function(){},isPersistent:$d}),h}var $a={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zd=wn($a),$h=p({},$a,{view:0,detail:0}),zN=wn($h),GO,KO,zh,Nd=p({},$h,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:e0,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==zh&&(zh&&a.type==="mousemove"?(GO=a.screenX-zh.screenX,KO=a.screenY-zh.screenY):KO=GO=0,zh=a),GO)},movementY:function(a){return"movementY"in a?a.movementY:KO}}),wC=wn(Nd),NN=p({},Nd,{dataTransfer:0}),jN=wn(NN),IN=p({},$h,{relatedTarget:0}),JO=wn(IN),VN=p({},$a,{animationName:0,elapsedTime:0,pseudoElement:0}),XN=wn(VN),ZN=p({},$a,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),qN=wn(ZN),WN=p({},$a,{data:0}),CC=wn(WN),UN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},YN={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"},HN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function FN(a){var h=this.nativeEvent;return h.getModifierState?h.getModifierState(a):(a=HN[a])?!!h[a]:!1}function e0(){return FN}var GN=p({},$h,{key:function(a){if(a.key){var h=UN[a.key]||a.key;if(h!=="Unidentified")return h}return a.type==="keypress"?(a=Bd(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?YN[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:e0,charCode:function(a){return a.type==="keypress"?Bd(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Bd(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),KN=wn(GN),JN=p({},Nd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),kC=wn(JN),e8=p({},$h,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:e0}),t8=wn(e8),i8=p({},$a,{propertyName:0,elapsedTime:0,pseudoElement:0}),n8=wn(i8),s8=p({},Nd,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),r8=wn(s8),o8=p({},$a,{newState:0,oldState:0}),a8=wn(o8),l8=[9,13,27,32],t0=Nr&&"CompositionEvent"in window,Nh=null;Nr&&"documentMode"in document&&(Nh=document.documentMode);var c8=Nr&&"TextEvent"in window&&!Nh,TC=Nr&&(!t0||Nh&&8<Nh&&11>=Nh),AC=" ",EC=!1;function MC(a,h){switch(a){case"keyup":return l8.indexOf(h.keyCode)!==-1;case"keydown":return h.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function PC(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Yl=!1;function h8(a,h){switch(a){case"compositionend":return PC(h);case"keypress":return h.which!==32?null:(EC=!0,AC);case"textInput":return a=h.data,a===AC&&EC?null:a;default:return null}}function u8(a,h){if(Yl)return a==="compositionend"||!t0&&MC(a,h)?(a=SC(),Dd=FO=Mo=null,Yl=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(h.ctrlKey||h.altKey||h.metaKey)||h.ctrlKey&&h.altKey){if(h.char&&1<h.char.length)return h.char;if(h.which)return String.fromCharCode(h.which)}return null;case"compositionend":return TC&&h.locale!=="ko"?null:h.data;default:return null}}var f8={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 RC(a){var h=a&&a.nodeName&&a.nodeName.toLowerCase();return h==="input"?!!f8[a.type]:h==="textarea"}function QC(a,h,f,m){Wl?Ul?Ul.push(m):Ul=[m]:Wl=m,h=Ap(h,"onChange"),0<h.length&&(f=new zd("onChange","change",null,f,m),a.push({event:f,listeners:h}))}var jh=null,Ih=null;function d8(a){m5(a,0)}function jd(a){var h=Lh(a);if(pC(h))return a}function LC(a,h){if(a==="change")return h}var DC=!1;if(Nr){var i0;if(Nr){var n0="oninput"in document;if(!n0){var BC=document.createElement("div");BC.setAttribute("oninput","return;"),n0=typeof BC.oninput=="function"}i0=n0}else i0=!1;DC=i0&&(!document.documentMode||9<document.documentMode)}function $C(){jh&&(jh.detachEvent("onpropertychange",zC),Ih=jh=null)}function zC(a){if(a.propertyName==="value"&&jd(Ih)){var h=[];QC(h,Ih,a,UO(a)),bC(d8,h)}}function p8(a,h,f){a==="focusin"?($C(),jh=h,Ih=f,jh.attachEvent("onpropertychange",zC)):a==="focusout"&&$C()}function m8(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return jd(Ih)}function g8(a,h){if(a==="click")return jd(h)}function O8(a,h){if(a==="input"||a==="change")return jd(h)}function v8(a,h){return a===h&&(a!==0||1/a===1/h)||a!==a&&h!==h}var Vn=typeof Object.is=="function"?Object.is:v8;function Vh(a,h){if(Vn(a,h))return!0;if(typeof a!="object"||a===null||typeof h!="object"||h===null)return!1;var f=Object.keys(a),m=Object.keys(h);if(f.length!==m.length)return!1;for(m=0;m<f.length;m++){var v=f[m];if(!Dr.call(h,v)||!Vn(a[v],h[v]))return!1}return!0}function NC(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function jC(a,h){var f=NC(a);a=0;for(var m;f;){if(f.nodeType===3){if(m=a+f.textContent.length,a<=h&&m>=h)return{node:f,offset:h-a};a=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=NC(f)}}function IC(a,h){return a&&h?a===h?!0:a&&a.nodeType===3?!1:h&&h.nodeType===3?IC(a,h.parentNode):"contains"in a?a.contains(h):a.compareDocumentPosition?!!(a.compareDocumentPosition(h)&16):!1:!1}function VC(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var h=Qd(a.document);h instanceof a.HTMLIFrameElement;){try{var f=typeof h.contentWindow.location.href=="string"}catch{f=!1}if(f)a=h.contentWindow;else break;h=Qd(a.document)}return h}function s0(a){var h=a&&a.nodeName&&a.nodeName.toLowerCase();return h&&(h==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||h==="textarea"||a.contentEditable==="true")}var _8=Nr&&"documentMode"in document&&11>=document.documentMode,Hl=null,r0=null,Xh=null,o0=!1;function XC(a,h,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;o0||Hl==null||Hl!==Qd(m)||(m=Hl,"selectionStart"in m&&s0(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Xh&&Vh(Xh,m)||(Xh=m,m=Ap(r0,"onSelect"),0<m.length&&(h=new zd("onSelect","select",null,h,f),a.push({event:h,listeners:m}),h.target=Hl)))}function za(a,h){var f={};return f[a.toLowerCase()]=h.toLowerCase(),f["Webkit"+a]="webkit"+h,f["Moz"+a]="moz"+h,f}var Fl={animationend:za("Animation","AnimationEnd"),animationiteration:za("Animation","AnimationIteration"),animationstart:za("Animation","AnimationStart"),transitionrun:za("Transition","TransitionRun"),transitionstart:za("Transition","TransitionStart"),transitioncancel:za("Transition","TransitionCancel"),transitionend:za("Transition","TransitionEnd")},a0={},ZC={};Nr&&(ZC=document.createElement("div").style,"AnimationEvent"in window||(delete Fl.animationend.animation,delete Fl.animationiteration.animation,delete Fl.animationstart.animation),"TransitionEvent"in window||delete Fl.transitionend.transition);function Na(a){if(a0[a])return a0[a];if(!Fl[a])return a;var h=Fl[a],f;for(f in h)if(h.hasOwnProperty(f)&&f in ZC)return a0[a]=h[f];return a}var qC=Na("animationend"),WC=Na("animationiteration"),UC=Na("animationstart"),y8=Na("transitionrun"),b8=Na("transitionstart"),S8=Na("transitioncancel"),YC=Na("transitionend"),HC=new Map,l0="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(" ");l0.push("scrollEnd");function $s(a,h){HC.set(a,h),Ba(h,[a])}var Id=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var h=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(h))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},hs=[],Gl=0,c0=0;function Vd(){for(var a=Gl,h=c0=Gl=0;h<a;){var f=hs[h];hs[h++]=null;var m=hs[h];hs[h++]=null;var v=hs[h];hs[h++]=null;var y=hs[h];if(hs[h++]=null,m!==null&&v!==null){var C=m.pending;C===null?v.next=v:(v.next=C.next,C.next=v),m.pending=v}y!==0&&FC(f,v,y)}}function Xd(a,h,f,m){hs[Gl++]=a,hs[Gl++]=h,hs[Gl++]=f,hs[Gl++]=m,c0|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function h0(a,h,f,m){return Xd(a,h,f,m),Zd(a)}function ja(a,h){return Xd(a,null,null,h),Zd(a)}function FC(a,h,f){a.lanes|=f;var m=a.alternate;m!==null&&(m.lanes|=f);for(var v=!1,y=a.return;y!==null;)y.childLanes|=f,m=y.alternate,m!==null&&(m.childLanes|=f),y.tag===22&&(a=y.stateNode,a===null||a._visibility&1||(v=!0)),a=y,y=y.return;return a.tag===3?(y=a.stateNode,v&&h!==null&&(v=31-_t(f),a=y.hiddenUpdates,m=a[v],m===null?a[v]=[h]:m.push(h),h.lane=f|536870912),y):null}function Zd(a){if(50<uu)throw uu=0,_v=null,Error(n(185));for(var h=a.return;h!==null;)a=h,h=a.return;return a.tag===3?a.stateNode:null}var Kl={};function x8(a,h,f,m){this.tag=a,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=h,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xn(a,h,f,m){return new x8(a,h,f,m)}function u0(a){return a=a.prototype,!(!a||!a.isReactComponent)}function jr(a,h){var f=a.alternate;return f===null?(f=Xn(a.tag,h,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=h,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&65011712,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,h=a.dependencies,f.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f.refCleanup=a.refCleanup,f}function GC(a,h){a.flags&=65011714;var f=a.alternate;return f===null?(a.childLanes=0,a.lanes=h,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=f.childLanes,a.lanes=f.lanes,a.child=f.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=f.memoizedProps,a.memoizedState=f.memoizedState,a.updateQueue=f.updateQueue,a.type=f.type,h=f.dependencies,a.dependencies=h===null?null:{lanes:h.lanes,firstContext:h.firstContext}),a}function qd(a,h,f,m,v,y){var C=0;if(m=a,typeof a=="function")u0(a)&&(C=1);else if(typeof a=="string")C=Aj(a,f,ue.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case q:return a=Xn(31,f,h,v),a.elementType=q,a.lanes=y,a;case b:return Ia(f.children,v,y,h);case x:C=8,v|=24;break;case w:return a=Xn(12,f,h,v|2),a.elementType=w,a.lanes=y,a;case L:return a=Xn(13,f,h,v),a.elementType=L,a.lanes=y,a;case E:return a=Xn(19,f,h,v),a.elementType=E,a.lanes=y,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case T:C=10;break e;case k:C=9;break e;case A:C=11;break e;case z:C=14;break e;case N:C=16,m=null;break e}C=29,f=Error(n(130,a===null?"null":typeof a,"")),m=null}return h=Xn(C,f,h,v),h.elementType=a,h.type=m,h.lanes=y,h}function Ia(a,h,f,m){return a=Xn(7,a,m,h),a.lanes=f,a}function f0(a,h,f){return a=Xn(6,a,null,h),a.lanes=f,a}function KC(a){var h=Xn(18,null,null,0);return h.stateNode=a,h}function d0(a,h,f){return h=Xn(4,a.children!==null?a.children:[],a.key,h),h.lanes=f,h.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},h}var JC=new WeakMap;function us(a,h){if(typeof a=="object"&&a!==null){var f=JC.get(a);return f!==void 0?f:(h={value:a,source:h,stack:La(h)},JC.set(a,h),h)}return{value:a,source:h,stack:La(h)}}var Jl=[],ec=0,Wd=null,Zh=0,fs=[],ds=0,Po=null,er=1,tr="";function Ir(a,h){Jl[ec++]=Zh,Jl[ec++]=Wd,Wd=a,Zh=h}function ek(a,h,f){fs[ds++]=er,fs[ds++]=tr,fs[ds++]=Po,Po=a;var m=er;a=tr;var v=32-_t(m)-1;m&=~(1<<v),f+=1;var y=32-_t(h)+v;if(30<y){var C=v-v%5;y=(m&(1<<C)-1).toString(32),m>>=C,v-=C,er=1<<32-_t(h)+v|f<<v|m,tr=y+a}else er=1<<y|f<<v|m,tr=a}function p0(a){a.return!==null&&(Ir(a,1),ek(a,1,0))}function m0(a){for(;a===Wd;)Wd=Jl[--ec],Jl[ec]=null,Zh=Jl[--ec],Jl[ec]=null;for(;a===Po;)Po=fs[--ds],fs[ds]=null,tr=fs[--ds],fs[ds]=null,er=fs[--ds],fs[ds]=null}function tk(a,h){fs[ds++]=er,fs[ds++]=tr,fs[ds++]=Po,er=h.id,tr=h.overflow,Po=a}var Ni=null,At=null,tt=!1,Ro=null,ps=!1,g0=Error(n(519));function Qo(a){var h=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw qh(us(h,a)),g0}function ik(a){var h=a.stateNode,f=a.type,m=a.memoizedProps;switch(h[zi]=a,h[xn]=m,f){case"dialog":He("cancel",h),He("close",h);break;case"iframe":case"object":case"embed":He("load",h);break;case"video":case"audio":for(f=0;f<du.length;f++)He(du[f],h);break;case"source":He("error",h);break;case"img":case"image":case"link":He("error",h),He("load",h);break;case"details":He("toggle",h);break;case"input":He("invalid",h),mC(h,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":He("invalid",h);break;case"textarea":He("invalid",h),OC(h,m.value,m.defaultValue,m.children)}f=m.children,typeof f!="string"&&typeof f!="number"&&typeof f!="bigint"||h.textContent===""+f||m.suppressHydrationWarning===!0||_5(h.textContent,f)?(m.popover!=null&&(He("beforetoggle",h),He("toggle",h)),m.onScroll!=null&&He("scroll",h),m.onScrollEnd!=null&&He("scrollend",h),m.onClick!=null&&(h.onclick=zr),h=!0):h=!1,h||Qo(a,!0)}function nk(a){for(Ni=a.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:ps=!1;return;case 27:case 3:ps=!0;return;default:Ni=Ni.return}}function tc(a){if(a!==Ni)return!1;if(!tt)return nk(a),tt=!0,!1;var h=a.tag,f;if((f=h!==3&&h!==27)&&((f=h===5)&&(f=a.type,f=!(f!=="form"&&f!=="button")||Lv(a.type,a.memoizedProps)),f=!f),f&&At&&Qo(a),nk(a),h===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));At=A5(a)}else if(h===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));At=A5(a)}else h===27?(h=At,Uo(a.type)?(a=Nv,Nv=null,At=a):At=h):At=Ni?gs(a.stateNode.nextSibling):null;return!0}function Va(){At=Ni=null,tt=!1}function O0(){var a=Ro;return a!==null&&(An===null?An=a:An.push.apply(An,a),Ro=null),a}function qh(a){Ro===null?Ro=[a]:Ro.push(a)}var v0=I(null),Xa=null,Vr=null;function Lo(a,h,f){Q(v0,h._currentValue),h._currentValue=f}function Xr(a){a._currentValue=v0.current,K(v0)}function _0(a,h,f){for(;a!==null;){var m=a.alternate;if((a.childLanes&h)!==h?(a.childLanes|=h,m!==null&&(m.childLanes|=h)):m!==null&&(m.childLanes&h)!==h&&(m.childLanes|=h),a===f)break;a=a.return}}function y0(a,h,f,m){var v=a.child;for(v!==null&&(v.return=a);v!==null;){var y=v.dependencies;if(y!==null){var C=v.child;y=y.firstContext;e:for(;y!==null;){var P=y;y=v;for(var W=0;W<h.length;W++)if(P.context===h[W]){y.lanes|=f,P=y.alternate,P!==null&&(P.lanes|=f),_0(y.return,f,a),m||(C=null);break e}y=P.next}}else if(v.tag===18){if(C=v.return,C===null)throw Error(n(341));C.lanes|=f,y=C.alternate,y!==null&&(y.lanes|=f),_0(C,f,a),C=null}else C=v.child;if(C!==null)C.return=v;else for(C=v;C!==null;){if(C===a){C=null;break}if(v=C.sibling,v!==null){v.return=C.return,C=v;break}C=C.return}v=C}}function ic(a,h,f,m){a=null;for(var v=h,y=!1;v!==null;){if(!y){if((v.flags&524288)!==0)y=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var C=v.alternate;if(C===null)throw Error(n(387));if(C=C.memoizedProps,C!==null){var P=v.type;Vn(v.pendingProps.value,C.value)||(a!==null?a.push(P):a=[P])}}else if(v===Oe.current){if(C=v.alternate,C===null)throw Error(n(387));C.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(a!==null?a.push(vu):a=[vu])}v=v.return}a!==null&&y0(h,a,f,m),h.flags|=262144}function Ud(a){for(a=a.firstContext;a!==null;){if(!Vn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Za(a){Xa=a,Vr=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function ji(a){return sk(Xa,a)}function Yd(a,h){return Xa===null&&Za(a),sk(a,h)}function sk(a,h){var f=h._currentValue;if(h={context:h,memoizedValue:f,next:null},Vr===null){if(a===null)throw Error(n(308));Vr=h,a.dependencies={lanes:0,firstContext:h},a.flags|=524288}else Vr=Vr.next=h;return f}var w8=typeof AbortController<"u"?AbortController:function(){var a=[],h=this.signal={aborted:!1,addEventListener:function(f,m){a.push(m)}};this.abort=function(){h.aborted=!0,a.forEach(function(f){return f()})}},C8=t.unstable_scheduleCallback,k8=t.unstable_NormalPriority,ti={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function b0(){return{controller:new w8,data:new Map,refCount:0}}function Wh(a){a.refCount--,a.refCount===0&&C8(k8,function(){a.controller.abort()})}var Uh=null,S0=0,nc=0,sc=null;function T8(a,h){if(Uh===null){var f=Uh=[];S0=0,nc=Cv(),sc={status:"pending",value:void 0,then:function(m){f.push(m)}}}return S0++,h.then(rk,rk),h}function rk(){if(--S0===0&&Uh!==null){sc!==null&&(sc.status="fulfilled");var a=Uh;Uh=null,nc=0,sc=null;for(var h=0;h<a.length;h++)(0,a[h])()}}function A8(a,h){var f=[],m={status:"pending",value:null,reason:null,then:function(v){f.push(v)}};return a.then(function(){m.status="fulfilled",m.value=h;for(var v=0;v<f.length;v++)(0,f[v])(h)},function(v){for(m.status="rejected",m.reason=v,v=0;v<f.length;v++)(0,f[v])(void 0)}),m}var ok=$.S;$.S=function(a,h){X2=cn(),typeof h=="object"&&h!==null&&typeof h.then=="function"&&T8(a,h),ok!==null&&ok(a,h)};var qa=I(null);function x0(){var a=qa.current;return a!==null?a:yt.pooledCache}function Hd(a,h){h===null?Q(qa,qa.current):Q(qa,h.pool)}function ak(){var a=x0();return a===null?null:{parent:ti._currentValue,pool:a}}var rc=Error(n(460)),w0=Error(n(474)),Fd=Error(n(542)),Gd={then:function(){}};function lk(a){return a=a.status,a==="fulfilled"||a==="rejected"}function ck(a,h,f){switch(f=a[f],f===void 0?a.push(h):f!==h&&(h.then(zr,zr),h=f),h.status){case"fulfilled":return h.value;case"rejected":throw a=h.reason,uk(a),a;default:if(typeof h.status=="string")h.then(zr,zr);else{if(a=yt,a!==null&&100<a.shellSuspendCounter)throw Error(n(482));a=h,a.status="pending",a.then(function(m){if(h.status==="pending"){var v=h;v.status="fulfilled",v.value=m}},function(m){if(h.status==="pending"){var v=h;v.status="rejected",v.reason=m}})}switch(h.status){case"fulfilled":return h.value;case"rejected":throw a=h.reason,uk(a),a}throw Ua=h,rc}}function Wa(a){try{var h=a._init;return h(a._payload)}catch(f){throw f!==null&&typeof f=="object"&&typeof f.then=="function"?(Ua=f,rc):f}}var Ua=null;function hk(){if(Ua===null)throw Error(n(459));var a=Ua;return Ua=null,a}function uk(a){if(a===rc||a===Fd)throw Error(n(483))}var oc=null,Yh=0;function Kd(a){var h=Yh;return Yh+=1,oc===null&&(oc=[]),ck(oc,a,h)}function Hh(a,h){h=h.props.ref,a.ref=h!==void 0?h:null}function Jd(a,h){throw h.$$typeof===g?Error(n(525)):(a=Object.prototype.toString.call(h),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(h).join(", ")+"}":a)))}function fk(a){function h(G,Y){if(a){var ee=G.deletions;ee===null?(G.deletions=[Y],G.flags|=16):ee.push(Y)}}function f(G,Y){if(!a)return null;for(;Y!==null;)h(G,Y),Y=Y.sibling;return null}function m(G){for(var Y=new Map;G!==null;)G.key!==null?Y.set(G.key,G):Y.set(G.index,G),G=G.sibling;return Y}function v(G,Y){return G=jr(G,Y),G.index=0,G.sibling=null,G}function y(G,Y,ee){return G.index=ee,a?(ee=G.alternate,ee!==null?(ee=ee.index,ee<Y?(G.flags|=67108866,Y):ee):(G.flags|=67108866,Y)):(G.flags|=1048576,Y)}function C(G){return a&&G.alternate===null&&(G.flags|=67108866),G}function P(G,Y,ee,ae){return Y===null||Y.tag!==6?(Y=f0(ee,G.mode,ae),Y.return=G,Y):(Y=v(Y,ee),Y.return=G,Y)}function W(G,Y,ee,ae){var Re=ee.type;return Re===b?se(G,Y,ee.props.children,ae,ee.key):Y!==null&&(Y.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===N&&Wa(Re)===Y.type)?(Y=v(Y,ee.props),Hh(Y,ee),Y.return=G,Y):(Y=qd(ee.type,ee.key,ee.props,null,G.mode,ae),Hh(Y,ee),Y.return=G,Y)}function te(G,Y,ee,ae){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==ee.containerInfo||Y.stateNode.implementation!==ee.implementation?(Y=d0(ee,G.mode,ae),Y.return=G,Y):(Y=v(Y,ee.children||[]),Y.return=G,Y)}function se(G,Y,ee,ae,Re){return Y===null||Y.tag!==7?(Y=Ia(ee,G.mode,ae,Re),Y.return=G,Y):(Y=v(Y,ee),Y.return=G,Y)}function le(G,Y,ee){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=f0(""+Y,G.mode,ee),Y.return=G,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case O:return ee=qd(Y.type,Y.key,Y.props,null,G.mode,ee),Hh(ee,Y),ee.return=G,ee;case _:return Y=d0(Y,G.mode,ee),Y.return=G,Y;case N:return Y=Wa(Y),le(G,Y,ee)}if(j(Y)||R(Y))return Y=Ia(Y,G.mode,ee,null),Y.return=G,Y;if(typeof Y.then=="function")return le(G,Kd(Y),ee);if(Y.$$typeof===T)return le(G,Yd(G,Y),ee);Jd(G,Y)}return null}function ie(G,Y,ee,ae){var Re=Y!==null?Y.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return Re!==null?null:P(G,Y,""+ee,ae);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:return ee.key===Re?W(G,Y,ee,ae):null;case _:return ee.key===Re?te(G,Y,ee,ae):null;case N:return ee=Wa(ee),ie(G,Y,ee,ae)}if(j(ee)||R(ee))return Re!==null?null:se(G,Y,ee,ae,null);if(typeof ee.then=="function")return ie(G,Y,Kd(ee),ae);if(ee.$$typeof===T)return ie(G,Y,Yd(G,ee),ae);Jd(G,ee)}return null}function ne(G,Y,ee,ae,Re){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return G=G.get(ee)||null,P(Y,G,""+ae,Re);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case O:return G=G.get(ae.key===null?ee:ae.key)||null,W(Y,G,ae,Re);case _:return G=G.get(ae.key===null?ee:ae.key)||null,te(Y,G,ae,Re);case N:return ae=Wa(ae),ne(G,Y,ee,ae,Re)}if(j(ae)||R(ae))return G=G.get(ee)||null,se(Y,G,ae,Re,null);if(typeof ae.then=="function")return ne(G,Y,ee,Kd(ae),Re);if(ae.$$typeof===T)return ne(G,Y,ee,Yd(Y,ae),Re);Jd(Y,ae)}return null}function we(G,Y,ee,ae){for(var Re=null,st=null,Ee=Y,Ve=Y=0,Je=null;Ee!==null&&Ve<ee.length;Ve++){Ee.index>Ve?(Je=Ee,Ee=null):Je=Ee.sibling;var rt=ie(G,Ee,ee[Ve],ae);if(rt===null){Ee===null&&(Ee=Je);break}a&&Ee&&rt.alternate===null&&h(G,Ee),Y=y(rt,Y,Ve),st===null?Re=rt:st.sibling=rt,st=rt,Ee=Je}if(Ve===ee.length)return f(G,Ee),tt&&Ir(G,Ve),Re;if(Ee===null){for(;Ve<ee.length;Ve++)Ee=le(G,ee[Ve],ae),Ee!==null&&(Y=y(Ee,Y,Ve),st===null?Re=Ee:st.sibling=Ee,st=Ee);return tt&&Ir(G,Ve),Re}for(Ee=m(Ee);Ve<ee.length;Ve++)Je=ne(Ee,G,Ve,ee[Ve],ae),Je!==null&&(a&&Je.alternate!==null&&Ee.delete(Je.key===null?Ve:Je.key),Y=y(Je,Y,Ve),st===null?Re=Je:st.sibling=Je,st=Je);return a&&Ee.forEach(function(Ko){return h(G,Ko)}),tt&&Ir(G,Ve),Re}function Qe(G,Y,ee,ae){if(ee==null)throw Error(n(151));for(var Re=null,st=null,Ee=Y,Ve=Y=0,Je=null,rt=ee.next();Ee!==null&&!rt.done;Ve++,rt=ee.next()){Ee.index>Ve?(Je=Ee,Ee=null):Je=Ee.sibling;var Ko=ie(G,Ee,rt.value,ae);if(Ko===null){Ee===null&&(Ee=Je);break}a&&Ee&&Ko.alternate===null&&h(G,Ee),Y=y(Ko,Y,Ve),st===null?Re=Ko:st.sibling=Ko,st=Ko,Ee=Je}if(rt.done)return f(G,Ee),tt&&Ir(G,Ve),Re;if(Ee===null){for(;!rt.done;Ve++,rt=ee.next())rt=le(G,rt.value,ae),rt!==null&&(Y=y(rt,Y,Ve),st===null?Re=rt:st.sibling=rt,st=rt);return tt&&Ir(G,Ve),Re}for(Ee=m(Ee);!rt.done;Ve++,rt=ee.next())rt=ne(Ee,G,Ve,rt.value,ae),rt!==null&&(a&&rt.alternate!==null&&Ee.delete(rt.key===null?Ve:rt.key),Y=y(rt,Y,Ve),st===null?Re=rt:st.sibling=rt,st=rt);return a&&Ee.forEach(function(Nj){return h(G,Nj)}),tt&&Ir(G,Ve),Re}function gt(G,Y,ee,ae){if(typeof ee=="object"&&ee!==null&&ee.type===b&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case O:e:{for(var Re=ee.key;Y!==null;){if(Y.key===Re){if(Re=ee.type,Re===b){if(Y.tag===7){f(G,Y.sibling),ae=v(Y,ee.props.children),ae.return=G,G=ae;break e}}else if(Y.elementType===Re||typeof Re=="object"&&Re!==null&&Re.$$typeof===N&&Wa(Re)===Y.type){f(G,Y.sibling),ae=v(Y,ee.props),Hh(ae,ee),ae.return=G,G=ae;break e}f(G,Y);break}else h(G,Y);Y=Y.sibling}ee.type===b?(ae=Ia(ee.props.children,G.mode,ae,ee.key),ae.return=G,G=ae):(ae=qd(ee.type,ee.key,ee.props,null,G.mode,ae),Hh(ae,ee),ae.return=G,G=ae)}return C(G);case _:e:{for(Re=ee.key;Y!==null;){if(Y.key===Re)if(Y.tag===4&&Y.stateNode.containerInfo===ee.containerInfo&&Y.stateNode.implementation===ee.implementation){f(G,Y.sibling),ae=v(Y,ee.children||[]),ae.return=G,G=ae;break e}else{f(G,Y);break}else h(G,Y);Y=Y.sibling}ae=d0(ee,G.mode,ae),ae.return=G,G=ae}return C(G);case N:return ee=Wa(ee),gt(G,Y,ee,ae)}if(j(ee))return we(G,Y,ee,ae);if(R(ee)){if(Re=R(ee),typeof Re!="function")throw Error(n(150));return ee=Re.call(ee),Qe(G,Y,ee,ae)}if(typeof ee.then=="function")return gt(G,Y,Kd(ee),ae);if(ee.$$typeof===T)return gt(G,Y,Yd(G,ee),ae);Jd(G,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,Y!==null&&Y.tag===6?(f(G,Y.sibling),ae=v(Y,ee),ae.return=G,G=ae):(f(G,Y),ae=f0(ee,G.mode,ae),ae.return=G,G=ae),C(G)):f(G,Y)}return function(G,Y,ee,ae){try{Yh=0;var Re=gt(G,Y,ee,ae);return oc=null,Re}catch(Ee){if(Ee===rc||Ee===Fd)throw Ee;var st=Xn(29,Ee,null,G.mode);return st.lanes=ae,st.return=G,st}finally{}}}var Ya=fk(!0),dk=fk(!1),Do=!1;function C0(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function k0(a,h){a=a.updateQueue,h.updateQueue===a&&(h.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Bo(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function $o(a,h,f){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(ot&2)!==0){var v=m.pending;return v===null?h.next=h:(h.next=v.next,v.next=h),m.pending=h,h=Zd(a),FC(a,null,f),h}return Xd(a,m,h,f),Zd(a)}function Fh(a,h,f){if(h=h.updateQueue,h!==null&&(h=h.shared,(f&4194048)!==0)){var m=h.lanes;m&=a.pendingLanes,f|=m,h.lanes=f,sC(a,f)}}function T0(a,h){var f=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var v=null,y=null;if(f=f.firstBaseUpdate,f!==null){do{var C={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};y===null?v=y=C:y=y.next=C,f=f.next}while(f!==null);y===null?v=y=h:y=y.next=h}else v=y=h;f={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:y,shared:m.shared,callbacks:m.callbacks},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=h:a.next=h,f.lastBaseUpdate=h}var A0=!1;function Gh(){if(A0){var a=sc;if(a!==null)throw a}}function Kh(a,h,f,m){A0=!1;var v=a.updateQueue;Do=!1;var y=v.firstBaseUpdate,C=v.lastBaseUpdate,P=v.shared.pending;if(P!==null){v.shared.pending=null;var W=P,te=W.next;W.next=null,C===null?y=te:C.next=te,C=W;var se=a.alternate;se!==null&&(se=se.updateQueue,P=se.lastBaseUpdate,P!==C&&(P===null?se.firstBaseUpdate=te:P.next=te,se.lastBaseUpdate=W))}if(y!==null){var le=v.baseState;C=0,se=te=W=null,P=y;do{var ie=P.lane&-536870913,ne=ie!==P.lane;if(ne?(Ke&ie)===ie:(m&ie)===ie){ie!==0&&ie===nc&&(A0=!0),se!==null&&(se=se.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var we=a,Qe=P;ie=h;var gt=f;switch(Qe.tag){case 1:if(we=Qe.payload,typeof we=="function"){le=we.call(gt,le,ie);break e}le=we;break e;case 3:we.flags=we.flags&-65537|128;case 0:if(we=Qe.payload,ie=typeof we=="function"?we.call(gt,le,ie):we,ie==null)break e;le=p({},le,ie);break e;case 2:Do=!0}}ie=P.callback,ie!==null&&(a.flags|=64,ne&&(a.flags|=8192),ne=v.callbacks,ne===null?v.callbacks=[ie]:ne.push(ie))}else ne={lane:ie,tag:P.tag,payload:P.payload,callback:P.callback,next:null},se===null?(te=se=ne,W=le):se=se.next=ne,C|=ie;if(P=P.next,P===null){if(P=v.shared.pending,P===null)break;ne=P,P=ne.next,ne.next=null,v.lastBaseUpdate=ne,v.shared.pending=null}}while(!0);se===null&&(W=le),v.baseState=W,v.firstBaseUpdate=te,v.lastBaseUpdate=se,y===null&&(v.shared.lanes=0),Vo|=C,a.lanes=C,a.memoizedState=le}}function pk(a,h){if(typeof a!="function")throw Error(n(191,a));a.call(h)}function mk(a,h){var f=a.callbacks;if(f!==null)for(a.callbacks=null,a=0;a<f.length;a++)pk(f[a],h)}var ac=I(null),ep=I(0);function gk(a,h){a=Kr,Q(ep,a),Q(ac,h),Kr=a|h.baseLanes}function E0(){Q(ep,Kr),Q(ac,ac.current)}function M0(){Kr=ep.current,K(ac),K(ep)}var Zn=I(null),ms=null;function zo(a){var h=a.alternate;Q(Ht,Ht.current&1),Q(Zn,a),ms===null&&(h===null||ac.current!==null||h.memoizedState!==null)&&(ms=a)}function P0(a){Q(Ht,Ht.current),Q(Zn,a),ms===null&&(ms=a)}function Ok(a){a.tag===22?(Q(Ht,Ht.current),Q(Zn,a),ms===null&&(ms=a)):No()}function No(){Q(Ht,Ht.current),Q(Zn,Zn.current)}function qn(a){K(Zn),ms===a&&(ms=null),K(Ht)}var Ht=I(0);function tp(a){for(var h=a;h!==null;){if(h.tag===13){var f=h.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||$v(f)||zv(f)))return h}else if(h.tag===19&&(h.memoizedProps.revealOrder==="forwards"||h.memoizedProps.revealOrder==="backwards"||h.memoizedProps.revealOrder==="unstable_legacy-backwards"||h.memoizedProps.revealOrder==="together")){if((h.flags&128)!==0)return h}else if(h.child!==null){h.child.return=h,h=h.child;continue}if(h===a)break;for(;h.sibling===null;){if(h.return===null||h.return===a)return null;h=h.return}h.sibling.return=h.return,h=h.sibling}return null}var Zr=0,Ie=null,pt=null,ii=null,ip=!1,lc=!1,Ha=!1,np=0,Jh=0,cc=null,E8=0;function jt(){throw Error(n(321))}function R0(a,h){if(h===null)return!1;for(var f=0;f<h.length&&f<a.length;f++)if(!Vn(a[f],h[f]))return!1;return!0}function Q0(a,h,f,m,v,y){return Zr=y,Ie=h,h.memoizedState=null,h.updateQueue=null,h.lanes=0,$.H=a===null||a.memoizedState===null?e2:Y0,Ha=!1,y=f(m,v),Ha=!1,lc&&(y=_k(h,f,m,v)),vk(a),y}function vk(a){$.H=iu;var h=pt!==null&&pt.next!==null;if(Zr=0,ii=pt=Ie=null,ip=!1,Jh=0,cc=null,h)throw Error(n(300));a===null||ni||(a=a.dependencies,a!==null&&Ud(a)&&(ni=!0))}function _k(a,h,f,m){Ie=a;var v=0;do{if(lc&&(cc=null),Jh=0,lc=!1,25<=v)throw Error(n(301));if(v+=1,ii=pt=null,a.updateQueue!=null){var y=a.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}$.H=t2,y=h(f,m)}while(lc);return y}function M8(){var a=$.H,h=a.useState()[0];return h=typeof h.then=="function"?eu(h):h,a=a.useState()[0],(pt!==null?pt.memoizedState:null)!==a&&(Ie.flags|=1024),h}function L0(){var a=np!==0;return np=0,a}function D0(a,h,f){h.updateQueue=a.updateQueue,h.flags&=-2053,a.lanes&=~f}function B0(a){if(ip){for(a=a.memoizedState;a!==null;){var h=a.queue;h!==null&&(h.pending=null),a=a.next}ip=!1}Zr=0,ii=pt=Ie=null,lc=!1,Jh=np=0,cc=null}function un(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ii===null?Ie.memoizedState=ii=a:ii=ii.next=a,ii}function Ft(){if(pt===null){var a=Ie.alternate;a=a!==null?a.memoizedState:null}else a=pt.next;var h=ii===null?Ie.memoizedState:ii.next;if(h!==null)ii=h,pt=a;else{if(a===null)throw Ie.alternate===null?Error(n(467)):Error(n(310));pt=a,a={memoizedState:pt.memoizedState,baseState:pt.baseState,baseQueue:pt.baseQueue,queue:pt.queue,next:null},ii===null?Ie.memoizedState=ii=a:ii=ii.next=a}return ii}function sp(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function eu(a){var h=Jh;return Jh+=1,cc===null&&(cc=[]),a=ck(cc,a,h),h=Ie,(ii===null?h.memoizedState:ii.next)===null&&(h=h.alternate,$.H=h===null||h.memoizedState===null?e2:Y0),a}function rp(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return eu(a);if(a.$$typeof===T)return ji(a)}throw Error(n(438,String(a)))}function $0(a){var h=null,f=Ie.updateQueue;if(f!==null&&(h=f.memoCache),h==null){var m=Ie.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(h={data:m.data.map(function(v){return v.slice()}),index:0})))}if(h==null&&(h={data:[],index:0}),f===null&&(f=sp(),Ie.updateQueue=f),f.memoCache=h,f=h.data[h.index],f===void 0)for(f=h.data[h.index]=Array(a),m=0;m<a;m++)f[m]=J;return h.index++,f}function qr(a,h){return typeof h=="function"?h(a):h}function op(a){var h=Ft();return z0(h,pt,a)}function z0(a,h,f){var m=a.queue;if(m===null)throw Error(n(311));m.lastRenderedReducer=f;var v=a.baseQueue,y=m.pending;if(y!==null){if(v!==null){var C=v.next;v.next=y.next,y.next=C}h.baseQueue=v=y,m.pending=null}if(y=a.baseState,v===null)a.memoizedState=y;else{h=v.next;var P=C=null,W=null,te=h,se=!1;do{var le=te.lane&-536870913;if(le!==te.lane?(Ke&le)===le:(Zr&le)===le){var ie=te.revertLane;if(ie===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),le===nc&&(se=!0);else if((Zr&ie)===ie){te=te.next,ie===nc&&(se=!0);continue}else le={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},W===null?(P=W=le,C=y):W=W.next=le,Ie.lanes|=ie,Vo|=ie;le=te.action,Ha&&f(y,le),y=te.hasEagerState?te.eagerState:f(y,le)}else ie={lane:le,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},W===null?(P=W=ie,C=y):W=W.next=ie,Ie.lanes|=le,Vo|=le;te=te.next}while(te!==null&&te!==h);if(W===null?C=y:W.next=P,!Vn(y,a.memoizedState)&&(ni=!0,se&&(f=sc,f!==null)))throw f;a.memoizedState=y,a.baseState=C,a.baseQueue=W,m.lastRenderedState=y}return v===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function N0(a){var h=Ft(),f=h.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var m=f.dispatch,v=f.pending,y=h.memoizedState;if(v!==null){f.pending=null;var C=v=v.next;do y=a(y,C.action),C=C.next;while(C!==v);Vn(y,h.memoizedState)||(ni=!0),h.memoizedState=y,h.baseQueue===null&&(h.baseState=y),f.lastRenderedState=y}return[y,m]}function yk(a,h,f){var m=Ie,v=Ft(),y=tt;if(y){if(f===void 0)throw Error(n(407));f=f()}else f=h();var C=!Vn((pt||v).memoizedState,f);if(C&&(v.memoizedState=f,ni=!0),v=v.queue,V0(xk.bind(null,m,v,a),[a]),v.getSnapshot!==h||C||ii!==null&&ii.memoizedState.tag&1){if(m.flags|=2048,hc(9,{destroy:void 0},Sk.bind(null,m,v,f,h),null),yt===null)throw Error(n(349));y||(Zr&127)!==0||bk(m,h,f)}return f}function bk(a,h,f){a.flags|=16384,a={getSnapshot:h,value:f},h=Ie.updateQueue,h===null?(h=sp(),Ie.updateQueue=h,h.stores=[a]):(f=h.stores,f===null?h.stores=[a]:f.push(a))}function Sk(a,h,f,m){h.value=f,h.getSnapshot=m,wk(h)&&Ck(a)}function xk(a,h,f){return f(function(){wk(h)&&Ck(a)})}function wk(a){var h=a.getSnapshot;a=a.value;try{var f=h();return!Vn(a,f)}catch{return!0}}function Ck(a){var h=ja(a,2);h!==null&&En(h,a,2)}function j0(a){var h=un();if(typeof a=="function"){var f=a;if(a=f(),Ha){Sn(!0);try{f()}finally{Sn(!1)}}}return h.memoizedState=h.baseState=a,h.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:a},h}function kk(a,h,f,m){return a.baseState=f,z0(a,pt,typeof m=="function"?m:qr)}function P8(a,h,f,m,v){if(cp(a))throw Error(n(485));if(a=h.action,a!==null){var y={payload:v,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){y.listeners.push(C)}};$.T!==null?f(!0):y.isTransition=!1,m(y),f=h.pending,f===null?(y.next=h.pending=y,Tk(h,y)):(y.next=f.next,h.pending=f.next=y)}}function Tk(a,h){var f=h.action,m=h.payload,v=a.state;if(h.isTransition){var y=$.T,C={};$.T=C;try{var P=f(v,m),W=$.S;W!==null&&W(C,P),Ak(a,h,P)}catch(te){I0(a,h,te)}finally{y!==null&&C.types!==null&&(y.types=C.types),$.T=y}}else try{y=f(v,m),Ak(a,h,y)}catch(te){I0(a,h,te)}}function Ak(a,h,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(m){Ek(a,h,m)},function(m){return I0(a,h,m)}):Ek(a,h,f)}function Ek(a,h,f){h.status="fulfilled",h.value=f,Mk(h),a.state=f,h=a.pending,h!==null&&(f=h.next,f===h?a.pending=null:(f=f.next,h.next=f,Tk(a,f)))}function I0(a,h,f){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do h.status="rejected",h.reason=f,Mk(h),h=h.next;while(h!==m)}a.action=null}function Mk(a){a=a.listeners;for(var h=0;h<a.length;h++)(0,a[h])()}function Pk(a,h){return h}function Rk(a,h){if(tt){var f=yt.formState;if(f!==null){e:{var m=Ie;if(tt){if(At){t:{for(var v=At,y=ps;v.nodeType!==8;){if(!y){v=null;break t}if(v=gs(v.nextSibling),v===null){v=null;break t}}y=v.data,v=y==="F!"||y==="F"?v:null}if(v){At=gs(v.nextSibling),m=v.data==="F!";break e}}Qo(m)}m=!1}m&&(h=f[0])}}return f=un(),f.memoizedState=f.baseState=h,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pk,lastRenderedState:h},f.queue=m,f=Gk.bind(null,Ie,m),m.dispatch=f,m=j0(!1),y=U0.bind(null,Ie,!1,m.queue),m=un(),v={state:h,dispatch:null,action:a,pending:null},m.queue=v,f=P8.bind(null,Ie,v,y,f),v.dispatch=f,m.memoizedState=a,[h,f,!1]}function Qk(a){var h=Ft();return Lk(h,pt,a)}function Lk(a,h,f){if(h=z0(a,h,Pk)[0],a=op(qr)[0],typeof h=="object"&&h!==null&&typeof h.then=="function")try{var m=eu(h)}catch(C){throw C===rc?Fd:C}else m=h;h=Ft();var v=h.queue,y=v.dispatch;return f!==h.memoizedState&&(Ie.flags|=2048,hc(9,{destroy:void 0},R8.bind(null,v,f),null)),[m,y,a]}function R8(a,h){a.action=h}function Dk(a){var h=Ft(),f=pt;if(f!==null)return Lk(h,f,a);Ft(),h=h.memoizedState,f=Ft();var m=f.queue.dispatch;return f.memoizedState=a,[h,m,!1]}function hc(a,h,f,m){return a={tag:a,create:f,deps:m,inst:h,next:null},h=Ie.updateQueue,h===null&&(h=sp(),Ie.updateQueue=h),f=h.lastEffect,f===null?h.lastEffect=a.next=a:(m=f.next,f.next=a,a.next=m,h.lastEffect=a),a}function Bk(){return Ft().memoizedState}function ap(a,h,f,m){var v=un();Ie.flags|=a,v.memoizedState=hc(1|h,{destroy:void 0},f,m===void 0?null:m)}function lp(a,h,f,m){var v=Ft();m=m===void 0?null:m;var y=v.memoizedState.inst;pt!==null&&m!==null&&R0(m,pt.memoizedState.deps)?v.memoizedState=hc(h,y,f,m):(Ie.flags|=a,v.memoizedState=hc(1|h,y,f,m))}function $k(a,h){ap(8390656,8,a,h)}function V0(a,h){lp(2048,8,a,h)}function Q8(a){Ie.flags|=4;var h=Ie.updateQueue;if(h===null)h=sp(),Ie.updateQueue=h,h.events=[a];else{var f=h.events;f===null?h.events=[a]:f.push(a)}}function zk(a){var h=Ft().memoizedState;return Q8({ref:h,nextImpl:a}),function(){if((ot&2)!==0)throw Error(n(440));return h.impl.apply(void 0,arguments)}}function Nk(a,h){return lp(4,2,a,h)}function jk(a,h){return lp(4,4,a,h)}function Ik(a,h){if(typeof h=="function"){a=a();var f=h(a);return function(){typeof f=="function"?f():h(null)}}if(h!=null)return a=a(),h.current=a,function(){h.current=null}}function Vk(a,h,f){f=f!=null?f.concat([a]):null,lp(4,4,Ik.bind(null,h,a),f)}function X0(){}function Xk(a,h){var f=Ft();h=h===void 0?null:h;var m=f.memoizedState;return h!==null&&R0(h,m[1])?m[0]:(f.memoizedState=[a,h],a)}function Zk(a,h){var f=Ft();h=h===void 0?null:h;var m=f.memoizedState;if(h!==null&&R0(h,m[1]))return m[0];if(m=a(),Ha){Sn(!0);try{a()}finally{Sn(!1)}}return f.memoizedState=[m,h],m}function Z0(a,h,f){return f===void 0||(Zr&1073741824)!==0&&(Ke&261930)===0?a.memoizedState=h:(a.memoizedState=f,a=q2(),Ie.lanes|=a,Vo|=a,f)}function qk(a,h,f,m){return Vn(f,h)?f:ac.current!==null?(a=Z0(a,f,m),Vn(a,h)||(ni=!0),a):(Zr&42)===0||(Zr&1073741824)!==0&&(Ke&261930)===0?(ni=!0,a.memoizedState=f):(a=q2(),Ie.lanes|=a,Vo|=a,h)}function Wk(a,h,f,m,v){var y=X.p;X.p=y!==0&&8>y?y:8;var C=$.T,P={};$.T=P,U0(a,!1,h,f);try{var W=v(),te=$.S;if(te!==null&&te(P,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var se=A8(W,m);tu(a,h,se,Yn(a))}else tu(a,h,m,Yn(a))}catch(le){tu(a,h,{then:function(){},status:"rejected",reason:le},Yn())}finally{X.p=y,C!==null&&P.types!==null&&(C.types=P.types),$.T=C}}function L8(){}function q0(a,h,f,m){if(a.tag!==5)throw Error(n(476));var v=Uk(a).queue;Wk(a,v,h,H,f===null?L8:function(){return Yk(a),f(m)})}function Uk(a){var h=a.memoizedState;if(h!==null)return h;h={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:H},next:null};var f={};return h.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:qr,lastRenderedState:f},next:null},a.memoizedState=h,a=a.alternate,a!==null&&(a.memoizedState=h),h}function Yk(a){var h=Uk(a);h.next===null&&(h=a.alternate.memoizedState),tu(a,h.next.queue,{},Yn())}function W0(){return ji(vu)}function Hk(){return Ft().memoizedState}function Fk(){return Ft().memoizedState}function D8(a){for(var h=a.return;h!==null;){switch(h.tag){case 24:case 3:var f=Yn();a=Bo(f);var m=$o(h,a,f);m!==null&&(En(m,h,f),Fh(m,h,f)),h={cache:b0()},a.payload=h;return}h=h.return}}function B8(a,h,f){var m=Yn();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},cp(a)?Kk(h,f):(f=h0(a,h,f,m),f!==null&&(En(f,a,m),Jk(f,h,m)))}function Gk(a,h,f){var m=Yn();tu(a,h,f,m)}function tu(a,h,f,m){var v={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(cp(a))Kk(h,v);else{var y=a.alternate;if(a.lanes===0&&(y===null||y.lanes===0)&&(y=h.lastRenderedReducer,y!==null))try{var C=h.lastRenderedState,P=y(C,f);if(v.hasEagerState=!0,v.eagerState=P,Vn(P,C))return Xd(a,h,v,0),yt===null&&Vd(),!1}catch{}finally{}if(f=h0(a,h,v,m),f!==null)return En(f,a,m),Jk(f,h,m),!0}return!1}function U0(a,h,f,m){if(m={lane:2,revertLane:Cv(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},cp(a)){if(h)throw Error(n(479))}else h=h0(a,f,m,2),h!==null&&En(h,a,2)}function cp(a){var h=a.alternate;return a===Ie||h!==null&&h===Ie}function Kk(a,h){lc=ip=!0;var f=a.pending;f===null?h.next=h:(h.next=f.next,f.next=h),a.pending=h}function Jk(a,h,f){if((f&4194048)!==0){var m=h.lanes;m&=a.pendingLanes,f|=m,h.lanes=f,sC(a,f)}}var iu={readContext:ji,use:rp,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};iu.useEffectEvent=jt;var e2={readContext:ji,use:rp,useCallback:function(a,h){return un().memoizedState=[a,h===void 0?null:h],a},useContext:ji,useEffect:$k,useImperativeHandle:function(a,h,f){f=f!=null?f.concat([a]):null,ap(4194308,4,Ik.bind(null,h,a),f)},useLayoutEffect:function(a,h){return ap(4194308,4,a,h)},useInsertionEffect:function(a,h){ap(4,2,a,h)},useMemo:function(a,h){var f=un();h=h===void 0?null:h;var m=a();if(Ha){Sn(!0);try{a()}finally{Sn(!1)}}return f.memoizedState=[m,h],m},useReducer:function(a,h,f){var m=un();if(f!==void 0){var v=f(h);if(Ha){Sn(!0);try{f(h)}finally{Sn(!1)}}}else v=h;return m.memoizedState=m.baseState=v,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:v},m.queue=a,a=a.dispatch=B8.bind(null,Ie,a),[m.memoizedState,a]},useRef:function(a){var h=un();return a={current:a},h.memoizedState=a},useState:function(a){a=j0(a);var h=a.queue,f=Gk.bind(null,Ie,h);return h.dispatch=f,[a.memoizedState,f]},useDebugValue:X0,useDeferredValue:function(a,h){var f=un();return Z0(f,a,h)},useTransition:function(){var a=j0(!1);return a=Wk.bind(null,Ie,a.queue,!0,!1),un().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,h,f){var m=Ie,v=un();if(tt){if(f===void 0)throw Error(n(407));f=f()}else{if(f=h(),yt===null)throw Error(n(349));(Ke&127)!==0||bk(m,h,f)}v.memoizedState=f;var y={value:f,getSnapshot:h};return v.queue=y,$k(xk.bind(null,m,y,a),[a]),m.flags|=2048,hc(9,{destroy:void 0},Sk.bind(null,m,y,f,h),null),f},useId:function(){var a=un(),h=yt.identifierPrefix;if(tt){var f=tr,m=er;f=(m&~(1<<32-_t(m)-1)).toString(32)+f,h="_"+h+"R_"+f,f=np++,0<f&&(h+="H"+f.toString(32)),h+="_"}else f=E8++,h="_"+h+"r_"+f.toString(32)+"_";return a.memoizedState=h},useHostTransitionStatus:W0,useFormState:Rk,useActionState:Rk,useOptimistic:function(a){var h=un();h.memoizedState=h.baseState=a;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return h.queue=f,h=U0.bind(null,Ie,!0,f),f.dispatch=h,[a,h]},useMemoCache:$0,useCacheRefresh:function(){return un().memoizedState=D8.bind(null,Ie)},useEffectEvent:function(a){var h=un(),f={impl:a};return h.memoizedState=f,function(){if((ot&2)!==0)throw Error(n(440));return f.impl.apply(void 0,arguments)}}},Y0={readContext:ji,use:rp,useCallback:Xk,useContext:ji,useEffect:V0,useImperativeHandle:Vk,useInsertionEffect:Nk,useLayoutEffect:jk,useMemo:Zk,useReducer:op,useRef:Bk,useState:function(){return op(qr)},useDebugValue:X0,useDeferredValue:function(a,h){var f=Ft();return qk(f,pt.memoizedState,a,h)},useTransition:function(){var a=op(qr)[0],h=Ft().memoizedState;return[typeof a=="boolean"?a:eu(a),h]},useSyncExternalStore:yk,useId:Hk,useHostTransitionStatus:W0,useFormState:Qk,useActionState:Qk,useOptimistic:function(a,h){var f=Ft();return kk(f,pt,a,h)},useMemoCache:$0,useCacheRefresh:Fk};Y0.useEffectEvent=zk;var t2={readContext:ji,use:rp,useCallback:Xk,useContext:ji,useEffect:V0,useImperativeHandle:Vk,useInsertionEffect:Nk,useLayoutEffect:jk,useMemo:Zk,useReducer:N0,useRef:Bk,useState:function(){return N0(qr)},useDebugValue:X0,useDeferredValue:function(a,h){var f=Ft();return pt===null?Z0(f,a,h):qk(f,pt.memoizedState,a,h)},useTransition:function(){var a=N0(qr)[0],h=Ft().memoizedState;return[typeof a=="boolean"?a:eu(a),h]},useSyncExternalStore:yk,useId:Hk,useHostTransitionStatus:W0,useFormState:Dk,useActionState:Dk,useOptimistic:function(a,h){var f=Ft();return pt!==null?kk(f,pt,a,h):(f.baseState=a,[a,f.queue.dispatch])},useMemoCache:$0,useCacheRefresh:Fk};t2.useEffectEvent=zk;function H0(a,h,f,m){h=a.memoizedState,f=f(m,h),f=f==null?h:p({},h,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var F0={enqueueSetState:function(a,h,f){a=a._reactInternals;var m=Yn(),v=Bo(m);v.payload=h,f!=null&&(v.callback=f),h=$o(a,v,m),h!==null&&(En(h,a,m),Fh(h,a,m))},enqueueReplaceState:function(a,h,f){a=a._reactInternals;var m=Yn(),v=Bo(m);v.tag=1,v.payload=h,f!=null&&(v.callback=f),h=$o(a,v,m),h!==null&&(En(h,a,m),Fh(h,a,m))},enqueueForceUpdate:function(a,h){a=a._reactInternals;var f=Yn(),m=Bo(f);m.tag=2,h!=null&&(m.callback=h),h=$o(a,m,f),h!==null&&(En(h,a,f),Fh(h,a,f))}};function i2(a,h,f,m,v,y,C){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,y,C):h.prototype&&h.prototype.isPureReactComponent?!Vh(f,m)||!Vh(v,y):!0}function n2(a,h,f,m){a=h.state,typeof h.componentWillReceiveProps=="function"&&h.componentWillReceiveProps(f,m),typeof h.UNSAFE_componentWillReceiveProps=="function"&&h.UNSAFE_componentWillReceiveProps(f,m),h.state!==a&&F0.enqueueReplaceState(h,h.state,null)}function Fa(a,h){var f=h;if("ref"in h){f={};for(var m in h)m!=="ref"&&(f[m]=h[m])}if(a=a.defaultProps){f===h&&(f=p({},f));for(var v in a)f[v]===void 0&&(f[v]=a[v])}return f}function s2(a){Id(a)}function r2(a){console.error(a)}function o2(a){Id(a)}function hp(a,h){try{var f=a.onUncaughtError;f(h.value,{componentStack:h.stack})}catch(m){setTimeout(function(){throw m})}}function a2(a,h,f){try{var m=a.onCaughtError;m(f.value,{componentStack:f.stack,errorBoundary:h.tag===1?h.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function G0(a,h,f){return f=Bo(f),f.tag=3,f.payload={element:null},f.callback=function(){hp(a,h)},f}function l2(a){return a=Bo(a),a.tag=3,a}function c2(a,h,f,m){var v=f.type.getDerivedStateFromError;if(typeof v=="function"){var y=m.value;a.payload=function(){return v(y)},a.callback=function(){a2(h,f,m)}}var C=f.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(a.callback=function(){a2(h,f,m),typeof v!="function"&&(Xo===null?Xo=new Set([this]):Xo.add(this));var P=m.stack;this.componentDidCatch(m.value,{componentStack:P!==null?P:""})})}function $8(a,h,f,m,v){if(f.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(h=f.alternate,h!==null&&ic(h,f,v,!0),f=Zn.current,f!==null){switch(f.tag){case 31:case 13:return ms===null?Sp():f.alternate===null&&It===0&&(It=3),f.flags&=-257,f.flags|=65536,f.lanes=v,m===Gd?f.flags|=16384:(h=f.updateQueue,h===null?f.updateQueue=new Set([m]):h.add(m),Sv(a,m,v)),!1;case 22:return f.flags|=65536,m===Gd?f.flags|=16384:(h=f.updateQueue,h===null?(h={transitions:null,markerInstances:null,retryQueue:new Set([m])},f.updateQueue=h):(f=h.retryQueue,f===null?h.retryQueue=new Set([m]):f.add(m)),Sv(a,m,v)),!1}throw Error(n(435,f.tag))}return Sv(a,m,v),Sp(),!1}if(tt)return h=Zn.current,h!==null?((h.flags&65536)===0&&(h.flags|=256),h.flags|=65536,h.lanes=v,m!==g0&&(a=Error(n(422),{cause:m}),qh(us(a,f)))):(m!==g0&&(h=Error(n(423),{cause:m}),qh(us(h,f))),a=a.current.alternate,a.flags|=65536,v&=-v,a.lanes|=v,m=us(m,f),v=G0(a.stateNode,m,v),T0(a,v),It!==4&&(It=2)),!1;var y=Error(n(520),{cause:m});if(y=us(y,f),hu===null?hu=[y]:hu.push(y),It!==4&&(It=2),h===null)return!0;m=us(m,f),f=h;do{switch(f.tag){case 3:return f.flags|=65536,a=v&-v,f.lanes|=a,a=G0(f.stateNode,m,a),T0(f,a),!1;case 1:if(h=f.type,y=f.stateNode,(f.flags&128)===0&&(typeof h.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Xo===null||!Xo.has(y))))return f.flags|=65536,v&=-v,f.lanes|=v,v=l2(v),c2(v,a,f,m),T0(f,v),!1}f=f.return}while(f!==null);return!1}var K0=Error(n(461)),ni=!1;function Ii(a,h,f,m){h.child=a===null?dk(h,null,f,m):Ya(h,a.child,f,m)}function h2(a,h,f,m,v){f=f.render;var y=h.ref;if("ref"in m){var C={};for(var P in m)P!=="ref"&&(C[P]=m[P])}else C=m;return Za(h),m=Q0(a,h,f,C,y,v),P=L0(),a!==null&&!ni?(D0(a,h,v),Wr(a,h,v)):(tt&&P&&p0(h),h.flags|=1,Ii(a,h,m,v),h.child)}function u2(a,h,f,m,v){if(a===null){var y=f.type;return typeof y=="function"&&!u0(y)&&y.defaultProps===void 0&&f.compare===null?(h.tag=15,h.type=y,f2(a,h,y,m,v)):(a=qd(f.type,null,m,h,h.mode,v),a.ref=h.ref,a.return=h,h.child=a)}if(y=a.child,!ov(a,v)){var C=y.memoizedProps;if(f=f.compare,f=f!==null?f:Vh,f(C,m)&&a.ref===h.ref)return Wr(a,h,v)}return h.flags|=1,a=jr(y,m),a.ref=h.ref,a.return=h,h.child=a}function f2(a,h,f,m,v){if(a!==null){var y=a.memoizedProps;if(Vh(y,m)&&a.ref===h.ref)if(ni=!1,h.pendingProps=m=y,ov(a,v))(a.flags&131072)!==0&&(ni=!0);else return h.lanes=a.lanes,Wr(a,h,v)}return J0(a,h,f,m,v)}function d2(a,h,f,m){var v=m.children,y=a!==null?a.memoizedState:null;if(a===null&&h.stateNode===null&&(h.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((h.flags&128)!==0){if(y=y!==null?y.baseLanes|f:f,a!==null){for(m=h.child=a.child,v=0;m!==null;)v=v|m.lanes|m.childLanes,m=m.sibling;m=v&~y}else m=0,h.child=null;return p2(a,h,y,f,m)}if((f&536870912)!==0)h.memoizedState={baseLanes:0,cachePool:null},a!==null&&Hd(h,y!==null?y.cachePool:null),y!==null?gk(h,y):E0(),Ok(h);else return m=h.lanes=536870912,p2(a,h,y!==null?y.baseLanes|f:f,f,m)}else y!==null?(Hd(h,y.cachePool),gk(h,y),No(),h.memoizedState=null):(a!==null&&Hd(h,null),E0(),No());return Ii(a,h,v,f),h.child}function nu(a,h){return a!==null&&a.tag===22||h.stateNode!==null||(h.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.sibling}function p2(a,h,f,m,v){var y=x0();return y=y===null?null:{parent:ti._currentValue,pool:y},h.memoizedState={baseLanes:f,cachePool:y},a!==null&&Hd(h,null),E0(),Ok(h),a!==null&&ic(a,h,m,!0),h.childLanes=v,null}function up(a,h){return h=dp({mode:h.mode,children:h.children},a.mode),h.ref=a.ref,a.child=h,h.return=a,h}function m2(a,h,f){return Ya(h,a.child,null,f),a=up(h,h.pendingProps),a.flags|=2,qn(h),h.memoizedState=null,a}function z8(a,h,f){var m=h.pendingProps,v=(h.flags&128)!==0;if(h.flags&=-129,a===null){if(tt){if(m.mode==="hidden")return a=up(h,m),h.lanes=536870912,nu(null,a);if(P0(h),(a=At)?(a=T5(a,ps),a=a!==null&&a.data==="&"?a:null,a!==null&&(h.memoizedState={dehydrated:a,treeContext:Po!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},f=KC(a),f.return=h,h.child=f,Ni=h,At=null)):a=null,a===null)throw Qo(h);return h.lanes=536870912,null}return up(h,m)}var y=a.memoizedState;if(y!==null){var C=y.dehydrated;if(P0(h),v)if(h.flags&256)h.flags&=-257,h=m2(a,h,f);else if(h.memoizedState!==null)h.child=a.child,h.flags|=128,h=null;else throw Error(n(558));else if(ni||ic(a,h,f,!1),v=(f&a.childLanes)!==0,ni||v){if(m=yt,m!==null&&(C=rC(m,f),C!==0&&C!==y.retryLane))throw y.retryLane=C,ja(a,C),En(m,a,C),K0;Sp(),h=m2(a,h,f)}else a=y.treeContext,At=gs(C.nextSibling),Ni=h,tt=!0,Ro=null,ps=!1,a!==null&&tk(h,a),h=up(h,m),h.flags|=4096;return h}return a=jr(a.child,{mode:m.mode,children:m.children}),a.ref=h.ref,h.child=a,a.return=h,a}function fp(a,h){var f=h.ref;if(f===null)a!==null&&a.ref!==null&&(h.flags|=4194816);else{if(typeof f!="function"&&typeof f!="object")throw Error(n(284));(a===null||a.ref!==f)&&(h.flags|=4194816)}}function J0(a,h,f,m,v){return Za(h),f=Q0(a,h,f,m,void 0,v),m=L0(),a!==null&&!ni?(D0(a,h,v),Wr(a,h,v)):(tt&&m&&p0(h),h.flags|=1,Ii(a,h,f,v),h.child)}function g2(a,h,f,m,v,y){return Za(h),h.updateQueue=null,f=_k(h,m,f,v),vk(a),m=L0(),a!==null&&!ni?(D0(a,h,y),Wr(a,h,y)):(tt&&m&&p0(h),h.flags|=1,Ii(a,h,f,y),h.child)}function O2(a,h,f,m,v){if(Za(h),h.stateNode===null){var y=Kl,C=f.contextType;typeof C=="object"&&C!==null&&(y=ji(C)),y=new f(m,y),h.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=F0,h.stateNode=y,y._reactInternals=h,y=h.stateNode,y.props=m,y.state=h.memoizedState,y.refs={},C0(h),C=f.contextType,y.context=typeof C=="object"&&C!==null?ji(C):Kl,y.state=h.memoizedState,C=f.getDerivedStateFromProps,typeof C=="function"&&(H0(h,f,C,m),y.state=h.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(C=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),C!==y.state&&F0.enqueueReplaceState(y,y.state,null),Kh(h,m,y,v),Gh(),y.state=h.memoizedState),typeof y.componentDidMount=="function"&&(h.flags|=4194308),m=!0}else if(a===null){y=h.stateNode;var P=h.memoizedProps,W=Fa(f,P);y.props=W;var te=y.context,se=f.contextType;C=Kl,typeof se=="object"&&se!==null&&(C=ji(se));var le=f.getDerivedStateFromProps;se=typeof le=="function"||typeof y.getSnapshotBeforeUpdate=="function",P=h.pendingProps!==P,se||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(P||te!==C)&&n2(h,y,m,C),Do=!1;var ie=h.memoizedState;y.state=ie,Kh(h,m,y,v),Gh(),te=h.memoizedState,P||ie!==te||Do?(typeof le=="function"&&(H0(h,f,le,m),te=h.memoizedState),(W=Do||i2(h,f,W,m,ie,te,C))?(se||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(h.flags|=4194308)):(typeof y.componentDidMount=="function"&&(h.flags|=4194308),h.memoizedProps=m,h.memoizedState=te),y.props=m,y.state=te,y.context=C,m=W):(typeof y.componentDidMount=="function"&&(h.flags|=4194308),m=!1)}else{y=h.stateNode,k0(a,h),C=h.memoizedProps,se=Fa(f,C),y.props=se,le=h.pendingProps,ie=y.context,te=f.contextType,W=Kl,typeof te=="object"&&te!==null&&(W=ji(te)),P=f.getDerivedStateFromProps,(te=typeof P=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(C!==le||ie!==W)&&n2(h,y,m,W),Do=!1,ie=h.memoizedState,y.state=ie,Kh(h,m,y,v),Gh();var ne=h.memoizedState;C!==le||ie!==ne||Do||a!==null&&a.dependencies!==null&&Ud(a.dependencies)?(typeof P=="function"&&(H0(h,f,P,m),ne=h.memoizedState),(se=Do||i2(h,f,se,m,ie,ne,W)||a!==null&&a.dependencies!==null&&Ud(a.dependencies))?(te||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(m,ne,W),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(m,ne,W)),typeof y.componentDidUpdate=="function"&&(h.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(h.flags|=1024)):(typeof y.componentDidUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=1024),h.memoizedProps=m,h.memoizedState=ne),y.props=m,y.state=ne,y.context=W,m=se):(typeof y.componentDidUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||C===a.memoizedProps&&ie===a.memoizedState||(h.flags|=1024),m=!1)}return y=m,fp(a,h),m=(h.flags&128)!==0,y||m?(y=h.stateNode,f=m&&typeof f.getDerivedStateFromError!="function"?null:y.render(),h.flags|=1,a!==null&&m?(h.child=Ya(h,a.child,null,v),h.child=Ya(h,null,f,v)):Ii(a,h,f,v),h.memoizedState=y.state,a=h.child):a=Wr(a,h,v),a}function v2(a,h,f,m){return Va(),h.flags|=256,Ii(a,h,f,m),h.child}var ev={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function tv(a){return{baseLanes:a,cachePool:ak()}}function iv(a,h,f){return a=a!==null?a.childLanes&~f:0,h&&(a|=Un),a}function _2(a,h,f){var m=h.pendingProps,v=!1,y=(h.flags&128)!==0,C;if((C=y)||(C=a!==null&&a.memoizedState===null?!1:(Ht.current&2)!==0),C&&(v=!0,h.flags&=-129),C=(h.flags&32)!==0,h.flags&=-33,a===null){if(tt){if(v?zo(h):No(),(a=At)?(a=T5(a,ps),a=a!==null&&a.data!=="&"?a:null,a!==null&&(h.memoizedState={dehydrated:a,treeContext:Po!==null?{id:er,overflow:tr}:null,retryLane:536870912,hydrationErrors:null},f=KC(a),f.return=h,h.child=f,Ni=h,At=null)):a=null,a===null)throw Qo(h);return zv(a)?h.lanes=32:h.lanes=536870912,null}var P=m.children;return m=m.fallback,v?(No(),v=h.mode,P=dp({mode:"hidden",children:P},v),m=Ia(m,v,f,null),P.return=h,m.return=h,P.sibling=m,h.child=P,m=h.child,m.memoizedState=tv(f),m.childLanes=iv(a,C,f),h.memoizedState=ev,nu(null,m)):(zo(h),nv(h,P))}var W=a.memoizedState;if(W!==null&&(P=W.dehydrated,P!==null)){if(y)h.flags&256?(zo(h),h.flags&=-257,h=sv(a,h,f)):h.memoizedState!==null?(No(),h.child=a.child,h.flags|=128,h=null):(No(),P=m.fallback,v=h.mode,m=dp({mode:"visible",children:m.children},v),P=Ia(P,v,f,null),P.flags|=2,m.return=h,P.return=h,m.sibling=P,h.child=m,Ya(h,a.child,null,f),m=h.child,m.memoizedState=tv(f),m.childLanes=iv(a,C,f),h.memoizedState=ev,h=nu(null,m));else if(zo(h),zv(P)){if(C=P.nextSibling&&P.nextSibling.dataset,C)var te=C.dgst;C=te,m=Error(n(419)),m.stack="",m.digest=C,qh({value:m,source:null,stack:null}),h=sv(a,h,f)}else if(ni||ic(a,h,f,!1),C=(f&a.childLanes)!==0,ni||C){if(C=yt,C!==null&&(m=rC(C,f),m!==0&&m!==W.retryLane))throw W.retryLane=m,ja(a,m),En(C,a,m),K0;$v(P)||Sp(),h=sv(a,h,f)}else $v(P)?(h.flags|=192,h.child=a.child,h=null):(a=W.treeContext,At=gs(P.nextSibling),Ni=h,tt=!0,Ro=null,ps=!1,a!==null&&tk(h,a),h=nv(h,m.children),h.flags|=4096);return h}return v?(No(),P=m.fallback,v=h.mode,W=a.child,te=W.sibling,m=jr(W,{mode:"hidden",children:m.children}),m.subtreeFlags=W.subtreeFlags&65011712,te!==null?P=jr(te,P):(P=Ia(P,v,f,null),P.flags|=2),P.return=h,m.return=h,m.sibling=P,h.child=m,nu(null,m),m=h.child,P=a.child.memoizedState,P===null?P=tv(f):(v=P.cachePool,v!==null?(W=ti._currentValue,v=v.parent!==W?{parent:W,pool:W}:v):v=ak(),P={baseLanes:P.baseLanes|f,cachePool:v}),m.memoizedState=P,m.childLanes=iv(a,C,f),h.memoizedState=ev,nu(a.child,m)):(zo(h),f=a.child,a=f.sibling,f=jr(f,{mode:"visible",children:m.children}),f.return=h,f.sibling=null,a!==null&&(C=h.deletions,C===null?(h.deletions=[a],h.flags|=16):C.push(a)),h.child=f,h.memoizedState=null,f)}function nv(a,h){return h=dp({mode:"visible",children:h},a.mode),h.return=a,a.child=h}function dp(a,h){return a=Xn(22,a,null,h),a.lanes=0,a}function sv(a,h,f){return Ya(h,a.child,null,f),a=nv(h,h.pendingProps.children),a.flags|=2,h.memoizedState=null,a}function y2(a,h,f){a.lanes|=h;var m=a.alternate;m!==null&&(m.lanes|=h),_0(a.return,h,f)}function rv(a,h,f,m,v,y){var C=a.memoizedState;C===null?a.memoizedState={isBackwards:h,rendering:null,renderingStartTime:0,last:m,tail:f,tailMode:v,treeForkCount:y}:(C.isBackwards=h,C.rendering=null,C.renderingStartTime=0,C.last=m,C.tail=f,C.tailMode=v,C.treeForkCount=y)}function b2(a,h,f){var m=h.pendingProps,v=m.revealOrder,y=m.tail;m=m.children;var C=Ht.current,P=(C&2)!==0;if(P?(C=C&1|2,h.flags|=128):C&=1,Q(Ht,C),Ii(a,h,m,f),m=tt?Zh:0,!P&&a!==null&&(a.flags&128)!==0)e:for(a=h.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&y2(a,f,h);else if(a.tag===19)y2(a,f,h);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===h)break e;for(;a.sibling===null;){if(a.return===null||a.return===h)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(v){case"forwards":for(f=h.child,v=null;f!==null;)a=f.alternate,a!==null&&tp(a)===null&&(v=f),f=f.sibling;f=v,f===null?(v=h.child,h.child=null):(v=f.sibling,f.sibling=null),rv(h,!1,v,f,y,m);break;case"backwards":case"unstable_legacy-backwards":for(f=null,v=h.child,h.child=null;v!==null;){if(a=v.alternate,a!==null&&tp(a)===null){h.child=v;break}a=v.sibling,v.sibling=f,f=v,v=a}rv(h,!0,f,null,y,m);break;case"together":rv(h,!1,null,null,void 0,m);break;default:h.memoizedState=null}return h.child}function Wr(a,h,f){if(a!==null&&(h.dependencies=a.dependencies),Vo|=h.lanes,(f&h.childLanes)===0)if(a!==null){if(ic(a,h,f,!1),(f&h.childLanes)===0)return null}else return null;if(a!==null&&h.child!==a.child)throw Error(n(153));if(h.child!==null){for(a=h.child,f=jr(a,a.pendingProps),h.child=f,f.return=h;a.sibling!==null;)a=a.sibling,f=f.sibling=jr(a,a.pendingProps),f.return=h;f.sibling=null}return h.child}function ov(a,h){return(a.lanes&h)!==0?!0:(a=a.dependencies,!!(a!==null&&Ud(a)))}function N8(a,h,f){switch(h.tag){case 3:Ce(h,h.stateNode.containerInfo),Lo(h,ti,a.memoizedState.cache),Va();break;case 27:case 5:nt(h);break;case 4:Ce(h,h.stateNode.containerInfo);break;case 10:Lo(h,h.type,h.memoizedProps.value);break;case 31:if(h.memoizedState!==null)return h.flags|=128,P0(h),null;break;case 13:var m=h.memoizedState;if(m!==null)return m.dehydrated!==null?(zo(h),h.flags|=128,null):(f&h.child.childLanes)!==0?_2(a,h,f):(zo(h),a=Wr(a,h,f),a!==null?a.sibling:null);zo(h);break;case 19:var v=(a.flags&128)!==0;if(m=(f&h.childLanes)!==0,m||(ic(a,h,f,!1),m=(f&h.childLanes)!==0),v){if(m)return b2(a,h,f);h.flags|=128}if(v=h.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),Q(Ht,Ht.current),m)break;return null;case 22:return h.lanes=0,d2(a,h,f,h.pendingProps);case 24:Lo(h,ti,a.memoizedState.cache)}return Wr(a,h,f)}function S2(a,h,f){if(a!==null)if(a.memoizedProps!==h.pendingProps)ni=!0;else{if(!ov(a,f)&&(h.flags&128)===0)return ni=!1,N8(a,h,f);ni=(a.flags&131072)!==0}else ni=!1,tt&&(h.flags&1048576)!==0&&ek(h,Zh,h.index);switch(h.lanes=0,h.tag){case 16:e:{var m=h.pendingProps;if(a=Wa(h.elementType),h.type=a,typeof a=="function")u0(a)?(m=Fa(a,m),h.tag=1,h=O2(null,h,a,m,f)):(h.tag=0,h=J0(null,h,a,m,f));else{if(a!=null){var v=a.$$typeof;if(v===A){h.tag=11,h=h2(null,h,a,m,f);break e}else if(v===z){h.tag=14,h=u2(null,h,a,m,f);break e}}throw h=D(a)||a,Error(n(306,h,""))}}return h;case 0:return J0(a,h,h.type,h.pendingProps,f);case 1:return m=h.type,v=Fa(m,h.pendingProps),O2(a,h,m,v,f);case 3:e:{if(Ce(h,h.stateNode.containerInfo),a===null)throw Error(n(387));m=h.pendingProps;var y=h.memoizedState;v=y.element,k0(a,h),Kh(h,m,null,f);var C=h.memoizedState;if(m=C.cache,Lo(h,ti,m),m!==y.cache&&y0(h,[ti],f,!0),Gh(),m=C.element,y.isDehydrated)if(y={element:m,isDehydrated:!1,cache:C.cache},h.updateQueue.baseState=y,h.memoizedState=y,h.flags&256){h=v2(a,h,m,f);break e}else if(m!==v){v=us(Error(n(424)),h),qh(v),h=v2(a,h,m,f);break e}else{switch(a=h.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(At=gs(a.firstChild),Ni=h,tt=!0,Ro=null,ps=!0,f=dk(h,null,m,f),h.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling}else{if(Va(),m===v){h=Wr(a,h,f);break e}Ii(a,h,m,f)}h=h.child}return h;case 26:return fp(a,h),a===null?(f=Q5(h.type,null,h.pendingProps,null))?h.memoizedState=f:tt||(f=h.type,a=h.pendingProps,m=Ep(fe.current).createElement(f),m[zi]=h,m[xn]=a,Vi(m,f,a),bi(m),h.stateNode=m):h.memoizedState=Q5(h.type,a.memoizedProps,h.pendingProps,a.memoizedState),null;case 27:return nt(h),a===null&&tt&&(m=h.stateNode=M5(h.type,h.pendingProps,fe.current),Ni=h,ps=!0,v=At,Uo(h.type)?(Nv=v,At=gs(m.firstChild)):At=v),Ii(a,h,h.pendingProps.children,f),fp(a,h),a===null&&(h.flags|=4194304),h.child;case 5:return a===null&&tt&&((v=m=At)&&(m=mj(m,h.type,h.pendingProps,ps),m!==null?(h.stateNode=m,Ni=h,At=gs(m.firstChild),ps=!1,v=!0):v=!1),v||Qo(h)),nt(h),v=h.type,y=h.pendingProps,C=a!==null?a.memoizedProps:null,m=y.children,Lv(v,y)?m=null:C!==null&&Lv(v,C)&&(h.flags|=32),h.memoizedState!==null&&(v=Q0(a,h,M8,null,null,f),vu._currentValue=v),fp(a,h),Ii(a,h,m,f),h.child;case 6:return a===null&&tt&&((a=f=At)&&(f=gj(f,h.pendingProps,ps),f!==null?(h.stateNode=f,Ni=h,At=null,a=!0):a=!1),a||Qo(h)),null;case 13:return _2(a,h,f);case 4:return Ce(h,h.stateNode.containerInfo),m=h.pendingProps,a===null?h.child=Ya(h,null,m,f):Ii(a,h,m,f),h.child;case 11:return h2(a,h,h.type,h.pendingProps,f);case 7:return Ii(a,h,h.pendingProps,f),h.child;case 8:return Ii(a,h,h.pendingProps.children,f),h.child;case 12:return Ii(a,h,h.pendingProps.children,f),h.child;case 10:return m=h.pendingProps,Lo(h,h.type,m.value),Ii(a,h,m.children,f),h.child;case 9:return v=h.type._context,m=h.pendingProps.children,Za(h),v=ji(v),m=m(v),h.flags|=1,Ii(a,h,m,f),h.child;case 14:return u2(a,h,h.type,h.pendingProps,f);case 15:return f2(a,h,h.type,h.pendingProps,f);case 19:return b2(a,h,f);case 31:return z8(a,h,f);case 22:return d2(a,h,f,h.pendingProps);case 24:return Za(h),m=ji(ti),a===null?(v=x0(),v===null&&(v=yt,y=b0(),v.pooledCache=y,y.refCount++,y!==null&&(v.pooledCacheLanes|=f),v=y),h.memoizedState={parent:m,cache:v},C0(h),Lo(h,ti,v)):((a.lanes&f)!==0&&(k0(a,h),Kh(h,null,null,f),Gh()),v=a.memoizedState,y=h.memoizedState,v.parent!==m?(v={parent:m,cache:m},h.memoizedState=v,h.lanes===0&&(h.memoizedState=h.updateQueue.baseState=v),Lo(h,ti,m)):(m=y.cache,Lo(h,ti,m),m!==v.cache&&y0(h,[ti],f,!0))),Ii(a,h,h.pendingProps.children,f),h.child;case 29:throw h.pendingProps}throw Error(n(156,h.tag))}function Ur(a){a.flags|=4}function av(a,h,f,m,v){if((h=(a.mode&32)!==0)&&(h=!1),h){if(a.flags|=16777216,(v&335544128)===v)if(a.stateNode.complete)a.flags|=8192;else if(H2())a.flags|=8192;else throw Ua=Gd,w0}else a.flags&=-16777217}function x2(a,h){if(h.type!=="stylesheet"||(h.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!z5(h))if(H2())a.flags|=8192;else throw Ua=Gd,w0}function pp(a,h){h!==null&&(a.flags|=4),a.flags&16384&&(h=a.tag!==22?iC():536870912,a.lanes|=h,pc|=h)}function su(a,h){if(!tt)switch(a.tailMode){case"hidden":h=a.tail;for(var f=null;h!==null;)h.alternate!==null&&(f=h),h=h.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var m=null;f!==null;)f.alternate!==null&&(m=f),f=f.sibling;m===null?h||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function Et(a){var h=a.alternate!==null&&a.alternate.child===a.child,f=0,m=0;if(h)for(var v=a.child;v!==null;)f|=v.lanes|v.childLanes,m|=v.subtreeFlags&65011712,m|=v.flags&65011712,v.return=a,v=v.sibling;else for(v=a.child;v!==null;)f|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=a,v=v.sibling;return a.subtreeFlags|=m,a.childLanes=f,h}function j8(a,h,f){var m=h.pendingProps;switch(m0(h),h.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Et(h),null;case 1:return Et(h),null;case 3:return f=h.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),h.memoizedState.cache!==m&&(h.flags|=2048),Xr(ti),ye(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(a===null||a.child===null)&&(tc(h)?Ur(h):a===null||a.memoizedState.isDehydrated&&(h.flags&256)===0||(h.flags|=1024,O0())),Et(h),null;case 26:var v=h.type,y=h.memoizedState;return a===null?(Ur(h),y!==null?(Et(h),x2(h,y)):(Et(h),av(h,v,null,m,f))):y?y!==a.memoizedState?(Ur(h),Et(h),x2(h,y)):(Et(h),h.flags&=-16777217):(a=a.memoizedProps,a!==m&&Ur(h),Et(h),av(h,v,a,m,f)),null;case 27:if(Qt(h),f=fe.current,v=h.type,a!==null&&h.stateNode!=null)a.memoizedProps!==m&&Ur(h);else{if(!m){if(h.stateNode===null)throw Error(n(166));return Et(h),null}a=ue.current,tc(h)?ik(h):(a=M5(v,m,f),h.stateNode=a,Ur(h))}return Et(h),null;case 5:if(Qt(h),v=h.type,a!==null&&h.stateNode!=null)a.memoizedProps!==m&&Ur(h);else{if(!m){if(h.stateNode===null)throw Error(n(166));return Et(h),null}if(y=ue.current,tc(h))ik(h);else{var C=Ep(fe.current);switch(y){case 1:y=C.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:y=C.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":y=C.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":y=C.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":y=C.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof m.is=="string"?C.createElement("select",{is:m.is}):C.createElement("select"),m.multiple?y.multiple=!0:m.size&&(y.size=m.size);break;default:y=typeof m.is=="string"?C.createElement(v,{is:m.is}):C.createElement(v)}}y[zi]=h,y[xn]=m;e:for(C=h.child;C!==null;){if(C.tag===5||C.tag===6)y.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===h)break e;for(;C.sibling===null;){if(C.return===null||C.return===h)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}h.stateNode=y;e:switch(Vi(y,v,m),v){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Ur(h)}}return Et(h),av(h,h.type,a===null?null:a.memoizedProps,h.pendingProps,f),null;case 6:if(a&&h.stateNode!=null)a.memoizedProps!==m&&Ur(h);else{if(typeof m!="string"&&h.stateNode===null)throw Error(n(166));if(a=fe.current,tc(h)){if(a=h.stateNode,f=h.memoizedProps,m=null,v=Ni,v!==null)switch(v.tag){case 27:case 5:m=v.memoizedProps}a[zi]=h,a=!!(a.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||_5(a.nodeValue,f)),a||Qo(h,!0)}else a=Ep(a).createTextNode(m),a[zi]=h,h.stateNode=a}return Et(h),null;case 31:if(f=h.memoizedState,a===null||a.memoizedState!==null){if(m=tc(h),f!==null){if(a===null){if(!m)throw Error(n(318));if(a=h.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(557));a[zi]=h}else Va(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Et(h),a=!1}else f=O0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=f),a=!0;if(!a)return h.flags&256?(qn(h),h):(qn(h),null);if((h.flags&128)!==0)throw Error(n(558))}return Et(h),null;case 13:if(m=h.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(v=tc(h),m!==null&&m.dehydrated!==null){if(a===null){if(!v)throw Error(n(318));if(v=h.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(n(317));v[zi]=h}else Va(),(h.flags&128)===0&&(h.memoizedState=null),h.flags|=4;Et(h),v=!1}else v=O0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=v),v=!0;if(!v)return h.flags&256?(qn(h),h):(qn(h),null)}return qn(h),(h.flags&128)!==0?(h.lanes=f,h):(f=m!==null,a=a!==null&&a.memoizedState!==null,f&&(m=h.child,v=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(v=m.alternate.memoizedState.cachePool.pool),y=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(y=m.memoizedState.cachePool.pool),y!==v&&(m.flags|=2048)),f!==a&&f&&(h.child.flags|=8192),pp(h,h.updateQueue),Et(h),null);case 4:return ye(),a===null&&Ev(h.stateNode.containerInfo),Et(h),null;case 10:return Xr(h.type),Et(h),null;case 19:if(K(Ht),m=h.memoizedState,m===null)return Et(h),null;if(v=(h.flags&128)!==0,y=m.rendering,y===null)if(v)su(m,!1);else{if(It!==0||a!==null&&(a.flags&128)!==0)for(a=h.child;a!==null;){if(y=tp(a),y!==null){for(h.flags|=128,su(m,!1),a=y.updateQueue,h.updateQueue=a,pp(h,a),h.subtreeFlags=0,a=f,f=h.child;f!==null;)GC(f,a),f=f.sibling;return Q(Ht,Ht.current&1|2),tt&&Ir(h,m.treeForkCount),h.child}a=a.sibling}m.tail!==null&&cn()>_p&&(h.flags|=128,v=!0,su(m,!1),h.lanes=4194304)}else{if(!v)if(a=tp(y),a!==null){if(h.flags|=128,v=!0,a=a.updateQueue,h.updateQueue=a,pp(h,a),su(m,!0),m.tail===null&&m.tailMode==="hidden"&&!y.alternate&&!tt)return Et(h),null}else 2*cn()-m.renderingStartTime>_p&&f!==536870912&&(h.flags|=128,v=!0,su(m,!1),h.lanes=4194304);m.isBackwards?(y.sibling=h.child,h.child=y):(a=m.last,a!==null?a.sibling=y:h.child=y,m.last=y)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=cn(),a.sibling=null,f=Ht.current,Q(Ht,v?f&1|2:f&1),tt&&Ir(h,m.treeForkCount),a):(Et(h),null);case 22:case 23:return qn(h),M0(),m=h.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(h.flags|=8192):m&&(h.flags|=8192),m?(f&536870912)!==0&&(h.flags&128)===0&&(Et(h),h.subtreeFlags&6&&(h.flags|=8192)):Et(h),f=h.updateQueue,f!==null&&pp(h,f.retryQueue),f=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),m=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(m=h.memoizedState.cachePool.pool),m!==f&&(h.flags|=2048),a!==null&&K(qa),null;case 24:return f=null,a!==null&&(f=a.memoizedState.cache),h.memoizedState.cache!==f&&(h.flags|=2048),Xr(ti),Et(h),null;case 25:return null;case 30:return null}throw Error(n(156,h.tag))}function I8(a,h){switch(m0(h),h.tag){case 1:return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 3:return Xr(ti),ye(),a=h.flags,(a&65536)!==0&&(a&128)===0?(h.flags=a&-65537|128,h):null;case 26:case 27:case 5:return Qt(h),null;case 31:if(h.memoizedState!==null){if(qn(h),h.alternate===null)throw Error(n(340));Va()}return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 13:if(qn(h),a=h.memoizedState,a!==null&&a.dehydrated!==null){if(h.alternate===null)throw Error(n(340));Va()}return a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 19:return K(Ht),null;case 4:return ye(),null;case 10:return Xr(h.type),null;case 22:case 23:return qn(h),M0(),a!==null&&K(qa),a=h.flags,a&65536?(h.flags=a&-65537|128,h):null;case 24:return Xr(ti),null;case 25:return null;default:return null}}function w2(a,h){switch(m0(h),h.tag){case 3:Xr(ti),ye();break;case 26:case 27:case 5:Qt(h);break;case 4:ye();break;case 31:h.memoizedState!==null&&qn(h);break;case 13:qn(h);break;case 19:K(Ht);break;case 10:Xr(h.type);break;case 22:case 23:qn(h),M0(),a!==null&&K(qa);break;case 24:Xr(ti)}}function ru(a,h){try{var f=h.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var v=m.next;f=v;do{if((f.tag&a)===a){m=void 0;var y=f.create,C=f.inst;m=y(),C.destroy=m}f=f.next}while(f!==v)}}catch(P){dt(h,h.return,P)}}function jo(a,h,f){try{var m=h.updateQueue,v=m!==null?m.lastEffect:null;if(v!==null){var y=v.next;m=y;do{if((m.tag&a)===a){var C=m.inst,P=C.destroy;if(P!==void 0){C.destroy=void 0,v=h;var W=f,te=P;try{te()}catch(se){dt(v,W,se)}}}m=m.next}while(m!==y)}}catch(se){dt(h,h.return,se)}}function C2(a){var h=a.updateQueue;if(h!==null){var f=a.stateNode;try{mk(h,f)}catch(m){dt(a,a.return,m)}}}function k2(a,h,f){f.props=Fa(a.type,a.memoizedProps),f.state=a.memoizedState;try{f.componentWillUnmount()}catch(m){dt(a,h,m)}}function ou(a,h){try{var f=a.ref;if(f!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof f=="function"?a.refCleanup=f(m):f.current=m}}catch(v){dt(a,h,v)}}function ir(a,h){var f=a.ref,m=a.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(v){dt(a,h,v)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(v){dt(a,h,v)}else f.current=null}function T2(a){var h=a.type,f=a.memoizedProps,m=a.stateNode;try{e:switch(h){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(v){dt(a,a.return,v)}}function lv(a,h,f){try{var m=a.stateNode;cj(m,a.type,f,h),m[xn]=h}catch(v){dt(a,a.return,v)}}function A2(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Uo(a.type)||a.tag===4}function cv(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||A2(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Uo(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function hv(a,h,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,h?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(a,h):(h=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,h.appendChild(a),f=f._reactRootContainer,f!=null||h.onclick!==null||(h.onclick=zr));else if(m!==4&&(m===27&&Uo(a.type)&&(f=a.stateNode,h=null),a=a.child,a!==null))for(hv(a,h,f),a=a.sibling;a!==null;)hv(a,h,f),a=a.sibling}function mp(a,h,f){var m=a.tag;if(m===5||m===6)a=a.stateNode,h?f.insertBefore(a,h):f.appendChild(a);else if(m!==4&&(m===27&&Uo(a.type)&&(f=a.stateNode),a=a.child,a!==null))for(mp(a,h,f),a=a.sibling;a!==null;)mp(a,h,f),a=a.sibling}function E2(a){var h=a.stateNode,f=a.memoizedProps;try{for(var m=a.type,v=h.attributes;v.length;)h.removeAttributeNode(v[0]);Vi(h,m,f),h[zi]=a,h[xn]=f}catch(y){dt(a,a.return,y)}}var Yr=!1,si=!1,uv=!1,M2=typeof WeakSet=="function"?WeakSet:Set,Si=null;function V8(a,h){if(a=a.containerInfo,Rv=Bp,a=VC(a),s0(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var v=m.anchorOffset,y=m.focusNode;m=m.focusOffset;try{f.nodeType,y.nodeType}catch{f=null;break e}var C=0,P=-1,W=-1,te=0,se=0,le=a,ie=null;t:for(;;){for(var ne;le!==f||v!==0&&le.nodeType!==3||(P=C+v),le!==y||m!==0&&le.nodeType!==3||(W=C+m),le.nodeType===3&&(C+=le.nodeValue.length),(ne=le.firstChild)!==null;)ie=le,le=ne;for(;;){if(le===a)break t;if(ie===f&&++te===v&&(P=C),ie===y&&++se===m&&(W=C),(ne=le.nextSibling)!==null)break;le=ie,ie=le.parentNode}le=ne}f=P===-1||W===-1?null:{start:P,end:W}}else f=null}f=f||{start:0,end:0}}else f=null;for(Qv={focusedElem:a,selectionRange:f},Bp=!1,Si=h;Si!==null;)if(h=Si,a=h.child,(h.subtreeFlags&1028)!==0&&a!==null)a.return=h,Si=a;else for(;Si!==null;){switch(h=Si,y=h.alternate,a=h.flags,h.tag){case 0:if((a&4)!==0&&(a=h.updateQueue,a=a!==null?a.events:null,a!==null))for(f=0;f<a.length;f++)v=a[f],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&y!==null){a=void 0,f=h,v=y.memoizedProps,y=y.memoizedState,m=f.stateNode;try{var we=Fa(f.type,v);a=m.getSnapshotBeforeUpdate(we,y),m.__reactInternalSnapshotBeforeUpdate=a}catch(Qe){dt(f,f.return,Qe)}}break;case 3:if((a&1024)!==0){if(a=h.stateNode.containerInfo,f=a.nodeType,f===9)Bv(a);else if(f===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Bv(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(n(163))}if(a=h.sibling,a!==null){a.return=h.return,Si=a;break}Si=h.return}}function P2(a,h,f){var m=f.flags;switch(f.tag){case 0:case 11:case 15:Fr(a,f),m&4&&ru(5,f);break;case 1:if(Fr(a,f),m&4)if(a=f.stateNode,h===null)try{a.componentDidMount()}catch(C){dt(f,f.return,C)}else{var v=Fa(f.type,h.memoizedProps);h=h.memoizedState;try{a.componentDidUpdate(v,h,a.__reactInternalSnapshotBeforeUpdate)}catch(C){dt(f,f.return,C)}}m&64&&C2(f),m&512&&ou(f,f.return);break;case 3:if(Fr(a,f),m&64&&(a=f.updateQueue,a!==null)){if(h=null,f.child!==null)switch(f.child.tag){case 27:case 5:h=f.child.stateNode;break;case 1:h=f.child.stateNode}try{mk(a,h)}catch(C){dt(f,f.return,C)}}break;case 27:h===null&&m&4&&E2(f);case 26:case 5:Fr(a,f),h===null&&m&4&&T2(f),m&512&&ou(f,f.return);break;case 12:Fr(a,f);break;case 31:Fr(a,f),m&4&&L2(a,f);break;case 13:Fr(a,f),m&4&&D2(a,f),m&64&&(a=f.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(f=G8.bind(null,f),Oj(a,f))));break;case 22:if(m=f.memoizedState!==null||Yr,!m){h=h!==null&&h.memoizedState!==null||si,v=Yr;var y=si;Yr=m,(si=h)&&!y?Gr(a,f,(f.subtreeFlags&8772)!==0):Fr(a,f),Yr=v,si=y}break;case 30:break;default:Fr(a,f)}}function R2(a){var h=a.alternate;h!==null&&(a.alternate=null,R2(h)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(h=a.stateNode,h!==null&&IO(h)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var Lt=null,Cn=!1;function Hr(a,h,f){for(f=f.child;f!==null;)Q2(a,h,f),f=f.sibling}function Q2(a,h,f){if(fi&&typeof fi.onCommitFiberUnmount=="function")try{fi.onCommitFiberUnmount(hn,f)}catch{}switch(f.tag){case 26:si||ir(f,h),Hr(a,h,f),f.memoizedState?f.memoizedState.count--:f.stateNode&&(f=f.stateNode,f.parentNode.removeChild(f));break;case 27:si||ir(f,h);var m=Lt,v=Cn;Uo(f.type)&&(Lt=f.stateNode,Cn=!1),Hr(a,h,f),mu(f.stateNode),Lt=m,Cn=v;break;case 5:si||ir(f,h);case 6:if(m=Lt,v=Cn,Lt=null,Hr(a,h,f),Lt=m,Cn=v,Lt!==null)if(Cn)try{(Lt.nodeType===9?Lt.body:Lt.nodeName==="HTML"?Lt.ownerDocument.body:Lt).removeChild(f.stateNode)}catch(y){dt(f,h,y)}else try{Lt.removeChild(f.stateNode)}catch(y){dt(f,h,y)}break;case 18:Lt!==null&&(Cn?(a=Lt,C5(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,f.stateNode),Sc(a)):C5(Lt,f.stateNode));break;case 4:m=Lt,v=Cn,Lt=f.stateNode.containerInfo,Cn=!0,Hr(a,h,f),Lt=m,Cn=v;break;case 0:case 11:case 14:case 15:jo(2,f,h),si||jo(4,f,h),Hr(a,h,f);break;case 1:si||(ir(f,h),m=f.stateNode,typeof m.componentWillUnmount=="function"&&k2(f,h,m)),Hr(a,h,f);break;case 21:Hr(a,h,f);break;case 22:si=(m=si)||f.memoizedState!==null,Hr(a,h,f),si=m;break;default:Hr(a,h,f)}}function L2(a,h){if(h.memoizedState===null&&(a=h.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Sc(a)}catch(f){dt(h,h.return,f)}}}function D2(a,h){if(h.memoizedState===null&&(a=h.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Sc(a)}catch(f){dt(h,h.return,f)}}function X8(a){switch(a.tag){case 31:case 13:case 19:var h=a.stateNode;return h===null&&(h=a.stateNode=new M2),h;case 22:return a=a.stateNode,h=a._retryCache,h===null&&(h=a._retryCache=new M2),h;default:throw Error(n(435,a.tag))}}function gp(a,h){var f=X8(a);h.forEach(function(m){if(!f.has(m)){f.add(m);var v=K8.bind(null,a,m);m.then(v,v)}})}function kn(a,h){var f=h.deletions;if(f!==null)for(var m=0;m<f.length;m++){var v=f[m],y=a,C=h,P=C;e:for(;P!==null;){switch(P.tag){case 27:if(Uo(P.type)){Lt=P.stateNode,Cn=!1;break e}break;case 5:Lt=P.stateNode,Cn=!1;break e;case 3:case 4:Lt=P.stateNode.containerInfo,Cn=!0;break e}P=P.return}if(Lt===null)throw Error(n(160));Q2(y,C,v),Lt=null,Cn=!1,y=v.alternate,y!==null&&(y.return=null),v.return=null}if(h.subtreeFlags&13886)for(h=h.child;h!==null;)B2(h,a),h=h.sibling}var zs=null;function B2(a,h){var f=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:kn(h,a),Tn(a),m&4&&(jo(3,a,a.return),ru(3,a),jo(5,a,a.return));break;case 1:kn(h,a),Tn(a),m&512&&(si||f===null||ir(f,f.return)),m&64&&Yr&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(f=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=f===null?m:f.concat(m))));break;case 26:var v=zs;if(kn(h,a),Tn(a),m&512&&(si||f===null||ir(f,f.return)),m&4){var y=f!==null?f.memoizedState:null;if(m=a.memoizedState,f===null)if(m===null)if(a.stateNode===null){e:{m=a.type,f=a.memoizedProps,v=v.ownerDocument||v;t:switch(m){case"title":y=v.getElementsByTagName("title")[0],(!y||y[Qh]||y[zi]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=v.createElement(m),v.head.insertBefore(y,v.querySelector("head > title"))),Vi(y,m,f),y[zi]=a,bi(y),m=y;break e;case"link":var C=B5("link","href",v).get(m+(f.href||""));if(C){for(var P=0;P<C.length;P++)if(y=C[P],y.getAttribute("href")===(f.href==null||f.href===""?null:f.href)&&y.getAttribute("rel")===(f.rel==null?null:f.rel)&&y.getAttribute("title")===(f.title==null?null:f.title)&&y.getAttribute("crossorigin")===(f.crossOrigin==null?null:f.crossOrigin)){C.splice(P,1);break t}}y=v.createElement(m),Vi(y,m,f),v.head.appendChild(y);break;case"meta":if(C=B5("meta","content",v).get(m+(f.content||""))){for(P=0;P<C.length;P++)if(y=C[P],y.getAttribute("content")===(f.content==null?null:""+f.content)&&y.getAttribute("name")===(f.name==null?null:f.name)&&y.getAttribute("property")===(f.property==null?null:f.property)&&y.getAttribute("http-equiv")===(f.httpEquiv==null?null:f.httpEquiv)&&y.getAttribute("charset")===(f.charSet==null?null:f.charSet)){C.splice(P,1);break t}}y=v.createElement(m),Vi(y,m,f),v.head.appendChild(y);break;default:throw Error(n(468,m))}y[zi]=a,bi(y),m=y}a.stateNode=m}else $5(v,a.type,a.stateNode);else a.stateNode=D5(v,m,a.memoizedProps);else y!==m?(y===null?f.stateNode!==null&&(f=f.stateNode,f.parentNode.removeChild(f)):y.count--,m===null?$5(v,a.type,a.stateNode):D5(v,m,a.memoizedProps)):m===null&&a.stateNode!==null&&lv(a,a.memoizedProps,f.memoizedProps)}break;case 27:kn(h,a),Tn(a),m&512&&(si||f===null||ir(f,f.return)),f!==null&&m&4&&lv(a,a.memoizedProps,f.memoizedProps);break;case 5:if(kn(h,a),Tn(a),m&512&&(si||f===null||ir(f,f.return)),a.flags&32){v=a.stateNode;try{ql(v,"")}catch(we){dt(a,a.return,we)}}m&4&&a.stateNode!=null&&(v=a.memoizedProps,lv(a,v,f!==null?f.memoizedProps:v)),m&1024&&(uv=!0);break;case 6:if(kn(h,a),Tn(a),m&4){if(a.stateNode===null)throw Error(n(162));m=a.memoizedProps,f=a.stateNode;try{f.nodeValue=m}catch(we){dt(a,a.return,we)}}break;case 3:if(Rp=null,v=zs,zs=Mp(h.containerInfo),kn(h,a),zs=v,Tn(a),m&4&&f!==null&&f.memoizedState.isDehydrated)try{Sc(h.containerInfo)}catch(we){dt(a,a.return,we)}uv&&(uv=!1,$2(a));break;case 4:m=zs,zs=Mp(a.stateNode.containerInfo),kn(h,a),Tn(a),zs=m;break;case 12:kn(h,a),Tn(a);break;case 31:kn(h,a),Tn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gp(a,m)));break;case 13:kn(h,a),Tn(a),a.child.flags&8192&&a.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(vp=cn()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gp(a,m)));break;case 22:v=a.memoizedState!==null;var W=f!==null&&f.memoizedState!==null,te=Yr,se=si;if(Yr=te||v,si=se||W,kn(h,a),si=se,Yr=te,Tn(a),m&8192)e:for(h=a.stateNode,h._visibility=v?h._visibility&-2:h._visibility|1,v&&(f===null||W||Yr||si||Ga(a)),f=null,h=a;;){if(h.tag===5||h.tag===26){if(f===null){W=f=h;try{if(y=W.stateNode,v)C=y.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{P=W.stateNode;var le=W.memoizedProps.style,ie=le!=null&&le.hasOwnProperty("display")?le.display:null;P.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(we){dt(W,W.return,we)}}}else if(h.tag===6){if(f===null){W=h;try{W.stateNode.nodeValue=v?"":W.memoizedProps}catch(we){dt(W,W.return,we)}}}else if(h.tag===18){if(f===null){W=h;try{var ne=W.stateNode;v?k5(ne,!0):k5(W.stateNode,!1)}catch(we){dt(W,W.return,we)}}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===a)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===a)break e;for(;h.sibling===null;){if(h.return===null||h.return===a)break e;f===h&&(f=null),h=h.return}f===h&&(f=null),h.sibling.return=h.return,h=h.sibling}m&4&&(m=a.updateQueue,m!==null&&(f=m.retryQueue,f!==null&&(m.retryQueue=null,gp(a,f))));break;case 19:kn(h,a),Tn(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,gp(a,m)));break;case 30:break;case 21:break;default:kn(h,a),Tn(a)}}function Tn(a){var h=a.flags;if(h&2){try{for(var f,m=a.return;m!==null;){if(A2(m)){f=m;break}m=m.return}if(f==null)throw Error(n(160));switch(f.tag){case 27:var v=f.stateNode,y=cv(a);mp(a,y,v);break;case 5:var C=f.stateNode;f.flags&32&&(ql(C,""),f.flags&=-33);var P=cv(a);mp(a,P,C);break;case 3:case 4:var W=f.stateNode.containerInfo,te=cv(a);hv(a,te,W);break;default:throw Error(n(161))}}catch(se){dt(a,a.return,se)}a.flags&=-3}h&4096&&(a.flags&=-4097)}function $2(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var h=a;$2(h),h.tag===5&&h.flags&1024&&h.stateNode.reset(),a=a.sibling}}function Fr(a,h){if(h.subtreeFlags&8772)for(h=h.child;h!==null;)P2(a,h.alternate,h),h=h.sibling}function Ga(a){for(a=a.child;a!==null;){var h=a;switch(h.tag){case 0:case 11:case 14:case 15:jo(4,h,h.return),Ga(h);break;case 1:ir(h,h.return);var f=h.stateNode;typeof f.componentWillUnmount=="function"&&k2(h,h.return,f),Ga(h);break;case 27:mu(h.stateNode);case 26:case 5:ir(h,h.return),Ga(h);break;case 22:h.memoizedState===null&&Ga(h);break;case 30:Ga(h);break;default:Ga(h)}a=a.sibling}}function Gr(a,h,f){for(f=f&&(h.subtreeFlags&8772)!==0,h=h.child;h!==null;){var m=h.alternate,v=a,y=h,C=y.flags;switch(y.tag){case 0:case 11:case 15:Gr(v,y,f),ru(4,y);break;case 1:if(Gr(v,y,f),m=y,v=m.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(te){dt(m,m.return,te)}if(m=y,v=m.updateQueue,v!==null){var P=m.stateNode;try{var W=v.shared.hiddenCallbacks;if(W!==null)for(v.shared.hiddenCallbacks=null,v=0;v<W.length;v++)pk(W[v],P)}catch(te){dt(m,m.return,te)}}f&&C&64&&C2(y),ou(y,y.return);break;case 27:E2(y);case 26:case 5:Gr(v,y,f),f&&m===null&&C&4&&T2(y),ou(y,y.return);break;case 12:Gr(v,y,f);break;case 31:Gr(v,y,f),f&&C&4&&L2(v,y);break;case 13:Gr(v,y,f),f&&C&4&&D2(v,y);break;case 22:y.memoizedState===null&&Gr(v,y,f),ou(y,y.return);break;case 30:break;default:Gr(v,y,f)}h=h.sibling}}function fv(a,h){var f=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(f=a.memoizedState.cachePool.pool),a=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(a=h.memoizedState.cachePool.pool),a!==f&&(a!=null&&a.refCount++,f!=null&&Wh(f))}function dv(a,h){a=null,h.alternate!==null&&(a=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==a&&(h.refCount++,a!=null&&Wh(a))}function Ns(a,h,f,m){if(h.subtreeFlags&10256)for(h=h.child;h!==null;)z2(a,h,f,m),h=h.sibling}function z2(a,h,f,m){var v=h.flags;switch(h.tag){case 0:case 11:case 15:Ns(a,h,f,m),v&2048&&ru(9,h);break;case 1:Ns(a,h,f,m);break;case 3:Ns(a,h,f,m),v&2048&&(a=null,h.alternate!==null&&(a=h.alternate.memoizedState.cache),h=h.memoizedState.cache,h!==a&&(h.refCount++,a!=null&&Wh(a)));break;case 12:if(v&2048){Ns(a,h,f,m),a=h.stateNode;try{var y=h.memoizedProps,C=y.id,P=y.onPostCommit;typeof P=="function"&&P(C,h.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(W){dt(h,h.return,W)}}else Ns(a,h,f,m);break;case 31:Ns(a,h,f,m);break;case 13:Ns(a,h,f,m);break;case 23:break;case 22:y=h.stateNode,C=h.alternate,h.memoizedState!==null?y._visibility&2?Ns(a,h,f,m):au(a,h):y._visibility&2?Ns(a,h,f,m):(y._visibility|=2,uc(a,h,f,m,(h.subtreeFlags&10256)!==0||!1)),v&2048&&fv(C,h);break;case 24:Ns(a,h,f,m),v&2048&&dv(h.alternate,h);break;default:Ns(a,h,f,m)}}function uc(a,h,f,m,v){for(v=v&&((h.subtreeFlags&10256)!==0||!1),h=h.child;h!==null;){var y=a,C=h,P=f,W=m,te=C.flags;switch(C.tag){case 0:case 11:case 15:uc(y,C,P,W,v),ru(8,C);break;case 23:break;case 22:var se=C.stateNode;C.memoizedState!==null?se._visibility&2?uc(y,C,P,W,v):au(y,C):(se._visibility|=2,uc(y,C,P,W,v)),v&&te&2048&&fv(C.alternate,C);break;case 24:uc(y,C,P,W,v),v&&te&2048&&dv(C.alternate,C);break;default:uc(y,C,P,W,v)}h=h.sibling}}function au(a,h){if(h.subtreeFlags&10256)for(h=h.child;h!==null;){var f=a,m=h,v=m.flags;switch(m.tag){case 22:au(f,m),v&2048&&fv(m.alternate,m);break;case 24:au(f,m),v&2048&&dv(m.alternate,m);break;default:au(f,m)}h=h.sibling}}var lu=8192;function fc(a,h,f){if(a.subtreeFlags&lu)for(a=a.child;a!==null;)N2(a,h,f),a=a.sibling}function N2(a,h,f){switch(a.tag){case 26:fc(a,h,f),a.flags&lu&&a.memoizedState!==null&&Ej(f,zs,a.memoizedState,a.memoizedProps);break;case 5:fc(a,h,f);break;case 3:case 4:var m=zs;zs=Mp(a.stateNode.containerInfo),fc(a,h,f),zs=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=lu,lu=16777216,fc(a,h,f),lu=m):fc(a,h,f));break;default:fc(a,h,f)}}function j2(a){var h=a.alternate;if(h!==null&&(a=h.child,a!==null)){h.child=null;do h=a.sibling,a.sibling=null,a=h;while(a!==null)}}function cu(a){var h=a.deletions;if((a.flags&16)!==0){if(h!==null)for(var f=0;f<h.length;f++){var m=h[f];Si=m,V2(m,a)}j2(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)I2(a),a=a.sibling}function I2(a){switch(a.tag){case 0:case 11:case 15:cu(a),a.flags&2048&&jo(9,a,a.return);break;case 3:cu(a);break;case 12:cu(a);break;case 22:var h=a.stateNode;a.memoizedState!==null&&h._visibility&2&&(a.return===null||a.return.tag!==13)?(h._visibility&=-3,Op(a)):cu(a);break;default:cu(a)}}function Op(a){var h=a.deletions;if((a.flags&16)!==0){if(h!==null)for(var f=0;f<h.length;f++){var m=h[f];Si=m,V2(m,a)}j2(a)}for(a=a.child;a!==null;){switch(h=a,h.tag){case 0:case 11:case 15:jo(8,h,h.return),Op(h);break;case 22:f=h.stateNode,f._visibility&2&&(f._visibility&=-3,Op(h));break;default:Op(h)}a=a.sibling}}function V2(a,h){for(;Si!==null;){var f=Si;switch(f.tag){case 0:case 11:case 15:jo(8,f,h);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var m=f.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Wh(f.memoizedState.cache)}if(m=f.child,m!==null)m.return=f,Si=m;else e:for(f=a;Si!==null;){m=Si;var v=m.sibling,y=m.return;if(R2(m),m===f){Si=null;break e}if(v!==null){v.return=y,Si=v;break e}Si=y}}}var Z8={getCacheForType:function(a){var h=ji(ti),f=h.data.get(a);return f===void 0&&(f=a(),h.data.set(a,f)),f},cacheSignal:function(){return ji(ti).controller.signal}},q8=typeof WeakMap=="function"?WeakMap:Map,ot=0,yt=null,Ye=null,Ke=0,ft=0,Wn=null,Io=!1,dc=!1,pv=!1,Kr=0,It=0,Vo=0,Ka=0,mv=0,Un=0,pc=0,hu=null,An=null,gv=!1,vp=0,X2=0,_p=1/0,yp=null,Xo=null,di=0,Zo=null,mc=null,Jr=0,Ov=0,vv=null,Z2=null,uu=0,_v=null;function Yn(){return(ot&2)!==0&&Ke!==0?Ke&-Ke:$.T!==null?Cv():oC()}function q2(){if(Un===0)if((Ke&536870912)===0||tt){var a=Ad;Ad<<=1,(Ad&3932160)===0&&(Ad=262144),Un=a}else Un=536870912;return a=Zn.current,a!==null&&(a.flags|=32),Un}function En(a,h,f){(a===yt&&(ft===2||ft===9)||a.cancelPendingCommit!==null)&&(gc(a,0),qo(a,Ke,Un,!1)),Rh(a,f),((ot&2)===0||a!==yt)&&(a===yt&&((ot&2)===0&&(Ka|=f),It===4&&qo(a,Ke,Un,!1)),nr(a))}function W2(a,h,f){if((ot&6)!==0)throw Error(n(327));var m=!f&&(h&127)===0&&(h&a.expiredLanes)===0||Ph(a,h),v=m?Y8(a,h):bv(a,h,!0),y=m;do{if(v===0){dc&&!m&&qo(a,h,0,!1);break}else{if(f=a.current.alternate,y&&!W8(f)){v=bv(a,h,!1),y=!1;continue}if(v===2){if(y=h,a.errorRecoveryDisabledLanes&y)var C=0;else C=a.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){h=C;e:{var P=a;v=hu;var W=P.current.memoizedState.isDehydrated;if(W&&(gc(P,C).flags|=256),C=bv(P,C,!1),C!==2){if(pv&&!W){P.errorRecoveryDisabledLanes|=y,Ka|=y,v=4;break e}y=An,An=v,y!==null&&(An===null?An=y:An.push.apply(An,y))}v=C}if(y=!1,v!==2)continue}}if(v===1){gc(a,0),qo(a,h,0,!0);break}e:{switch(m=a,y=v,y){case 0:case 1:throw Error(n(345));case 4:if((h&4194048)!==h)break;case 6:qo(m,h,Un,!Io);break e;case 2:An=null;break;case 3:case 5:break;default:throw Error(n(329))}if((h&62914560)===h&&(v=vp+300-cn(),10<v)){if(qo(m,h,Un,!Io),Md(m,0,!0)!==0)break e;Jr=h,m.timeoutHandle=x5(U2.bind(null,m,f,An,yp,gv,h,Un,Ka,pc,Io,y,"Throttled",-0,0),v);break e}U2(m,f,An,yp,gv,h,Un,Ka,pc,Io,y,null,-0,0)}}break}while(!0);nr(a)}function U2(a,h,f,m,v,y,C,P,W,te,se,le,ie,ne){if(a.timeoutHandle=-1,le=h.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zr},N2(h,y,le);var we=(y&62914560)===y?vp-cn():(y&4194048)===y?X2-cn():0;if(we=Mj(le,we),we!==null){Jr=y,a.cancelPendingCommit=we(t5.bind(null,a,h,y,f,m,v,C,P,W,se,le,null,ie,ne)),qo(a,y,C,!te);return}}t5(a,h,y,f,m,v,C,P,W)}function W8(a){for(var h=a;;){var f=h.tag;if((f===0||f===11||f===15)&&h.flags&16384&&(f=h.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var m=0;m<f.length;m++){var v=f[m],y=v.getSnapshot;v=v.value;try{if(!Vn(y(),v))return!1}catch{return!1}}if(f=h.child,h.subtreeFlags&16384&&f!==null)f.return=h,h=f;else{if(h===a)break;for(;h.sibling===null;){if(h.return===null||h.return===a)return!0;h=h.return}h.sibling.return=h.return,h=h.sibling}}return!0}function qo(a,h,f,m){h&=~mv,h&=~Ka,a.suspendedLanes|=h,a.pingedLanes&=~h,m&&(a.warmLanes|=h),m=a.expirationTimes;for(var v=h;0<v;){var y=31-_t(v),C=1<<y;m[y]=-1,v&=~C}f!==0&&nC(a,f,h)}function bp(){return(ot&6)===0?(fu(0),!1):!0}function yv(){if(Ye!==null){if(ft===0)var a=Ye.return;else a=Ye,Vr=Xa=null,B0(a),oc=null,Yh=0,a=Ye;for(;a!==null;)w2(a.alternate,a),a=a.return;Ye=null}}function gc(a,h){var f=a.timeoutHandle;f!==-1&&(a.timeoutHandle=-1,fj(f)),f=a.cancelPendingCommit,f!==null&&(a.cancelPendingCommit=null,f()),Jr=0,yv(),yt=a,Ye=f=jr(a.current,null),Ke=h,ft=0,Wn=null,Io=!1,dc=Ph(a,h),pv=!1,pc=Un=mv=Ka=Vo=It=0,An=hu=null,gv=!1,(h&8)!==0&&(h|=h&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=h;0<m;){var v=31-_t(m),y=1<<v;h|=a[v],m&=~y}return Kr=h,Vd(),f}function Y2(a,h){Ie=null,$.H=iu,h===rc||h===Fd?(h=hk(),ft=3):h===w0?(h=hk(),ft=4):ft=h===K0?8:h!==null&&typeof h=="object"&&typeof h.then=="function"?6:1,Wn=h,Ye===null&&(It=1,hp(a,us(h,a.current)))}function H2(){var a=Zn.current;return a===null?!0:(Ke&4194048)===Ke?ms===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?a===ms:!1}function F2(){var a=$.H;return $.H=iu,a===null?iu:a}function G2(){var a=$.A;return $.A=Z8,a}function Sp(){It=4,Io||(Ke&4194048)!==Ke&&Zn.current!==null||(dc=!0),(Vo&134217727)===0&&(Ka&134217727)===0||yt===null||qo(yt,Ke,Un,!1)}function bv(a,h,f){var m=ot;ot|=2;var v=F2(),y=G2();(yt!==a||Ke!==h)&&(yp=null,gc(a,h)),h=!1;var C=It;e:do try{if(ft!==0&&Ye!==null){var P=Ye,W=Wn;switch(ft){case 8:yv(),C=6;break e;case 3:case 2:case 9:case 6:Zn.current===null&&(h=!0);var te=ft;if(ft=0,Wn=null,Oc(a,P,W,te),f&&dc){C=0;break e}break;default:te=ft,ft=0,Wn=null,Oc(a,P,W,te)}}U8(),C=It;break}catch(se){Y2(a,se)}while(!0);return h&&a.shellSuspendCounter++,Vr=Xa=null,ot=m,$.H=v,$.A=y,Ye===null&&(yt=null,Ke=0,Vd()),C}function U8(){for(;Ye!==null;)K2(Ye)}function Y8(a,h){var f=ot;ot|=2;var m=F2(),v=G2();yt!==a||Ke!==h?(yp=null,_p=cn()+500,gc(a,h)):dc=Ph(a,h);e:do try{if(ft!==0&&Ye!==null){h=Ye;var y=Wn;t:switch(ft){case 1:ft=0,Wn=null,Oc(a,h,y,1);break;case 2:case 9:if(lk(y)){ft=0,Wn=null,J2(h);break}h=function(){ft!==2&&ft!==9||yt!==a||(ft=7),nr(a)},y.then(h,h);break e;case 3:ft=7;break e;case 4:ft=5;break e;case 7:lk(y)?(ft=0,Wn=null,J2(h)):(ft=0,Wn=null,Oc(a,h,y,7));break;case 5:var C=null;switch(Ye.tag){case 26:C=Ye.memoizedState;case 5:case 27:var P=Ye;if(C?z5(C):P.stateNode.complete){ft=0,Wn=null;var W=P.sibling;if(W!==null)Ye=W;else{var te=P.return;te!==null?(Ye=te,xp(te)):Ye=null}break t}}ft=0,Wn=null,Oc(a,h,y,5);break;case 6:ft=0,Wn=null,Oc(a,h,y,6);break;case 8:yv(),It=6;break e;default:throw Error(n(462))}}H8();break}catch(se){Y2(a,se)}while(!0);return Vr=Xa=null,$.H=m,$.A=v,ot=f,Ye!==null?0:(yt=null,Ke=0,Vd(),It)}function H8(){for(;Ye!==null&&!LO();)K2(Ye)}function K2(a){var h=S2(a.alternate,a,Kr);a.memoizedProps=a.pendingProps,h===null?xp(a):Ye=h}function J2(a){var h=a,f=h.alternate;switch(h.tag){case 15:case 0:h=g2(f,h,h.pendingProps,h.type,void 0,Ke);break;case 11:h=g2(f,h,h.pendingProps,h.type.render,h.ref,Ke);break;case 5:B0(h);default:w2(f,h),h=Ye=GC(h,Kr),h=S2(f,h,Kr)}a.memoizedProps=a.pendingProps,h===null?xp(a):Ye=h}function Oc(a,h,f,m){Vr=Xa=null,B0(h),oc=null,Yh=0;var v=h.return;try{if($8(a,v,h,f,Ke)){It=1,hp(a,us(f,a.current)),Ye=null;return}}catch(y){if(v!==null)throw Ye=v,y;It=1,hp(a,us(f,a.current)),Ye=null;return}h.flags&32768?(tt||m===1?a=!0:dc||(Ke&536870912)!==0?a=!1:(Io=a=!0,(m===2||m===9||m===3||m===6)&&(m=Zn.current,m!==null&&m.tag===13&&(m.flags|=16384))),e5(h,a)):xp(h)}function xp(a){var h=a;do{if((h.flags&32768)!==0){e5(h,Io);return}a=h.return;var f=j8(h.alternate,h,Kr);if(f!==null){Ye=f;return}if(h=h.sibling,h!==null){Ye=h;return}Ye=h=a}while(h!==null);It===0&&(It=5)}function e5(a,h){do{var f=I8(a.alternate,a);if(f!==null){f.flags&=32767,Ye=f;return}if(f=a.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!h&&(a=a.sibling,a!==null)){Ye=a;return}Ye=a=f}while(a!==null);It=6,Ye=null}function t5(a,h,f,m,v,y,C,P,W){a.cancelPendingCommit=null;do wp();while(di!==0);if((ot&6)!==0)throw Error(n(327));if(h!==null){if(h===a.current)throw Error(n(177));if(y=h.lanes|h.childLanes,y|=c0,AN(a,f,y,C,P,W),a===yt&&(Ye=yt=null,Ke=0),mc=h,Zo=a,Jr=f,Ov=y,vv=v,Z2=m,(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,J8(De,function(){return o5(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(h.flags&13878)!==0,(h.subtreeFlags&13878)!==0||m){m=$.T,$.T=null,v=X.p,X.p=2,C=ot,ot|=4;try{V8(a,h,f)}finally{ot=C,X.p=v,$.T=m}}di=1,i5(),n5(),s5()}}function i5(){if(di===1){di=0;var a=Zo,h=mc,f=(h.flags&13878)!==0;if((h.subtreeFlags&13878)!==0||f){f=$.T,$.T=null;var m=X.p;X.p=2;var v=ot;ot|=4;try{B2(h,a);var y=Qv,C=VC(a.containerInfo),P=y.focusedElem,W=y.selectionRange;if(C!==P&&P&&P.ownerDocument&&IC(P.ownerDocument.documentElement,P)){if(W!==null&&s0(P)){var te=W.start,se=W.end;if(se===void 0&&(se=te),"selectionStart"in P)P.selectionStart=te,P.selectionEnd=Math.min(se,P.value.length);else{var le=P.ownerDocument||document,ie=le&&le.defaultView||window;if(ie.getSelection){var ne=ie.getSelection(),we=P.textContent.length,Qe=Math.min(W.start,we),gt=W.end===void 0?Qe:Math.min(W.end,we);!ne.extend&&Qe>gt&&(C=gt,gt=Qe,Qe=C);var G=jC(P,Qe),Y=jC(P,gt);if(G&&Y&&(ne.rangeCount!==1||ne.anchorNode!==G.node||ne.anchorOffset!==G.offset||ne.focusNode!==Y.node||ne.focusOffset!==Y.offset)){var ee=le.createRange();ee.setStart(G.node,G.offset),ne.removeAllRanges(),Qe>gt?(ne.addRange(ee),ne.extend(Y.node,Y.offset)):(ee.setEnd(Y.node,Y.offset),ne.addRange(ee))}}}}for(le=[],ne=P;ne=ne.parentNode;)ne.nodeType===1&&le.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<le.length;P++){var ae=le[P];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Bp=!!Rv,Qv=Rv=null}finally{ot=v,X.p=m,$.T=f}}a.current=h,di=2}}function n5(){if(di===2){di=0;var a=Zo,h=mc,f=(h.flags&8772)!==0;if((h.subtreeFlags&8772)!==0||f){f=$.T,$.T=null;var m=X.p;X.p=2;var v=ot;ot|=4;try{P2(a,h.alternate,h)}finally{ot=v,X.p=m,$.T=f}}di=3}}function s5(){if(di===4||di===3){di=0,DO();var a=Zo,h=mc,f=Jr,m=Z2;(h.subtreeFlags&10256)!==0||(h.flags&10256)!==0?di=5:(di=0,mc=Zo=null,r5(a,a.pendingLanes));var v=a.pendingLanes;if(v===0&&(Xo=null),NO(f),h=h.stateNode,fi&&typeof fi.onCommitFiberRoot=="function")try{fi.onCommitFiberRoot(hn,h,void 0,(h.current.flags&128)===128)}catch{}if(m!==null){h=$.T,v=X.p,X.p=2,$.T=null;try{for(var y=a.onRecoverableError,C=0;C<m.length;C++){var P=m[C];y(P.value,{componentStack:P.stack})}}finally{$.T=h,X.p=v}}(Jr&3)!==0&&wp(),nr(a),v=a.pendingLanes,(f&261930)!==0&&(v&42)!==0?a===_v?uu++:(uu=0,_v=a):uu=0,fu(0)}}function r5(a,h){(a.pooledCacheLanes&=h)===0&&(h=a.pooledCache,h!=null&&(a.pooledCache=null,Wh(h)))}function wp(){return i5(),n5(),s5(),o5()}function o5(){if(di!==5)return!1;var a=Zo,h=Ov;Ov=0;var f=NO(Jr),m=$.T,v=X.p;try{X.p=32>f?32:f,$.T=null,f=vv,vv=null;var y=Zo,C=Jr;if(di=0,mc=Zo=null,Jr=0,(ot&6)!==0)throw Error(n(331));var P=ot;if(ot|=4,I2(y.current),z2(y,y.current,C,f),ot=P,fu(0,!1),fi&&typeof fi.onPostCommitFiberRoot=="function")try{fi.onPostCommitFiberRoot(hn,y)}catch{}return!0}finally{X.p=v,$.T=m,r5(a,h)}}function a5(a,h,f){h=us(f,h),h=G0(a.stateNode,h,2),a=$o(a,h,2),a!==null&&(Rh(a,2),nr(a))}function dt(a,h,f){if(a.tag===3)a5(a,a,f);else for(;h!==null;){if(h.tag===3){a5(h,a,f);break}else if(h.tag===1){var m=h.stateNode;if(typeof h.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Xo===null||!Xo.has(m))){a=us(f,a),f=l2(2),m=$o(h,f,2),m!==null&&(c2(f,m,h,a),Rh(m,2),nr(m));break}}h=h.return}}function Sv(a,h,f){var m=a.pingCache;if(m===null){m=a.pingCache=new q8;var v=new Set;m.set(h,v)}else v=m.get(h),v===void 0&&(v=new Set,m.set(h,v));v.has(f)||(pv=!0,v.add(f),a=F8.bind(null,a,h,f),h.then(a,a))}function F8(a,h,f){var m=a.pingCache;m!==null&&m.delete(h),a.pingedLanes|=a.suspendedLanes&f,a.warmLanes&=~f,yt===a&&(Ke&f)===f&&(It===4||It===3&&(Ke&62914560)===Ke&&300>cn()-vp?(ot&2)===0&&gc(a,0):mv|=f,pc===Ke&&(pc=0)),nr(a)}function l5(a,h){h===0&&(h=iC()),a=ja(a,h),a!==null&&(Rh(a,h),nr(a))}function G8(a){var h=a.memoizedState,f=0;h!==null&&(f=h.retryLane),l5(a,f)}function K8(a,h){var f=0;switch(a.tag){case 31:case 13:var m=a.stateNode,v=a.memoizedState;v!==null&&(f=v.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(n(314))}m!==null&&m.delete(h),l5(a,f)}function J8(a,h){return To(a,h)}var Cp=null,vc=null,xv=!1,kp=!1,wv=!1,Wo=0;function nr(a){a!==vc&&a.next===null&&(vc===null?Cp=vc=a:vc=vc.next=a),kp=!0,xv||(xv=!0,tj())}function fu(a,h){if(!wv&&kp){wv=!0;do for(var f=!1,m=Cp;m!==null;){if(a!==0){var v=m.pendingLanes;if(v===0)var y=0;else{var C=m.suspendedLanes,P=m.pingedLanes;y=(1<<31-_t(42|a)+1)-1,y&=v&~(C&~P),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(f=!0,f5(m,y))}else y=Ke,y=Md(m,m===yt?y:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(y&3)===0||Ph(m,y)||(f=!0,f5(m,y));m=m.next}while(f);wv=!1}}function ej(){c5()}function c5(){kp=xv=!1;var a=0;Wo!==0&&uj()&&(a=Wo);for(var h=cn(),f=null,m=Cp;m!==null;){var v=m.next,y=h5(m,h);y===0?(m.next=null,f===null?Cp=v:f.next=v,v===null&&(vc=f)):(f=m,(a!==0||(y&3)!==0)&&(kp=!0)),m=v}di!==0&&di!==5||fu(a),Wo!==0&&(Wo=0)}function h5(a,h){for(var f=a.suspendedLanes,m=a.pingedLanes,v=a.expirationTimes,y=a.pendingLanes&-62914561;0<y;){var C=31-_t(y),P=1<<C,W=v[C];W===-1?((P&f)===0||(P&m)!==0)&&(v[C]=TN(P,h)):W<=h&&(a.expiredLanes|=P),y&=~P}if(h=yt,f=Ke,f=Md(a,a===h?f:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,f===0||a===h&&(ft===2||ft===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Mh(m),a.callbackNode=null,a.callbackPriority=0;if((f&3)===0||Ph(a,f)){if(h=f&-f,h===a.callbackPriority)return h;switch(m!==null&&Mh(m),NO(f)){case 2:case 8:f=ge;break;case 32:f=De;break;case 268435456:f=ht;break;default:f=De}return m=u5.bind(null,a),f=To(f,m),a.callbackPriority=h,a.callbackNode=f,h}return m!==null&&m!==null&&Mh(m),a.callbackPriority=2,a.callbackNode=null,2}function u5(a,h){if(di!==0&&di!==5)return a.callbackNode=null,a.callbackPriority=0,null;var f=a.callbackNode;if(wp()&&a.callbackNode!==f)return null;var m=Ke;return m=Md(a,a===yt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(W2(a,m,h),h5(a,cn()),a.callbackNode!=null&&a.callbackNode===f?u5.bind(null,a):null)}function f5(a,h){if(wp())return null;W2(a,h,!0)}function tj(){dj(function(){(ot&6)!==0?To(oe,ej):c5()})}function Cv(){if(Wo===0){var a=nc;a===0&&(a=Td,Td<<=1,(Td&261888)===0&&(Td=256)),Wo=a}return Wo}function d5(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Ld(""+a)}function p5(a,h){var f=h.ownerDocument.createElement("input");return f.name=h.name,f.value=h.value,a.id&&f.setAttribute("form",a.id),h.parentNode.insertBefore(f,h),a=new FormData(a),f.parentNode.removeChild(f),a}function ij(a,h,f,m,v){if(h==="submit"&&f&&f.stateNode===v){var y=d5((v[xn]||null).action),C=m.submitter;C&&(h=(h=C[xn]||null)?d5(h.formAction):C.getAttribute("formAction"),h!==null&&(y=h,C=null));var P=new zd("action","action",null,m,v);a.push({event:P,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Wo!==0){var W=C?p5(v,C):new FormData(v);q0(f,{pending:!0,data:W,method:v.method,action:y},null,W)}}else typeof y=="function"&&(P.preventDefault(),W=C?p5(v,C):new FormData(v),q0(f,{pending:!0,data:W,method:v.method,action:y},y,W))},currentTarget:v}]})}}for(var kv=0;kv<l0.length;kv++){var Tv=l0[kv],nj=Tv.toLowerCase(),sj=Tv[0].toUpperCase()+Tv.slice(1);$s(nj,"on"+sj)}$s(qC,"onAnimationEnd"),$s(WC,"onAnimationIteration"),$s(UC,"onAnimationStart"),$s("dblclick","onDoubleClick"),$s("focusin","onFocus"),$s("focusout","onBlur"),$s(y8,"onTransitionRun"),$s(b8,"onTransitionStart"),$s(S8,"onTransitionCancel"),$s(YC,"onTransitionEnd"),Xl("onMouseEnter",["mouseout","mouseover"]),Xl("onMouseLeave",["mouseout","mouseover"]),Xl("onPointerEnter",["pointerout","pointerover"]),Xl("onPointerLeave",["pointerout","pointerover"]),Ba("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ba("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ba("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ba("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ba("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ba("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var du="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(" "),rj=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(du));function m5(a,h){h=(h&4)!==0;for(var f=0;f<a.length;f++){var m=a[f],v=m.event;m=m.listeners;e:{var y=void 0;if(h)for(var C=m.length-1;0<=C;C--){var P=m[C],W=P.instance,te=P.currentTarget;if(P=P.listener,W!==y&&v.isPropagationStopped())break e;y=P,v.currentTarget=te;try{y(v)}catch(se){Id(se)}v.currentTarget=null,y=W}else for(C=0;C<m.length;C++){if(P=m[C],W=P.instance,te=P.currentTarget,P=P.listener,W!==y&&v.isPropagationStopped())break e;y=P,v.currentTarget=te;try{y(v)}catch(se){Id(se)}v.currentTarget=null,y=W}}}}function He(a,h){var f=h[jO];f===void 0&&(f=h[jO]=new Set);var m=a+"__bubble";f.has(m)||(g5(h,a,2,!1),f.add(m))}function Av(a,h,f){var m=0;h&&(m|=4),g5(f,a,m,h)}var Tp="_reactListening"+Math.random().toString(36).slice(2);function Ev(a){if(!a[Tp]){a[Tp]=!0,cC.forEach(function(f){f!=="selectionchange"&&(rj.has(f)||Av(f,!1,a),Av(f,!0,a))});var h=a.nodeType===9?a:a.ownerDocument;h===null||h[Tp]||(h[Tp]=!0,Av("selectionchange",!1,h))}}function g5(a,h,f,m){switch(q5(h)){case 2:var v=Qj;break;case 8:v=Lj;break;default:v=Zv}f=v.bind(null,h,f,a),v=void 0,!HO||h!=="touchstart"&&h!=="touchmove"&&h!=="wheel"||(v=!0),m?v!==void 0?a.addEventListener(h,f,{capture:!0,passive:v}):a.addEventListener(h,f,!0):v!==void 0?a.addEventListener(h,f,{passive:v}):a.addEventListener(h,f,!1)}function Mv(a,h,f,m,v){var y=m;if((h&1)===0&&(h&2)===0&&m!==null)e:for(;;){if(m===null)return;var C=m.tag;if(C===3||C===4){var P=m.stateNode.containerInfo;if(P===v)break;if(C===4)for(C=m.return;C!==null;){var W=C.tag;if((W===3||W===4)&&C.stateNode.containerInfo===v)return;C=C.return}for(;P!==null;){if(C=jl(P),C===null)return;if(W=C.tag,W===5||W===6||W===26||W===27){m=y=C;continue e}P=P.parentNode}}m=m.return}bC(function(){var te=y,se=UO(f),le=[];e:{var ie=HC.get(a);if(ie!==void 0){var ne=zd,we=a;switch(a){case"keypress":if(Bd(f)===0)break e;case"keydown":case"keyup":ne=KN;break;case"focusin":we="focus",ne=JO;break;case"focusout":we="blur",ne=JO;break;case"beforeblur":case"afterblur":ne=JO;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":ne=wC;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=jN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=t8;break;case qC:case WC:case UC:ne=XN;break;case YC:ne=n8;break;case"scroll":case"scrollend":ne=zN;break;case"wheel":ne=r8;break;case"copy":case"cut":case"paste":ne=qN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=kC;break;case"toggle":case"beforetoggle":ne=a8}var Qe=(h&4)!==0,gt=!Qe&&(a==="scroll"||a==="scrollend"),G=Qe?ie!==null?ie+"Capture":null:ie;Qe=[];for(var Y=te,ee;Y!==null;){var ae=Y;if(ee=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||ee===null||G===null||(ae=Dh(Y,G),ae!=null&&Qe.push(pu(Y,ae,ee))),gt)break;Y=Y.return}0<Qe.length&&(ie=new ne(ie,we,null,f,se),le.push({event:ie,listeners:Qe}))}}if((h&7)===0){e:{if(ie=a==="mouseover"||a==="pointerover",ne=a==="mouseout"||a==="pointerout",ie&&f!==WO&&(we=f.relatedTarget||f.fromElement)&&(jl(we)||we[Nl]))break e;if((ne||ie)&&(ie=se.window===se?se:(ie=se.ownerDocument)?ie.defaultView||ie.parentWindow:window,ne?(we=f.relatedTarget||f.toElement,ne=te,we=we?jl(we):null,we!==null&&(gt=r(we),Qe=we.tag,we!==gt||Qe!==5&&Qe!==27&&Qe!==6)&&(we=null)):(ne=null,we=te),ne!==we)){if(Qe=wC,ae="onMouseLeave",G="onMouseEnter",Y="mouse",(a==="pointerout"||a==="pointerover")&&(Qe=kC,ae="onPointerLeave",G="onPointerEnter",Y="pointer"),gt=ne==null?ie:Lh(ne),ee=we==null?ie:Lh(we),ie=new Qe(ae,Y+"leave",ne,f,se),ie.target=gt,ie.relatedTarget=ee,ae=null,jl(se)===te&&(Qe=new Qe(G,Y+"enter",we,f,se),Qe.target=ee,Qe.relatedTarget=gt,ae=Qe),gt=ae,ne&&we)t:{for(Qe=oj,G=ne,Y=we,ee=0,ae=G;ae;ae=Qe(ae))ee++;ae=0;for(var Re=Y;Re;Re=Qe(Re))ae++;for(;0<ee-ae;)G=Qe(G),ee--;for(;0<ae-ee;)Y=Qe(Y),ae--;for(;ee--;){if(G===Y||Y!==null&&G===Y.alternate){Qe=G;break t}G=Qe(G),Y=Qe(Y)}Qe=null}else Qe=null;ne!==null&&O5(le,ie,ne,Qe,!1),we!==null&&gt!==null&&O5(le,gt,we,Qe,!0)}}e:{if(ie=te?Lh(te):window,ne=ie.nodeName&&ie.nodeName.toLowerCase(),ne==="select"||ne==="input"&&ie.type==="file")var st=LC;else if(RC(ie))if(DC)st=O8;else{st=m8;var Ee=p8}else ne=ie.nodeName,!ne||ne.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?te&&qO(te.elementType)&&(st=LC):st=g8;if(st&&(st=st(a,te))){QC(le,st,f,se);break e}Ee&&Ee(a,ie,te),a==="focusout"&&te&&ie.type==="number"&&te.memoizedProps.value!=null&&ZO(ie,"number",ie.value)}switch(Ee=te?Lh(te):window,a){case"focusin":(RC(Ee)||Ee.contentEditable==="true")&&(Hl=Ee,r0=te,Xh=null);break;case"focusout":Xh=r0=Hl=null;break;case"mousedown":o0=!0;break;case"contextmenu":case"mouseup":case"dragend":o0=!1,XC(le,f,se);break;case"selectionchange":if(_8)break;case"keydown":case"keyup":XC(le,f,se)}var Ve;if(t0)e:{switch(a){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else Yl?MC(a,f)&&(Je="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(Je="onCompositionStart");Je&&(TC&&f.locale!=="ko"&&(Yl||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&Yl&&(Ve=SC()):(Mo=se,FO="value"in Mo?Mo.value:Mo.textContent,Yl=!0)),Ee=Ap(te,Je),0<Ee.length&&(Je=new CC(Je,a,null,f,se),le.push({event:Je,listeners:Ee}),Ve?Je.data=Ve:(Ve=PC(f),Ve!==null&&(Je.data=Ve)))),(Ve=c8?h8(a,f):u8(a,f))&&(Je=Ap(te,"onBeforeInput"),0<Je.length&&(Ee=new CC("onBeforeInput","beforeinput",null,f,se),le.push({event:Ee,listeners:Je}),Ee.data=Ve)),ij(le,a,te,f,se)}m5(le,h)})}function pu(a,h,f){return{instance:a,listener:h,currentTarget:f}}function Ap(a,h){for(var f=h+"Capture",m=[];a!==null;){var v=a,y=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||y===null||(v=Dh(a,f),v!=null&&m.unshift(pu(a,v,y)),v=Dh(a,h),v!=null&&m.push(pu(a,v,y))),a.tag===3)return m;a=a.return}return[]}function oj(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function O5(a,h,f,m,v){for(var y=h._reactName,C=[];f!==null&&f!==m;){var P=f,W=P.alternate,te=P.stateNode;if(P=P.tag,W!==null&&W===m)break;P!==5&&P!==26&&P!==27||te===null||(W=te,v?(te=Dh(f,y),te!=null&&C.unshift(pu(f,te,W))):v||(te=Dh(f,y),te!=null&&C.push(pu(f,te,W)))),f=f.return}C.length!==0&&a.push({event:h,listeners:C})}var aj=/\r\n?/g,lj=/\u0000|\uFFFD/g;function v5(a){return(typeof a=="string"?a:""+a).replace(aj,`
49
+ `).replace(lj,"")}function _5(a,h){return h=v5(h),v5(a)===h}function mt(a,h,f,m,v,y){switch(f){case"children":typeof m=="string"?h==="body"||h==="textarea"&&m===""||ql(a,m):(typeof m=="number"||typeof m=="bigint")&&h!=="body"&&ql(a,""+m);break;case"className":Rd(a,"class",m);break;case"tabIndex":Rd(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Rd(a,f,m);break;case"style":_C(a,m,y);break;case"data":if(h!=="object"){Rd(a,"data",m);break}case"src":case"href":if(m===""&&(h!=="a"||f!=="href")){a.removeAttribute(f);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Ld(""+m),a.setAttribute(f,m);break;case"action":case"formAction":if(typeof m=="function"){a.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 y=="function"&&(f==="formAction"?(h!=="input"&&mt(a,h,"name",v.name,v,null),mt(a,h,"formEncType",v.formEncType,v,null),mt(a,h,"formMethod",v.formMethod,v,null),mt(a,h,"formTarget",v.formTarget,v,null)):(mt(a,h,"encType",v.encType,v,null),mt(a,h,"method",v.method,v,null),mt(a,h,"target",v.target,v,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(f);break}m=Ld(""+m),a.setAttribute(f,m);break;case"onClick":m!=null&&(a.onclick=zr);break;case"onScroll":m!=null&&He("scroll",a);break;case"onScrollEnd":m!=null&&He("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(n(60));a.innerHTML=f}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}f=Ld(""+m),a.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":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""+m):a.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":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,""):a.removeAttribute(f);break;case"capture":case"download":m===!0?a.setAttribute(f,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(f,m):a.removeAttribute(f);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(f,m):a.removeAttribute(f);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(f):a.setAttribute(f,m);break;case"popover":He("beforetoggle",a),He("toggle",a),Pd(a,"popover",m);break;case"xlinkActuate":$r(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":$r(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":$r(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":$r(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":$r(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":$r(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":$r(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":$r(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":$r(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Pd(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<f.length)||f[0]!=="o"&&f[0]!=="O"||f[1]!=="n"&&f[1]!=="N")&&(f=BN.get(f)||f,Pd(a,f,m))}}function Pv(a,h,f,m,v,y){switch(f){case"style":_C(a,m,y);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(n(61));if(f=m.__html,f!=null){if(v.children!=null)throw Error(n(60));a.innerHTML=f}}break;case"children":typeof m=="string"?ql(a,m):(typeof m=="number"||typeof m=="bigint")&&ql(a,""+m);break;case"onScroll":m!=null&&He("scroll",a);break;case"onScrollEnd":m!=null&&He("scrollend",a);break;case"onClick":m!=null&&(a.onclick=zr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!hC.hasOwnProperty(f))e:{if(f[0]==="o"&&f[1]==="n"&&(v=f.endsWith("Capture"),h=f.slice(2,v?f.length-7:void 0),y=a[xn]||null,y=y!=null?y[f]:null,typeof y=="function"&&a.removeEventListener(h,y,v),typeof m=="function")){typeof y!="function"&&y!==null&&(f in a?a[f]=null:a.hasAttribute(f)&&a.removeAttribute(f)),a.addEventListener(h,m,v);break e}f in a?a[f]=m:m===!0?a.setAttribute(f,""):Pd(a,f,m)}}}function Vi(a,h,f){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",a),He("load",a);var m=!1,v=!1,y;for(y in f)if(f.hasOwnProperty(y)){var C=f[y];if(C!=null)switch(y){case"src":m=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,h));default:mt(a,h,y,C,f,null)}}v&&mt(a,h,"srcSet",f.srcSet,f,null),m&&mt(a,h,"src",f.src,f,null);return;case"input":He("invalid",a);var P=y=C=v=null,W=null,te=null;for(m in f)if(f.hasOwnProperty(m)){var se=f[m];if(se!=null)switch(m){case"name":v=se;break;case"type":C=se;break;case"checked":W=se;break;case"defaultChecked":te=se;break;case"value":y=se;break;case"defaultValue":P=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(n(137,h));break;default:mt(a,h,m,se,f,null)}}mC(a,y,P,W,te,C,v,!1);return;case"select":He("invalid",a),m=C=y=null;for(v in f)if(f.hasOwnProperty(v)&&(P=f[v],P!=null))switch(v){case"value":y=P;break;case"defaultValue":C=P;break;case"multiple":m=P;default:mt(a,h,v,P,f,null)}h=y,f=C,a.multiple=!!m,h!=null?Zl(a,!!m,h,!1):f!=null&&Zl(a,!!m,f,!0);return;case"textarea":He("invalid",a),y=v=m=null;for(C in f)if(f.hasOwnProperty(C)&&(P=f[C],P!=null))switch(C){case"value":m=P;break;case"defaultValue":v=P;break;case"children":y=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(n(91));break;default:mt(a,h,C,P,f,null)}OC(a,m,v,y);return;case"option":for(W in f)if(f.hasOwnProperty(W)&&(m=f[W],m!=null))switch(W){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:mt(a,h,W,m,f,null)}return;case"dialog":He("beforetoggle",a),He("toggle",a),He("cancel",a),He("close",a);break;case"iframe":case"object":He("load",a);break;case"video":case"audio":for(m=0;m<du.length;m++)He(du[m],a);break;case"image":He("error",a),He("load",a);break;case"details":He("toggle",a);break;case"embed":case"source":case"link":He("error",a),He("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in f)if(f.hasOwnProperty(te)&&(m=f[te],m!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,h));default:mt(a,h,te,m,f,null)}return;default:if(qO(h)){for(se in f)f.hasOwnProperty(se)&&(m=f[se],m!==void 0&&Pv(a,h,se,m,f,void 0));return}}for(P in f)f.hasOwnProperty(P)&&(m=f[P],m!=null&&mt(a,h,P,m,f,null))}function cj(a,h,f,m){switch(h){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,y=null,C=null,P=null,W=null,te=null,se=null;for(ne in f){var le=f[ne];if(f.hasOwnProperty(ne)&&le!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":W=le;default:m.hasOwnProperty(ne)||mt(a,h,ne,null,m,le)}}for(var ie in m){var ne=m[ie];if(le=f[ie],m.hasOwnProperty(ie)&&(ne!=null||le!=null))switch(ie){case"type":y=ne;break;case"name":v=ne;break;case"checked":te=ne;break;case"defaultChecked":se=ne;break;case"value":C=ne;break;case"defaultValue":P=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(n(137,h));break;default:ne!==le&&mt(a,h,ie,ne,m,le)}}XO(a,C,P,W,te,se,y,v);return;case"select":ne=C=P=ie=null;for(y in f)if(W=f[y],f.hasOwnProperty(y)&&W!=null)switch(y){case"value":break;case"multiple":ne=W;default:m.hasOwnProperty(y)||mt(a,h,y,null,m,W)}for(v in m)if(y=m[v],W=f[v],m.hasOwnProperty(v)&&(y!=null||W!=null))switch(v){case"value":ie=y;break;case"defaultValue":P=y;break;case"multiple":C=y;default:y!==W&&mt(a,h,v,y,m,W)}h=P,f=C,m=ne,ie!=null?Zl(a,!!f,ie,!1):!!m!=!!f&&(h!=null?Zl(a,!!f,h,!0):Zl(a,!!f,f?[]:"",!1));return;case"textarea":ne=ie=null;for(P in f)if(v=f[P],f.hasOwnProperty(P)&&v!=null&&!m.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:mt(a,h,P,null,m,v)}for(C in m)if(v=m[C],y=f[C],m.hasOwnProperty(C)&&(v!=null||y!=null))switch(C){case"value":ie=v;break;case"defaultValue":ne=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(n(91));break;default:v!==y&&mt(a,h,C,v,m,y)}gC(a,ie,ne);return;case"option":for(var we in f)if(ie=f[we],f.hasOwnProperty(we)&&ie!=null&&!m.hasOwnProperty(we))switch(we){case"selected":a.selected=!1;break;default:mt(a,h,we,null,m,ie)}for(W in m)if(ie=m[W],ne=f[W],m.hasOwnProperty(W)&&ie!==ne&&(ie!=null||ne!=null))switch(W){case"selected":a.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:mt(a,h,W,ie,m,ne)}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 Qe in f)ie=f[Qe],f.hasOwnProperty(Qe)&&ie!=null&&!m.hasOwnProperty(Qe)&&mt(a,h,Qe,null,m,ie);for(te in m)if(ie=m[te],ne=f[te],m.hasOwnProperty(te)&&ie!==ne&&(ie!=null||ne!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(n(137,h));break;default:mt(a,h,te,ie,m,ne)}return;default:if(qO(h)){for(var gt in f)ie=f[gt],f.hasOwnProperty(gt)&&ie!==void 0&&!m.hasOwnProperty(gt)&&Pv(a,h,gt,void 0,m,ie);for(se in m)ie=m[se],ne=f[se],!m.hasOwnProperty(se)||ie===ne||ie===void 0&&ne===void 0||Pv(a,h,se,ie,m,ne);return}}for(var G in f)ie=f[G],f.hasOwnProperty(G)&&ie!=null&&!m.hasOwnProperty(G)&&mt(a,h,G,null,m,ie);for(le in m)ie=m[le],ne=f[le],!m.hasOwnProperty(le)||ie===ne||ie==null&&ne==null||mt(a,h,le,ie,m,ne)}function y5(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hj(){if(typeof performance.getEntriesByType=="function"){for(var a=0,h=0,f=performance.getEntriesByType("resource"),m=0;m<f.length;m++){var v=f[m],y=v.transferSize,C=v.initiatorType,P=v.duration;if(y&&P&&y5(C)){for(C=0,P=v.responseEnd,m+=1;m<f.length;m++){var W=f[m],te=W.startTime;if(te>P)break;var se=W.transferSize,le=W.initiatorType;se&&y5(le)&&(W=W.responseEnd,C+=se*(W<P?1:(P-te)/(W-te)))}if(--m,h+=8*(y+C)/(v.duration/1e3),a++,10<a)break}}if(0<a)return h/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var Rv=null,Qv=null;function Ep(a){return a.nodeType===9?a:a.ownerDocument}function b5(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function S5(a,h){if(a===0)switch(h){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&h==="foreignObject"?0:a}function Lv(a,h){return a==="textarea"||a==="noscript"||typeof h.children=="string"||typeof h.children=="number"||typeof h.children=="bigint"||typeof h.dangerouslySetInnerHTML=="object"&&h.dangerouslySetInnerHTML!==null&&h.dangerouslySetInnerHTML.__html!=null}var Dv=null;function uj(){var a=window.event;return a&&a.type==="popstate"?a===Dv?!1:(Dv=a,!0):(Dv=null,!1)}var x5=typeof setTimeout=="function"?setTimeout:void 0,fj=typeof clearTimeout=="function"?clearTimeout:void 0,w5=typeof Promise=="function"?Promise:void 0,dj=typeof queueMicrotask=="function"?queueMicrotask:typeof w5<"u"?function(a){return w5.resolve(null).then(a).catch(pj)}:x5;function pj(a){setTimeout(function(){throw a})}function Uo(a){return a==="head"}function C5(a,h){var f=h,m=0;do{var v=f.nextSibling;if(a.removeChild(f),v&&v.nodeType===8)if(f=v.data,f==="/$"||f==="/&"){if(m===0){a.removeChild(v),Sc(h);return}m--}else if(f==="$"||f==="$?"||f==="$~"||f==="$!"||f==="&")m++;else if(f==="html")mu(a.ownerDocument.documentElement);else if(f==="head"){f=a.ownerDocument.head,mu(f);for(var y=f.firstChild;y;){var C=y.nextSibling,P=y.nodeName;y[Qh]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&y.rel.toLowerCase()==="stylesheet"||f.removeChild(y),y=C}}else f==="body"&&mu(a.ownerDocument.body);f=v}while(f);Sc(h)}function k5(a,h){var f=a;a=0;do{var m=f.nextSibling;if(f.nodeType===1?h?(f._stashedDisplay=f.style.display,f.style.display="none"):(f.style.display=f._stashedDisplay||"",f.getAttribute("style")===""&&f.removeAttribute("style")):f.nodeType===3&&(h?(f._stashedText=f.nodeValue,f.nodeValue=""):f.nodeValue=f._stashedText||""),m&&m.nodeType===8)if(f=m.data,f==="/$"){if(a===0)break;a--}else f!=="$"&&f!=="$?"&&f!=="$~"&&f!=="$!"||a++;f=m}while(f)}function Bv(a){var h=a.firstChild;for(h&&h.nodeType===10&&(h=h.nextSibling);h;){var f=h;switch(h=h.nextSibling,f.nodeName){case"HTML":case"HEAD":case"BODY":Bv(f),IO(f);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(f.rel.toLowerCase()==="stylesheet")continue}a.removeChild(f)}}function mj(a,h,f,m){for(;a.nodeType===1;){var v=f;if(a.nodeName.toLowerCase()!==h.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Qh])switch(h){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(y=a.getAttribute("rel"),y==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(y!==v.rel||a.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||a.getAttribute("title")!==(v.title==null?null:v.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(y=a.getAttribute("src"),(y!==(v.src==null?null:v.src)||a.getAttribute("type")!==(v.type==null?null:v.type)||a.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&y&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(h==="input"&&a.type==="hidden"){var y=v.name==null?null:""+v.name;if(v.type==="hidden"&&a.getAttribute("name")===y)return a}else return a;if(a=gs(a.nextSibling),a===null)break}return null}function gj(a,h,f){if(h==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!f||(a=gs(a.nextSibling),a===null))return null;return a}function T5(a,h){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!h||(a=gs(a.nextSibling),a===null))return null;return a}function $v(a){return a.data==="$?"||a.data==="$~"}function zv(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function Oj(a,h){var f=a.ownerDocument;if(a.data==="$~")a._reactRetry=h;else if(a.data!=="$?"||f.readyState!=="loading")h();else{var m=function(){h(),f.removeEventListener("DOMContentLoaded",m)};f.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function gs(a){for(;a!=null;a=a.nextSibling){var h=a.nodeType;if(h===1||h===3)break;if(h===8){if(h=a.data,h==="$"||h==="$!"||h==="$?"||h==="$~"||h==="&"||h==="F!"||h==="F")break;if(h==="/$"||h==="/&")return null}}return a}var Nv=null;function A5(a){a=a.nextSibling;for(var h=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"||f==="/&"){if(h===0)return gs(a.nextSibling);h--}else f!=="$"&&f!=="$!"&&f!=="$?"&&f!=="$~"&&f!=="&"||h++}a=a.nextSibling}return null}function E5(a){a=a.previousSibling;for(var h=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"){if(h===0)return a;h--}else f!=="/$"&&f!=="/&"||h++}a=a.previousSibling}return null}function M5(a,h,f){switch(h=Ep(f),a){case"html":if(a=h.documentElement,!a)throw Error(n(452));return a;case"head":if(a=h.head,!a)throw Error(n(453));return a;case"body":if(a=h.body,!a)throw Error(n(454));return a;default:throw Error(n(451))}}function mu(a){for(var h=a.attributes;h.length;)a.removeAttributeNode(h[0]);IO(a)}var Os=new Map,P5=new Set;function Mp(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var eo=X.d;X.d={f:vj,r:_j,D:yj,C:bj,L:Sj,m:xj,X:Cj,S:wj,M:kj};function vj(){var a=eo.f(),h=bp();return a||h}function _j(a){var h=Il(a);h!==null&&h.tag===5&&h.type==="form"?Yk(h):eo.r(a)}var _c=typeof document>"u"?null:document;function R5(a,h,f){var m=_c;if(m&&typeof h=="string"&&h){var v=cs(h);v='link[rel="'+a+'"][href="'+v+'"]',typeof f=="string"&&(v+='[crossorigin="'+f+'"]'),P5.has(v)||(P5.add(v),a={rel:a,crossOrigin:f,href:h},m.querySelector(v)===null&&(h=m.createElement("link"),Vi(h,"link",a),bi(h),m.head.appendChild(h)))}}function yj(a){eo.D(a),R5("dns-prefetch",a,null)}function bj(a,h){eo.C(a,h),R5("preconnect",a,h)}function Sj(a,h,f){eo.L(a,h,f);var m=_c;if(m&&a&&h){var v='link[rel="preload"][as="'+cs(h)+'"]';h==="image"&&f&&f.imageSrcSet?(v+='[imagesrcset="'+cs(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(v+='[imagesizes="'+cs(f.imageSizes)+'"]')):v+='[href="'+cs(a)+'"]';var y=v;switch(h){case"style":y=yc(a);break;case"script":y=bc(a)}Os.has(y)||(a=p({rel:"preload",href:h==="image"&&f&&f.imageSrcSet?void 0:a,as:h},f),Os.set(y,a),m.querySelector(v)!==null||h==="style"&&m.querySelector(gu(y))||h==="script"&&m.querySelector(Ou(y))||(h=m.createElement("link"),Vi(h,"link",a),bi(h),m.head.appendChild(h)))}}function xj(a,h){eo.m(a,h);var f=_c;if(f&&a){var m=h&&typeof h.as=="string"?h.as:"script",v='link[rel="modulepreload"][as="'+cs(m)+'"][href="'+cs(a)+'"]',y=v;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=bc(a)}if(!Os.has(y)&&(a=p({rel:"modulepreload",href:a},h),Os.set(y,a),f.querySelector(v)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(Ou(y)))return}m=f.createElement("link"),Vi(m,"link",a),bi(m),f.head.appendChild(m)}}}function wj(a,h,f){eo.S(a,h,f);var m=_c;if(m&&a){var v=Vl(m).hoistableStyles,y=yc(a);h=h||"default";var C=v.get(y);if(!C){var P={loading:0,preload:null};if(C=m.querySelector(gu(y)))P.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":h},f),(f=Os.get(y))&&jv(a,f);var W=C=m.createElement("link");bi(W),Vi(W,"link",a),W._p=new Promise(function(te,se){W.onload=te,W.onerror=se}),W.addEventListener("load",function(){P.loading|=1}),W.addEventListener("error",function(){P.loading|=2}),P.loading|=4,Pp(C,h,m)}C={type:"stylesheet",instance:C,count:1,state:P},v.set(y,C)}}}function Cj(a,h){eo.X(a,h);var f=_c;if(f&&a){var m=Vl(f).hoistableScripts,v=bc(a),y=m.get(v);y||(y=f.querySelector(Ou(v)),y||(a=p({src:a,async:!0},h),(h=Os.get(v))&&Iv(a,h),y=f.createElement("script"),bi(y),Vi(y,"link",a),f.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},m.set(v,y))}}function kj(a,h){eo.M(a,h);var f=_c;if(f&&a){var m=Vl(f).hoistableScripts,v=bc(a),y=m.get(v);y||(y=f.querySelector(Ou(v)),y||(a=p({src:a,async:!0,type:"module"},h),(h=Os.get(v))&&Iv(a,h),y=f.createElement("script"),bi(y),Vi(y,"link",a),f.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},m.set(v,y))}}function Q5(a,h,f,m){var v=(v=fe.current)?Mp(v):null;if(!v)throw Error(n(446));switch(a){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(h=yc(f.href),f=Vl(v).hoistableStyles,m=f.get(h),m||(m={type:"style",instance:null,count:0,state:null},f.set(h,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){a=yc(f.href);var y=Vl(v).hoistableStyles,C=y.get(a);if(C||(v=v.ownerDocument||v,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(a,C),(y=v.querySelector(gu(a)))&&!y._p&&(C.instance=y,C.state.loading=5),Os.has(a)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Os.set(a,f),y||Tj(v,a,f,C.state))),h&&m===null)throw Error(n(528,""));return C}if(h&&m!==null)throw Error(n(529,""));return null;case"script":return h=f.async,f=f.src,typeof f=="string"&&h&&typeof h!="function"&&typeof h!="symbol"?(h=bc(f),f=Vl(v).hoistableScripts,m=f.get(h),m||(m={type:"script",instance:null,count:0,state:null},f.set(h,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,a))}}function yc(a){return'href="'+cs(a)+'"'}function gu(a){return'link[rel="stylesheet"]['+a+"]"}function L5(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function Tj(a,h,f,m){a.querySelector('link[rel="preload"][as="style"]['+h+"]")?m.loading=1:(h=a.createElement("link"),m.preload=h,h.addEventListener("load",function(){return m.loading|=1}),h.addEventListener("error",function(){return m.loading|=2}),Vi(h,"link",f),bi(h),a.head.appendChild(h))}function bc(a){return'[src="'+cs(a)+'"]'}function Ou(a){return"script[async]"+a}function D5(a,h,f){if(h.count++,h.instance===null)switch(h.type){case"style":var m=a.querySelector('style[data-href~="'+cs(f.href)+'"]');if(m)return h.instance=m,bi(m),m;var v=p({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),bi(m),Vi(m,"style",v),Pp(m,f.precedence,a),h.instance=m;case"stylesheet":v=yc(f.href);var y=a.querySelector(gu(v));if(y)return h.state.loading|=4,h.instance=y,bi(y),y;m=L5(f),(v=Os.get(v))&&jv(m,v),y=(a.ownerDocument||a).createElement("link"),bi(y);var C=y;return C._p=new Promise(function(P,W){C.onload=P,C.onerror=W}),Vi(y,"link",m),h.state.loading|=4,Pp(y,f.precedence,a),h.instance=y;case"script":return y=bc(f.src),(v=a.querySelector(Ou(y)))?(h.instance=v,bi(v),v):(m=f,(v=Os.get(y))&&(m=p({},f),Iv(m,v)),a=a.ownerDocument||a,v=a.createElement("script"),bi(v),Vi(v,"link",m),a.head.appendChild(v),h.instance=v);case"void":return null;default:throw Error(n(443,h.type))}else h.type==="stylesheet"&&(h.state.loading&4)===0&&(m=h.instance,h.state.loading|=4,Pp(m,f.precedence,a));return h.instance}function Pp(a,h,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=m.length?m[m.length-1]:null,y=v,C=0;C<m.length;C++){var P=m[C];if(P.dataset.precedence===h)y=P;else if(y!==v)break}y?y.parentNode.insertBefore(a,y.nextSibling):(h=f.nodeType===9?f.head:f,h.insertBefore(a,h.firstChild))}function jv(a,h){a.crossOrigin==null&&(a.crossOrigin=h.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=h.referrerPolicy),a.title==null&&(a.title=h.title)}function Iv(a,h){a.crossOrigin==null&&(a.crossOrigin=h.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=h.referrerPolicy),a.integrity==null&&(a.integrity=h.integrity)}var Rp=null;function B5(a,h,f){if(Rp===null){var m=new Map,v=Rp=new Map;v.set(f,m)}else v=Rp,m=v.get(f),m||(m=new Map,v.set(f,m));if(m.has(a))return m;for(m.set(a,null),f=f.getElementsByTagName(a),v=0;v<f.length;v++){var y=f[v];if(!(y[Qh]||y[zi]||a==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var C=y.getAttribute(h)||"";C=a+C;var P=m.get(C);P?P.push(y):m.set(C,[y])}}return m}function $5(a,h,f){a=a.ownerDocument||a,a.head.insertBefore(f,h==="title"?a.querySelector("head > title"):null)}function Aj(a,h,f){if(f===1||h.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof h.precedence!="string"||typeof h.href!="string"||h.href==="")break;return!0;case"link":if(typeof h.rel!="string"||typeof h.href!="string"||h.href===""||h.onLoad||h.onError)break;switch(h.rel){case"stylesheet":return a=h.disabled,typeof h.precedence=="string"&&a==null;default:return!0}case"script":if(h.async&&typeof h.async!="function"&&typeof h.async!="symbol"&&!h.onLoad&&!h.onError&&h.src&&typeof h.src=="string")return!0}return!1}function z5(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function Ej(a,h,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var v=yc(m.href),y=h.querySelector(gu(v));if(y){h=y._p,h!==null&&typeof h=="object"&&typeof h.then=="function"&&(a.count++,a=Qp.bind(a),h.then(a,a)),f.state.loading|=4,f.instance=y,bi(y);return}y=h.ownerDocument||h,m=L5(m),(v=Os.get(v))&&jv(m,v),y=y.createElement("link"),bi(y);var C=y;C._p=new Promise(function(P,W){C.onload=P,C.onerror=W}),Vi(y,"link",m),f.instance=y}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(f,h),(h=f.state.preload)&&(f.state.loading&3)===0&&(a.count++,f=Qp.bind(a),h.addEventListener("load",f),h.addEventListener("error",f))}}var Vv=0;function Mj(a,h){return a.stylesheets&&a.count===0&&Dp(a,a.stylesheets),0<a.count||0<a.imgCount?function(f){var m=setTimeout(function(){if(a.stylesheets&&Dp(a,a.stylesheets),a.unsuspend){var y=a.unsuspend;a.unsuspend=null,y()}},6e4+h);0<a.imgBytes&&Vv===0&&(Vv=62500*hj());var v=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Dp(a,a.stylesheets),a.unsuspend)){var y=a.unsuspend;a.unsuspend=null,y()}},(a.imgBytes>Vv?50:800)+h);return a.unsuspend=f,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(v)}}:null}function Qp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dp(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Lp=null;function Dp(a,h){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Lp=new Map,h.forEach(Pj,a),Lp=null,Qp.call(a))}function Pj(a,h){if(!(h.state.loading&4)){var f=Lp.get(a);if(f)var m=f.get(null);else{f=new Map,Lp.set(a,f);for(var v=a.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<v.length;y++){var C=v[y];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(f.set(C.dataset.precedence,C),m=C)}m&&f.set(null,m)}v=h.instance,C=v.getAttribute("data-precedence"),y=f.get(C)||m,y===m&&f.set(null,v),f.set(C,v),this.count++,m=Qp.bind(this),v.addEventListener("load",m),v.addEventListener("error",m),y?y.parentNode.insertBefore(v,y.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(v,a.firstChild)),h.state.loading|=4}}var vu={$$typeof:T,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function Rj(a,h,f,m,v,y,C,P,W){this.tag=1,this.containerInfo=a,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=$O(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$O(0),this.hiddenUpdates=$O(null),this.identifierPrefix=m,this.onUncaughtError=v,this.onCaughtError=y,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function N5(a,h,f,m,v,y,C,P,W,te,se,le){return a=new Rj(a,h,f,C,W,te,se,le,P),h=1,y===!0&&(h|=24),y=Xn(3,null,null,h),a.current=y,y.stateNode=a,h=b0(),h.refCount++,a.pooledCache=h,h.refCount++,y.memoizedState={element:m,isDehydrated:f,cache:h},C0(y),a}function j5(a){return a?(a=Kl,a):Kl}function I5(a,h,f,m,v,y){v=j5(v),m.context===null?m.context=v:m.pendingContext=v,m=Bo(h),m.payload={element:f},y=y===void 0?null:y,y!==null&&(m.callback=y),f=$o(a,m,h),f!==null&&(En(f,a,h),Fh(f,a,h))}function V5(a,h){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<h?f:h}}function Xv(a,h){V5(a,h),(a=a.alternate)&&V5(a,h)}function X5(a){if(a.tag===13||a.tag===31){var h=ja(a,67108864);h!==null&&En(h,a,67108864),Xv(a,67108864)}}function Z5(a){if(a.tag===13||a.tag===31){var h=Yn();h=zO(h);var f=ja(a,h);f!==null&&En(f,a,h),Xv(a,h)}}var Bp=!0;function Qj(a,h,f,m){var v=$.T;$.T=null;var y=X.p;try{X.p=2,Zv(a,h,f,m)}finally{X.p=y,$.T=v}}function Lj(a,h,f,m){var v=$.T;$.T=null;var y=X.p;try{X.p=8,Zv(a,h,f,m)}finally{X.p=y,$.T=v}}function Zv(a,h,f,m){if(Bp){var v=qv(m);if(v===null)Mv(a,h,m,$p,f),W5(a,m);else if(Bj(v,a,h,f,m))m.stopPropagation();else if(W5(a,m),h&4&&-1<Dj.indexOf(a)){for(;v!==null;){var y=Il(v);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var C=Da(y.pendingLanes);if(C!==0){var P=y;for(P.pendingLanes|=2,P.entangledLanes|=2;C;){var W=1<<31-_t(C);P.entanglements[1]|=W,C&=~W}nr(y),(ot&6)===0&&(_p=cn()+500,fu(0))}}break;case 31:case 13:P=ja(y,2),P!==null&&En(P,y,2),bp(),Xv(y,2)}if(y=qv(m),y===null&&Mv(a,h,m,$p,f),y===v)break;v=y}v!==null&&m.stopPropagation()}else Mv(a,h,m,null,f)}}function qv(a){return a=UO(a),Wv(a)}var $p=null;function Wv(a){if($p=null,a=jl(a),a!==null){var h=r(a);if(h===null)a=null;else{var f=h.tag;if(f===13){if(a=o(h),a!==null)return a;a=null}else if(f===31){if(a=l(h),a!==null)return a;a=null}else if(f===3){if(h.stateNode.current.memoizedState.isDehydrated)return h.tag===3?h.stateNode.containerInfo:null;a=null}else h!==a&&(a=null)}}return $p=a,null}function q5(a){switch(a){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(BO()){case oe:return 2;case ge:return 8;case De:case Ue:return 32;case ht:return 268435456;default:return 32}default:return 32}}var Uv=!1,Yo=null,Ho=null,Fo=null,_u=new Map,yu=new Map,Go=[],Dj="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 W5(a,h){switch(a){case"focusin":case"focusout":Yo=null;break;case"dragenter":case"dragleave":Ho=null;break;case"mouseover":case"mouseout":Fo=null;break;case"pointerover":case"pointerout":_u.delete(h.pointerId);break;case"gotpointercapture":case"lostpointercapture":yu.delete(h.pointerId)}}function bu(a,h,f,m,v,y){return a===null||a.nativeEvent!==y?(a={blockedOn:h,domEventName:f,eventSystemFlags:m,nativeEvent:y,targetContainers:[v]},h!==null&&(h=Il(h),h!==null&&X5(h)),a):(a.eventSystemFlags|=m,h=a.targetContainers,v!==null&&h.indexOf(v)===-1&&h.push(v),a)}function Bj(a,h,f,m,v){switch(h){case"focusin":return Yo=bu(Yo,a,h,f,m,v),!0;case"dragenter":return Ho=bu(Ho,a,h,f,m,v),!0;case"mouseover":return Fo=bu(Fo,a,h,f,m,v),!0;case"pointerover":var y=v.pointerId;return _u.set(y,bu(_u.get(y)||null,a,h,f,m,v)),!0;case"gotpointercapture":return y=v.pointerId,yu.set(y,bu(yu.get(y)||null,a,h,f,m,v)),!0}return!1}function U5(a){var h=jl(a.target);if(h!==null){var f=r(h);if(f!==null){if(h=f.tag,h===13){if(h=o(f),h!==null){a.blockedOn=h,aC(a.priority,function(){Z5(f)});return}}else if(h===31){if(h=l(f),h!==null){a.blockedOn=h,aC(a.priority,function(){Z5(f)});return}}else if(h===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function zp(a){if(a.blockedOn!==null)return!1;for(var h=a.targetContainers;0<h.length;){var f=qv(a.nativeEvent);if(f===null){f=a.nativeEvent;var m=new f.constructor(f.type,f);WO=m,f.target.dispatchEvent(m),WO=null}else return h=Il(f),h!==null&&X5(h),a.blockedOn=f,!1;h.shift()}return!0}function Y5(a,h,f){zp(a)&&f.delete(h)}function $j(){Uv=!1,Yo!==null&&zp(Yo)&&(Yo=null),Ho!==null&&zp(Ho)&&(Ho=null),Fo!==null&&zp(Fo)&&(Fo=null),_u.forEach(Y5),yu.forEach(Y5)}function Np(a,h){a.blockedOn===h&&(a.blockedOn=null,Uv||(Uv=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,$j)))}var jp=null;function H5(a){jp!==a&&(jp=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===a&&(jp=null);for(var h=0;h<a.length;h+=3){var f=a[h],m=a[h+1],v=a[h+2];if(typeof m!="function"){if(Wv(m||f)===null)continue;break}var y=Il(f);y!==null&&(a.splice(h,3),h-=3,q0(y,{pending:!0,data:v,method:f.method,action:m},m,v))}}))}function Sc(a){function h(W){return Np(W,a)}Yo!==null&&Np(Yo,a),Ho!==null&&Np(Ho,a),Fo!==null&&Np(Fo,a),_u.forEach(h),yu.forEach(h);for(var f=0;f<Go.length;f++){var m=Go[f];m.blockedOn===a&&(m.blockedOn=null)}for(;0<Go.length&&(f=Go[0],f.blockedOn===null);)U5(f),f.blockedOn===null&&Go.shift();if(f=(a.ownerDocument||a).$$reactFormReplay,f!=null)for(m=0;m<f.length;m+=3){var v=f[m],y=f[m+1],C=v[xn]||null;if(typeof y=="function")C||H5(f);else if(C){var P=null;if(y&&y.hasAttribute("formAction")){if(v=y,C=y[xn]||null)P=C.formAction;else if(Wv(v)!==null)continue}else P=C.action;typeof P=="function"?f[m+1]=P:(f.splice(m,3),m-=3),H5(f)}}}function F5(){function a(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(C){return v=C})},focusReset:"manual",scroll:"manual"})}function h(){v!==null&&(v(),v=null),m||setTimeout(f,20)}function f(){if(!m&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,v=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",h),navigation.addEventListener("navigateerror",h),setTimeout(f,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",h),navigation.removeEventListener("navigateerror",h),v!==null&&(v(),v=null)}}}function Yv(a){this._internalRoot=a}Ip.prototype.render=Yv.prototype.render=function(a){var h=this._internalRoot;if(h===null)throw Error(n(409));var f=h.current,m=Yn();I5(f,m,a,h,null,null)},Ip.prototype.unmount=Yv.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var h=a.containerInfo;I5(a.current,2,null,a,null,null),bp(),h[Nl]=null}};function Ip(a){this._internalRoot=a}Ip.prototype.unstable_scheduleHydration=function(a){if(a){var h=oC();a={blockedOn:null,target:a,priority:h};for(var f=0;f<Go.length&&h!==0&&h<Go[f].priority;f++);Go.splice(f,0,a),f===0&&U5(a)}};var G5=e.version;if(G5!=="19.2.4")throw Error(n(527,G5,"19.2.4"));X.findDOMNode=function(a){var h=a._reactInternals;if(h===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=u(h),a=a!==null?d(a):null,a=a===null?null:a.stateNode,a};var zj={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:$,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vp.isDisabled&&Vp.supportsFiber)try{hn=Vp.inject(zj),fi=Vp}catch{}}return xu.createRoot=function(a,h){if(!s(a))throw Error(n(299));var f=!1,m="",v=s2,y=r2,C=o2;return h!=null&&(h.unstable_strictMode===!0&&(f=!0),h.identifierPrefix!==void 0&&(m=h.identifierPrefix),h.onUncaughtError!==void 0&&(v=h.onUncaughtError),h.onCaughtError!==void 0&&(y=h.onCaughtError),h.onRecoverableError!==void 0&&(C=h.onRecoverableError)),h=N5(a,1,!1,null,null,f,m,null,v,y,C,F5),a[Nl]=h.current,Ev(a),new Yv(h)},xu.hydrateRoot=function(a,h,f){if(!s(a))throw Error(n(299));var m=!1,v="",y=s2,C=r2,P=o2,W=null;return f!=null&&(f.unstable_strictMode===!0&&(m=!0),f.identifierPrefix!==void 0&&(v=f.identifierPrefix),f.onUncaughtError!==void 0&&(y=f.onUncaughtError),f.onCaughtError!==void 0&&(C=f.onCaughtError),f.onRecoverableError!==void 0&&(P=f.onRecoverableError),f.formState!==void 0&&(W=f.formState)),h=N5(a,1,!0,h,f??null,m,v,W,y,C,P,F5),h.context=j5(null),f=h.current,m=Yn(),m=zO(m),v=Bo(m),v.callback=null,$o(f,v,m),f=m,h.current.lanes=f,Rh(h,f),nr(h),a[Nl]=h.current,Ev(a),new Ip(h)},xu.version="19.2.4",xu}var aT;function Yj(){if(aT)return Gv.exports;aT=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(),Gv.exports=Uj(),Gv.exports}var Hj=Yj();const iL=Z.createContext({connected:!1,lastChange:0,lifecycleEvent:null,pendingQuestionCount:0,onQuestionReceivedRef:{current:null}}),lT=2e3,Fj=3e4,Gj=1.5;function Kj({children:t}){const[e,i]=Z.useState(!1),[n,s]=Z.useState(0),[r,o]=Z.useState(null),[l,c]=Z.useState(0),u=Z.useRef(null),d=Z.useRef(null),p=Z.useRef(lT),g=Z.useRef(null);return Z.useEffect(()=>{function O(){const b=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/ws`,x=new WebSocket(b);u.current=x,x.onopen=()=>{i(!0),p.current=lT},x.onclose=()=>{i(!1),u.current=null;const w=p.current;p.current=Math.min(w*Gj,Fj),d.current=setTimeout(O,w)},x.onmessage=w=>{var k,T;try{const A=JSON.parse(w.data);switch(A.type){case"file-changes":typeof A.timestamp=="number"&&s(A.timestamp);break;case"question-received":{const L=A.question,E={id:L.id,header:"Question",question:L.question,multiSelect:!1,options:(L.options||[]).map(z=>({id:z.value,label:z.label,description:z.description||""}))};(k=g.current)==null||k.call(g,[E]),c(A.queueLength??0);break}case"questions-queued":{const L=(A.questions||[]).map(E=>({id:E.id,header:"Question",question:E.question,multiSelect:!1,options:(E.options||[]).map(z=>({id:z.value,label:z.label,description:z.description||""}))}));(T=g.current)==null||T.call(g,L),c(A.count??0);break}case"answer-given":c(A.remainingQueue??0);break;case"lifecycle":o(A.event);break}}catch{}},x.onerror=()=>{console.warn("[ws-provider] WebSocket error occurred")}}return O(),()=>{d.current!==null&&(clearTimeout(d.current),d.current=null),u.current&&(u.current.onclose=null,u.current.close(),u.current=null)}},[]),S.jsx(iL.Provider,{value:{connected:e,lastChange:n,lifecycleEvent:r,pendingQuestionCount:l,onQuestionReceivedRef:g},children:t})}function Ea(){return Z.useContext(iL)}function Jj(t,e){switch(e.type){case"SET_TAB":return{...t,activeTab:e.tab,expandedCardId:null};case"SET_EXPANDED":return{...t,expandedCardId:e.cardId};case"SET_INPUT":return{...t,inputValues:{...t.inputValues,[e.cardId]:e.value}};case"RESET":return{activeTab:"plan",expandedCardId:null,inputValues:{}};default:return t}}const e7={activeTab:"plan",expandedCardId:null,inputValues:{}},nL=Z.createContext(null);function t7({children:t}){const[e,i]=Z.useReducer(Jj,e7),n=Z.useCallback(l=>i({type:"SET_TAB",tab:l}),[]),s=Z.useCallback(l=>i({type:"SET_EXPANDED",cardId:l}),[]),r=Z.useCallback((l,c)=>i({type:"SET_INPUT",cardId:l,value:c}),[]),o=Z.useCallback(()=>i({type:"RESET"}),[]);return S.jsx(nL.Provider,{value:{...e,setTab:n,setExpanded:s,setInput:r,reset:o},children:t})}function oO(){const t=Z.useContext(nL);if(!t)throw new Error("useSimpleMode must be used within SimpleModeProvider");return t}const sL={phase:"idle",questions:[],currentQuestion:null,answeredQuestions:[],answerCount:0};function i7(t,e){switch(e.type){case"START_DISCUSSION":return{...t,phase:"loading"};case"QUESTIONS_RECEIVED":{const[i,...n]=e.questions;return{...t,phase:i?"active":t.phase,currentQuestion:i??null,questions:[...t.questions,...n]}}case"SUBMIT_ANSWER":return{...t,phase:"submitting",answeredQuestions:[...t.answeredQuestions,e.answer],answerCount:t.answerCount+1};case"ANSWER_ACCEPTED":{const[i,...n]=t.questions;return{...t,phase:i?"active":"loading",currentQuestion:i??null,questions:n}}case"ASK_MORE":return{...t,phase:"loading"};case"DONE_EXECUTE":return{...t,phase:"complete",currentQuestion:null,questions:[]};case"RESET":return sL;default:return t}}const rL=Z.createContext(null);function n7({children:t}){const[e,i]=Z.useReducer(i7,sL),n=Z.useRef(null),s=Z.useRef(null),r=Z.useCallback(()=>{i({type:"START_DISCUSSION"})},[]),o=Z.useCallback(p=>{i({type:"QUESTIONS_RECEIVED",questions:p})},[]),l=Z.useCallback(async p=>{i({type:"SUBMIT_ANSWER",answer:p});const g=p.freeText.trim()?p.freeText:p.selectedLabels.join(", ");try{await fetch("/api/mcp-answer",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({questionId:p.questionId,answer:g})})}catch(O){console.error("[discussion] Failed to submit answer:",O)}i({type:"ANSWER_ACCEPTED"})},[]),c=Z.useCallback(()=>{i({type:"ASK_MORE"})},[]),u=Z.useCallback(()=>{var p;i({type:"DONE_EXECUTE"}),(p=s.current)==null||p.call(s)},[]),d=Z.useCallback(()=>{i({type:"RESET"})},[]);return S.jsx(rL.Provider,{value:{...e,startDiscussion:r,receiveQuestions:o,submitAnswer:l,askMore:c,doneExecute:u,resetDiscussion:d,onQuestionReceived:n,onExecutionQueued:s},children:t})}function oL(){const t=Z.useContext(rL);if(!t)throw new Error("useDiscussion must be used within DiscussionProvider");return t}function Rl(){const{lastChange:t}=Ea(),[e,i]=Z.useState(null),[n,s]=Z.useState(null),[r,o]=Z.useState(null),[l,c]=Z.useState(!0),[u,d]=Z.useState(null),p=Z.useCallback(async()=>{try{d(null);const[g,O,_]=await Promise.all([fetch("/api/roadmap"),fetch("/api/state"),fetch("/api/todos")]);if(!g.ok&&g.status!==404)throw new Error(`Roadmap fetch failed: ${g.status}`);if(!O.ok&&O.status!==404)throw new Error(`State fetch failed: ${O.status}`);if(!_.ok)throw new Error(`Todos fetch failed: ${_.status}`);const b=g.ok?await g.json():null,x=O.ok?await O.json():null,w=_.ok?await _.json():{pending:[],completed:[]};i(b),s(x),o(w)}catch(g){const O=g instanceof Error?g.message:"Failed to fetch dashboard data";d(O),console.error("[use-dashboard-data]",O)}finally{c(!1)}},[]);return Z.useEffect(()=>{p()},[p]),Z.useEffect(()=>{t>0&&p()},[t,p]),{roadmap:e,state:n,todos:r,loading:l,error:u}}const Xp="maxsim_dashboard_mode";function s7(){const[t,e]=Z.useState(()=>{try{const r=localStorage.getItem(Xp);if(r==="simple"||r==="advanced")return r}catch{}return null}),[i,n]=Z.useState(()=>{try{const r=localStorage.getItem(Xp);return r==="simple"||r==="advanced"}catch{return!1}});return Z.useEffect(()=>{i||fetch("/api/simple-mode-config").then(r=>r.json()).then(r=>{if(r.default_mode==="simple"||r.default_mode==="advanced"){e(r.default_mode);try{localStorage.setItem(Xp,r.default_mode)}catch{}}}).catch(()=>{}).finally(()=>n(!0))},[i]),{mode:t,setMode:r=>{e(r),i||n(!0);try{localStorage.setItem(Xp,r)}catch{}fetch("/api/simple-mode-config",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({default_mode:r})}).catch(()=>{})},initialized:i}}const YS=Z.createContext({});function HS(t){const e=Z.useRef(null);return e.current===null&&(e.current=t()),e.current}const aL=typeof window<"u",lL=aL?Z.useLayoutEffect:Z.useEffect,aO=Z.createContext(null);function FS(t,e){t.indexOf(e)===-1&&t.push(e)}function hg(t,e){const i=t.indexOf(e);i>-1&&t.splice(i,1)}const Ar=(t,e,i)=>i>e?e:i<t?t:i;let GS=()=>{};const Oo={},cL=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function hL(t){return typeof t=="object"&&t!==null}const uL=t=>/^0[^.\s]+$/u.test(t);function fL(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ps=t=>t,r7=(t,e)=>i=>e(t(i)),od=(...t)=>t.reduce(r7),Cf=(t,e,i)=>{const n=e-t;return n===0?1:(i-t)/n};class KS{constructor(){this.subscriptions=[]}add(e){return FS(this.subscriptions,e),()=>hg(this.subscriptions,e)}notify(e,i,n){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,i,n);else for(let r=0;r<s;r++){const o=this.subscriptions[r];o&&o(e,i,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ws=t=>t*1e3,Cs=t=>t/1e3;function dL(t,e){return e?t*(1e3/e):0}const pL=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t,o7=1e-7,a7=12;function l7(t,e,i,n,s){let r,o,l=0;do o=e+(i-e)/2,r=pL(o,n,s)-t,r>0?i=o:e=o;while(Math.abs(r)>o7&&++l<a7);return o}function ad(t,e,i,n){if(t===e&&i===n)return Ps;const s=r=>l7(r,0,1,t,i);return r=>r===0||r===1?r:pL(s(r),e,n)}const mL=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,gL=t=>e=>1-t(1-e),OL=ad(.33,1.53,.69,.99),JS=gL(OL),vL=mL(JS),_L=t=>(t*=2)<1?.5*JS(t):.5*(2-Math.pow(2,-10*(t-1))),ex=t=>1-Math.sin(Math.acos(t)),yL=gL(ex),bL=mL(ex),c7=ad(.42,0,1,1),h7=ad(0,0,.58,1),SL=ad(.42,0,.58,1),u7=t=>Array.isArray(t)&&typeof t[0]!="number",xL=t=>Array.isArray(t)&&typeof t[0]=="number",f7={linear:Ps,easeIn:c7,easeInOut:SL,easeOut:h7,circIn:ex,circInOut:bL,circOut:yL,backIn:JS,backInOut:vL,backOut:OL,anticipate:_L},d7=t=>typeof t=="string",cT=t=>{if(xL(t)){GS(t.length===4);const[e,i,n,s]=t;return ad(e,i,n,s)}else if(d7(t))return f7[t];return t},Zp=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function p7(t,e){let i=new Set,n=new Set,s=!1,r=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(d){o.has(d)&&(u.schedule(d),t()),d(l)}const u={schedule:(d,p=!1,g=!1)=>{const _=g&&s?i:n;return p&&o.add(d),_.has(d)||_.add(d),d},cancel:d=>{n.delete(d),o.delete(d)},process:d=>{if(l=d,s){r=!0;return}s=!0,[i,n]=[n,i],i.forEach(c),i.clear(),s=!1,r&&(r=!1,u.process(d))}};return u}const m7=40;function wL(t,e){let i=!1,n=!0;const s={delta:0,timestamp:0,isProcessing:!1},r=()=>i=!0,o=Zp.reduce((T,A)=>(T[A]=p7(r),T),{}),{setup:l,read:c,resolveKeyframes:u,preUpdate:d,update:p,preRender:g,render:O,postRender:_}=o,b=()=>{const T=Oo.useManualTiming?s.timestamp:performance.now();i=!1,Oo.useManualTiming||(s.delta=n?1e3/60:Math.max(Math.min(T-s.timestamp,m7),1)),s.timestamp=T,s.isProcessing=!0,l.process(s),c.process(s),u.process(s),d.process(s),p.process(s),g.process(s),O.process(s),_.process(s),s.isProcessing=!1,i&&e&&(n=!1,t(b))},x=()=>{i=!0,n=!0,s.isProcessing||t(b)};return{schedule:Zp.reduce((T,A)=>{const L=o[A];return T[A]=(E,z=!1,N=!1)=>(i||x(),L.schedule(E,z,N)),T},{}),cancel:T=>{for(let A=0;A<Zp.length;A++)o[Zp[A]].cancel(T)},state:s,steps:o}}const{schedule:Tt,cancel:ba,state:qi,steps:t_}=wL(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ps,!0);let Dm;function g7(){Dm=void 0}const On={now:()=>(Dm===void 0&&On.set(qi.isProcessing||Oo.useManualTiming?qi.timestamp:performance.now()),Dm),set:t=>{Dm=t,queueMicrotask(g7)}},CL=t=>e=>typeof e=="string"&&e.startsWith(t),kL=CL("--"),O7=CL("var(--"),tx=t=>O7(t)?v7.test(t.split("/*")[0].trim()):!1,v7=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function hT(t){return typeof t!="string"?!1:t.split("/*")[0].includes("var(--")}const gh={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},kf={...gh,transform:t=>Ar(0,1,t)},qp={...gh,default:1},lf=t=>Math.round(t*1e5)/1e5,ix=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function _7(t){return t==null}const y7=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,nx=(t,e)=>i=>!!(typeof i=="string"&&y7.test(i)&&i.startsWith(t)||e&&!_7(i)&&Object.prototype.hasOwnProperty.call(i,e)),TL=(t,e,i)=>n=>{if(typeof n!="string")return n;const[s,r,o,l]=n.match(ix);return{[t]:parseFloat(s),[e]:parseFloat(r),[i]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},b7=t=>Ar(0,255,t),i_={...gh,transform:t=>Math.round(b7(t))},dl={test:nx("rgb","red"),parse:TL("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:n=1})=>"rgba("+i_.transform(t)+", "+i_.transform(e)+", "+i_.transform(i)+", "+lf(kf.transform(n))+")"};function S7(t){let e="",i="",n="",s="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),n=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),n=t.substring(3,4),s=t.substring(4,5),e+=e,i+=i,n+=n,s+=s),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:s?parseInt(s,16)/255:1}}const v1={test:nx("#"),parse:S7,transform:dl.transform},ld=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),la=ld("deg"),wr=ld("%"),Te=ld("px"),x7=ld("vh"),w7=ld("vw"),uT={...wr,parse:t=>wr.parse(t)/100,transform:t=>wr.transform(t*100)},Lc={test:nx("hsl","hue"),parse:TL("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:n=1})=>"hsla("+Math.round(t)+", "+wr.transform(lf(e))+", "+wr.transform(lf(i))+", "+lf(kf.transform(n))+")"},ai={test:t=>dl.test(t)||v1.test(t)||Lc.test(t),parse:t=>dl.test(t)?dl.parse(t):Lc.test(t)?Lc.parse(t):v1.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?dl.transform(t):Lc.transform(t),getAnimatableNone:t=>{const e=ai.parse(t);return e.alpha=0,ai.transform(e)}},C7=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function k7(t){var e,i;return isNaN(t)&&typeof t=="string"&&(((e=t.match(ix))==null?void 0:e.length)||0)+(((i=t.match(C7))==null?void 0:i.length)||0)>0}const AL="number",EL="color",T7="var",A7="var(",fT="${}",E7=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Tf(t){const e=t.toString(),i=[],n={color:[],number:[],var:[]},s=[];let r=0;const l=e.replace(E7,c=>(ai.test(c)?(n.color.push(r),s.push(EL),i.push(ai.parse(c))):c.startsWith(A7)?(n.var.push(r),s.push(T7),i.push(c)):(n.number.push(r),s.push(AL),i.push(parseFloat(c))),++r,fT)).split(fT);return{values:i,split:l,indexes:n,types:s}}function ML(t){return Tf(t).values}function PL(t){const{split:e,types:i}=Tf(t),n=e.length;return s=>{let r="";for(let o=0;o<n;o++)if(r+=e[o],s[o]!==void 0){const l=i[o];l===AL?r+=lf(s[o]):l===EL?r+=ai.transform(s[o]):r+=s[o]}return r}}const M7=t=>typeof t=="number"?0:ai.test(t)?ai.getAnimatableNone(t):t;function P7(t){const e=ML(t);return PL(t)(e.map(M7))}const Us={test:k7,parse:ML,createTransformer:PL,getAnimatableNone:P7};function n_(t,e,i){return i<0&&(i+=1),i>1&&(i-=1),i<1/6?t+(e-t)*6*i:i<1/2?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function R7({hue:t,saturation:e,lightness:i,alpha:n}){t/=360,e/=100,i/=100;let s=0,r=0,o=0;if(!e)s=r=o=i;else{const l=i<.5?i*(1+e):i+e-i*e,c=2*i-l;s=n_(c,l,t+1/3),r=n_(c,l,t),o=n_(c,l,t-1/3)}return{red:Math.round(s*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:n}}function ug(t,e){return i=>i>0?e:t}const Nt=(t,e,i)=>t+(e-t)*i,s_=(t,e,i)=>{const n=t*t,s=i*(e*e-n)+n;return s<0?0:Math.sqrt(s)},Q7=[v1,dl,Lc],L7=t=>Q7.find(e=>e.test(t));function dT(t){const e=L7(t);if(!e)return!1;let i=e.parse(t);return e===Lc&&(i=R7(i)),i}const pT=(t,e)=>{const i=dT(t),n=dT(e);if(!i||!n)return ug(t,e);const s={...i};return r=>(s.red=s_(i.red,n.red,r),s.green=s_(i.green,n.green,r),s.blue=s_(i.blue,n.blue,r),s.alpha=Nt(i.alpha,n.alpha,r),dl.transform(s))},_1=new Set(["none","hidden"]);function D7(t,e){return _1.has(t)?i=>i<=0?t:e:i=>i>=1?e:t}function B7(t,e){return i=>Nt(t,e,i)}function sx(t){return typeof t=="number"?B7:typeof t=="string"?tx(t)?ug:ai.test(t)?pT:N7:Array.isArray(t)?RL:typeof t=="object"?ai.test(t)?pT:$7:ug}function RL(t,e){const i=[...t],n=i.length,s=t.map((r,o)=>sx(r)(r,e[o]));return r=>{for(let o=0;o<n;o++)i[o]=s[o](r);return i}}function $7(t,e){const i={...t,...e},n={};for(const s in i)t[s]!==void 0&&e[s]!==void 0&&(n[s]=sx(t[s])(t[s],e[s]));return s=>{for(const r in n)i[r]=n[r](s);return i}}function z7(t,e){const i=[],n={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const r=e.types[s],o=t.indexes[r][n[r]],l=t.values[o]??0;i[s]=l,n[r]++}return i}const N7=(t,e)=>{const i=Us.createTransformer(e),n=Tf(t),s=Tf(e);return n.indexes.var.length===s.indexes.var.length&&n.indexes.color.length===s.indexes.color.length&&n.indexes.number.length>=s.indexes.number.length?_1.has(t)&&!s.values.length||_1.has(e)&&!n.values.length?D7(t,e):od(RL(z7(n,s),s.values),i):ug(t,e)};function QL(t,e,i){return typeof t=="number"&&typeof e=="number"&&typeof i=="number"?Nt(t,e,i):sx(t)(t,e)}const j7=t=>{const e=({timestamp:i})=>t(i);return{start:(i=!0)=>Tt.update(e,i),stop:()=>ba(e),now:()=>qi.isProcessing?qi.timestamp:On.now()}},LL=(t,e,i=10)=>{let n="";const s=Math.max(Math.round(e/i),2);for(let r=0;r<s;r++)n+=Math.round(t(r/(s-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`},fg=2e4;function rx(t){let e=0;const i=50;let n=t.next(e);for(;!n.done&&e<fg;)e+=i,n=t.next(e);return e>=fg?1/0:e}function I7(t,e=100,i){const n=i({...t,keyframes:[0,e]}),s=Math.min(rx(n),fg);return{type:"keyframes",ease:r=>n.next(s*r).value/e,duration:Cs(s)}}const V7=5;function DL(t,e,i){const n=Math.max(e-V7,0);return dL(i-t(n),e-n)}const Xt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},r_=.001;function X7({duration:t=Xt.duration,bounce:e=Xt.bounce,velocity:i=Xt.velocity,mass:n=Xt.mass}){let s,r,o=1-e;o=Ar(Xt.minDamping,Xt.maxDamping,o),t=Ar(Xt.minDuration,Xt.maxDuration,Cs(t)),o<1?(s=u=>{const d=u*o,p=d*t,g=d-i,O=y1(u,o),_=Math.exp(-p);return r_-g/O*_},r=u=>{const p=u*o*t,g=p*i+i,O=Math.pow(o,2)*Math.pow(u,2)*t,_=Math.exp(-p),b=y1(Math.pow(u,2),o);return(-s(u)+r_>0?-1:1)*((g-O)*_)/b}):(s=u=>{const d=Math.exp(-u*t),p=(u-i)*t+1;return-r_+d*p},r=u=>{const d=Math.exp(-u*t),p=(i-u)*(t*t);return d*p});const l=5/t,c=q7(s,r,l);if(t=Ws(t),isNaN(c))return{stiffness:Xt.stiffness,damping:Xt.damping,duration:t};{const u=Math.pow(c,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:t}}}const Z7=12;function q7(t,e,i){let n=i;for(let s=1;s<Z7;s++)n=n-t(n)/e(n);return n}function y1(t,e){return t*Math.sqrt(1-e*e)}const W7=["duration","bounce"],U7=["stiffness","damping","mass"];function mT(t,e){return e.some(i=>t[i]!==void 0)}function Y7(t){let e={velocity:Xt.velocity,stiffness:Xt.stiffness,damping:Xt.damping,mass:Xt.mass,isResolvedFromDuration:!1,...t};if(!mT(t,U7)&&mT(t,W7))if(e.velocity=0,t.visualDuration){const i=t.visualDuration,n=2*Math.PI/(i*1.2),s=n*n,r=2*Ar(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Xt.mass,stiffness:s,damping:r}}else{const i=X7({...t,velocity:0});e={...e,...i,mass:Xt.mass},e.isResolvedFromDuration=!0}return e}function dg(t=Xt.visualDuration,e=Xt.bounce){const i=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:s}=i;const r=i.keyframes[0],o=i.keyframes[i.keyframes.length-1],l={done:!1,value:r},{stiffness:c,damping:u,mass:d,duration:p,velocity:g,isResolvedFromDuration:O}=Y7({...i,velocity:-Cs(i.velocity||0)}),_=g||0,b=u/(2*Math.sqrt(c*d)),x=o-r,w=Cs(Math.sqrt(c/d)),k=Math.abs(x)<5;n||(n=k?Xt.restSpeed.granular:Xt.restSpeed.default),s||(s=k?Xt.restDelta.granular:Xt.restDelta.default);let T;if(b<1){const L=y1(w,b);T=E=>{const z=Math.exp(-b*w*E);return o-z*((_+b*w*x)/L*Math.sin(L*E)+x*Math.cos(L*E))}}else if(b===1)T=L=>o-Math.exp(-w*L)*(x+(_+w*x)*L);else{const L=w*Math.sqrt(b*b-1);T=E=>{const z=Math.exp(-b*w*E),N=Math.min(L*E,300);return o-z*((_+b*w*x)*Math.sinh(N)+L*x*Math.cosh(N))/L}}const A={calculatedDuration:O&&p||null,next:L=>{const E=T(L);if(O)l.done=L>=p;else{let z=L===0?_:0;b<1&&(z=L===0?Ws(_):DL(T,L,E));const N=Math.abs(z)<=n,q=Math.abs(o-E)<=s;l.done=N&&q}return l.value=l.done?o:E,l},toString:()=>{const L=Math.min(rx(A),fg),E=LL(z=>A.next(L*z).value,L,30);return L+"ms "+E},toTransition:()=>{}};return A}dg.applyToOptions=t=>{const e=I7(t,100,dg);return t.ease=e.ease,t.duration=Ws(e.duration),t.type="keyframes",t};function b1({keyframes:t,velocity:e=0,power:i=.8,timeConstant:n=325,bounceDamping:s=10,bounceStiffness:r=500,modifyTarget:o,min:l,max:c,restDelta:u=.5,restSpeed:d}){const p=t[0],g={done:!1,value:p},O=N=>l!==void 0&&N<l||c!==void 0&&N>c,_=N=>l===void 0?c:c===void 0||Math.abs(l-N)<Math.abs(c-N)?l:c;let b=i*e;const x=p+b,w=o===void 0?x:o(x);w!==x&&(b=w-p);const k=N=>-b*Math.exp(-N/n),T=N=>w+k(N),A=N=>{const q=k(N),J=T(N);g.done=Math.abs(q)<=u,g.value=g.done?w:J};let L,E;const z=N=>{O(g.value)&&(L=N,E=dg({keyframes:[g.value,_(g.value)],velocity:DL(T,N,g.value),damping:s,stiffness:r,restDelta:u,restSpeed:d}))};return z(0),{calculatedDuration:null,next:N=>{let q=!1;return!E&&L===void 0&&(q=!0,A(N),z(N)),L!==void 0&&N>=L?E.next(N-L):(!q&&A(N),g)}}}function H7(t,e,i){const n=[],s=i||Oo.mix||QL,r=t.length-1;for(let o=0;o<r;o++){let l=s(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||Ps:e;l=od(c,l)}n.push(l)}return n}function F7(t,e,{clamp:i=!0,ease:n,mixer:s}={}){const r=t.length;if(GS(r===e.length),r===1)return()=>e[0];if(r===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=H7(e,n,s),c=l.length,u=d=>{if(o&&d<t[0])return e[0];let p=0;if(c>1)for(;p<t.length-2&&!(d<t[p+1]);p++);const g=Cf(t[p],t[p+1],d);return l[p](g)};return i?d=>u(Ar(t[0],t[r-1],d)):u}function G7(t,e){const i=t[t.length-1];for(let n=1;n<=e;n++){const s=Cf(0,e,n);t.push(Nt(i,1,s))}}function K7(t){const e=[0];return G7(e,t.length-1),e}function J7(t,e){return t.map(i=>i*e)}function eI(t,e){return t.map(()=>e||SL).splice(0,t.length-1)}function cf({duration:t=300,keyframes:e,times:i,ease:n="easeInOut"}){const s=u7(n)?n.map(cT):cT(n),r={done:!1,value:e[0]},o=J7(i&&i.length===e.length?i:K7(e),t),l=F7(o,e,{ease:Array.isArray(s)?s:eI(e,s)});return{calculatedDuration:t,next:c=>(r.value=l(c),r.done=c>=t,r)}}const tI=t=>t!==null;function ox(t,{repeat:e,repeatType:i="loop"},n,s=1){const r=t.filter(tI),l=s<0||e&&i!=="loop"&&e%2===1?0:r.length-1;return!l||n===void 0?r[l]:n}const iI={decay:b1,inertia:b1,tween:cf,keyframes:cf,spring:dg};function BL(t){typeof t.type=="string"&&(t.type=iI[t.type])}class ax{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,i){return this.finished.then(e,i)}}const nI=t=>t/100;class lx extends ax{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var n,s;const{motionValue:i}=this.options;i&&i.updatedAt!==On.now()&&this.tick(On.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(n=this.options).onStop)==null||s.call(n))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;BL(e);const{type:i=cf,repeat:n=0,repeatDelay:s=0,repeatType:r,velocity:o=0}=e;let{keyframes:l}=e;const c=i||cf;c!==cf&&typeof l[0]!="number"&&(this.mixKeyframes=od(nI,QL(l[0],l[1])),l=[0,100]);const u=c({...e,keyframes:l});r==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=rx(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=u}updateTime(e){const i=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=i}tick(e,i=!1){const{generator:n,totalDuration:s,mixKeyframes:r,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return n.next(0);const{delay:u=0,keyframes:d,repeat:p,repeatType:g,repeatDelay:O,type:_,onUpdate:b,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),i?this.currentTime=e:this.updateTime(e);const w=this.currentTime-u*(this.playbackSpeed>=0?1:-1),k=this.playbackSpeed>=0?w<0:w>s;this.currentTime=Math.max(w,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,A=n;if(p){const N=Math.min(this.currentTime,s)/l;let q=Math.floor(N),J=N%1;!J&&N>=1&&(J=1),J===1&&q--,q=Math.min(q,p+1),!!(q%2)&&(g==="reverse"?(J=1-J,O&&(J-=O/l)):g==="mirror"&&(A=o)),T=Ar(0,1,J)*l}const L=k?{done:!1,value:d[0]}:A.next(T);r&&(L.value=r(L.value));let{done:E}=L;!k&&c!==null&&(E=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const z=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return z&&_!==b1&&(L.value=ox(d,this.options,x,this.speed)),b&&b(L.value),z&&this.finish(),L}then(e,i){return this.finished.then(e,i)}get duration(){return Cs(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Cs(e)}get time(){return Cs(this.currentTime)}set time(e){var i;e=Ws(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(i=this.driver)==null||i.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(On.now());const i=this.playbackSpeed!==e;this.playbackSpeed=e,i&&(this.time=Cs(this.currentTime))}play(){var s,r;if(this.isStopped)return;const{driver:e=j7,startTime:i}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(r=(s=this.options).onPlay)==null||r.call(s);const n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=i??n),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(On.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,i;this.notifyFinished(),this.teardown(),this.state="finished",(i=(e=this.options).onComplete)==null||i.call(e)}cancel(){var e,i;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(i=(e=this.options).onCancel)==null||i.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var i;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(i=this.driver)==null||i.stop(),e.observe(this)}}function sI(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const pl=t=>t*180/Math.PI,S1=t=>{const e=pl(Math.atan2(t[1],t[0]));return x1(e)},rI={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:S1,rotateZ:S1,skewX:t=>pl(Math.atan(t[1])),skewY:t=>pl(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},x1=t=>(t=t%360,t<0&&(t+=360),t),gT=S1,OT=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),vT=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),oI={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:OT,scaleY:vT,scale:t=>(OT(t)+vT(t))/2,rotateX:t=>x1(pl(Math.atan2(t[6],t[5]))),rotateY:t=>x1(pl(Math.atan2(-t[2],t[0]))),rotateZ:gT,rotate:gT,skewX:t=>pl(Math.atan(t[4])),skewY:t=>pl(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function w1(t){return t.includes("scale")?1:0}function C1(t,e){if(!t||t==="none")return w1(e);const i=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let n,s;if(i)n=oI,s=i;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=rI,s=l}if(!s)return w1(e);const r=n[e],o=s[1].split(",").map(lI);return typeof r=="function"?r(o):o[r]}const aI=(t,e)=>{const{transform:i="none"}=getComputedStyle(t);return C1(i,e)};function lI(t){return parseFloat(t.trim())}const Oh=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],vh=new Set(Oh),_T=t=>t===gh||t===Te,cI=new Set(["x","y","z"]),hI=Oh.filter(t=>!cI.has(t));function uI(t){const e=[];return hI.forEach(i=>{const n=t.getValue(i);n!==void 0&&(e.push([i,n.get()]),n.set(i.startsWith("scale")?1:0))}),e}const ga={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>C1(e,"x"),y:(t,{transform:e})=>C1(e,"y")};ga.translateX=ga.x;ga.translateY=ga.y;const bl=new Set;let k1=!1,T1=!1,A1=!1;function $L(){if(T1){const t=Array.from(bl).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),i=new Map;e.forEach(n=>{const s=uI(n);s.length&&(i.set(n,s),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>{n.render();const s=i.get(n);s&&s.forEach(([r,o])=>{var l;(l=n.getValue(r))==null||l.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}T1=!1,k1=!1,bl.forEach(t=>t.complete(A1)),bl.clear()}function zL(){bl.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(T1=!0)})}function fI(){A1=!0,zL(),$L(),A1=!1}class cx{constructor(e,i,n,s,r,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=i,this.name=n,this.motionValue=s,this.element=r,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(bl.add(this),k1||(k1=!0,Tt.read(zL),Tt.resolveKeyframes($L))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:i,element:n,motionValue:s}=this;if(e[0]===null){const r=s==null?void 0:s.get(),o=e[e.length-1];if(r!==void 0)e[0]=r;else if(n&&i){const l=n.readValue(i,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&r===void 0&&s.set(e[0])}sI(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),bl.delete(this)}cancel(){this.state==="scheduled"&&(bl.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const dI=t=>t.startsWith("--");function pI(t,e,i){dI(e)?t.style.setProperty(e,i):t.style[e]=i}const mI={};function NL(t,e){const i=fL(t);return()=>mI[e]??i()}const gI=NL(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),jL=NL(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Hu=([t,e,i,n])=>`cubic-bezier(${t}, ${e}, ${i}, ${n})`,yT={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Hu([0,.65,.55,1]),circOut:Hu([.55,0,1,.45]),backIn:Hu([.31,.01,.66,-.59]),backOut:Hu([.33,1.53,.69,.99])};function IL(t,e){if(t)return typeof t=="function"?jL()?LL(t,e):"ease-out":xL(t)?Hu(t):Array.isArray(t)?t.map(i=>IL(i,e)||yT.easeOut):yT[t]}function OI(t,e,i,{delay:n=0,duration:s=300,repeat:r=0,repeatType:o="loop",ease:l="easeOut",times:c}={},u=void 0){const d={[e]:i};c&&(d.offset=c);const p=IL(l,s);Array.isArray(p)&&(d.easing=p);const g={delay:n,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"};return u&&(g.pseudoElement=u),t.animate(d,g)}function VL(t){return typeof t=="function"&&"applyToOptions"in t}function vI({type:t,...e}){return VL(t)&&jL()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class XL extends ax{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:i,name:n,keyframes:s,pseudoElement:r,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=!!r,this.allowFlatten=o,this.options=e,GS(typeof e.type!="string");const u=vI(e);this.animation=OI(i,n,s,u,r),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!r){const d=ox(s,this.options,l,this.speed);this.updateMotionValue?this.updateMotionValue(d):pI(i,n,d),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,i;(i=(e=this.animation).finish)==null||i.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var i,n,s;const e=(i=this.options)==null?void 0:i.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(n=this.animation).commitStyles)==null||s.call(n))}get duration(){var i,n;const e=((n=(i=this.animation.effect)==null?void 0:i.getComputedTiming)==null?void 0:n.call(i).duration)||0;return Cs(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Cs(e)}get time(){return Cs(Number(this.animation.currentTime)||0)}set time(e){this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ws(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,observe:i}){var n;return this.allowFlatten&&((n=this.animation.effect)==null||n.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&gI()?(this.animation.timeline=e,Ps):i(this)}}const ZL={anticipate:_L,backInOut:vL,circInOut:bL};function _I(t){return t in ZL}function yI(t){typeof t.ease=="string"&&_I(t.ease)&&(t.ease=ZL[t.ease])}const o_=10;class bI extends XL{constructor(e){yI(e),BL(e),super(e),e.startTime!==void 0&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:i,onUpdate:n,onComplete:s,element:r,...o}=this.options;if(!i)return;if(e!==void 0){i.set(e);return}const l=new lx({...o,autoplay:!1}),c=Math.max(o_,On.now()-this.startTime),u=Ar(0,o_,c-o_);i.setWithVelocity(l.sample(Math.max(0,c-u)).value,l.sample(c).value,u),l.stop()}}const bT=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Us.test(t)||t==="0")&&!t.startsWith("url("));function SI(t){const e=t[0];if(t.length===1)return!0;for(let i=0;i<t.length;i++)if(t[i]!==e)return!0}function xI(t,e,i,n){const s=t[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const r=t[t.length-1],o=bT(s,e),l=bT(r,e);return!o||!l?!1:SI(t)||(i==="spring"||VL(i))&&n}function E1(t){t.duration=0,t.type="keyframes"}const wI=new Set(["opacity","clipPath","filter","transform"]),CI=fL(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function kI(t){var d;const{motionValue:e,name:i,repeatDelay:n,repeatType:s,damping:r,type:o}=t;if(!(((d=e==null?void 0:e.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return CI()&&i&&wI.has(i)&&(i!=="transform"||!u)&&!c&&!n&&s!=="mirror"&&r!==0&&o!=="inertia"}const TI=40;class AI extends ax{constructor({autoplay:e=!0,delay:i=0,type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:o="loop",keyframes:l,name:c,motionValue:u,element:d,...p}){var _;super(),this.stop=()=>{var b,x;this._animation&&(this._animation.stop(),(b=this.stopTimeline)==null||b.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=On.now();const g={autoplay:e,delay:i,type:n,repeat:s,repeatDelay:r,repeatType:o,name:c,motionValue:u,element:d,...p},O=(d==null?void 0:d.KeyframeResolver)||cx;this.keyframeResolver=new O(l,(b,x,w)=>this.onKeyframesResolved(b,x,g,!w),c,u,d),(_=this.keyframeResolver)==null||_.scheduleResolve()}onKeyframesResolved(e,i,n,s){var x,w;this.keyframeResolver=void 0;const{name:r,type:o,velocity:l,delay:c,isHandoff:u,onUpdate:d}=n;this.resolvedAt=On.now(),xI(e,r,o,l)||((Oo.instantAnimations||!c)&&(d==null||d(ox(e,n,i))),e[0]=e[e.length-1],E1(n),n.repeat=0);const g={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>TI?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:i,...n,keyframes:e},O=!u&&kI(g),_=(w=(x=g.motionValue)==null?void 0:x.owner)==null?void 0:w.current,b=O?new bI({...g,element:_}):new lx(g);b.finished.then(()=>{this.notifyFinished()}).catch(Ps),this.pendingTimeline&&(this.stopTimeline=b.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=b}get finished(){return this._animation?this.animation.finished:this._finished}then(e,i){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),fI()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function qL(t,e,i,n=0,s=1){const r=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),o=t.size,l=(o-1)*n;return typeof i=="function"?i(r,o):s===1?r*n:l-r*n}const EI=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function MI(t){const e=EI.exec(t);if(!e)return[,];const[,i,n,s]=e;return[`--${i??n}`,s]}function WL(t,e,i=1){const[n,s]=MI(t);if(!n)return;const r=window.getComputedStyle(e).getPropertyValue(n);if(r){const o=r.trim();return cL(o)?parseFloat(o):o}return tx(s)?WL(s,e,i+1):s}const PI={type:"spring",stiffness:500,damping:25,restSpeed:10},RI=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),QI={type:"keyframes",duration:.8},LI={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},DI=(t,{keyframes:e})=>e.length>2?QI:vh.has(t)?t.startsWith("scale")?RI(e[1]):PI:LI,BI=t=>t!==null;function $I(t,{repeat:e,repeatType:i="loop"},n){const s=t.filter(BI),r=e&&i!=="loop"&&e%2===1?0:s.length-1;return s[r]}function UL(t,e){if(t!=null&&t.inherit&&e){const{inherit:i,...n}=t;return{...e,...n}}return t}function hx(t,e){const i=(t==null?void 0:t[e])??(t==null?void 0:t.default)??t;return i!==t?UL(i,t):i}function zI({when:t,delay:e,delayChildren:i,staggerChildren:n,staggerDirection:s,repeat:r,repeatType:o,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const ux=(t,e,i,n={},s,r)=>o=>{const l=hx(n,t)||{},c=l.delay||n.delay||0;let{elapsed:u=0}=n;u=u-Ws(c);const d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:g=>{e.set(g),l.onUpdate&&l.onUpdate(g)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:r?void 0:s};zI(l)||Object.assign(d,DI(t,d)),d.duration&&(d.duration=Ws(d.duration)),d.repeatDelay&&(d.repeatDelay=Ws(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let p=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(E1(d),d.delay===0&&(p=!0)),(Oo.instantAnimations||Oo.skipAnimations||s!=null&&s.shouldSkipAnimations)&&(p=!0,E1(d),d.delay=0),d.allowFlatten=!l.type&&!l.ease,p&&!r&&e.get()!==void 0){const g=$I(d.keyframes,l);if(g!==void 0){Tt.update(()=>{d.onUpdate(g),d.onComplete()});return}}return l.isSync?new lx(d):new AI(d)};function ST(t){const e=[{},{}];return t==null||t.values.forEach((i,n)=>{e[0][n]=i.get(),e[1][n]=i.getVelocity()}),e}function fx(t,e,i,n){if(typeof e=="function"){const[s,r]=ST(n);e=e(i!==void 0?i:t.custom,s,r)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,r]=ST(n);e=e(i!==void 0?i:t.custom,s,r)}return e}function qc(t,e,i){const n=t.getProps();return fx(n,e,i!==void 0?i:n.custom,t)}const YL=new Set(["width","height","top","left","right","bottom",...Oh]),xT=30,NI=t=>!isNaN(parseFloat(t));class jI{constructor(e,i={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var r;const s=On.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((r=this.events.change)==null||r.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=i.owner}setCurrent(e){this.current=e,this.updatedAt=On.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=NI(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,i){this.events[e]||(this.events[e]=new KS);const n=this.events[e].add(i);return e==="change"?()=>{n(),Tt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,i){this.passiveEffect=e,this.stopPassiveEffect=i}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,i,n){this.set(i),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,i=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,i&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=On.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>xT)return 0;const i=Math.min(this.updatedAt-this.prevUpdatedAt,xT);return dL(parseFloat(this.current)-parseFloat(this.prevFrameValue),i)}start(e){return this.stop(),new Promise(i=>{this.hasAnimated=!0,this.animation=e(i),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,i;(e=this.dependents)==null||e.clear(),(i=this.events.destroy)==null||i.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function nh(t,e){return new jI(t,e)}const M1=t=>Array.isArray(t);function II(t,e,i){t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,nh(i))}function VI(t){return M1(t)?t[t.length-1]||0:t}function XI(t,e){const i=qc(t,e);let{transitionEnd:n={},transition:s={},...r}=i||{};r={...r,...n};for(const o in r){const l=VI(r[o]);II(t,o,l)}}const rn=t=>!!(t&&t.getVelocity);function ZI(t){return!!(rn(t)&&t.add)}function P1(t,e){const i=t.getValue("willChange");if(ZI(i))return i.add(e);if(!i&&Oo.WillChange){const n=new Oo.WillChange("auto");t.addValue("willChange",n),n.add(e)}}function dx(t){return t.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const qI="framerAppearId",HL="data-"+dx(qI);function FL(t){return t.props[HL]}function WI({protectedKeys:t,needsAnimating:e},i){const n=t.hasOwnProperty(i)&&e[i]!==!0;return e[i]=!1,n}function GL(t,e,{delay:i=0,transitionOverride:n,type:s}={}){let{transition:r,transitionEnd:o,...l}=e;const c=t.getDefaultTransition();r=r?UL(r,c):c;const u=r==null?void 0:r.reduceMotion;n&&(r=n);const d=[],p=s&&t.animationState&&t.animationState.getState()[s];for(const g in l){const O=t.getValue(g,t.latestValues[g]??null),_=l[g];if(_===void 0||p&&WI(p,g))continue;const b={delay:i,...hx(r||{},g)},x=O.get();if(x!==void 0&&!O.isAnimating&&!Array.isArray(_)&&_===x&&!b.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const A=FL(t);if(A){const L=window.MotionHandoffAnimation(A,g,Tt);L!==null&&(b.startTime=L,w=!0)}}P1(t,g);const k=u??t.shouldReduceMotion;O.start(ux(g,O,_,k&&YL.has(g)?{type:!1}:b,t,w));const T=O.animation;T&&d.push(T)}if(o){const g=()=>Tt.update(()=>{o&&XI(t,o)});d.length?Promise.all(d).then(g):g()}return d}function R1(t,e,i={}){var c;const n=qc(t,e,i.type==="exit"?(c=t.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(s=i.transitionOverride);const r=n?()=>Promise.all(GL(t,n,i)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:p,staggerDirection:g}=s;return UI(t,e,u,d,p,g,i)}:()=>Promise.resolve(),{when:l}=s;if(l){const[u,d]=l==="beforeChildren"?[r,o]:[o,r];return u().then(()=>d())}else return Promise.all([r(),o(i.delay)])}function UI(t,e,i=0,n=0,s=0,r=1,o){const l=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),l.push(R1(c,e,{...o,delay:i+(typeof n=="function"?0:n)+qL(t.variantChildren,c,n,s,r)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(l)}function YI(t,e,i={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const s=e.map(r=>R1(t,r,i));n=Promise.all(s)}else if(typeof e=="string")n=R1(t,e,i);else{const s=typeof e=="function"?qc(t,e,i.custom):e;n=Promise.all(GL(t,s,i))}return n.then(()=>{t.notify("AnimationComplete",e)})}const HI={test:t=>t==="auto",parse:t=>t},KL=t=>e=>e.test(t),JL=[gh,Te,wr,la,w7,x7,HI],wT=t=>JL.find(KL(t));function FI(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||uL(t):!0}const GI=new Set(["brightness","contrast","saturate","opacity"]);function KI(t){const[e,i]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=i.match(ix)||[];if(!n)return t;const s=i.replace(n,"");let r=GI.has(e)?1:0;return n!==i&&(r*=100),e+"("+r+s+")"}const JI=/\b([a-z-]*)\(.*?\)/gu,Q1={...Us,getAnimatableNone:t=>{const e=t.match(JI);return e?e.map(KI).join(" "):t}},L1={...Us,getAnimatableNone:t=>{const e=Us.parse(t);return Us.createTransformer(t)(e.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}},CT={...gh,transform:Math.round},eV={rotate:la,rotateX:la,rotateY:la,rotateZ:la,scale:qp,scaleX:qp,scaleY:qp,scaleZ:qp,skew:la,skewX:la,skewY:la,distance:Te,translateX:Te,translateY:Te,translateZ:Te,x:Te,y:Te,z:Te,perspective:Te,transformPerspective:Te,opacity:kf,originX:uT,originY:uT,originZ:Te},px={borderWidth:Te,borderTopWidth:Te,borderRightWidth:Te,borderBottomWidth:Te,borderLeftWidth:Te,borderRadius:Te,borderTopLeftRadius:Te,borderTopRightRadius:Te,borderBottomRightRadius:Te,borderBottomLeftRadius:Te,width:Te,maxWidth:Te,height:Te,maxHeight:Te,top:Te,right:Te,bottom:Te,left:Te,inset:Te,insetBlock:Te,insetBlockStart:Te,insetBlockEnd:Te,insetInline:Te,insetInlineStart:Te,insetInlineEnd:Te,padding:Te,paddingTop:Te,paddingRight:Te,paddingBottom:Te,paddingLeft:Te,paddingBlock:Te,paddingBlockStart:Te,paddingBlockEnd:Te,paddingInline:Te,paddingInlineStart:Te,paddingInlineEnd:Te,margin:Te,marginTop:Te,marginRight:Te,marginBottom:Te,marginLeft:Te,marginBlock:Te,marginBlockStart:Te,marginBlockEnd:Te,marginInline:Te,marginInlineStart:Te,marginInlineEnd:Te,fontSize:Te,backgroundPositionX:Te,backgroundPositionY:Te,...eV,zIndex:CT,fillOpacity:kf,strokeOpacity:kf,numOctaves:CT},tV={...px,color:ai,backgroundColor:ai,outlineColor:ai,fill:ai,stroke:ai,borderColor:ai,borderTopColor:ai,borderRightColor:ai,borderBottomColor:ai,borderLeftColor:ai,filter:Q1,WebkitFilter:Q1,mask:L1,WebkitMask:L1},e3=t=>tV[t],iV=new Set([Q1,L1]);function t3(t,e){let i=e3(t);return iV.has(i)||(i=Us),i.getAnimatableNone?i.getAnimatableNone(e):void 0}const nV=new Set(["auto","none","0"]);function sV(t,e,i){let n=0,s;for(;n<t.length&&!s;){const r=t[n];typeof r=="string"&&!nV.has(r)&&Tf(r).values.length&&(s=t[n]),n++}if(s&&i)for(const r of e)t[r]=t3(i,s)}class rV extends cx{constructor(e,i,n,s,r){super(e,i,n,s,r,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:i,name:n}=this;if(!i||!i.current)return;super.readKeyframes();for(let d=0;d<e.length;d++){let p=e[d];if(typeof p=="string"&&(p=p.trim(),tx(p))){const g=WL(p,i.current);g!==void 0&&(e[d]=g),d===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!YL.has(n)||e.length!==2)return;const[s,r]=e,o=wT(s),l=wT(r),c=hT(s),u=hT(r);if(c!==u&&ga[n]){this.needsMeasurement=!0;return}if(o!==l)if(_T(o)&&_T(l))for(let d=0;d<e.length;d++){const p=e[d];typeof p=="string"&&(e[d]=parseFloat(p))}else ga[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:i}=this,n=[];for(let s=0;s<e.length;s++)(e[s]===null||FI(e[s]))&&n.push(s);n.length&&sV(e,n,i)}measureInitialState(){const{element:e,unresolvedKeyframes:i,name:n}=this;if(!e||!e.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=ga[n](e.measureViewportBox(),window.getComputedStyle(e.current)),i[0]=this.measuredOrigin;const s=i[i.length-1];s!==void 0&&e.getValue(n,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:i,unresolvedKeyframes:n}=this;if(!e||!e.current)return;const s=e.getValue(i);s&&s.jump(this.measuredOrigin,!1);const r=n.length-1,o=n[r];n[r]=ga[i](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{e.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const oV=new Set(["opacity","clipPath","filter","transform"]);function i3(t,e,i){if(t==null)return[];if(t instanceof EventTarget)return[t];if(typeof t=="string"){let n=document;const s=(i==null?void 0:i[t])??n.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t).filter(n=>n!=null)}const n3=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function D1(t){return hL(t)&&"offsetHeight"in t}const{schedule:mx}=wL(queueMicrotask,!1),Xs={x:!1,y:!1};function s3(){return Xs.x||Xs.y}function aV(t){return t==="x"||t==="y"?Xs[t]?null:(Xs[t]=!0,()=>{Xs[t]=!1}):Xs.x||Xs.y?null:(Xs.x=Xs.y=!0,()=>{Xs.x=Xs.y=!1})}function r3(t,e){const i=i3(t),n=new AbortController,s={passive:!0,...e,signal:n.signal};return[i,s,()=>n.abort()]}function lV(t){return!(t.pointerType==="touch"||s3())}function cV(t,e,i={}){const[n,s,r]=r3(t,i);return n.forEach(o=>{let l=!1,c=!1,u;const d=()=>{o.removeEventListener("pointerleave",_)},p=x=>{u&&(u(x),u=void 0),d()},g=x=>{l=!1,window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g),c&&(c=!1,p(x))},O=()=>{l=!0,window.addEventListener("pointerup",g,s),window.addEventListener("pointercancel",g,s)},_=x=>{if(x.pointerType!=="touch"){if(l){c=!0;return}p(x)}},b=x=>{if(!lV(x))return;c=!1;const w=e(o,x);typeof w=="function"&&(u=w,o.addEventListener("pointerleave",_,s))};o.addEventListener("pointerenter",b,s),o.addEventListener("pointerdown",O,s)}),r}const o3=(t,e)=>e?t===e?!0:o3(t,e.parentElement):!1,gx=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,hV=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function uV(t){return hV.has(t.tagName)||t.isContentEditable===!0}const fV=new Set(["INPUT","SELECT","TEXTAREA"]);function dV(t){return fV.has(t.tagName)||t.isContentEditable===!0}const Bm=new WeakSet;function kT(t){return e=>{e.key==="Enter"&&t(e)}}function a_(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const pV=(t,e)=>{const i=t.currentTarget;if(!i)return;const n=kT(()=>{if(Bm.has(i))return;a_(i,"down");const s=kT(()=>{a_(i,"up")}),r=()=>a_(i,"cancel");i.addEventListener("keyup",s,e),i.addEventListener("blur",r,e)});i.addEventListener("keydown",n,e),i.addEventListener("blur",()=>i.removeEventListener("keydown",n),e)};function TT(t){return gx(t)&&!s3()}const AT=new WeakSet;function mV(t,e,i={}){const[n,s,r]=r3(t,i),o=l=>{const c=l.currentTarget;if(!TT(l)||AT.has(l))return;Bm.add(c),i.stopPropagation&&AT.add(l);const u=e(c,l),d=(O,_)=>{window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",g),Bm.has(c)&&Bm.delete(c),TT(O)&&typeof u=="function"&&u(O,{success:_})},p=O=>{d(O,c===window||c===document||i.useGlobalTarget||o3(c,O.target))},g=O=>{d(O,!1)};window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",g,s)};return n.forEach(l=>{(i.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),D1(l)&&(l.addEventListener("focus",u=>pV(u,s)),!uV(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),r}function Ox(t){return hL(t)&&"ownerSVGElement"in t}const $m=new WeakMap;let ca;const a3=(t,e,i)=>(n,s)=>s&&s[0]?s[0][t+"Size"]:Ox(n)&&"getBBox"in n?n.getBBox()[e]:n[i],gV=a3("inline","width","offsetWidth"),OV=a3("block","height","offsetHeight");function vV({target:t,borderBoxSize:e}){var i;(i=$m.get(t))==null||i.forEach(n=>{n(t,{get width(){return gV(t,e)},get height(){return OV(t,e)}})})}function _V(t){t.forEach(vV)}function yV(){typeof ResizeObserver>"u"||(ca=new ResizeObserver(_V))}function bV(t,e){ca||yV();const i=i3(t);return i.forEach(n=>{let s=$m.get(n);s||(s=new Set,$m.set(n,s)),s.add(e),ca==null||ca.observe(n)}),()=>{i.forEach(n=>{const s=$m.get(n);s==null||s.delete(e),s!=null&&s.size||ca==null||ca.unobserve(n)})}}const zm=new Set;let Dc;function SV(){Dc=()=>{const t={get width(){return window.innerWidth},get height(){return window.innerHeight}};zm.forEach(e=>e(t))},window.addEventListener("resize",Dc)}function xV(t){return zm.add(t),Dc||SV(),()=>{zm.delete(t),!zm.size&&typeof Dc=="function"&&(window.removeEventListener("resize",Dc),Dc=void 0)}}function ET(t,e){return typeof t=="function"?xV(t):bV(t,e)}function wV(t){return Ox(t)&&t.tagName==="svg"}const CV=[...JL,ai,Us],kV=t=>CV.find(KL(t)),MT=()=>({translate:0,scale:1,origin:0,originPoint:0}),Bc=()=>({x:MT(),y:MT()}),PT=()=>({min:0,max:0}),Oi=()=>({x:PT(),y:PT()}),TV=new WeakMap;function lO(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Af(t){return typeof t=="string"||Array.isArray(t)}const vx=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_x=["initial",...vx];function cO(t){return lO(t.animate)||_x.some(e=>Af(t[e]))}function l3(t){return!!(cO(t)||t.variants)}function AV(t,e,i){for(const n in e){const s=e[n],r=i[n];if(rn(s))t.addValue(n,s);else if(rn(r))t.addValue(n,nh(s,{owner:t}));else if(r!==s)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(n);t.addValue(n,nh(o!==void 0?o:s,{owner:t}))}}for(const n in i)e[n]===void 0&&t.removeValue(n);return e}const B1={current:null},c3={current:!1},EV=typeof window<"u";function MV(){if(c3.current=!0,!!EV)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>B1.current=t.matches;t.addEventListener("change",e),e()}else B1.current=!1}const RT=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let pg={};function h3(t){pg=t}function PV(){return pg}class RV{scrapeMotionValuesFromProps(e,i,n){return{}}constructor({parent:e,props:i,presenceContext:n,reducedMotionConfig:s,skipAnimations:r,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=cx,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const O=On.now();this.renderScheduledAt<O&&(this.renderScheduledAt=O,Tt.render(this.render,!1,!0))};const{latestValues:u,renderState:d}=l;this.latestValues=u,this.baseTarget={...u},this.initialValues=i.initial?{...u}:{},this.renderState=d,this.parent=e,this.props=i,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=r,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=cO(i),this.isVariantNode=l3(i),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:p,...g}=this.scrapeMotionValuesFromProps(i,{},this);for(const O in g){const _=g[O];u[O]!==void 0&&rn(_)&&_.set(u[O])}}mount(e){var i,n;if(this.hasBeenMounted)for(const s in this.initialValues)(i=this.values.get(s))==null||i.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,TV.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,r)=>this.bindToMotionValue(r,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(c3.current||MV(),this.shouldReduceMotion=B1.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),ba(this.notifyUpdate),ba(this.render),this.valueSubscriptions.forEach(i=>i()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const i in this.events)this.events[i].clear();for(const i in this.features){const n=this.features[i];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,i){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),i.accelerate&&oV.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:u,duration:d}=i.accelerate,p=new XL({element:this.current,name:e,keyframes:l,times:c,ease:u,duration:Ws(d)}),g=o(p);this.valueSubscriptions.set(e,()=>{g(),p.cancel()});return}const n=vh.has(e);n&&this.onBindTransform&&this.onBindTransform();const s=i.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Tt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let r;typeof window<"u"&&window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,e,i)),this.valueSubscriptions.set(e,()=>{s(),r&&r(),i.owner&&i.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in pg){const i=pg[e];if(!i)continue;const{isEnabled:n,Feature:s}=i;if(!this.features[e]&&s&&n(this.props)&&(this.features[e]=new s(this)),this.features[e]){const r=this.features[e];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Oi()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,i){this.latestValues[e]=i}update(e,i){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=i;for(let n=0;n<RT.length;n++){const s=RT[n];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const r="on"+s,o=e[r];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=AV(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const i=this.getClosestVariantNode();if(i)return i.variantChildren&&i.variantChildren.add(e),()=>i.variantChildren.delete(e)}addValue(e,i){const n=this.values.get(e);i!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,i),this.values.set(e,i),this.latestValues[e]=i.get())}removeValue(e){this.values.delete(e);const i=this.valueSubscriptions.get(e);i&&(i(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,i){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&i!==void 0&&(n=nh(i===null?void 0:i,{owner:this}),this.addValue(e,n)),n}readValue(e,i){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n=="string"&&(cL(n)||uL(n))?n=parseFloat(n):!kV(n)&&Us.test(i)&&(n=t3(e,i)),this.setBaseTarget(e,rn(n)?n.get():n)),rn(n)?n.get():n}setBaseTarget(e,i){this.baseTarget[e]=i}getBaseTarget(e){var r;const{initial:i}=this.props;let n;if(typeof i=="string"||typeof i=="object"){const o=fx(this.props,i,(r=this.presenceContext)==null?void 0:r.custom);o&&(n=o[e])}if(i&&n!==void 0)return n;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!rn(s)?s:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,i){return this.events[e]||(this.events[e]=new KS),this.events[e].add(i)}notify(e,...i){this.events[e]&&this.events[e].notify(...i)}scheduleRenderMicrotask(){mx.render(this.render)}}class u3 extends RV{constructor(){super(...arguments),this.KeyframeResolver=rV}sortInstanceNodePosition(e,i){return e.compareDocumentPosition(i)&2?1:-1}getBaseTargetFromProps(e,i){const n=e.style;return n?n[i]:void 0}removeValueFromRenderState(e,{vars:i,style:n}){delete i[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;rn(e)&&(this.childSubscription=e.on("change",i=>{this.current&&(this.current.textContent=`${i}`)}))}}class Ma{constructor(e){this.isMounted=!1,this.node=e}update(){}}function f3({top:t,left:e,right:i,bottom:n}){return{x:{min:e,max:i},y:{min:t,max:n}}}function QV({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function LV(t,e){if(!e)return t;const i=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:n.y,right:n.x}}function l_(t){return t===void 0||t===1}function $1({scale:t,scaleX:e,scaleY:i}){return!l_(t)||!l_(e)||!l_(i)}function ol(t){return $1(t)||d3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function d3(t){return QT(t.x)||QT(t.y)}function QT(t){return t&&t!=="0%"}function mg(t,e,i){const n=t-i,s=e*n;return i+s}function LT(t,e,i,n,s){return s!==void 0&&(t=mg(t,s,n)),mg(t,i,n)+e}function z1(t,e=0,i=1,n,s){t.min=LT(t.min,e,i,n,s),t.max=LT(t.max,e,i,n,s)}function p3(t,{x:e,y:i}){z1(t.x,e.translate,e.scale,e.originPoint),z1(t.y,i.translate,i.scale,i.originPoint)}const DT=.999999999999,BT=1.0000000000001;function DV(t,e,i,n=!1){const s=i.length;if(!s)return;e.x=e.y=1;let r,o;for(let l=0;l<s;l++){r=i[l],o=r.projectionDelta;const{visualElement:c}=r.options;c&&c.props.style&&c.props.style.display==="contents"||(n&&r.options.layoutScroll&&r.scroll&&r!==r.root&&zc(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,p3(t,o)),n&&ol(r.latestValues)&&zc(t,r.latestValues))}e.x<BT&&e.x>DT&&(e.x=1),e.y<BT&&e.y>DT&&(e.y=1)}function $c(t,e){t.min=t.min+e,t.max=t.max+e}function $T(t,e,i,n,s=.5){const r=Nt(t.min,t.max,s);z1(t,e,i,r,n)}function zc(t,e){$T(t.x,e.x,e.scaleX,e.scale,e.originX),$T(t.y,e.y,e.scaleY,e.scale,e.originY)}function m3(t,e){return f3(LV(t.getBoundingClientRect(),e))}function BV(t,e,i){const n=m3(t,i),{scroll:s}=e;return s&&($c(n.x,s.offset.x),$c(n.y,s.offset.y)),n}const $V={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},zV=Oh.length;function NV(t,e,i){let n="",s=!0;for(let r=0;r<zV;r++){const o=Oh[r],l=t[o];if(l===void 0)continue;let c=!0;if(typeof l=="number")c=l===(o.startsWith("scale")?1:0);else{const u=parseFloat(l);c=o.startsWith("scale")?u===1:u===0}if(!c||i){const u=n3(l,px[o]);if(!c){s=!1;const d=$V[o]||o;n+=`${d}(${u}) `}i&&(e[o]=u)}}return n=n.trim(),i?n=i(e,s?"":n):s&&(n="none"),n}function yx(t,e,i){const{style:n,vars:s,transformOrigin:r}=t;let o=!1,l=!1;for(const c in e){const u=e[c];if(vh.has(c)){o=!0;continue}else if(kL(c)){s[c]=u;continue}else{const d=n3(u,px[c]);c.startsWith("origin")?(l=!0,r[c]=d):n[c]=d}}if(e.transform||(o||i?n.transform=NV(e,t.transform,i):n.transform&&(n.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=r;n.transformOrigin=`${c} ${u} ${d}`}}function g3(t,{style:e,vars:i},n,s){const r=t.style;let o;for(o in e)r[o]=e[o];s==null||s.applyProjectionStyles(r,n);for(o in i)r.setProperty(o,i[o])}function zT(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const wu={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Te.test(t))t=parseFloat(t);else return t;const i=zT(t,e.target.x),n=zT(t,e.target.y);return`${i}% ${n}%`}},jV={correct:(t,{treeScale:e,projectionDelta:i})=>{const n=t,s=Us.parse(t);if(s.length>5)return n;const r=Us.createTransformer(t),o=typeof s[0]!="number"?1:0,l=i.x.scale*e.x,c=i.y.scale*e.y;s[0+o]/=l,s[1+o]/=c;const u=Nt(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),r(s)}},N1={borderRadius:{...wu,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wu,borderTopRightRadius:wu,borderBottomLeftRadius:wu,borderBottomRightRadius:wu,boxShadow:jV};function O3(t,{layout:e,layoutId:i}){return vh.has(t)||t.startsWith("origin")||(e||i!==void 0)&&(!!N1[t]||t==="opacity")}function bx(t,e,i){var o;const n=t.style,s=e==null?void 0:e.style,r={};if(!n)return r;for(const l in n)(rn(n[l])||s&&rn(s[l])||O3(l,t)||((o=i==null?void 0:i.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(r[l]=n[l]);return r}function IV(t){return window.getComputedStyle(t)}class VV extends u3{constructor(){super(...arguments),this.type="html",this.renderInstance=g3}readValueFromInstance(e,i){var n;if(vh.has(i))return(n=this.projection)!=null&&n.isProjecting?w1(i):aI(e,i);{const s=IV(e),r=(kL(i)?s.getPropertyValue(i):s[i])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:i}){return m3(e,i)}build(e,i,n){yx(e,i,n.transformTemplate)}scrapeMotionValuesFromProps(e,i,n){return bx(e,i,n)}}const XV={offset:"stroke-dashoffset",array:"stroke-dasharray"},ZV={offset:"strokeDashoffset",array:"strokeDasharray"};function qV(t,e,i=1,n=0,s=!0){t.pathLength=1;const r=s?XV:ZV;t[r.offset]=`${-n}`,t[r.array]=`${e} ${i}`}const WV=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function v3(t,{attrX:e,attrY:i,attrScale:n,pathLength:s,pathSpacing:r=1,pathOffset:o=0,...l},c,u,d){if(yx(t,l,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:g}=t;p.transform&&(g.transform=p.transform,delete p.transform),(g.transform||p.transformOrigin)&&(g.transformOrigin=p.transformOrigin??"50% 50%",delete p.transformOrigin),g.transform&&(g.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete p.transformBox);for(const O of WV)p[O]!==void 0&&(g[O]=p[O],delete p[O]);e!==void 0&&(p.x=e),i!==void 0&&(p.y=i),n!==void 0&&(p.scale=n),s!==void 0&&qV(p,s,r,o,!1)}const _3=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),y3=t=>typeof t=="string"&&t.toLowerCase()==="svg";function UV(t,e,i,n){g3(t,e,void 0,n);for(const s in e.attrs)t.setAttribute(_3.has(s)?s:dx(s),e.attrs[s])}function b3(t,e,i){const n=bx(t,e,i);for(const s in t)if(rn(t[s])||rn(e[s])){const r=Oh.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;n[r]=t[s]}return n}class YV extends u3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Oi}getBaseTargetFromProps(e,i){return e[i]}readValueFromInstance(e,i){if(vh.has(i)){const n=e3(i);return n&&n.default||0}return i=_3.has(i)?i:dx(i),e.getAttribute(i)}scrapeMotionValuesFromProps(e,i,n){return b3(e,i,n)}build(e,i,n){v3(e,i,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,i,n,s){UV(e,i,n,s)}mount(e){this.isSVGTag=y3(e.tagName),super.mount(e)}}const HV=_x.length;function S3(t){if(!t)return;if(!t.isControllingVariants){const i=t.parent?S3(t.parent)||{}:{};return t.props.initial!==void 0&&(i.initial=t.props.initial),i}const e={};for(let i=0;i<HV;i++){const n=_x[i],s=t.props[n];(Af(s)||s===!1)&&(e[n]=s)}return e}function x3(t,e){if(!Array.isArray(e))return!1;const i=e.length;if(i!==t.length)return!1;for(let n=0;n<i;n++)if(e[n]!==t[n])return!1;return!0}const FV=[...vx].reverse(),GV=vx.length;function KV(t){return e=>Promise.all(e.map(({animation:i,options:n})=>YI(t,i,n)))}function JV(t){let e=KV(t),i=NT(),n=!0;const s=c=>(u,d)=>{var g;const p=qc(t,d,c==="exit"?(g=t.presenceContext)==null?void 0:g.custom:void 0);if(p){const{transition:O,transitionEnd:_,...b}=p;u={...u,...b,..._}}return u};function r(c){e=c(t)}function o(c){const{props:u}=t,d=S3(t.parent)||{},p=[],g=new Set;let O={},_=1/0;for(let x=0;x<GV;x++){const w=FV[x],k=i[w],T=u[w]!==void 0?u[w]:d[w],A=Af(T),L=w===c?k.isActive:null;L===!1&&(_=x);let E=T===d[w]&&T!==u[w]&&A;if(E&&n&&t.manuallyAnimateOnMount&&(E=!1),k.protectedKeys={...O},!k.isActive&&L===null||!T&&!k.prevProp||lO(T)||typeof T=="boolean")continue;if(w==="exit"&&k.isActive&&L!==!0){k.prevResolvedValues&&(O={...O,...k.prevResolvedValues});continue}const z=eX(k.prevProp,T);let N=z||w===c&&k.isActive&&!E&&A||x>_&&A,q=!1;const J=Array.isArray(T)?T:[T];let U=J.reduce(s(w),{});L===!1&&(U={});const{prevResolvedValues:R={}}=k,B={...R,...U},D=X=>{N=!0,g.has(X)&&(q=!0,g.delete(X)),k.needsAnimating[X]=!0;const H=t.getValue(X);H&&(H.liveStyle=!1)};for(const X in B){const H=U[X],F=R[X];if(O.hasOwnProperty(X))continue;let M=!1;M1(H)&&M1(F)?M=!x3(H,F):M=H!==F,M?H!=null?D(X):g.add(X):H!==void 0&&g.has(X)?D(X):k.protectedKeys[X]=!0}k.prevProp=T,k.prevResolvedValues=U,k.isActive&&(O={...O,...U}),n&&t.blockInitialAnimation&&(N=!1);const j=E&&z;N&&(!j||q)&&p.push(...J.map(X=>{const H={type:w};if(typeof X=="string"&&n&&!j&&t.manuallyAnimateOnMount&&t.parent){const{parent:F}=t,M=qc(F,X);if(F.enteringChildren&&M){const{delayChildren:I}=M.transition||{};H.delay=qL(F.enteringChildren,t,I)}}return{animation:X,options:H}}))}if(g.size){const x={};if(typeof u.initial!="boolean"){const w=qc(t,Array.isArray(u.initial)?u.initial[0]:u.initial);w&&w.transition&&(x.transition=w.transition)}g.forEach(w=>{const k=t.getBaseTarget(w),T=t.getValue(w);T&&(T.liveStyle=!0),x[w]=k??null}),p.push({animation:x})}let b=!!p.length;return n&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(b=!1),n=!1,b?e(p):Promise.resolve()}function l(c,u){var p;if(i[c].isActive===u)return Promise.resolve();(p=t.variantChildren)==null||p.forEach(g=>{var O;return(O=g.animationState)==null?void 0:O.setActive(c,u)}),i[c].isActive=u;const d=o(c);for(const g in i)i[g].protectedKeys={};return d}return{animateChanges:o,setActive:l,setAnimateFunction:r,getState:()=>i,reset:()=>{i=NT()}}}function eX(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!x3(e,t):!1}function Ja(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function NT(){return{animate:Ja(!0),whileInView:Ja(),whileHover:Ja(),whileTap:Ja(),whileDrag:Ja(),whileFocus:Ja(),exit:Ja()}}function jT(t,e){t.min=e.min,t.max=e.max}function js(t,e){jT(t.x,e.x),jT(t.y,e.y)}function IT(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}const w3=1e-4,tX=1-w3,iX=1+w3,C3=.01,nX=0-C3,sX=0+C3;function vn(t){return t.max-t.min}function rX(t,e,i){return Math.abs(t-e)<=i}function VT(t,e,i,n=.5){t.origin=n,t.originPoint=Nt(e.min,e.max,t.origin),t.scale=vn(i)/vn(e),t.translate=Nt(i.min,i.max,t.origin)-t.originPoint,(t.scale>=tX&&t.scale<=iX||isNaN(t.scale))&&(t.scale=1),(t.translate>=nX&&t.translate<=sX||isNaN(t.translate))&&(t.translate=0)}function hf(t,e,i,n){VT(t.x,e.x,i.x,n?n.originX:void 0),VT(t.y,e.y,i.y,n?n.originY:void 0)}function XT(t,e,i){t.min=i.min+e.min,t.max=t.min+vn(e)}function oX(t,e,i){XT(t.x,e.x,i.x),XT(t.y,e.y,i.y)}function ZT(t,e,i){t.min=e.min-i.min,t.max=t.min+vn(e)}function gg(t,e,i){ZT(t.x,e.x,i.x),ZT(t.y,e.y,i.y)}function qT(t,e,i,n,s){return t-=e,t=mg(t,1/i,n),s!==void 0&&(t=mg(t,1/s,n)),t}function aX(t,e=0,i=1,n=.5,s,r=t,o=t){if(wr.test(e)&&(e=parseFloat(e),e=Nt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=Nt(r.min,r.max,n);t===r&&(l-=e),t.min=qT(t.min,e,i,l,s),t.max=qT(t.max,e,i,l,s)}function WT(t,e,[i,n,s],r,o){aX(t,e[i],e[n],e[s],e.scale,r,o)}const lX=["x","scaleX","originX"],cX=["y","scaleY","originY"];function UT(t,e,i,n){WT(t.x,e,lX,i?i.x:void 0,n?n.x:void 0),WT(t.y,e,cX,i?i.y:void 0,n?n.y:void 0)}function YT(t){return t.translate===0&&t.scale===1}function k3(t){return YT(t.x)&&YT(t.y)}function HT(t,e){return t.min===e.min&&t.max===e.max}function hX(t,e){return HT(t.x,e.x)&&HT(t.y,e.y)}function FT(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function T3(t,e){return FT(t.x,e.x)&&FT(t.y,e.y)}function GT(t){return vn(t.x)/vn(t.y)}function KT(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}function dr(t){return[t("x"),t("y")]}function uX(t,e,i){let n="";const s=t.x.translate/e.x,r=t.y.translate/e.y,o=(i==null?void 0:i.z)||0;if((s||r||o)&&(n=`translate3d(${s}px, ${r}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),i){const{transformPerspective:u,rotate:d,rotateX:p,rotateY:g,skewX:O,skewY:_}=i;u&&(n=`perspective(${u}px) ${n}`),d&&(n+=`rotate(${d}deg) `),p&&(n+=`rotateX(${p}deg) `),g&&(n+=`rotateY(${g}deg) `),O&&(n+=`skewX(${O}deg) `),_&&(n+=`skewY(${_}deg) `)}const l=t.x.scale*e.x,c=t.y.scale*e.y;return(l!==1||c!==1)&&(n+=`scale(${l}, ${c})`),n||"none"}const A3=["TopLeft","TopRight","BottomLeft","BottomRight"],fX=A3.length,JT=t=>typeof t=="string"?parseFloat(t):t,eA=t=>typeof t=="number"||Te.test(t);function dX(t,e,i,n,s,r){s?(t.opacity=Nt(0,i.opacity??1,pX(n)),t.opacityExit=Nt(e.opacity??1,0,mX(n))):r&&(t.opacity=Nt(e.opacity??1,i.opacity??1,n));for(let o=0;o<fX;o++){const l=`border${A3[o]}Radius`;let c=tA(e,l),u=tA(i,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||eA(c)===eA(u)?(t[l]=Math.max(Nt(JT(c),JT(u),n),0),(wr.test(u)||wr.test(c))&&(t[l]+="%")):t[l]=u}(e.rotate||i.rotate)&&(t.rotate=Nt(e.rotate||0,i.rotate||0,n))}function tA(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const pX=E3(0,.5,yL),mX=E3(.5,.95,Ps);function E3(t,e,i){return n=>n<t?0:n>e?1:i(Cf(t,e,n))}function gX(t,e,i){const n=rn(t)?t:nh(t);return n.start(ux("",n,e,i)),n.animation}function Ef(t,e,i,n={passive:!0}){return t.addEventListener(e,i,n),()=>t.removeEventListener(e,i)}const OX=(t,e)=>t.depth-e.depth;class vX{constructor(){this.children=[],this.isDirty=!1}add(e){FS(this.children,e),this.isDirty=!0}remove(e){hg(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(OX),this.isDirty=!1,this.children.forEach(e)}}function _X(t,e){const i=On.now(),n=({timestamp:s})=>{const r=s-i;r>=e&&(ba(n),t(r-e))};return Tt.setup(n,!0),()=>ba(n)}function Nm(t){return rn(t)?t.get():t}class yX{constructor(){this.members=[]}add(e){FS(this.members,e);for(let i=this.members.length-1;i>=0;i--){const n=this.members[i];if(n===e||n===this.lead||n===this.prevLead)continue;const s=n.instance;s&&s.isConnected===!1&&n.isPresent!==!1&&!n.snapshot&&hg(this.members,n)}e.scheduleRender()}remove(e){if(hg(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const i=this.members[this.members.length-1];i&&this.promote(i)}}relegate(e){const i=this.members.findIndex(s=>e===s);if(i===0)return!1;let n;for(let s=i;s>=0;s--){const r=this.members[s],o=r.instance;if(r.isPresent!==!1&&(!o||o.isConnected!==!1)){n=r;break}}return n?(this.promote(n),!0):!1}promote(e,i){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender();const s=n.options.layoutDependency,r=e.options.layoutDependency;if(!(s!==void 0&&r!==void 0&&s===r)){const c=n.instance;c&&c.isConnected===!1&&!n.snapshot||(e.resumeFrom=n,i&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0))}const{crossfade:l}=e.options;l===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:i,resumingFrom:n}=e;i.onExitComplete&&i.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const jm={hasAnimatedSinceResize:!0,hasEverUpdated:!1},c_=["","X","Y","Z"],bX=1e3;let SX=0;function h_(t,e,i,n){const{latestValues:s}=e;s[t]&&(i[t]=s[t],e.setStaticValue(t,0),n&&(n[t]=0))}function M3(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const i=FL(e);if(window.MotionHasOptimisedAnimation(i,"transform")){const{layout:s,layoutId:r}=t.options;window.MotionCancelOptimisedAnimation(i,"transform",Tt,!(s||r))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&M3(n)}function P3({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:n,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=SX++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(CX),this.nodes.forEach(EX),this.nodes.forEach(MX),this.nodes.forEach(kX)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new vX)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new KS),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Ox(o)&&!wV(o),this.instance=o;const{layoutId:l,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),t){let d,p=0;const g=()=>this.root.updateBlockedByResize=!1;Tt.read(()=>{p=window.innerWidth}),t(o,()=>{const O=window.innerWidth;O!==p&&(p=O,this.root.updateBlockedByResize=!0,d&&d(),d=_X(g,250),jm.hasAnimatedSinceResize&&(jm.hasAnimatedSinceResize=!1,this.nodes.forEach(sA)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&u&&(l||c)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:p,hasRelativeLayoutChanged:g,layout:O})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||u.getDefaultTransition()||DX,{onLayoutAnimationStart:b,onLayoutAnimationComplete:x}=u.getProps(),w=!this.targetLayout||!T3(this.targetLayout,O),k=!p&&g;if(this.options.layoutRoot||this.resumeFrom||k||p&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...hx(_,"layout"),onPlay:b,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(d,k)}else p||sA(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=O})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ba(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(PX),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&M3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const p=this.path[d];p.shouldResetTransform=!0,p.updateScroll("snapshot"),p.options.layoutRoot&&p.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(iA);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(nA);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(AX),this.nodes.forEach(xX),this.nodes.forEach(wX)):this.nodes.forEach(nA),this.clearAllSnapshots();const l=On.now();qi.delta=Ar(0,1e3/60,l-qi.timestamp),qi.timestamp=l,qi.isProcessing=!0,t_.update.process(qi),t_.preRender.process(qi),t_.render.process(qi),qi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,mx.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(TX),this.sharedNodes.forEach(RX)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Tt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Tt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vn(this.snapshot.measuredBox.x)&&!vn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=Oi(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:i(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!k3(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;o&&this.instance&&(l||ol(this.latestValues)||d)&&(s(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),BX(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:o}=this.options;if(!o)return Oi();const l=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some($X))){const{scroll:d}=this.root;d&&($c(l.x,d.offset.x),$c(l.y,d.offset.y))}return l}removeElementScroll(o){var c;const l=Oi();if(js(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:p,options:g}=d;d!==this.root&&p&&g.layoutScroll&&(p.wasRoot&&js(l,o),$c(l.x,p.offset.x),$c(l.y,p.offset.y))}return l}applyTransform(o,l=!1){const c=Oi();js(c,o);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&zc(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),ol(d.latestValues)&&zc(c,d.latestValues)}return ol(this.latestValues)&&zc(c,this.latestValues),c}removeTransform(o){const l=Oi();js(l,o);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!ol(u.latestValues))continue;$1(u.latestValues)&&u.updateSnapshot();const d=Oi(),p=u.measurePageBox();js(d,p),UT(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return ol(this.latestValues)&&UT(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==qi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var O;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(O=this.parent)!=null&&O.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:p}=this.options;if(!this.layout||!(d||p))return;this.resolvedRelativeTargetAt=qi.timestamp;const g=this.getClosestProjectingParent();g&&this.linkedParentVersion!==g.layoutVersion&&!g.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(g&&g.layout?this.createRelativeTarget(g,this.layout.layoutBox,g.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Oi(),this.targetWithTransforms=Oi()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),oX(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):js(this.target,this.layout.layoutBox),p3(this.target,this.targetDelta)):js(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,g&&!!g.resumingFrom==!!this.resumingFrom&&!g.options.layoutScroll&&g.target&&this.animationProgress!==1?this.createRelativeTarget(g,this.target,g.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||$1(this.parent.latestValues)||d3(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Oi(),this.relativeTargetOrigin=Oi(),gg(this.relativeTargetOrigin,l,c),js(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var _;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(_=this.parent)!=null&&_.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===qi.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;js(this.layoutCorrected,this.layout.layoutBox);const p=this.treeScale.x,g=this.treeScale.y;DV(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Oi());const{target:O}=o;if(!O){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(IT(this.prevProjectionDelta.x,this.projectionDelta.x),IT(this.prevProjectionDelta.y,this.projectionDelta.y)),hf(this.projectionDelta,this.layoutCorrected,O,this.latestValues),(this.treeScale.x!==p||this.treeScale.y!==g||!KT(this.projectionDelta.x,this.prevProjectionDelta.x)||!KT(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",O))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Bc(),this.projectionDelta=Bc(),this.projectionDeltaWithTransform=Bc()}setAnimationOrigin(o,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},p=Bc();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const g=Oi(),O=c?c.source:void 0,_=this.layout?this.layout.source:void 0,b=O!==_,x=this.getStack(),w=!x||x.members.length<=1,k=!!(b&&!w&&this.options.crossfade===!0&&!this.path.some(LX));this.animationProgress=0;let T;this.mixTargetDelta=A=>{const L=A/1e3;rA(p.x,o.x,L),rA(p.y,o.y,L),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(gg(g,this.layout.layoutBox,this.relativeParent.layout.layoutBox),QX(this.relativeTarget,this.relativeTargetOrigin,g,L),T&&hX(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=Oi()),js(T,this.relativeTarget)),b&&(this.animationValues=d,dX(d,u,this.latestValues,L,k,w)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=L},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,u;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(ba(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tt.update(()=>{jm.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=nh(0)),this.motionValue.jump(0,!1),this.currentAnimation=gX(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(bX),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=o;if(!(!l||!c||!u)){if(this!==o&&this.layout&&u&&R3(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Oi();const p=vn(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+p;const g=vn(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+g}js(l,c),zc(l,d),hf(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new yX),this.sharedNodes.get(o).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&h_("z",o,u,this.animationValues);for(let d=0;d<c_.length;d++)h_(`rotate${c_[d]}`,o,u,this.animationValues),h_(`skew${c_[d]}`,o,u,this.animationValues);o.render();for(const d in u)o.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=Nm(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=Nm(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!ol(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const d=u.animationValues||u.latestValues;this.applyTransformsToTarget();let p=uX(this.projectionDeltaWithTransform,this.treeScale,d);c&&(p=c(d,p)),o.transform=p;const{x:g,y:O}=this.projectionDelta;o.transformOrigin=`${g.origin*100}% ${O.origin*100}% 0`,u.animationValues?o.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:o.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const _ in N1){if(d[_]===void 0)continue;const{correct:b,applyTo:x,isCSSVariable:w}=N1[_],k=p==="none"?d[_]:b(d[_],u);if(x){const T=x.length;for(let A=0;A<T;A++)o[x[A]]=k}else w?this.options.visualElement.renderState.vars[_]=k:o[_]=k}this.options.layoutId&&(o.pointerEvents=u===this?Nm(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(iA),this.root.sharedNodes.clear()}}}function xX(t){t.updateLayout()}function wX(t){var i;const e=((i=t.resumeFrom)==null?void 0:i.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:r}=t.options,o=e.source!==t.layout.source;r==="size"?dr(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],O=vn(g);g.min=n[p].min,g.max=g.min+O}):R3(r,e.layoutBox,n)&&dr(p=>{const g=o?e.measuredBox[p]:e.layoutBox[p],O=vn(n[p]);g.max=g.min+O,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[p].max=t.relativeTarget[p].min+O)});const l=Bc();hf(l,n,e.layoutBox);const c=Bc();o?hf(c,t.applyTransform(s,!0),e.measuredBox):hf(c,n,e.layoutBox);const u=!k3(l);let d=!1;if(!t.resumeFrom){const p=t.getClosestProjectingParent();if(p&&!p.resumeFrom){const{snapshot:g,layout:O}=p;if(g&&O){const _=Oi();gg(_,e.layoutBox,g.layoutBox);const b=Oi();gg(b,n,O.layoutBox),T3(_,b)||(d=!0),p.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=_,t.relativeParent=p)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function CX(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function kX(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function TX(t){t.clearSnapshot()}function iA(t){t.clearMeasurements()}function nA(t){t.isLayoutDirty=!1}function AX(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function sA(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function EX(t){t.resolveTargetDelta()}function MX(t){t.calcProjection()}function PX(t){t.resetSkewAndRotation()}function RX(t){t.removeLeadSnapshot()}function rA(t,e,i){t.translate=Nt(e.translate,0,i),t.scale=Nt(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function oA(t,e,i,n){t.min=Nt(e.min,i.min,n),t.max=Nt(e.max,i.max,n)}function QX(t,e,i,n){oA(t.x,e.x,i.x,n),oA(t.y,e.y,i.y,n)}function LX(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const DX={duration:.45,ease:[.4,0,.1,1]},aA=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),lA=aA("applewebkit/")&&!aA("chrome/")?Math.round:Ps;function cA(t){t.min=lA(t.min),t.max=lA(t.max)}function BX(t){cA(t.x),cA(t.y)}function R3(t,e,i){return t==="position"||t==="preserve-aspect"&&!rX(GT(e),GT(i),.2)}function $X(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const zX=P3({attachResizeListener:(t,e)=>Ef(t,"resize",e),measureScroll:()=>{var t,e;return{x:document.documentElement.scrollLeft||((t=document.body)==null?void 0:t.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),u_={current:void 0},Q3=P3({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!u_.current){const t=new zX({});t.mount(window),t.setOptions({layoutScroll:!0}),u_.current=t}return u_.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Sx=Z.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function hA(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function NX(...t){return e=>{let i=!1;const n=t.map(s=>{const r=hA(s,e);return!i&&typeof r=="function"&&(i=!0),r});if(i)return()=>{for(let s=0;s<n.length;s++){const r=n[s];typeof r=="function"?r():hA(t[s],null)}}}}function jX(...t){return Z.useCallback(NX(...t),t)}class IX extends Z.Component{getSnapshotBeforeUpdate(e){const i=this.props.childRef.current;if(i&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const n=i.offsetParent,s=D1(n)&&n.offsetWidth||0,r=D1(n)&&n.offsetHeight||0,o=this.props.sizeRef.current;o.height=i.offsetHeight||0,o.width=i.offsetWidth||0,o.top=i.offsetTop,o.left=i.offsetLeft,o.right=s-o.width-o.left,o.bottom=r-o.height-o.top}return null}componentDidUpdate(){}render(){return this.props.children}}function VX({children:t,isPresent:e,anchorX:i,anchorY:n,root:s,pop:r}){var g;const o=Z.useId(),l=Z.useRef(null),c=Z.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0}),{nonce:u}=Z.useContext(Sx),d=((g=t.props)==null?void 0:g.ref)??(t==null?void 0:t.ref),p=jX(l,d);return Z.useInsertionEffect(()=>{const{width:O,height:_,top:b,left:x,right:w,bottom:k}=c.current;if(e||r===!1||!l.current||!O||!_)return;const T=i==="left"?`left: ${x}`:`right: ${w}`,A=n==="bottom"?`bottom: ${k}`:`top: ${b}`;l.current.dataset.motionPopId=o;const L=document.createElement("style");u&&(L.nonce=u);const E=s??document.head;return E.appendChild(L),L.sheet&&L.sheet.insertRule(`
50
+ [data-motion-pop-id="${o}"] {
51
+ position: absolute !important;
52
+ width: ${O}px !important;
53
+ height: ${_}px !important;
54
+ ${T}px !important;
55
+ ${A}px !important;
56
+ }
57
+ `),()=>{E.contains(L)&&E.removeChild(L)}},[e]),S.jsx(IX,{isPresent:e,childRef:l,sizeRef:c,pop:r,children:r===!1?t:Z.cloneElement(t,{ref:p})})}const XX=({children:t,initial:e,isPresent:i,onExitComplete:n,custom:s,presenceAffectsLayout:r,mode:o,anchorX:l,anchorY:c,root:u})=>{const d=HS(ZX),p=Z.useId();let g=!0,O=Z.useMemo(()=>(g=!1,{id:p,initial:e,isPresent:i,custom:s,onExitComplete:_=>{d.set(_,!0);for(const b of d.values())if(!b)return;n&&n()},register:_=>(d.set(_,!1),()=>d.delete(_))}),[i,d,n]);return r&&g&&(O={...O}),Z.useMemo(()=>{d.forEach((_,b)=>d.set(b,!1))},[i]),Z.useEffect(()=>{!i&&!d.size&&n&&n()},[i]),t=S.jsx(VX,{pop:o==="popLayout",isPresent:i,anchorX:l,anchorY:c,root:u,children:t}),S.jsx(aO.Provider,{value:O,children:t})};function ZX(){return new Map}function L3(t=!0){const e=Z.useContext(aO);if(e===null)return[!0,null];const{isPresent:i,onExitComplete:n,register:s}=e,r=Z.useId();Z.useEffect(()=>{if(t)return s(r)},[t]);const o=Z.useCallback(()=>t&&n&&n(r),[r,n,t]);return!i&&n?[!1,o]:[!0]}const Wp=t=>t.key||"";function uA(t){const e=[];return Z.Children.forEach(t,i=>{Z.isValidElement(i)&&e.push(i)}),e}const xx=({children:t,custom:e,initial:i=!0,onExitComplete:n,presenceAffectsLayout:s=!0,mode:r="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:u})=>{const[d,p]=L3(o),g=Z.useMemo(()=>uA(t),[t]),O=o&&!d?[]:g.map(Wp),_=Z.useRef(!0),b=Z.useRef(g),x=HS(()=>new Map),w=Z.useRef(new Set),[k,T]=Z.useState(g),[A,L]=Z.useState(g);lL(()=>{_.current=!1,b.current=g;for(let N=0;N<A.length;N++){const q=Wp(A[N]);O.includes(q)?(x.delete(q),w.current.delete(q)):x.get(q)!==!0&&x.set(q,!1)}},[A,O.length,O.join("-")]);const E=[];if(g!==k){let N=[...g];for(let q=0;q<A.length;q++){const J=A[q],U=Wp(J);O.includes(U)||(N.splice(q,0,J),E.push(J))}return r==="wait"&&E.length&&(N=E),L(uA(N)),T(g),null}const{forceRender:z}=Z.useContext(YS);return S.jsx(S.Fragment,{children:A.map(N=>{const q=Wp(N),J=o&&!d?!1:g===A||O.includes(q),U=()=>{if(w.current.has(q))return;if(w.current.add(q),x.has(q))x.set(q,!0);else return;let R=!0;x.forEach(B=>{B||(R=!1)}),R&&(z==null||z(),L(b.current),o&&(p==null||p()),n&&n())};return S.jsx(XX,{isPresent:J,initial:!_.current||i?void 0:!1,custom:e,presenceAffectsLayout:s,mode:r,root:u,onExitComplete:J?void 0:U,anchorX:l,anchorY:c,children:N},q)})})},D3=Z.createContext({strict:!1}),fA={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let dA=!1;function qX(){if(dA)return;const t={};for(const e in fA)t[e]={isEnabled:i=>fA[e].some(n=>!!i[n])};h3(t),dA=!0}function B3(){return qX(),PV()}function WX(t){const e=B3();for(const i in t)e[i]={...e[i],...t[i]};h3(e)}const UX=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Og(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||UX.has(t)}let $3=t=>!Og(t);function YX(t){typeof t=="function"&&($3=e=>e.startsWith("on")?!Og(e):t(e))}try{YX(require("@emotion/is-prop-valid").default)}catch{}function HX(t,e,i){const n={};for(const s in t)s==="values"&&typeof t.values=="object"||($3(s)||i===!0&&Og(s)||!e&&!Og(s)||t.draggable&&s.startsWith("onDrag"))&&(n[s]=t[s]);return n}const hO=Z.createContext({});function FX(t,e){if(cO(t)){const{initial:i,animate:n}=t;return{initial:i===!1||Af(i)?i:void 0,animate:Af(n)?n:void 0}}return t.inherit!==!1?e:{}}function GX(t){const{initial:e,animate:i}=FX(t,Z.useContext(hO));return Z.useMemo(()=>({initial:e,animate:i}),[pA(e),pA(i)])}function pA(t){return Array.isArray(t)?t.join(" "):t}const wx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function z3(t,e,i){for(const n in e)!rn(e[n])&&!O3(n,i)&&(t[n]=e[n])}function KX({transformTemplate:t},e){return Z.useMemo(()=>{const i=wx();return yx(i,e,t),Object.assign({},i.vars,i.style)},[e])}function JX(t,e){const i=t.style||{},n={};return z3(n,i,t),Object.assign(n,KX(t,e)),n}function e9(t,e){const i={},n=JX(t,e);return t.drag&&t.dragListener!==!1&&(i.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=n,i}const N3=()=>({...wx(),attrs:{}});function t9(t,e,i,n){const s=Z.useMemo(()=>{const r=N3();return v3(r,e,y3(n),t.transformTemplate,t.style),{...r.attrs,style:{...r.style}}},[e]);if(t.style){const r={};z3(r,t.style,t),s.style={...r,...s.style}}return s}const i9=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Cx(t){return typeof t!="string"||t.includes("-")?!1:!!(i9.indexOf(t)>-1||/[A-Z]/u.test(t))}function n9(t,e,i,{latestValues:n},s,r=!1,o){const c=(o??Cx(t)?t9:e9)(e,n,s,t),u=HX(e,typeof t=="string",r),d=t!==Z.Fragment?{...u,...c,ref:i}:{},{children:p}=e,g=Z.useMemo(()=>rn(p)?p.get():p,[p]);return Z.createElement(t,{...d,children:g})}function s9({scrapeMotionValuesFromProps:t,createRenderState:e},i,n,s){return{latestValues:r9(i,n,s,t),renderState:e()}}function r9(t,e,i,n){const s={},r=n(t,{});for(const g in r)s[g]=Nm(r[g]);let{initial:o,animate:l}=t;const c=cO(t),u=l3(t);e&&u&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let d=i?i.initial===!1:!1;d=d||o===!1;const p=d?l:o;if(p&&typeof p!="boolean"&&!lO(p)){const g=Array.isArray(p)?p:[p];for(let O=0;O<g.length;O++){const _=fx(t,g[O]);if(_){const{transitionEnd:b,transition:x,...w}=_;for(const k in w){let T=w[k];if(Array.isArray(T)){const A=d?T.length-1:0;T=T[A]}T!==null&&(s[k]=T)}for(const k in b)s[k]=b[k]}}}return s}const j3=t=>(e,i)=>{const n=Z.useContext(hO),s=Z.useContext(aO),r=()=>s9(t,e,n,s);return i?r():HS(r)},o9=j3({scrapeMotionValuesFromProps:bx,createRenderState:wx}),a9=j3({scrapeMotionValuesFromProps:b3,createRenderState:N3}),l9=Symbol.for("motionComponentSymbol");function c9(t,e,i){const n=Z.useRef(i);Z.useInsertionEffect(()=>{n.current=i});const s=Z.useRef(null);return Z.useCallback(r=>{var l;r&&((l=t.onMount)==null||l.call(t,r)),e&&(r?e.mount(r):e.unmount());const o=n.current;if(typeof o=="function")if(r){const c=o(r);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):o(r);else o&&(o.current=r)},[e])}const I3=Z.createContext({});function Mc(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function h9(t,e,i,n,s,r){var T,A;const{visualElement:o}=Z.useContext(hO),l=Z.useContext(D3),c=Z.useContext(aO),u=Z.useContext(Sx),d=u.reducedMotion,p=u.skipAnimations,g=Z.useRef(null),O=Z.useRef(!1);n=n||l.renderer,!g.current&&n&&(g.current=n(t,{visualState:e,parent:o,props:i,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:d,skipAnimations:p,isSVG:r}),O.current&&g.current&&(g.current.manuallyAnimateOnMount=!0));const _=g.current,b=Z.useContext(I3);_&&!_.projection&&s&&(_.type==="html"||_.type==="svg")&&u9(g.current,i,s,b);const x=Z.useRef(!1);Z.useInsertionEffect(()=>{_&&x.current&&_.update(i,c)});const w=i[HL],k=Z.useRef(!!w&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,w))&&((A=window.MotionHasOptimisedAnimation)==null?void 0:A.call(window,w)));return lL(()=>{O.current=!0,_&&(x.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),k.current&&_.animationState&&_.animationState.animateChanges())}),Z.useEffect(()=>{_&&(!k.current&&_.animationState&&_.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var L;(L=window.MotionHandoffMarkAsComplete)==null||L.call(window,w)}),k.current=!1),_.enteringChildren=void 0)}),_}function u9(t,e,i,n){const{layoutId:s,layout:r,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:V3(t.parent)),t.projection.setOptions({layoutId:s,layout:r,alwaysMeasureLayout:!!o||l&&Mc(l),visualElement:t,animationType:typeof r=="string"?r:"both",initialPromotionConfig:n,crossfade:d,layoutScroll:c,layoutRoot:u})}function V3(t){if(t)return t.options.allowProjection!==!1?t.projection:V3(t.parent)}function f_(t,{forwardMotionProps:e=!1,type:i}={},n,s){n&&WX(n);const r=i?i==="svg":Cx(t),o=r?a9:o9;function l(u,d){let p;const g={...Z.useContext(Sx),...u,layoutId:f9(u)},{isStatic:O}=g,_=GX(u),b=o(u,O);if(!O&&aL){d9();const x=p9(g);p=x.MeasureLayout,_.visualElement=h9(t,b,g,s,x.ProjectionNode,r)}return S.jsxs(hO.Provider,{value:_,children:[p&&_.visualElement?S.jsx(p,{visualElement:_.visualElement,...g}):null,n9(t,u,c9(b,_.visualElement,d),b,O,e,r)]})}l.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const c=Z.forwardRef(l);return c[l9]=t,c}function f9({layoutId:t}){const e=Z.useContext(YS).id;return e&&t!==void 0?e+"-"+t:t}function d9(t,e){Z.useContext(D3).strict}function p9(t){const e=B3(),{drag:i,layout:n}=e;if(!i&&!n)return{};const s={...i,...n};return{MeasureLayout:i!=null&&i.isEnabled(t)||n!=null&&n.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function m9(t,e){if(typeof Proxy>"u")return f_;const i=new Map,n=(r,o)=>f_(r,o,t,e),s=(r,o)=>n(r,o);return new Proxy(s,{get:(r,o)=>o==="create"?n:(i.has(o)||i.set(o,f_(o,void 0,t,e)),i.get(o))})}const g9=(t,e)=>e.isSVG??Cx(t)?new YV(e):new VV(e,{allowProjection:t!==Z.Fragment});class O9 extends Ma{constructor(e){super(e),e.animationState||(e.animationState=JV(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();lO(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:i}=this.node.prevProps||{};e!==i&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let v9=0;class _9 extends Ma{constructor(){super(...arguments),this.id=v9++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:i}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const s=this.node.animationState.setActive("exit",!e);i&&!e&&s.then(()=>{i(this.id)})}mount(){const{register:e,onExitComplete:i}=this.node.presenceContext||{};i&&i(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const y9={animation:{Feature:O9},exit:{Feature:_9}};function cd(t){return{point:{x:t.pageX,y:t.pageY}}}const b9=t=>e=>gx(e)&&t(e,cd(e));function uf(t,e,i,n){return Ef(t,e,b9(i),n)}const X3=({current:t})=>t?t.ownerDocument.defaultView:null,mA=(t,e)=>Math.abs(t-e);function S9(t,e){const i=mA(t.x,e.x),n=mA(t.y,e.y);return Math.sqrt(i**2+n**2)}const gA=new Set(["auto","scroll"]);class Z3{constructor(e,i,{transformPagePoint:n,contextWindow:s=window,dragSnapToOrigin:r=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=O=>{this.handleScroll(O.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const O=p_(this.lastMoveEventInfo,this.history),_=this.startEvent!==null,b=S9(O.offset,{x:0,y:0})>=this.distanceThreshold;if(!_&&!b)return;const{point:x}=O,{timestamp:w}=qi;this.history.push({...x,timestamp:w});const{onStart:k,onMove:T}=this.handlers;_||(k&&k(this.lastMoveEvent,O),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,O)},this.handlePointerMove=(O,_)=>{this.lastMoveEvent=O,this.lastMoveEventInfo=d_(_,this.transformPagePoint),Tt.update(this.updatePoint,!0)},this.handlePointerUp=(O,_)=>{this.end();const{onEnd:b,onSessionEnd:x,resumeAnimation:w}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=p_(O.type==="pointercancel"?this.lastMoveEventInfo:d_(_,this.transformPagePoint),this.history);this.startEvent&&b&&b(O,k),x&&x(O,k)},!gx(e))return;this.dragSnapToOrigin=r,this.handlers=i,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=s||window;const c=cd(e),u=d_(c,this.transformPagePoint),{point:d}=u,{timestamp:p}=qi;this.history=[{...d,timestamp:p}];const{onSessionStart:g}=i;g&&g(e,p_(u,this.history)),this.removeListeners=od(uf(this.contextWindow,"pointermove",this.handlePointerMove),uf(this.contextWindow,"pointerup",this.handlePointerUp),uf(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(e){let i=e.parentElement;for(;i;){const n=getComputedStyle(i);(gA.has(n.overflowX)||gA.has(n.overflowY))&&this.scrollPositions.set(i,{x:i.scrollLeft,y:i.scrollTop}),i=i.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const i=this.scrollPositions.get(e);if(!i)return;const n=e===window,s=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},r={x:s.x-i.x,y:s.y-i.y};r.x===0&&r.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=r.x,this.lastMoveEventInfo.point.y+=r.y):this.history.length>0&&(this.history[0].x-=r.x,this.history[0].y-=r.y),this.scrollPositions.set(e,s),Tt.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ba(this.updatePoint)}}function d_(t,e){return e?{point:e(t.point)}:t}function OA(t,e){return{x:t.x-e.x,y:t.y-e.y}}function p_({point:t},e){return{point:t,delta:OA(t,q3(e)),offset:OA(t,x9(e)),velocity:w9(e,.1)}}function x9(t){return t[0]}function q3(t){return t[t.length-1]}function w9(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,n=null;const s=q3(t);for(;i>=0&&(n=t[i],!(s.timestamp-n.timestamp>Ws(e)));)i--;if(!n)return{x:0,y:0};n===t[0]&&t.length>2&&s.timestamp-n.timestamp>Ws(e)*2&&(n=t[1]);const r=Cs(s.timestamp-n.timestamp);if(r===0)return{x:0,y:0};const o={x:(s.x-n.x)/r,y:(s.y-n.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function C9(t,{min:e,max:i},n){return e!==void 0&&t<e?t=n?Nt(e,t,n.min):Math.max(t,e):i!==void 0&&t>i&&(t=n?Nt(i,t,n.max):Math.min(t,i)),t}function vA(t,e,i){return{min:e!==void 0?t.min+e:void 0,max:i!==void 0?t.max+i-(t.max-t.min):void 0}}function k9(t,{top:e,left:i,bottom:n,right:s}){return{x:vA(t.x,i,s),y:vA(t.y,e,n)}}function _A(t,e){let i=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([i,n]=[n,i]),{min:i,max:n}}function T9(t,e){return{x:_A(t.x,e.x),y:_A(t.y,e.y)}}function A9(t,e){let i=.5;const n=vn(t),s=vn(e);return s>n?i=Cf(e.min,e.max-n,t.min):n>s&&(i=Cf(t.min,t.max-s,e.min)),Ar(0,1,i)}function E9(t,e){const i={};return e.min!==void 0&&(i.min=e.min-t.min),e.max!==void 0&&(i.max=e.max-t.min),i}const j1=.35;function M9(t=j1){return t===!1?t=0:t===!0&&(t=j1),{x:yA(t,"left","right"),y:yA(t,"top","bottom")}}function yA(t,e,i){return{min:bA(t,e),max:bA(t,i)}}function bA(t,e){return typeof t=="number"?t:t[e]||0}const P9=new WeakMap;class R9{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Oi(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:i=!1,distanceThreshold:n}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const r=p=>{i&&this.snapToCursor(cd(p).point),this.stopAnimation()},o=(p,g)=>{const{drag:O,dragPropagation:_,onDragStart:b}=this.getProps();if(O&&!_&&(this.openDragLock&&this.openDragLock(),this.openDragLock=aV(O),!this.openDragLock))return;this.latestPointerEvent=p,this.latestPanInfo=g,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),dr(w=>{let k=this.getAxisMotionValue(w).get()||0;if(wr.test(k)){const{projection:T}=this.visualElement;if(T&&T.layout){const A=T.layout.layoutBox[w];A&&(k=vn(A)*(parseFloat(k)/100))}}this.originPoint[w]=k}),b&&Tt.update(()=>b(p,g),!1,!0),P1(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},l=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g;const{dragPropagation:O,dragDirectionLock:_,onDirectionLock:b,onDrag:x}=this.getProps();if(!O&&!this.openDragLock)return;const{offset:w}=g;if(_&&this.currentDirection===null){this.currentDirection=L9(w),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",g.point,w),this.updateAxis("y",g.point,w),this.visualElement.render(),x&&Tt.update(()=>x(p,g),!1,!0)},c=(p,g)=>{this.latestPointerEvent=p,this.latestPanInfo=g,this.stop(p,g),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{const{dragSnapToOrigin:p}=this.getProps();(p||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Z3(e,{onSessionStart:r,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:n,contextWindow:X3(this.visualElement),element:this.visualElement.current})}stop(e,i){const n=e||this.latestPointerEvent,s=i||this.latestPanInfo,r=this.isDragging;if(this.cancel(),!r||!s||!n)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&Tt.postRender(()=>l(n,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:i}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),i&&i.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,i,n){const{drag:s}=this.getProps();if(!n||!Up(e,s,this.currentDirection))return;const r=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=C9(o,this.constraints[e],this.elastic[e])),r.set(o)}resolveConstraints(){var r;const{dragConstraints:e,dragElastic:i}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(r=this.visualElement.projection)==null?void 0:r.layout,s=this.constraints;e&&Mc(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&n?this.constraints=k9(n.layoutBox,e):this.constraints=!1,this.elastic=M9(i),s!==this.constraints&&!Mc(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&dr(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=E9(n.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!Mc(e))return!1;const n=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const r=BV(n,s.root,this.visualElement.getTransformPagePoint());let o=T9(s.layout.layoutBox,r);if(i){const l=i(QV(o));this.hasMutatedConstraints=!!l,l&&(o=f3(l))}return o}startAnimation(e){const{drag:i,dragMomentum:n,dragElastic:s,dragTransition:r,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=dr(d=>{if(!Up(d,i,this.currentDirection))return;let p=c&&c[d]||{};o&&(p={min:0,max:0});const g=s?200:1e6,O=s?40:1e7,_={type:"inertia",velocity:n?e[d]:0,bounceStiffness:g,bounceDamping:O,timeConstant:750,restDelta:1,restSpeed:10,...r,...p};return this.startAxisValueAnimation(d,_)});return Promise.all(u).then(l)}startAxisValueAnimation(e,i){const n=this.getAxisMotionValue(e);return P1(this.visualElement,e),n.start(ux(e,n,0,i,this.visualElement,!1))}stopAnimation(){dr(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const i=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),s=n[i];return s||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){dr(i=>{const{drag:n}=this.getProps();if(!Up(i,n,this.currentDirection))return;const{projection:s}=this.visualElement,r=this.getAxisMotionValue(i);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[i],c=r.get()||0;r.set(e[i]-Nt(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:i}=this.getProps(),{projection:n}=this.visualElement;if(!Mc(i)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};dr(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=A9({min:c,max:c},this.constraints[o])}});const{transformTemplate:r}=this.visualElement.getProps();this.visualElement.current.style.transform=r?r({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),dr(o=>{if(!Up(o,e,null))return;const l=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];l.set(Nt(c,u,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;P9.set(this.visualElement,this);const e=this.visualElement.current,i=uf(e,"pointerdown",u=>{const{drag:d,dragListener:p=!0}=this.getProps(),g=u.target,O=g!==e&&dV(g);d&&p&&!O&&this.start(u)});let n;const s=()=>{const{dragConstraints:u}=this.getProps();Mc(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),n||(n=Q9(e,u.current,()=>this.scalePositionWithinConstraints())))},{projection:r}=this.visualElement,o=r.addEventListener("measure",s);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Tt.read(s);const l=Ef(window,"resize",()=>this.scalePositionWithinConstraints()),c=r.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:d})=>{this.isDragging&&d&&(dr(p=>{const g=this.getAxisMotionValue(p);g&&(this.originPoint[p]+=u[p].translate,g.set(g.get()+u[p].translate))}),this.visualElement.render())}));return()=>{l(),i(),o(),c&&c(),n&&n()}}getProps(){const e=this.visualElement.getProps(),{drag:i=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:r=!1,dragElastic:o=j1,dragMomentum:l=!0}=e;return{...e,drag:i,dragDirectionLock:n,dragPropagation:s,dragConstraints:r,dragElastic:o,dragMomentum:l}}}function SA(t){let e=!0;return()=>{if(e){e=!1;return}t()}}function Q9(t,e,i){const n=ET(t,SA(i)),s=ET(e,SA(i));return()=>{n(),s()}}function Up(t,e,i){return(e===!0||e===t)&&(i===null||i===t)}function L9(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}class D9 extends Ma{constructor(e){super(e),this.removeGroupControls=Ps,this.removeListeners=Ps,this.controls=new R9(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ps}update(){const{dragControls:e}=this.node.getProps(),{dragControls:i}=this.node.prevProps||{};e!==i&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const m_=t=>(e,i)=>{t&&Tt.update(()=>t(e,i),!1,!0)};class B9 extends Ma{constructor(){super(...arguments),this.removePointerDownListener=Ps}onPointerDown(e){this.session=new Z3(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:X3(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:i,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:m_(e),onStart:m_(i),onMove:m_(n),onEnd:(r,o)=>{delete this.session,s&&Tt.postRender(()=>s(r,o))}}}mount(){this.removePointerDownListener=uf(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let g_=!1;class $9 extends Z.Component{componentDidMount(){const{visualElement:e,layoutGroup:i,switchLayoutGroup:n,layoutId:s}=this.props,{projection:r}=e;r&&(i.group&&i.group.add(r),n&&n.register&&s&&n.register(r),g_&&r.root.didUpdate(),r.addEventListener("animationComplete",()=>{this.safeToRemove()}),r.setOptions({...r.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),jm.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:i,visualElement:n,drag:s,isPresent:r}=this.props,{projection:o}=n;return o&&(o.isPresent=r,e.layoutDependency!==i&&o.setOptions({...o.options,layoutDependency:i}),g_=!0,s||e.layoutDependency!==i||i===void 0||e.isPresent!==r?o.willUpdate():this.safeToRemove(),e.isPresent!==r&&(r?o.promote():o.relegate()||Tt.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),mx.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:i,switchLayoutGroup:n}=this.props,{projection:s}=e;g_=!0,s&&(s.scheduleCheckAfterUnmount(),i&&i.group&&i.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function W3(t){const[e,i]=L3(),n=Z.useContext(YS);return S.jsx($9,{...t,layoutGroup:n,switchLayoutGroup:Z.useContext(I3),isPresent:e,safeToRemove:i})}const z9={pan:{Feature:B9},drag:{Feature:D9,ProjectionNode:Q3,MeasureLayout:W3}};function xA(t,e,i){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover",i==="Start");const s="onHover"+i,r=n[s];r&&Tt.postRender(()=>r(e,cd(e)))}class N9 extends Ma{mount(){const{current:e}=this.node;e&&(this.unmount=cV(e,(i,n)=>(xA(this.node,n,"Start"),s=>xA(this.node,s,"End"))))}unmount(){}}class j9 extends Ma{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=od(Ef(this.node.current,"focus",()=>this.onFocus()),Ef(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function wA(t,e,i){const{props:n}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap",i==="Start");const s="onTap"+(i==="End"?"":i),r=n[s];r&&Tt.postRender(()=>r(e,cd(e)))}class I9 extends Ma{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:i,propagate:n}=this.node.props;this.unmount=mV(e,(s,r)=>(wA(this.node,r,"Start"),(o,{success:l})=>wA(this.node,o,l?"End":"Cancel")),{useGlobalTarget:i,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}}const I1=new WeakMap,O_=new WeakMap,V9=t=>{const e=I1.get(t.target);e&&e(t)},X9=t=>{t.forEach(V9)};function Z9({root:t,...e}){const i=t||document;O_.has(i)||O_.set(i,{});const n=O_.get(i),s=JSON.stringify(e);return n[s]||(n[s]=new IntersectionObserver(X9,{root:t,...e})),n[s]}function q9(t,e,i){const n=Z9(e);return I1.set(t,i),n.observe(t),()=>{I1.delete(t),n.unobserve(t)}}const W9={some:0,all:1};class U9 extends Ma{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:i,margin:n,amount:s="some",once:r}=e,o={root:i?i.current:void 0,rootMargin:n,threshold:typeof s=="number"?s:W9[s]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,r&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:p}=this.node.getProps(),g=u?d:p;g&&g(c)};return q9(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:i}=this.node;["amount","margin","root"].some(Y9(e,i))&&this.startObserver()}unmount(){}}function Y9({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}const H9={inView:{Feature:U9},tap:{Feature:I9},focus:{Feature:j9},hover:{Feature:N9}},F9={layout:{ProjectionNode:Q3,MeasureLayout:W3}},G9={...y9,...H9,...z9,...F9},vo=m9(G9,g9);function K9({roadmap:t,state:e,todos:i}){var p;const{connected:n}=Ea(),s=(t==null?void 0:t.progress_percent)??0,r=(t==null?void 0:t.current_phase)??(e==null?void 0:e.currentPhase)??"--",o=((p=t==null?void 0:t.phases.find(g=>g.number===t.current_phase))==null?void 0:p.name)??"",l=(e==null?void 0:e.blockers.filter(g=>!g.includes("RESOLVED")).length)??0,c=(i==null?void 0:i.pending.length)??0,u=(t==null?void 0:t.completed_phases)??0,d=(t==null?void 0:t.phase_count)??0;return S.jsxs("div",{className:"border-b border-border pb-6",children:[S.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[S.jsx("span",{className:"block w-6 h-px bg-accent"}),S.jsx("span",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"Milestone Progress"}),S.jsxs("span",{className:"ml-auto flex items-center gap-3",children:[S.jsxs("span",{className:"text-xs text-muted-foreground tabular-nums",children:[u,"/",d," phases"]}),S.jsx("span",{className:`inline-block h-1.5 w-1.5 ${n?"bg-success":"bg-danger"}`,title:n?"Connected":"Disconnected"})]})]}),S.jsx("div",{className:"h-1 w-full bg-muted mb-5",children:S.jsx(vo.div,{className:"h-full bg-accent",initial:{width:0},animate:{width:`${s}%`},transition:{duration:.6,ease:"easeOut"}})}),S.jsxs("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-end sm:gap-10",children:[S.jsxs("div",{className:"flex items-end gap-4 sm:gap-10",children:[S.jsxs("div",{children:[S.jsx("span",{className:"font-mono text-3xl font-bold tabular-nums text-foreground leading-none",children:s}),S.jsx("span",{className:"text-sm text-muted-foreground ml-1",children:"%"})]}),S.jsxs("div",{className:"border-l border-border pl-4 sm:pl-10",children:[S.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground block mb-1",children:"Current"}),S.jsxs("div",{className:"flex items-baseline gap-2",children:[S.jsx("span",{className:"font-mono text-sm font-bold text-accent",children:r}),S.jsx("span",{className:"truncate text-sm text-foreground/80 max-w-[140px] sm:max-w-none",children:o})]})]})]}),S.jsxs("div",{className:"flex items-end gap-6 sm:ml-auto sm:gap-8",children:[S.jsxs("div",{children:[S.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground block mb-1",children:"Blockers"}),S.jsx("span",{className:`font-mono text-xl font-bold tabular-nums ${l>0?"text-danger":"text-muted-foreground"}`,children:l})]}),S.jsxs("div",{children:[S.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground block mb-1",children:"Todos"}),S.jsx("span",{className:`font-mono text-xl font-bold tabular-nums ${c>0?"text-warning":"text-muted-foreground"}`,children:c})]})]})]})]})}function J9(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";default:return"bg-muted-foreground/40"}}function eZ(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";default:return"bg-muted-foreground/40"}}function tZ({phaseName:t,phaseNumber:e,completedPlans:i,totalPlans:n,status:s,roadmapComplete:r,isCurrent:o,onClick:l,onToggleComplete:c}){const u=n>0?Math.round(i/n*100):0;return S.jsxs("button",{type:"button",onClick:()=>l(e),className:`group relative w-full text-left transition-colors duration-200 bg-background ${o?"border-l-2 border-l-accent":"border-l-2 border-l-transparent hover:border-l-accent/40"}`,children:[S.jsx("div",{className:"absolute inset-0 pointer-events-none opacity-0 group-hover:opacity-100 transition-opacity duration-200 bg-card-hover"}),S.jsxs("div",{className:"relative flex items-center gap-3 px-4 py-3",children:[c?S.jsx("input",{type:"checkbox",checked:r,onChange:d=>{d.stopPropagation(),c(e,d.target.checked)},onClick:d=>d.stopPropagation(),className:"h-3 w-3 shrink-0 cursor-pointer accent-accent",title:r?"Mark incomplete":"Mark complete"}):S.jsx("span",{className:`inline-block h-1.5 w-1.5 shrink-0 ${eZ(s)}`}),S.jsx("span",{className:`font-mono text-xs font-bold tabular-nums shrink-0 ${o?"text-accent":"text-muted-foreground"}`,children:e}),S.jsx("span",{className:"truncate text-sm text-foreground/90",children:t}),S.jsxs("span",{className:"ml-auto shrink-0 font-mono text-xs text-muted-foreground tabular-nums",children:[i,"/",n]})]}),S.jsx("div",{className:"h-px w-full bg-muted/50",children:S.jsx(vo.div,{className:`h-full ${J9(s)}`,initial:{width:0},animate:{width:`${u}%`},transition:{duration:.5,ease:"easeOut"}})})]})}function iZ({phases:t,currentPhase:e,onPhaseClick:i,onToggleComplete:n}){return S.jsxs("div",{className:"flex flex-col gap-4",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("span",{className:"block w-6 h-px bg-accent"}),S.jsx("span",{className:"text-xs font-medium uppercase tracking-widest text-muted-foreground",children:"Phases"})]}),S.jsx("span",{className:"text-xs text-muted-foreground",children:t.length})]}),t.length===0?S.jsxs("div",{className:"flex flex-col items-center gap-3 border border-border px-4 py-10 text-center",children:[S.jsx("span",{className:"text-sm text-muted-foreground",children:"No project initialized yet."}),S.jsxs("span",{className:"text-sm text-muted-foreground",children:["Run"," ",S.jsx("code",{className:"bg-muted px-1.5 py-0.5 font-mono text-accent text-xs",children:"/maxsim:new-project"})," ","in Claude Code to get started."]})]}):S.jsx("div",{className:"flex flex-col gap-px bg-border",children:t.map(s=>S.jsx(tZ,{phaseNumber:s.number,phaseName:s.name,completedPlans:s.summaryCount,totalPlans:s.planCount,status:s.diskStatus,roadmapComplete:s.roadmapComplete,isCurrent:s.number===e,onClick:i,onToggleComplete:n},s.number))})]})}function U3(t){var e,i,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(i=U3(t[e]))&&(n&&(n+=" "),n+=i)}else for(i in t)t[i]&&(n&&(n+=" "),n+=i);return n}function nZ(){for(var t,e,i=0,n="",s=arguments.length;i<s;i++)(t=arguments[i])&&(e=U3(t))&&(n&&(n+=" "),n+=e);return n}const sZ=(t,e)=>{const i=new Array(t.length+e.length);for(let n=0;n<t.length;n++)i[n]=t[n];for(let n=0;n<e.length;n++)i[t.length+n]=e[n];return i},rZ=(t,e)=>({classGroupId:t,validator:e}),Y3=(t=new Map,e=null,i)=>({nextPart:t,validators:e,classGroupId:i}),vg="-",CA=[],oZ="arbitrary..",aZ=t=>{const e=cZ(t),{conflictingClassGroups:i,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return lZ(o);const l=o.split(vg),c=l[0]===""&&l.length>1?1:0;return H3(l,c,e)},getConflictingClassGroupIds:(o,l)=>{if(l){const c=n[o],u=i[o];return c?u?sZ(u,c):c:u||CA}return i[o]||CA}}},H3=(t,e,i)=>{if(t.length-e===0)return i.classGroupId;const s=t[e],r=i.nextPart.get(s);if(r){const u=H3(t,e+1,r);if(u)return u}const o=i.validators;if(o===null)return;const l=e===0?t.join(vg):t.slice(e).join(vg),c=o.length;for(let u=0;u<c;u++){const d=o[u];if(d.validator(l))return d.classGroupId}},lZ=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),i=e.indexOf(":"),n=e.slice(0,i);return n?oZ+n:void 0})(),cZ=t=>{const{theme:e,classGroups:i}=t;return hZ(i,e)},hZ=(t,e)=>{const i=Y3();for(const n in t){const s=t[n];kx(s,i,n,e)}return i},kx=(t,e,i,n)=>{const s=t.length;for(let r=0;r<s;r++){const o=t[r];uZ(o,e,i,n)}},uZ=(t,e,i,n)=>{if(typeof t=="string"){fZ(t,e,i);return}if(typeof t=="function"){dZ(t,e,i,n);return}pZ(t,e,i,n)},fZ=(t,e,i)=>{const n=t===""?e:F3(e,t);n.classGroupId=i},dZ=(t,e,i,n)=>{if(mZ(t)){kx(t(n),e,i,n);return}e.validators===null&&(e.validators=[]),e.validators.push(rZ(i,t))},pZ=(t,e,i,n)=>{const s=Object.entries(t),r=s.length;for(let o=0;o<r;o++){const[l,c]=s[o];kx(c,F3(e,l),i,n)}},F3=(t,e)=>{let i=t;const n=e.split(vg),s=n.length;for(let r=0;r<s;r++){const o=n[r];let l=i.nextPart.get(o);l||(l=Y3(),i.nextPart.set(o,l)),i=l}return i},mZ=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,gZ=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,i=Object.create(null),n=Object.create(null);const s=(r,o)=>{i[r]=o,e++,e>t&&(e=0,n=i,i=Object.create(null))};return{get(r){let o=i[r];if(o!==void 0)return o;if((o=n[r])!==void 0)return s(r,o),o},set(r,o){r in i?i[r]=o:s(r,o)}}},V1="!",kA=":",OZ=[],TA=(t,e,i,n,s)=>({modifiers:t,hasImportantModifier:e,baseClassName:i,maybePostfixModifierPosition:n,isExternal:s}),vZ=t=>{const{prefix:e,experimentalParseClassName:i}=t;let n=s=>{const r=[];let o=0,l=0,c=0,u;const d=s.length;for(let b=0;b<d;b++){const x=s[b];if(o===0&&l===0){if(x===kA){r.push(s.slice(c,b)),c=b+1;continue}if(x==="/"){u=b;continue}}x==="["?o++:x==="]"?o--:x==="("?l++:x===")"&&l--}const p=r.length===0?s:s.slice(c);let g=p,O=!1;p.endsWith(V1)?(g=p.slice(0,-1),O=!0):p.startsWith(V1)&&(g=p.slice(1),O=!0);const _=u&&u>c?u-c:void 0;return TA(r,O,g,_)};if(e){const s=e+kA,r=n;n=o=>o.startsWith(s)?r(o.slice(s.length)):TA(OZ,!1,o,void 0,!0)}if(i){const s=n;n=r=>i({className:r,parseClassName:s})}return n},_Z=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((i,n)=>{e.set(i,1e6+n)}),i=>{const n=[];let s=[];for(let r=0;r<i.length;r++){const o=i[r],l=o[0]==="[",c=e.has(o);l||c?(s.length>0&&(s.sort(),n.push(...s),s=[]),n.push(o)):s.push(o)}return s.length>0&&(s.sort(),n.push(...s)),n}},yZ=t=>({cache:gZ(t.cacheSize),parseClassName:vZ(t),sortModifiers:_Z(t),...aZ(t)}),bZ=/\s+/,SZ=(t,e)=>{const{parseClassName:i,getClassGroupId:n,getConflictingClassGroupIds:s,sortModifiers:r}=e,o=[],l=t.trim().split(bZ);let c="";for(let u=l.length-1;u>=0;u-=1){const d=l[u],{isExternal:p,modifiers:g,hasImportantModifier:O,baseClassName:_,maybePostfixModifierPosition:b}=i(d);if(p){c=d+(c.length>0?" "+c:c);continue}let x=!!b,w=n(x?_.substring(0,b):_);if(!w){if(!x){c=d+(c.length>0?" "+c:c);continue}if(w=n(_),!w){c=d+(c.length>0?" "+c:c);continue}x=!1}const k=g.length===0?"":g.length===1?g[0]:r(g).join(":"),T=O?k+V1:k,A=T+w;if(o.indexOf(A)>-1)continue;o.push(A);const L=s(w,x);for(let E=0;E<L.length;++E){const z=L[E];o.push(T+z)}c=d+(c.length>0?" "+c:c)}return c},xZ=(...t)=>{let e=0,i,n,s="";for(;e<t.length;)(i=t[e++])&&(n=G3(i))&&(s&&(s+=" "),s+=n);return s},G3=t=>{if(typeof t=="string")return t;let e,i="";for(let n=0;n<t.length;n++)t[n]&&(e=G3(t[n]))&&(i&&(i+=" "),i+=e);return i},wZ=(t,...e)=>{let i,n,s,r;const o=c=>{const u=e.reduce((d,p)=>p(d),t());return i=yZ(u),n=i.cache.get,s=i.cache.set,r=l,l(c)},l=c=>{const u=n(c);if(u)return u;const d=SZ(c,i);return s(c,d),d};return r=o,(...c)=>r(xZ(...c))},CZ=[],pi=t=>{const e=i=>i[t]||CZ;return e.isThemeGetter=!0,e},K3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,J3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,kZ=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,TZ=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,AZ=/\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$/,EZ=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,MZ=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,PZ=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Jo=t=>kZ.test(t),qe=t=>!!t&&!Number.isNaN(Number(t)),ea=t=>!!t&&Number.isInteger(Number(t)),v_=t=>t.endsWith("%")&&qe(t.slice(0,-1)),to=t=>TZ.test(t),eD=()=>!0,RZ=t=>AZ.test(t)&&!EZ.test(t),Tx=()=>!1,QZ=t=>MZ.test(t),LZ=t=>PZ.test(t),DZ=t=>!ke(t)&&!Ae(t),BZ=t=>Pa(t,nD,Tx),ke=t=>K3.test(t),el=t=>Pa(t,sD,RZ),AA=t=>Pa(t,ZZ,qe),$Z=t=>Pa(t,oD,eD),zZ=t=>Pa(t,rD,Tx),EA=t=>Pa(t,tD,Tx),NZ=t=>Pa(t,iD,LZ),Yp=t=>Pa(t,aD,QZ),Ae=t=>J3.test(t),Cu=t=>Ql(t,sD),jZ=t=>Ql(t,rD),MA=t=>Ql(t,tD),IZ=t=>Ql(t,nD),VZ=t=>Ql(t,iD),Hp=t=>Ql(t,aD,!0),XZ=t=>Ql(t,oD,!0),Pa=(t,e,i)=>{const n=K3.exec(t);return n?n[1]?e(n[1]):i(n[2]):!1},Ql=(t,e,i=!1)=>{const n=J3.exec(t);return n?n[1]?e(n[1]):i:!1},tD=t=>t==="position"||t==="percentage",iD=t=>t==="image"||t==="url",nD=t=>t==="length"||t==="size"||t==="bg-size",sD=t=>t==="length",ZZ=t=>t==="number",rD=t=>t==="family-name",oD=t=>t==="number"||t==="weight",aD=t=>t==="shadow",qZ=()=>{const t=pi("color"),e=pi("font"),i=pi("text"),n=pi("font-weight"),s=pi("tracking"),r=pi("leading"),o=pi("breakpoint"),l=pi("container"),c=pi("spacing"),u=pi("radius"),d=pi("shadow"),p=pi("inset-shadow"),g=pi("text-shadow"),O=pi("drop-shadow"),_=pi("blur"),b=pi("perspective"),x=pi("aspect"),w=pi("ease"),k=pi("animate"),T=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],L=()=>[...A(),Ae,ke],E=()=>["auto","hidden","clip","visible","scroll"],z=()=>["auto","contain","none"],N=()=>[Ae,ke,c],q=()=>[Jo,"full","auto",...N()],J=()=>[ea,"none","subgrid",Ae,ke],U=()=>["auto",{span:["full",ea,Ae,ke]},ea,Ae,ke],R=()=>[ea,"auto",Ae,ke],B=()=>["auto","min","max","fr",Ae,ke],D=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],j=()=>["start","end","center","stretch","center-safe","end-safe"],$=()=>["auto",...N()],X=()=>[Jo,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...N()],H=()=>[Jo,"screen","full","dvw","lvw","svw","min","max","fit",...N()],F=()=>[Jo,"screen","full","lh","dvh","lvh","svh","min","max","fit",...N()],M=()=>[t,Ae,ke],I=()=>[...A(),MA,EA,{position:[Ae,ke]}],K=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Q=()=>["auto","cover","contain",IZ,BZ,{size:[Ae,ke]}],ue=()=>[v_,Cu,el],he=()=>["","none","full",u,Ae,ke],fe=()=>["",qe,Cu,el],Oe=()=>["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"],ye=()=>[qe,v_,MA,EA],nt=()=>["","none",_,Ae,ke],Qt=()=>["none",qe,Ae,ke],Yt=()=>["none",qe,Ae,ke],ei=()=>[qe,Ae,ke],Le=()=>[Jo,"full",...N()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[to],breakpoint:[to],color:[eD],container:[to],"drop-shadow":[to],ease:["in","out","in-out"],font:[DZ],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[to],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[to],shadow:[to],spacing:["px",qe],text:[to],"text-shadow":[to],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Jo,ke,Ae,x]}],container:["container"],columns:[{columns:[qe,ke,Ae,l]}],"break-after":[{"break-after":T()}],"break-before":[{"break-before":T()}],"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:L()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:z()}],"overscroll-x":[{"overscroll-x":z()}],"overscroll-y":[{"overscroll-y":z()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:q()}],"inset-x":[{"inset-x":q()}],"inset-y":[{"inset-y":q()}],start:[{"inset-s":q(),start:q()}],end:[{"inset-e":q(),end:q()}],"inset-bs":[{"inset-bs":q()}],"inset-be":[{"inset-be":q()}],top:[{top:q()}],right:[{right:q()}],bottom:[{bottom:q()}],left:[{left:q()}],visibility:["visible","invisible","collapse"],z:[{z:[ea,"auto",Ae,ke]}],basis:[{basis:[Jo,"full","auto",l,...N()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[qe,Jo,"auto","initial","none",ke]}],grow:[{grow:["",qe,Ae,ke]}],shrink:[{shrink:["",qe,Ae,ke]}],order:[{order:[ea,"first","last","none",Ae,ke]}],"grid-cols":[{"grid-cols":J()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":J()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":B()}],"auto-rows":[{"auto-rows":B()}],gap:[{gap:N()}],"gap-x":[{"gap-x":N()}],"gap-y":[{"gap-y":N()}],"justify-content":[{justify:[...D(),"normal"]}],"justify-items":[{"justify-items":[...j(),"normal"]}],"justify-self":[{"justify-self":["auto",...j()]}],"align-content":[{content:["normal",...D()]}],"align-items":[{items:[...j(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...j(),{baseline:["","last"]}]}],"place-content":[{"place-content":D()}],"place-items":[{"place-items":[...j(),"baseline"]}],"place-self":[{"place-self":["auto",...j()]}],p:[{p:N()}],px:[{px:N()}],py:[{py:N()}],ps:[{ps:N()}],pe:[{pe:N()}],pbs:[{pbs:N()}],pbe:[{pbe:N()}],pt:[{pt:N()}],pr:[{pr:N()}],pb:[{pb:N()}],pl:[{pl:N()}],m:[{m:$()}],mx:[{mx:$()}],my:[{my:$()}],ms:[{ms:$()}],me:[{me:$()}],mbs:[{mbs:$()}],mbe:[{mbe:$()}],mt:[{mt:$()}],mr:[{mr:$()}],mb:[{mb:$()}],ml:[{ml:$()}],"space-x":[{"space-x":N()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":N()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],"inline-size":[{inline:["auto",...H()]}],"min-inline-size":[{"min-inline":["auto",...H()]}],"max-inline-size":[{"max-inline":["none",...H()]}],"block-size":[{block:["auto",...F()]}],"min-block-size":[{"min-block":["auto",...F()]}],"max-block-size":[{"max-block":["none",...F()]}],w:[{w:[l,"screen",...X()]}],"min-w":[{"min-w":[l,"screen","none",...X()]}],"max-w":[{"max-w":[l,"screen","none","prose",{screen:[o]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",i,Cu,el]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,XZ,$Z]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",v_,ke]}],"font-family":[{font:[jZ,zZ,e]}],"font-features":[{"font-features":[ke]}],"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:[s,Ae,ke]}],"line-clamp":[{"line-clamp":[qe,"none",Ae,AA]}],leading:[{leading:[r,...N()]}],"list-image":[{"list-image":["none",Ae,ke]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ae,ke]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:M()}],"text-color":[{text:M()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Oe(),"wavy"]}],"text-decoration-thickness":[{decoration:[qe,"from-font","auto",Ae,el]}],"text-decoration-color":[{decoration:M()}],"underline-offset":[{"underline-offset":[qe,"auto",Ae,ke]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:N()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ae,ke]}],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",Ae,ke]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:K()}],"bg-size":[{bg:Q()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ea,Ae,ke],radial:["",Ae,ke],conic:[ea,Ae,ke]},VZ,NZ]}],"bg-color":[{bg:M()}],"gradient-from-pos":[{from:ue()}],"gradient-via-pos":[{via:ue()}],"gradient-to-pos":[{to:ue()}],"gradient-from":[{from:M()}],"gradient-via":[{via:M()}],"gradient-to":[{to:M()}],rounded:[{rounded:he()}],"rounded-s":[{"rounded-s":he()}],"rounded-e":[{"rounded-e":he()}],"rounded-t":[{"rounded-t":he()}],"rounded-r":[{"rounded-r":he()}],"rounded-b":[{"rounded-b":he()}],"rounded-l":[{"rounded-l":he()}],"rounded-ss":[{"rounded-ss":he()}],"rounded-se":[{"rounded-se":he()}],"rounded-ee":[{"rounded-ee":he()}],"rounded-es":[{"rounded-es":he()}],"rounded-tl":[{"rounded-tl":he()}],"rounded-tr":[{"rounded-tr":he()}],"rounded-br":[{"rounded-br":he()}],"rounded-bl":[{"rounded-bl":he()}],"border-w":[{border:fe()}],"border-w-x":[{"border-x":fe()}],"border-w-y":[{"border-y":fe()}],"border-w-s":[{"border-s":fe()}],"border-w-e":[{"border-e":fe()}],"border-w-bs":[{"border-bs":fe()}],"border-w-be":[{"border-be":fe()}],"border-w-t":[{"border-t":fe()}],"border-w-r":[{"border-r":fe()}],"border-w-b":[{"border-b":fe()}],"border-w-l":[{"border-l":fe()}],"divide-x":[{"divide-x":fe()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":fe()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Oe(),"hidden","none"]}],"divide-style":[{divide:[...Oe(),"hidden","none"]}],"border-color":[{border:M()}],"border-color-x":[{"border-x":M()}],"border-color-y":[{"border-y":M()}],"border-color-s":[{"border-s":M()}],"border-color-e":[{"border-e":M()}],"border-color-bs":[{"border-bs":M()}],"border-color-be":[{"border-be":M()}],"border-color-t":[{"border-t":M()}],"border-color-r":[{"border-r":M()}],"border-color-b":[{"border-b":M()}],"border-color-l":[{"border-l":M()}],"divide-color":[{divide:M()}],"outline-style":[{outline:[...Oe(),"none","hidden"]}],"outline-offset":[{"outline-offset":[qe,Ae,ke]}],"outline-w":[{outline:["",qe,Cu,el]}],"outline-color":[{outline:M()}],shadow:[{shadow:["","none",d,Hp,Yp]}],"shadow-color":[{shadow:M()}],"inset-shadow":[{"inset-shadow":["none",p,Hp,Yp]}],"inset-shadow-color":[{"inset-shadow":M()}],"ring-w":[{ring:fe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:M()}],"ring-offset-w":[{"ring-offset":[qe,el]}],"ring-offset-color":[{"ring-offset":M()}],"inset-ring-w":[{"inset-ring":fe()}],"inset-ring-color":[{"inset-ring":M()}],"text-shadow":[{"text-shadow":["none",g,Hp,Yp]}],"text-shadow-color":[{"text-shadow":M()}],opacity:[{opacity:[qe,Ae,ke]}],"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":[qe]}],"mask-image-linear-from-pos":[{"mask-linear-from":ye()}],"mask-image-linear-to-pos":[{"mask-linear-to":ye()}],"mask-image-linear-from-color":[{"mask-linear-from":M()}],"mask-image-linear-to-color":[{"mask-linear-to":M()}],"mask-image-t-from-pos":[{"mask-t-from":ye()}],"mask-image-t-to-pos":[{"mask-t-to":ye()}],"mask-image-t-from-color":[{"mask-t-from":M()}],"mask-image-t-to-color":[{"mask-t-to":M()}],"mask-image-r-from-pos":[{"mask-r-from":ye()}],"mask-image-r-to-pos":[{"mask-r-to":ye()}],"mask-image-r-from-color":[{"mask-r-from":M()}],"mask-image-r-to-color":[{"mask-r-to":M()}],"mask-image-b-from-pos":[{"mask-b-from":ye()}],"mask-image-b-to-pos":[{"mask-b-to":ye()}],"mask-image-b-from-color":[{"mask-b-from":M()}],"mask-image-b-to-color":[{"mask-b-to":M()}],"mask-image-l-from-pos":[{"mask-l-from":ye()}],"mask-image-l-to-pos":[{"mask-l-to":ye()}],"mask-image-l-from-color":[{"mask-l-from":M()}],"mask-image-l-to-color":[{"mask-l-to":M()}],"mask-image-x-from-pos":[{"mask-x-from":ye()}],"mask-image-x-to-pos":[{"mask-x-to":ye()}],"mask-image-x-from-color":[{"mask-x-from":M()}],"mask-image-x-to-color":[{"mask-x-to":M()}],"mask-image-y-from-pos":[{"mask-y-from":ye()}],"mask-image-y-to-pos":[{"mask-y-to":ye()}],"mask-image-y-from-color":[{"mask-y-from":M()}],"mask-image-y-to-color":[{"mask-y-to":M()}],"mask-image-radial":[{"mask-radial":[Ae,ke]}],"mask-image-radial-from-pos":[{"mask-radial-from":ye()}],"mask-image-radial-to-pos":[{"mask-radial-to":ye()}],"mask-image-radial-from-color":[{"mask-radial-from":M()}],"mask-image-radial-to-color":[{"mask-radial-to":M()}],"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":A()}],"mask-image-conic-pos":[{"mask-conic":[qe]}],"mask-image-conic-from-pos":[{"mask-conic-from":ye()}],"mask-image-conic-to-pos":[{"mask-conic-to":ye()}],"mask-image-conic-from-color":[{"mask-conic-from":M()}],"mask-image-conic-to-color":[{"mask-conic-to":M()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:K()}],"mask-size":[{mask:Q()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ae,ke]}],filter:[{filter:["","none",Ae,ke]}],blur:[{blur:nt()}],brightness:[{brightness:[qe,Ae,ke]}],contrast:[{contrast:[qe,Ae,ke]}],"drop-shadow":[{"drop-shadow":["","none",O,Hp,Yp]}],"drop-shadow-color":[{"drop-shadow":M()}],grayscale:[{grayscale:["",qe,Ae,ke]}],"hue-rotate":[{"hue-rotate":[qe,Ae,ke]}],invert:[{invert:["",qe,Ae,ke]}],saturate:[{saturate:[qe,Ae,ke]}],sepia:[{sepia:["",qe,Ae,ke]}],"backdrop-filter":[{"backdrop-filter":["","none",Ae,ke]}],"backdrop-blur":[{"backdrop-blur":nt()}],"backdrop-brightness":[{"backdrop-brightness":[qe,Ae,ke]}],"backdrop-contrast":[{"backdrop-contrast":[qe,Ae,ke]}],"backdrop-grayscale":[{"backdrop-grayscale":["",qe,Ae,ke]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[qe,Ae,ke]}],"backdrop-invert":[{"backdrop-invert":["",qe,Ae,ke]}],"backdrop-opacity":[{"backdrop-opacity":[qe,Ae,ke]}],"backdrop-saturate":[{"backdrop-saturate":[qe,Ae,ke]}],"backdrop-sepia":[{"backdrop-sepia":["",qe,Ae,ke]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":N()}],"border-spacing-x":[{"border-spacing-x":N()}],"border-spacing-y":[{"border-spacing-y":N()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ae,ke]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[qe,"initial",Ae,ke]}],ease:[{ease:["linear","initial",w,Ae,ke]}],delay:[{delay:[qe,Ae,ke]}],animate:[{animate:["none",k,Ae,ke]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ae,ke]}],"perspective-origin":[{"perspective-origin":L()}],rotate:[{rotate:Qt()}],"rotate-x":[{"rotate-x":Qt()}],"rotate-y":[{"rotate-y":Qt()}],"rotate-z":[{"rotate-z":Qt()}],scale:[{scale:Yt()}],"scale-x":[{"scale-x":Yt()}],"scale-y":[{"scale-y":Yt()}],"scale-z":[{"scale-z":Yt()}],"scale-3d":["scale-3d"],skew:[{skew:ei()}],"skew-x":[{"skew-x":ei()}],"skew-y":[{"skew-y":ei()}],transform:[{transform:[Ae,ke,"","none","gpu","cpu"]}],"transform-origin":[{origin:L()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Le()}],"translate-x":[{"translate-x":Le()}],"translate-y":[{"translate-y":Le()}],"translate-z":[{"translate-z":Le()}],"translate-none":["translate-none"],accent:[{accent:M()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:M()}],"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",Ae,ke]}],"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":N()}],"scroll-mx":[{"scroll-mx":N()}],"scroll-my":[{"scroll-my":N()}],"scroll-ms":[{"scroll-ms":N()}],"scroll-me":[{"scroll-me":N()}],"scroll-mbs":[{"scroll-mbs":N()}],"scroll-mbe":[{"scroll-mbe":N()}],"scroll-mt":[{"scroll-mt":N()}],"scroll-mr":[{"scroll-mr":N()}],"scroll-mb":[{"scroll-mb":N()}],"scroll-ml":[{"scroll-ml":N()}],"scroll-p":[{"scroll-p":N()}],"scroll-px":[{"scroll-px":N()}],"scroll-py":[{"scroll-py":N()}],"scroll-ps":[{"scroll-ps":N()}],"scroll-pe":[{"scroll-pe":N()}],"scroll-pbs":[{"scroll-pbs":N()}],"scroll-pbe":[{"scroll-pbe":N()}],"scroll-pt":[{"scroll-pt":N()}],"scroll-pr":[{"scroll-pr":N()}],"scroll-pb":[{"scroll-pb":N()}],"scroll-pl":[{"scroll-pl":N()}],"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",Ae,ke]}],fill:[{fill:["none",...M()]}],"stroke-w":[{stroke:[qe,Cu,el,AA]}],stroke:[{stroke:["none",...M()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},WZ=wZ(qZ);function Fe(...t){return WZ(nZ(t))}function UZ(t){const[e,i]=Z.useState(null),[n,s]=Z.useState(!1),[r,o]=Z.useState(null),{lastChange:l}=Ea(),c=Z.useCallback(async()=>{if(!t){i(null),s(!1),o(null);return}s(!0),o(null);try{const u=await fetch(`/api/phase/${encodeURIComponent(t)}`);if(!u.ok){const p=await u.json().catch(()=>({}));throw new Error(p.error||`Failed to fetch phase ${t} (${u.status})`)}const d=await u.json();i(d)}catch(u){o(u instanceof Error?u.message:"Unknown error")}finally{s(!1)}},[t]);return Z.useEffect(()=>{c()},[c]),Z.useEffect(()=>{l>0&&c()},[l,c]),{plans:(e==null?void 0:e.plans)??[],context:(e==null?void 0:e.context)??null,research:(e==null?void 0:e.research)??null,loading:n,error:r,refetch:c}}function YZ({tasks:t,planPath:e,planContent:i,onContentChange:n}){const s=Z.useCallback(async r=>{const o=t[r];if(!o)return;let l=i;const c=o.name.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d=new RegExp(`<name>\\s*${c}\\s*</name>`).exec(l);if(d){const p=l.slice(d.index),g=p.match(/<done>([\s\S]*?)<\/done>/);if(g){const O=g[1],_=d.index+p.indexOf(g[0]),b=_+g[0].length,x=/^\s*\[x\]/i.test(O);let w;x?w=O.replace(/^\s*\[x\]\s*/i,""):w=`[x] ${O.trim()}`,l=l.slice(0,_)+`<done>${w}</done>`+l.slice(b)}}if(l!==i){n(l);try{const g=e.replace(/^\.planning[\\/]/,"").split(/[\\/]/);await fetch(`/api/plan/${g.join("/")}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:l})})}catch(p){console.error("[task-list] Failed to write checkbox change:",p)}}},[t,e,i,n]);return t.length===0?S.jsx("p",{className:"text-sm text-muted-foreground italic",children:"No tasks defined"}):S.jsx("div",{className:"space-y-1",children:t.map((r,o)=>S.jsxs("div",{className:Fe("flex items-start gap-2 py-1 px-2 rounded-md transition-colors","hover:bg-muted/50",r.completed&&"opacity-60"),children:[S.jsx("button",{type:"button",onClick:()=>s(o),className:Fe("mt-0.5 flex-shrink-0 w-4 h-4 rounded-sm border transition-colors","focus:outline-none focus:ring-2 focus:ring-accent/50",r.completed?"bg-success border-success text-background":"border-muted-foreground hover:border-accent"),"aria-label":`Toggle ${r.name}`,children:r.completed&&S.jsx("svg",{className:"w-4 h-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M3 8l3 3 7-7"})})}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:Fe("text-sm font-sans",r.completed&&"line-through text-muted-foreground"),children:r.name}),S.jsx("span",{className:Fe("text-xs px-1.5 py-0.5 rounded-sm font-mono",r.type.startsWith("checkpoint")?"bg-warning/20 text-warning":"bg-muted text-muted-foreground"),children:r.type})]}),r.files.length>0&&S.jsx("div",{className:"mt-0.5",children:r.files.map((l,c)=>S.jsx("span",{className:"text-xs font-mono text-muted-foreground mr-2",children:l},c))})]})]},o))})}function HZ({plan:t,onEdit:e}){const[i,n]=Z.useState(t.content),s=t.frontmatter,r=s.plan??"?",o=s.wave,l=s.autonomous,c=s.depends_on??[],u=s.files_modified??[];let d="";const p=t.content.match(/<objective>([\s\S]*?)<\/objective>/);if(p){const _=p[1].trim().split(`
58
+ `)[0];d=_.length>120?_.slice(0,117)+"...":_}const g=Z.useCallback(O=>{n(O)},[]);return S.jsxs("div",{className:"border border-border bg-card transition-colors hover:bg-card-hover",children:[S.jsxs("div",{className:"flex items-center justify-between border-b border-border px-4 py-3",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsxs("span",{className:"font-mono text-sm font-bold text-accent tabular-nums",children:["#",String(r).padStart(2,"0")]}),o!==void 0&&S.jsxs("span",{className:"font-mono text-[9px] uppercase tracking-widest px-1.5 py-0.5 border border-accent/20 text-accent/70",children:["Wave ",o]}),l&&S.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-1.5 py-0.5 border border-success/20 text-success",children:"Auto"})]}),S.jsx("button",{type:"button",onClick:()=>e(t.path),className:Fe("font-mono text-[10px] uppercase tracking-widest px-3 py-1","border border-border text-muted-foreground","hover:border-accent hover:text-accent","transition-colors"),children:"Edit"})]}),S.jsxs("div",{className:"px-4 py-3",children:[d&&S.jsx("p",{className:"text-sm text-muted-foreground mb-3 leading-relaxed",children:d}),S.jsxs("div",{className:"flex gap-4 mb-3 font-mono text-[10px] text-muted-foreground",children:[c.length>0&&S.jsxs("span",{children:["deps: ",c.join(", ")]}),u.length>0&&S.jsxs("span",{children:[u.length," file",u.length!==1?"s":""]}),S.jsxs("span",{children:[t.tasks.length," task",t.tasks.length!==1?"s":""]})]}),S.jsx(YZ,{tasks:t.tasks,planPath:t.path,planContent:i,onContentChange:g})]})]})}function X1(){return X1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)({}).hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},X1.apply(null,arguments)}function FZ(t,e){if(t==null)return{};var i={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;i[n]=t[n]}return i}let Z1=[],lD=[];(()=>{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,i=0;e<t.length;e++)(e%2?lD:Z1).push(i=i+t[e])})();function GZ(t){if(t<768)return!1;for(let e=0,i=Z1.length;;){let n=e+i>>1;if(t<Z1[n])i=n;else if(t>=lD[n])e=n+1;else return!0;if(e==i)return!1}}function PA(t){return t>=127462&&t<=127487}const RA=8205;function KZ(t,e,i=!0,n=!0){return(i?cD:JZ)(t,e,n)}function cD(t,e,i){if(e==t.length)return e;e&&hD(t.charCodeAt(e))&&uD(t.charCodeAt(e-1))&&e--;let n=__(t,e);for(e+=QA(n);e<t.length;){let s=__(t,e);if(n==RA||s==RA||i&&GZ(s))e+=QA(s),n=s;else if(PA(s)){let r=0,o=e-2;for(;o>=0&&PA(__(t,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function JZ(t,e,i){for(;e>0;){let n=cD(t,e-2,i);if(n<e)return n;e--}return 0}function __(t,e){let i=t.charCodeAt(e);if(!uD(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return hD(n)?(i-55296<<10)+(n-56320)+65536:i}function hD(t){return t>=56320&&t<57344}function uD(t){return t>=55296&&t<56320}function QA(t){return t<65536?1:2}let at=class fD{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,i,n){[e,i]=sh(this,e,i);let s=[];return this.decompose(0,e,s,2),n.length&&n.decompose(0,n.length,s,3),this.decompose(i,this.length,s,1),mr.from(s,this.length-(i-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,i=this.length){[e,i]=sh(this,e,i);let n=[];return this.decompose(e,i,n,0),mr.from(n,i-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let i=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),s=new ff(this),r=new ff(e);for(let o=i,l=i;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=n)return!0}}iter(e=1){return new ff(this,e)}iterRange(e,i=this.length){return new dD(this,e,i)}iterLines(e,i){let n;if(e==null)n=this.iter();else{i==null&&(i=this.lines+1);let s=this.line(e).from;n=this.iterRange(s,Math.max(s,i==this.lines+1?this.length:i<=1?0:this.line(i-1).to))}return new pD(n)}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]?fD.empty:e.length<=32?new Kt(e):mr.from(Kt.split(e,[]))}};class Kt extends at{constructor(e,i=eq(e)){super(),this.text=e,this.length=i}get lines(){return this.text.length}get children(){return null}lineInner(e,i,n,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((i?n:l)>=e)return new tq(s,l,n,o);s=l+1,n++}}decompose(e,i,n,s){let r=e<=0&&i>=this.length?this:new Kt(LA(this.text,e,i),Math.min(i,this.length)-Math.max(0,e));if(s&1){let o=n.pop(),l=Im(r.text,o.text.slice(),0,r.length);if(l.length<=32)n.push(new Kt(l,o.length+r.length));else{let c=l.length>>1;n.push(new Kt(l.slice(0,c)),new Kt(l.slice(c)))}}else n.push(r)}replace(e,i,n){if(!(n instanceof Kt))return super.replace(e,i,n);[e,i]=sh(this,e,i);let s=Im(this.text,Im(n.text,LA(this.text,0,e)),i),r=this.length+n.length-(i-e);return s.length<=32?new Kt(s,r):mr.from(Kt.split(s,[]),r)}sliceString(e,i=this.length,n=`
59
+ `){[e,i]=sh(this,e,i);let s="";for(let r=0,o=0;r<=i&&o<this.text.length;o++){let l=this.text[o],c=r+l.length;r>e&&o&&(s+=n),e<c&&i>r&&(s+=l.slice(Math.max(0,e-r),i-r)),r=c+1}return s}flatten(e){for(let i of this.text)e.push(i)}scanIdentical(){return 0}static split(e,i){let n=[],s=-1;for(let r of e)n.push(r),s+=r.length+1,n.length==32&&(i.push(new Kt(n,s)),n=[],s=-1);return s>-1&&i.push(new Kt(n,s)),i}}class mr extends at{constructor(e,i){super(),this.children=e,this.length=i,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,i,n,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,c=n+o.lines-1;if((i?c:l)>=e)return o.lineInner(e,i,n,s);s=l+1,n=c+1}}decompose(e,i,n,s){for(let r=0,o=0;o<=i&&r<this.children.length;r++){let l=this.children[r],c=o+l.length;if(e<=c&&i>=o){let u=s&((o<=e?1:0)|(c>=i?2:0));o>=e&&c<=i&&!u?n.push(l):l.decompose(e-o,i-o,n,u)}o=c+1}}replace(e,i,n){if([e,i]=sh(this,e,i),n.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&i<=l){let c=o.replace(e-r,i-r,n),u=this.lines-o.lines+c.lines;if(c.lines<u>>4&&c.lines>u>>6){let d=this.children.slice();return d[s]=c,new mr(d,this.length-(i-e)+n.length)}return super.replace(r,l,c)}r=l+1}return super.replace(e,i,n)}sliceString(e,i=this.length,n=`
60
+ `){[e,i]=sh(this,e,i);let s="";for(let r=0,o=0;r<this.children.length&&o<=i;r++){let l=this.children[r],c=o+l.length;o>e&&r&&(s+=n),e<c&&i>o&&(s+=l.sliceString(e-o,i-o,n)),o=c+1}return s}flatten(e){for(let i of this.children)i.flatten(e)}scanIdentical(e,i){if(!(e instanceof mr))return 0;let n=0,[s,r,o,l]=i>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=i,r+=i){if(s==o||r==l)return n;let c=this.children[s],u=e.children[r];if(c!=u)return n+c.scanIdentical(u,i);n+=c.length+1}}static from(e,i=e.reduce((n,s)=>n+s.length+1,-1)){let n=0;for(let O of e)n+=O.lines;if(n<32){let O=[];for(let _ of e)_.flatten(O);return new Kt(O,i)}let s=Math.max(32,n>>5),r=s<<1,o=s>>1,l=[],c=0,u=-1,d=[];function p(O){let _;if(O.lines>r&&O instanceof mr)for(let b of O.children)p(b);else O.lines>o&&(c>o||!c)?(g(),l.push(O)):O instanceof Kt&&c&&(_=d[d.length-1])instanceof Kt&&O.lines+_.lines<=32?(c+=O.lines,u+=O.length+1,d[d.length-1]=new Kt(_.text.concat(O.text),_.length+1+O.length)):(c+O.lines>s&&g(),c+=O.lines,u+=O.length+1,d.push(O))}function g(){c!=0&&(l.push(d.length==1?d[0]:mr.from(d,u)),u=-1,c=d.length=0)}for(let O of e)p(O);return g(),l.length==1?l[0]:new mr(l,i)}}at.empty=new Kt([""],0);function eq(t){let e=-1;for(let i of t)e+=i.length+1;return e}function Im(t,e,i=0,n=1e9){for(let s=0,r=0,o=!0;r<t.length&&s<=n;r++){let l=t[r],c=s+l.length;c>=i&&(c>n&&(l=l.slice(0,n-s)),s<i&&(l=l.slice(i-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=c+1}return e}function LA(t,e,i){return Im(t,[""],e,i)}class ff{constructor(e,i=1){this.dir=i,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[i>0?1:(e instanceof Kt?e.text.length:e.children.length)<<1]}nextInner(e,i){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,s=this.nodes[n],r=this.offsets[n],o=r>>1,l=s instanceof Kt?s.text.length:s.children.length;if(o==(i>0?l:0)){if(n==0)return this.done=!0,this.value="",this;i>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(i>0?0:1)){if(this.offsets[n]+=i,e==0)return this.lineBreak=!0,this.value=`
61
+ `,this;e--}else if(s instanceof Kt){let c=s.text[o+(i<0?-1:0)];if(this.offsets[n]+=i,c.length>Math.max(0,e))return this.value=e==0?c:i>0?c.slice(e):c.slice(0,c.length-e),this;e-=c.length}else{let c=s.children[o+(i<0?-1:0)];e>c.length?(e-=c.length,this.offsets[n]+=i):(i<0&&this.offsets[n]--,this.nodes.push(c),this.offsets.push(i>0?1:(c instanceof Kt?c.text.length:c.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class dD{constructor(e,i,n){this.value="",this.done=!1,this.cursor=new ff(e,i>n?-1:1),this.pos=i>n?e.length:0,this.from=Math.min(i,n),this.to=Math.max(i,n)}nextInner(e,i){if(i<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,i<0?this.pos-this.to:this.from-this.pos);let n=i<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*i,this.value=s.length<=n?s:i<0?s.slice(s.length-n):s.slice(0,n),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 pD{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:i,lineBreak:n,value:s}=this.inner.next(e);return i&&this.afterBreak?(this.value="",this.afterBreak=!1):i?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(at.prototype[Symbol.iterator]=function(){return this.iter()},ff.prototype[Symbol.iterator]=dD.prototype[Symbol.iterator]=pD.prototype[Symbol.iterator]=function(){return this});let tq=class{constructor(e,i,n,s){this.from=e,this.to=i,this.number=n,this.text=s}get length(){return this.to-this.from}};function sh(t,e,i){return e=Math.max(0,Math.min(t.length,e)),[e,Math.max(e,Math.min(t.length,i))]}function Di(t,e,i=!0,n=!0){return KZ(t,e,i,n)}function iq(t){return t>=56320&&t<57344}function nq(t){return t>=55296&&t<56320}function Ln(t,e){let i=t.charCodeAt(e);if(!nq(i)||e+1==t.length)return i;let n=t.charCodeAt(e+1);return iq(n)?(i-55296<<10)+(n-56320)+65536:i}function Ax(t){return t<=65535?String.fromCharCode(t):(t-=65536,String.fromCharCode((t>>10)+55296,(t&1023)+56320))}function gr(t){return t<65536?1:2}const q1=/\r\n?|\n/;var Fi=(function(t){return t[t.Simple=0]="Simple",t[t.TrackDel=1]="TrackDel",t[t.TrackBefore=2]="TrackBefore",t[t.TrackAfter=3]="TrackAfter",t})(Fi||(Fi={}));class Cr{constructor(e){this.sections=e}get length(){let e=0;for(let i=0;i<this.sections.length;i+=2)e+=this.sections[i];return e}get newLength(){let e=0;for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i+1];e+=n<0?this.sections[i]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let i=0,n=0,s=0;i<this.sections.length;){let r=this.sections[i++],o=this.sections[i++];o<0?(e(n,s,r),s+=r):s+=o,n+=r}}iterChangedRanges(e,i=!1){W1(this,e,i)}get invertedDesc(){let e=[];for(let i=0;i<this.sections.length;){let n=this.sections[i++],s=this.sections[i++];s<0?e.push(n,s):e.push(s,n)}return new Cr(e)}composeDesc(e){return this.empty?e:e.empty?this:mD(this,e)}mapDesc(e,i=!1){return e.empty?this:U1(this,e,i)}mapPos(e,i=-1,n=Fi.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],c=this.sections[o++],u=s+l;if(c<0){if(u>e)return r+(e-s);r+=l}else{if(n!=Fi.Simple&&u>=e&&(n==Fi.TrackDel&&s<e&&u>e||n==Fi.TrackBefore&&s<e||n==Fi.TrackAfter&&u>e))return null;if(u>e||u==e&&i<0&&!l)return e==s||i<0?r:r+c;r+=c}s=u}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,i=e){for(let n=0,s=0;n<this.sections.length&&s<=i;){let r=this.sections[n++],o=this.sections[n++],l=s+r;if(o>=0&&s<=i&&l>=e)return s<e&&l>i?"cover":!0;s=l}return!1}toString(){let e="";for(let i=0;i<this.sections.length;){let n=this.sections[i++],s=this.sections[i++];e+=(e?" ":"")+n+(s>=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(i=>typeof i!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Cr(e)}static create(e){return new Cr(e)}}class vi extends Cr{constructor(e,i){super(e),this.inserted=i}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return W1(this,(i,n,s,r,o)=>e=e.replace(s,s+(n-i),o),!1),e}mapDesc(e,i=!1){return U1(this,e,i,!0)}invert(e){let i=this.sections.slice(),n=[];for(let s=0,r=0;s<i.length;s+=2){let o=i[s],l=i[s+1];if(l>=0){i[s]=l,i[s+1]=o;let c=s>>1;for(;n.length<c;)n.push(at.empty);n.push(o?e.slice(r,r+o):at.empty)}r+=o}return new vi(i,n)}compose(e){return this.empty?e:e.empty?this:mD(this,e,!0)}map(e,i=!1){return e.empty?this:U1(this,e,i,!0)}iterChanges(e,i=!1){W1(this,e,i)}get desc(){return Cr.create(this.sections)}filter(e){let i=[],n=[],s=[],r=new Mf(this);e:for(let o=0,l=0;;){let c=o==e.length?1e9:e[o++];for(;l<c||l==c&&r.len==0;){if(r.done)break e;let d=Math.min(r.len,c-l);tn(s,d,-1);let p=r.ins==-1?-1:r.off==0?r.ins:0;tn(i,d,p),p>0&&Oa(n,i,r.text),r.forward(d),l+=d}let u=e[o++];for(;l<u;){if(r.done)break e;let d=Math.min(r.len,u-l);tn(i,d,-1),tn(s,d,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(d),l+=d}}return{changes:new vi(i,n),filtered:Cr.create(s)}}toJSON(){let e=[];for(let i=0;i<this.sections.length;i+=2){let n=this.sections[i],s=this.sections[i+1];s<0?e.push(n):s==0?e.push([n]):e.push([n].concat(this.inserted[i>>1].toJSON()))}return e}static of(e,i,n){let s=[],r=[],o=0,l=null;function c(d=!1){if(!d&&!s.length)return;o<i&&tn(s,i-o,-1);let p=new vi(s,r);l=l?l.compose(p.map(l)):p,s=[],r=[],o=0}function u(d){if(Array.isArray(d))for(let p of d)u(p);else if(d instanceof vi){if(d.length!=i)throw new RangeError(`Mismatched change set length (got ${d.length}, expected ${i})`);c(),l=l?l.compose(d.map(l)):d}else{let{from:p,to:g=p,insert:O}=d;if(p>g||p<0||g>i)throw new RangeError(`Invalid change range ${p} to ${g} (in doc of length ${i})`);let _=O?typeof O=="string"?at.of(O.split(n||q1)):O:at.empty,b=_.length;if(p==g&&b==0)return;p<o&&c(),p>o&&tn(s,p-o,-1),tn(s,g-p,b),Oa(r,s,_),o=g}}return u(e),c(!l),l}static empty(e){return new vi(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let i=[],n=[];for(let s=0;s<e.length;s++){let r=e[s];if(typeof r=="number")i.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)i.push(r[0],0);else{for(;n.length<s;)n.push(at.empty);n[s]=at.of(r.slice(1)),i.push(r[0],n[s].length)}}}return new vi(i,n)}static createSet(e,i){return new vi(e,i)}}function tn(t,e,i,n=!1){if(e==0&&i<=0)return;let s=t.length-2;s>=0&&i<=0&&i==t[s+1]?t[s]+=e:s>=0&&e==0&&t[s]==0?t[s+1]+=i:n?(t[s]+=e,t[s+1]+=i):t.push(e,i)}function Oa(t,e,i){if(i.length==0)return;let n=e.length-2>>1;if(n<t.length)t[t.length-1]=t[t.length-1].append(i);else{for(;t.length<n;)t.push(at.empty);t.push(i)}}function W1(t,e,i){let n=t.inserted;for(let s=0,r=0,o=0;o<t.sections.length;){let l=t.sections[o++],c=t.sections[o++];if(c<0)s+=l,r+=l;else{let u=s,d=r,p=at.empty;for(;u+=l,d+=c,c&&n&&(p=p.append(n[o-2>>1])),!(i||o==t.sections.length||t.sections[o+1]<0);)l=t.sections[o++],c=t.sections[o++];e(s,u,r,d,p),s=u,r=d}}}function U1(t,e,i,n=!1){let s=[],r=n?[]:null,o=new Mf(t),l=new Mf(e);for(let c=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let u=Math.min(o.len,l.len);tn(s,u,-1),o.forward(u),l.forward(u)}else if(l.ins>=0&&(o.ins<0||c==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!i))){let u=l.len;for(tn(s,l.ins,-1);u;){let d=Math.min(o.len,u);o.ins>=0&&c<o.i&&o.len<=d&&(tn(s,0,o.ins),r&&Oa(r,s,o.text),c=o.i),o.forward(d),u-=d}l.next()}else if(o.ins>=0){let u=0,d=o.len;for(;d;)if(l.ins==-1){let p=Math.min(d,l.len);u+=p,d-=p,l.forward(p)}else if(l.ins==0&&l.len<d)d-=l.len,l.next();else break;tn(s,u,c<o.i?o.ins:0),r&&c<o.i&&Oa(r,s,o.text),c=o.i,o.forward(o.len-d)}else{if(o.done&&l.done)return r?vi.createSet(s,r):Cr.create(s);throw new Error("Mismatched change set lengths")}}}function mD(t,e,i=!1){let n=[],s=i?[]:null,r=new Mf(t),o=new Mf(e);for(let l=!1;;){if(r.done&&o.done)return s?vi.createSet(n,s):Cr.create(n);if(r.ins==0)tn(n,r.len,0,l),r.next();else if(o.len==0&&!o.done)tn(n,0,o.ins,l),s&&Oa(s,n,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let c=Math.min(r.len2,o.len),u=n.length;if(r.ins==-1){let d=o.ins==-1?-1:o.off?0:o.ins;tn(n,c,d,l),s&&d&&Oa(s,n,o.text)}else o.ins==-1?(tn(n,r.off?0:r.len,c,l),s&&Oa(s,n,r.textBit(c))):(tn(n,r.off?0:r.len,o.off?0:o.ins,l),s&&!o.off&&Oa(s,n,o.text));l=(r.ins>c||o.ins>=0&&o.len>c)&&(l||n.length>u),r.forward2(c),o.forward(c)}}}}class Mf{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,i=this.i-2>>1;return i>=e.length?at.empty:e[i]}textBit(e){let{inserted:i}=this.set,n=this.i-2>>1;return n>=i.length&&!e?at.empty:i[n].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 ml{constructor(e,i,n){this.from=e,this.to=i,this.flags=n}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,i=-1){let n,s;return this.empty?n=s=e.mapPos(this.from,i):(n=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),n==this.from&&s==this.to?this:new ml(n,s,this.flags)}extend(e,i=e){if(e<=this.anchor&&i>=this.anchor)return re.range(e,i);let n=Math.abs(e-this.anchor)>Math.abs(i-this.anchor)?e:i;return re.range(this.anchor,n)}eq(e,i=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!i||!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 re.range(e.anchor,e.head)}static create(e,i,n){return new ml(e,i,n)}}class re{constructor(e,i){this.ranges=e,this.mainIndex=i}map(e,i=-1){return e.empty?this:re.create(this.ranges.map(n=>n.map(e,i)),this.mainIndex)}eq(e,i=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],i))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new re([this.main],0)}addRange(e,i=!0){return re.create([e].concat(this.ranges),i?0:this.mainIndex+1)}replaceRange(e,i=this.mainIndex){let n=this.ranges.slice();return n[i]=e,re.create(n,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 re(e.ranges.map(i=>ml.fromJSON(i)),e.main)}static single(e,i=e){return new re([re.range(e,i)],0)}static create(e,i=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,s=0;s<e.length;s++){let r=e[s];if(r.empty?r.from<=n:r.from<n)return re.normalized(e.slice(),i);n=r.to}return new re(e,i)}static cursor(e,i=0,n,s){return ml.create(e,e,(i==0?0:i<0?8:16)|(n==null?7:Math.min(6,n))|(s??16777215)<<6)}static range(e,i,n,s){let r=(n??16777215)<<6|(s==null?7:Math.min(6,s));return i<e?ml.create(i,e,48|r):ml.create(e,i,(i>e?8:0)|r)}static normalized(e,i=0){let n=e[i];e.sort((s,r)=>s.from-r.from),i=e.indexOf(n);for(let s=1;s<e.length;s++){let r=e[s],o=e[s-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,c=Math.max(r.to,o.to);s<=i&&i--,e.splice(--s,2,r.anchor>r.head?re.range(c,l):re.range(l,c))}}return new re(e,i)}}function gD(t,e){for(let i of t.ranges)if(i.to>e)throw new RangeError("Selection points outside of document")}let Ex=0;class Se{constructor(e,i,n,s,r){this.combine=e,this.compareInput=i,this.compare=n,this.isStatic=s,this.id=Ex++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new Se(e.combine||(i=>i),e.compareInput||((i,n)=>i===n),e.compare||(e.combine?(i,n)=>i===n:Mx),!!e.static,e.enables)}of(e){return new Vm([],this,0,e)}compute(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vm(e,this,1,i)}computeN(e,i){if(this.isStatic)throw new Error("Can't compute a static facet");return new Vm(e,this,2,i)}from(e,i){return i||(i=n=>n),this.compute([e],n=>i(n.field(e)))}}function Mx(t,e){return t==e||t.length==e.length&&t.every((i,n)=>i===e[n])}class Vm{constructor(e,i,n,s){this.dependencies=e,this.facet=i,this.type=n,this.value=s,this.id=Ex++}dynamicSlot(e){var i;let n=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,c=!1,u=!1,d=[];for(let p of this.dependencies)p=="doc"?c=!0:p=="selection"?u=!0:(((i=e[p.id])!==null&&i!==void 0?i:1)&1)==0&&d.push(e[p.id]);return{create(p){return p.values[o]=n(p),1},update(p,g){if(c&&g.docChanged||u&&(g.docChanged||g.selection)||Y1(p,d)){let O=n(p);if(l?!DA(O,p.values[o],s):!s(O,p.values[o]))return p.values[o]=O,1}return 0},reconfigure:(p,g)=>{let O,_=g.config.address[r];if(_!=null){let b=yg(g,_);if(this.dependencies.every(x=>x instanceof Se?g.facet(x)===p.facet(x):x instanceof Bi?g.field(x,!1)==p.field(x,!1):!0)||(l?DA(O=n(p),b,s):s(O=n(p),b)))return p.values[o]=b,0}else O=n(p);return p.values[o]=O,1}}}}function DA(t,e,i){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!i(t[n],e[n]))return!1;return!0}function Y1(t,e){let i=!1;for(let n of e)df(t,n)&1&&(i=!0);return i}function sq(t,e,i){let n=i.map(c=>t[c.id]),s=i.map(c=>c.type),r=n.filter(c=>!(c&1)),o=t[e.id]>>1;function l(c){let u=[];for(let d=0;d<n.length;d++){let p=yg(c,n[d]);if(s[d]==2)for(let g of p)u.push(g);else u.push(p)}return e.combine(u)}return{create(c){for(let u of n)df(c,u);return c.values[o]=l(c),1},update(c,u){if(!Y1(c,r))return 0;let d=l(c);return e.compare(d,c.values[o])?0:(c.values[o]=d,1)},reconfigure(c,u){let d=Y1(c,n),p=u.config.facets[e.id],g=u.facet(e);if(p&&!d&&Mx(i,p))return c.values[o]=g,0;let O=l(c);return e.compare(O,g)?(c.values[o]=g,0):(c.values[o]=O,1)}}}const Fp=Se.define({static:!0});class Bi{constructor(e,i,n,s,r){this.id=e,this.createF=i,this.updateF=n,this.compareF=s,this.spec=r,this.provides=void 0}static define(e){let i=new Bi(Ex++,e.create,e.update,e.compare||((n,s)=>n===s),e);return e.provide&&(i.provides=e.provide(i)),i}create(e){let i=e.facet(Fp).find(n=>n.field==this);return((i==null?void 0:i.create)||this.createF)(e)}slot(e){let i=e[this.id]>>1;return{create:n=>(n.values[i]=this.create(n),1),update:(n,s)=>{let r=n.values[i],o=this.updateF(r,s);return this.compareF(r,o)?0:(n.values[i]=o,1)},reconfigure:(n,s)=>{let r=n.facet(Fp),o=s.facet(Fp),l;return(l=r.find(c=>c.field==this))&&l!=o.find(c=>c.field==this)?(n.values[i]=l.create(n),1):s.config.address[this.id]!=null?(n.values[i]=s.field(this),0):(n.values[i]=this.create(n),1)}}}init(e){return[this,Fp.of({field:this,create:e})]}get extension(){return this}}const hl={lowest:4,low:3,default:2,high:1,highest:0};function ku(t){return e=>new OD(e,t)}const So={highest:ku(hl.highest),high:ku(hl.high),default:ku(hl.default),low:ku(hl.low),lowest:ku(hl.lowest)};class OD{constructor(e,i){this.inner=e,this.prec=i}}class uO{of(e){return new H1(this,e)}reconfigure(e){return uO.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class H1{constructor(e,i){this.compartment=e,this.inner=i}}class _g{constructor(e,i,n,s,r,o){for(this.base=e,this.compartments=i,this.dynamicSlots=n,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let i=this.address[e.id];return i==null?e.default:this.staticValues[i>>1]}static resolve(e,i,n){let s=[],r=Object.create(null),o=new Map;for(let g of rq(e,i,o))g instanceof Bi?s.push(g):(r[g.facet.id]||(r[g.facet.id]=[])).push(g);let l=Object.create(null),c=[],u=[];for(let g of s)l[g.id]=u.length<<1,u.push(O=>g.slot(O));let d=n==null?void 0:n.config.facets;for(let g in r){let O=r[g],_=O[0].facet,b=d&&d[g]||[];if(O.every(x=>x.type==0))if(l[_.id]=c.length<<1|1,Mx(b,O))c.push(n.facet(_));else{let x=_.combine(O.map(w=>w.value));c.push(n&&_.compare(x,n.facet(_))?n.facet(_):x)}else{for(let x of O)x.type==0?(l[x.id]=c.length<<1|1,c.push(x.value)):(l[x.id]=u.length<<1,u.push(w=>x.dynamicSlot(w)));l[_.id]=u.length<<1,u.push(x=>sq(x,_,O))}}let p=u.map(g=>g(l));return new _g(e,o,p,l,c,r)}}function rq(t,e,i){let n=[[],[],[],[],[]],s=new Map;function r(o,l){let c=s.get(o);if(c!=null){if(c<=l)return;let u=n[c].indexOf(o);u>-1&&n[c].splice(u,1),o instanceof H1&&i.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let u of o)r(u,l);else if(o instanceof H1){if(i.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let u=e.get(o.compartment)||o.inner;i.set(o.compartment,u),r(u,l)}else if(o instanceof OD)r(o.inner,o.prec);else if(o instanceof Bi)n[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Vm)n[l].push(o),o.facet.extensions&&r(o.facet.extensions,hl.default);else{let u=o.extension;if(!u)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(u,l)}}return r(t,hl.default),n.reduce((o,l)=>o.concat(l))}function df(t,e){if(e&1)return 2;let i=e>>1,n=t.status[i];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;t.status[i]=4;let s=t.computeSlot(t,t.config.dynamicSlots[i]);return t.status[i]=2|s}function yg(t,e){return e&1?t.config.staticValues[e>>1]:t.values[e>>1]}const vD=Se.define(),F1=Se.define({combine:t=>t.some(e=>e),static:!0}),_D=Se.define({combine:t=>t.length?t[0]:void 0,static:!0}),yD=Se.define(),bD=Se.define(),SD=Se.define(),xD=Se.define({combine:t=>t.length?t[0]:!1});class Rr{constructor(e,i){this.type=e,this.value=i}static define(){return new oq}}class oq{of(e){return new Rr(this,e)}}class aq{constructor(e){this.map=e}of(e){return new ze(this,e)}}class ze{constructor(e,i){this.type=e,this.value=i}map(e){let i=this.type.map(this.value,e);return i===void 0?void 0:i==this.value?this:new ze(this.type,i)}is(e){return this.type==e}static define(e={}){return new aq(e.map||(i=>i))}static mapEffects(e,i){if(!e.length)return e;let n=[];for(let s of e){let r=s.map(i);r&&n.push(r)}return n}}ze.reconfigure=ze.define();ze.appendConfig=ze.define();class hi{constructor(e,i,n,s,r,o){this.startState=e,this.changes=i,this.selection=n,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&gD(n,i.newLength),r.some(l=>l.type==hi.time)||(this.annotations=r.concat(hi.time.of(Date.now())))}static create(e,i,n,s,r,o){return new hi(e,i,n,s,r,o)}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 i of this.annotations)if(i.type==e)return i.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let i=this.annotation(hi.userEvent);return!!(i&&(i==e||i.length>e.length&&i.slice(0,e.length)==e&&i[e.length]=="."))}}hi.time=Rr.define();hi.userEvent=Rr.define();hi.addToHistory=Rr.define();hi.remote=Rr.define();function lq(t,e){let i=[];for(let n=0,s=0;;){let r,o;if(n<t.length&&(s==e.length||e[s]>=t[n]))r=t[n++],o=t[n++];else if(s<e.length)r=e[s++],o=e[s++];else return i;!i.length||i[i.length-1]<r?i.push(r,o):i[i.length-1]<o&&(i[i.length-1]=o)}}function wD(t,e,i){var n;let s,r,o;return i?(s=e.changes,r=vi.empty(e.changes.length),o=t.changes.compose(e.changes)):(s=e.changes.map(t.changes),r=t.changes.mapDesc(e.changes,!0),o=t.changes.compose(s)),{changes:o,selection:e.selection?e.selection.map(r):(n=t.selection)===null||n===void 0?void 0:n.map(s),effects:ze.mapEffects(t.effects,s).concat(ze.mapEffects(e.effects,r)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function G1(t,e,i){let n=e.selection,s=Wc(e.annotations);return e.userEvent&&(s=s.concat(hi.userEvent.of(e.userEvent))),{changes:e.changes instanceof vi?e.changes:vi.of(e.changes||[],i,t.facet(_D)),selection:n&&(n instanceof re?n:re.single(n.anchor,n.head)),effects:Wc(e.effects),annotations:s,scrollIntoView:!!e.scrollIntoView}}function CD(t,e,i){let n=G1(t,e.length?e[0]:{},t.doc.length);e.length&&e[0].filter===!1&&(i=!1);for(let r=1;r<e.length;r++){e[r].filter===!1&&(i=!1);let o=!!e[r].sequential;n=wD(n,G1(t,e[r],o?n.changes.newLength:t.doc.length),o)}let s=hi.create(t,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return hq(i?cq(s):s)}function cq(t){let e=t.startState,i=!0;for(let s of e.facet(yD)){let r=s(t);if(r===!1){i=!1;break}Array.isArray(r)&&(i=i===!0?r:lq(i,r))}if(i!==!0){let s,r;if(i===!1)r=t.changes.invertedDesc,s=vi.empty(e.doc.length);else{let o=t.changes.filter(i);s=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}t=hi.create(e,s,t.selection&&t.selection.map(r),ze.mapEffects(t.effects,r),t.annotations,t.scrollIntoView)}let n=e.facet(bD);for(let s=n.length-1;s>=0;s--){let r=n[s](t);r instanceof hi?t=r:Array.isArray(r)&&r.length==1&&r[0]instanceof hi?t=r[0]:t=CD(e,Wc(r),!1)}return t}function hq(t){let e=t.startState,i=e.facet(SD),n=t;for(let s=i.length-1;s>=0;s--){let r=i[s](t);r&&Object.keys(r).length&&(n=wD(n,G1(e,r,t.changes.newLength),!0))}return n==t?t:hi.create(e,t.changes,t.selection,n.effects,n.annotations,n.scrollIntoView)}const uq=[];function Wc(t){return t==null?uq:Array.isArray(t)?t:[t]}var Dt=(function(t){return t[t.Word=0]="Word",t[t.Space=1]="Space",t[t.Other=2]="Other",t})(Dt||(Dt={}));const fq=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let K1;try{K1=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function dq(t){if(K1)return K1.test(t);for(let e=0;e<t.length;e++){let i=t[e];if(/\w/.test(i)||i>"€"&&(i.toUpperCase()!=i.toLowerCase()||fq.test(i)))return!0}return!1}function pq(t){return e=>{if(!/\S/.test(e))return Dt.Space;if(dq(e))return Dt.Word;for(let i=0;i<t.length;i++)if(e.indexOf(t[i])>-1)return Dt.Word;return Dt.Other}}class et{constructor(e,i,n,s,r,o){this.config=e,this.doc=i,this.selection=n,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)df(this,l<<1);this.computeSlot=null}field(e,i=!0){let n=this.config.address[e.id];if(n==null){if(i)throw new RangeError("Field is not present in this state");return}return df(this,n),yg(this,n)}update(...e){return CD(this,e,!0)}applyTransaction(e){let i=this.config,{base:n,compartments:s}=i;for(let l of e.effects)l.is(uO.reconfigure)?(i&&(s=new Map,i.compartments.forEach((c,u)=>s.set(u,c)),i=null),s.set(l.value.compartment,l.value.extension)):l.is(ze.reconfigure)?(i=null,n=l.value):l.is(ze.appendConfig)&&(i=null,n=Wc(n).concat(l.value));let r;i?r=e.startState.values.slice():(i=_g.resolve(n,s,this),r=new et(i,this.doc,this.selection,i.dynamicSlots.map(()=>null),(c,u)=>u.reconfigure(c,this),null).values);let o=e.startState.facet(F1)?e.newSelection:e.newSelection.asSingle();new et(i,e.newDoc,o,r,(l,c)=>c.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:e},range:re.cursor(i.from+e.length)}))}changeByRange(e){let i=this.selection,n=e(i.ranges[0]),s=this.changes(n.changes),r=[n.range],o=Wc(n.effects);for(let l=1;l<i.ranges.length;l++){let c=e(i.ranges[l]),u=this.changes(c.changes),d=u.map(s);for(let g=0;g<l;g++)r[g]=r[g].map(d);let p=s.mapDesc(u,!0);r.push(c.range.map(p)),s=s.compose(d),o=ze.mapEffects(o,d).concat(ze.mapEffects(Wc(c.effects),p))}return{changes:s,selection:re.create(r,i.mainIndex),effects:o}}changes(e=[]){return e instanceof vi?e:vi.of(e,this.doc.length,this.facet(et.lineSeparator))}toText(e){return at.of(e.split(this.facet(et.lineSeparator)||q1))}sliceDoc(e=0,i=this.doc.length){return this.doc.sliceString(e,i,this.lineBreak)}facet(e){let i=this.config.address[e.id];return i==null?e.default:(df(this,i),yg(this,i))}toJSON(e){let i={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let s=e[n];s instanceof Bi&&this.config.address[s.id]!=null&&(i[n]=s.spec.toJSON(this.field(e[n]),this))}return i}static fromJSON(e,i={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let s=[];if(n){for(let r in n)if(Object.prototype.hasOwnProperty.call(e,r)){let o=n[r],l=e[r];s.push(o.init(c=>o.spec.fromJSON(l,c)))}}return et.create({doc:e.doc,selection:re.fromJSON(e.selection),extensions:i.extensions?s.concat([i.extensions]):s})}static create(e={}){let i=_g.resolve(e.extensions||[],new Map),n=e.doc instanceof at?e.doc:at.of((e.doc||"").split(i.staticFacet(et.lineSeparator)||q1)),s=e.selection?e.selection instanceof re?e.selection:re.single(e.selection.anchor,e.selection.head):re.single(0);return gD(s,n.length),i.staticFacet(F1)||(s=s.asSingle()),new et(i,n,s,i.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(et.tabSize)}get lineBreak(){return this.facet(et.lineSeparator)||`
62
+ `}get readOnly(){return this.facet(xD)}phrase(e,...i){for(let n of this.facet(et.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return i.length&&(e=e.replace(/\$(\$|\d*)/g,(n,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>i.length?n:i[r-1]})),e}languageDataAt(e,i,n=-1){let s=[];for(let r of this.facet(vD))for(let o of r(this,i,n))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){let i=this.languageDataAt("wordChars",e);return pq(i.length?i[0]:"")}wordAt(e){let{text:i,from:n,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let c=Di(i,o,!1);if(r(i.slice(c,o))!=Dt.Word)break;o=c}for(;l<s;){let c=Di(i,l);if(r(i.slice(l,c))!=Dt.Word)break;l=c}return o==l?null:re.range(o+n,l+n)}}et.allowMultipleSelections=F1;et.tabSize=Se.define({combine:t=>t.length?t[0]:4});et.lineSeparator=_D;et.readOnly=xD;et.phrases=Se.define({compare(t,e){let i=Object.keys(t),n=Object.keys(e);return i.length==n.length&&i.every(s=>t[s]==e[s])}});et.languageData=vD;et.changeFilter=yD;et.transactionFilter=bD;et.transactionExtender=SD;uO.reconfigure=ze.define();function Qr(t,e,i={}){let n={};for(let s of t)for(let r of Object.keys(s)){let o=s[r],l=n[r];if(l===void 0)n[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(i,r))n[r]=i[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)n[s]===void 0&&(n[s]=e[s]);return n}class Sa{eq(e){return this==e}range(e,i=e){return J1.create(e,i,this)}}Sa.prototype.startSide=Sa.prototype.endSide=0;Sa.prototype.point=!1;Sa.prototype.mapMode=Fi.TrackDel;function Px(t,e){return t==e||t.constructor==e.constructor&&t.eq(e)}let J1=class kD{constructor(e,i,n){this.from=e,this.to=i,this.value=n}static create(e,i,n){return new kD(e,i,n)}};function eb(t,e){return t.from-e.from||t.value.startSide-e.value.startSide}class Rx{constructor(e,i,n,s){this.from=e,this.to=i,this.value=n,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,i,n,s=0){let r=n?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let c=o+l>>1,u=r[c]-e||(n?this.value[c].endSide:this.value[c].startSide)-i;if(c==o)return u>=0?o:l;u>=0?l=c:o=c+1}}between(e,i,n,s){for(let r=this.findIndex(i,-1e9,!0),o=this.findIndex(n,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,i){let n=[],s=[],r=[],o=-1,l=-1;for(let c=0;c<this.value.length;c++){let u=this.value[c],d=this.from[c]+e,p=this.to[c]+e,g,O;if(d==p){let _=i.mapPos(d,u.startSide,u.mapMode);if(_==null||(g=O=_,u.startSide!=u.endSide&&(O=i.mapPos(d,u.endSide),O<g)))continue}else if(g=i.mapPos(d,u.startSide),O=i.mapPos(p,u.endSide),g>O||g==O&&u.startSide>0&&u.endSide<=0)continue;(O-g||u.endSide-u.startSide)<0||(o<0&&(o=g),u.point&&(l=Math.max(l,O-g)),n.push(u),s.push(g-o),r.push(O-o))}return{mapped:n.length?new Rx(s,r,n,l):null,pos:o}}}class Ge{constructor(e,i,n,s){this.chunkPos=e,this.chunk=i,this.nextLayer=n,this.maxPoint=s}static create(e,i,n,s){return new Ge(e,i,n,s)}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 i of this.chunk)e+=i.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:i=[],sort:n=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(i.length==0&&!o)return this;if(n&&(i=i.slice().sort(eb)),this.isEmpty)return i.length?Ge.of(i):this;let l=new TD(this,null,-1).goto(0),c=0,u=[],d=new _o;for(;l.value||c<i.length;)if(c<i.length&&(l.from-i[c].from||l.startSide-i[c].value.startSide)>=0){let p=i[c++];d.addInner(p.from,p.to,p.value)||u.push(p)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(c==i.length||this.chunkEnd(l.chunkIndex)<i[c].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&d.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(d.addInner(l.from,l.to,l.value)||u.push(J1.create(l.from,l.to,l.value))),l.next());return d.finishInner(this.nextLayer.isEmpty&&!u.length?Ge.empty:this.nextLayer.update({add:u,filter:o,filterFrom:s,filterTo:r}))}map(e){if(e.empty||this.isEmpty)return this;let i=[],n=[],s=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],c=this.chunk[o],u=e.touchesRange(l,l+c.length);if(u===!1)s=Math.max(s,c.maxPoint),i.push(c),n.push(e.mapPos(l));else if(u===!0){let{mapped:d,pos:p}=c.map(l,e);d&&(s=Math.max(s,d.maxPoint),i.push(d),n.push(p))}}let r=this.nextLayer.map(e);return i.length==0?r:new Ge(n,i,r||Ge.empty,s)}between(e,i,n){if(!this.isEmpty){for(let s=0;s<this.chunk.length;s++){let r=this.chunkPos[s],o=this.chunk[s];if(i>=r&&e<=r+o.length&&o.between(r,e-r,i-r,n)===!1)return}this.nextLayer.between(e,i,n)}}iter(e=0){return Pf.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,i=0){return Pf.from(e).goto(i)}static compare(e,i,n,s,r=-1){let o=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=r),l=i.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=r),c=BA(o,l,n),u=new Tu(o,c,r),d=new Tu(l,c,r);n.iterGaps((p,g,O)=>$A(u,p,d,g,O,s)),n.empty&&n.length==0&&$A(u,0,d,0,0,s)}static eq(e,i,n=0,s){s==null&&(s=999999999);let r=e.filter(d=>!d.isEmpty&&i.indexOf(d)<0),o=i.filter(d=>!d.isEmpty&&e.indexOf(d)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=BA(r,o),c=new Tu(r,l,0).goto(n),u=new Tu(o,l,0).goto(n);for(;;){if(c.to!=u.to||!tb(c.active,u.active)||c.point&&(!u.point||!Px(c.point,u.point)))return!1;if(c.to>s)return!0;c.next(),u.next()}}static spans(e,i,n,s,r=-1){let o=new Tu(e,null,r).goto(i),l=i,c=o.openStart;for(;;){let u=Math.min(o.to,n);if(o.point){let d=o.activeForPoint(o.to),p=o.pointFrom<i?d.length+1:o.point.startSide<0?d.length:Math.min(d.length,c);s.point(l,u,o.point,d,p,o.pointRank),c=Math.min(o.openEnd(u),d.length)}else u>l&&(s.span(l,u,o.active,c),c=o.openEnd(u));if(o.to>n)return c+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,i=!1){let n=new _o;for(let s of e instanceof J1?[e]:i?mq(e):e)n.add(s.from,s.to,s.value);return n.finish()}static join(e){if(!e.length)return Ge.empty;let i=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let s=e[n];s!=Ge.empty;s=s.nextLayer)i=new Ge(s.chunkPos,s.chunk,i,Math.max(s.maxPoint,i.maxPoint));return i}}Ge.empty=new Ge([],[],null,-1);function mq(t){if(t.length>1)for(let e=t[0],i=1;i<t.length;i++){let n=t[i];if(eb(e,n)>0)return t.slice().sort(eb);e=n}return t}Ge.empty.nextLayer=Ge.empty;class _o{finishChunk(e){this.chunks.push(new Rx(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,i,n){this.addInner(e,i,n)||(this.nextLayer||(this.nextLayer=new _o)).add(e,i,n)}addInner(e,i,n){let s=e-this.lastTo||n.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(i-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=i,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,i-e)),!0)}addChunk(e,i){if((e-this.lastTo||i.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,i.maxPoint),this.chunks.push(i),this.chunkPos.push(e);let n=i.value.length-1;return this.last=i.value[n],this.lastFrom=i.from[n]+e,this.lastTo=i.to[n]+e,!0}finish(){return this.finishInner(Ge.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let i=Ge.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,i}}function BA(t,e,i){let n=new Map;for(let r of t)for(let o=0;o<r.chunk.length;o++)r.chunk[o].maxPoint<=0&&n.set(r.chunk[o],r.chunkPos[o]);let s=new Set;for(let r of e)for(let o=0;o<r.chunk.length;o++){let l=n.get(r.chunk[o]);l!=null&&(i?i.mapPos(l):l)==r.chunkPos[o]&&!(i!=null&&i.touchesRange(l,l+r.chunk[o].length))&&s.add(r.chunk[o])}return s}class TD{constructor(e,i,n,s=0){this.layer=e,this.skip=i,this.minPoint=n,this.rank=s}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,i=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,i,!1),this}gotoInner(e,i,n){for(;this.chunkIndex<this.layer.chunk.length;){let s=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(s)||this.layer.chunkEnd(this.chunkIndex)<e||s.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let s=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],i,!0);(!n||this.rangeIndex<s)&&this.setRangeIndex(s)}this.next()}forward(e,i){(this.to-e||this.endSide-i)<0&&this.gotoInner(e,i,!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],i=this.layer.chunk[this.chunkIndex],n=e+i.from[this.rangeIndex];if(this.from=n,this.to=e+i.to[this.rangeIndex],this.value=i.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 Pf{constructor(e){this.heap=e}static from(e,i=null,n=-1){let s=[];for(let r=0;r<e.length;r++)for(let o=e[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=n&&s.push(new TD(o,i,n,r));return s.length==1?s[0]:new Pf(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,i=-1e9){for(let n of this.heap)n.goto(e,i);for(let n=this.heap.length>>1;n>=0;n--)y_(this.heap,n);return this.next(),this}forward(e,i){for(let n of this.heap)n.forward(e,i);for(let n=this.heap.length>>1;n>=0;n--)y_(this.heap,n);(this.to-e||this.value.endSide-i)<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(),y_(this.heap,0)}}}function y_(t,e){for(let i=t[e];;){let n=(e<<1)+1;if(n>=t.length)break;let s=t[n];if(n+1<t.length&&s.compare(t[n+1])>=0&&(s=t[n+1],n++),i.compare(s)<0)break;t[n]=i,t[e]=s,e=n}}class Tu{constructor(e,i,n){this.minPoint=n,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=Pf.from(e,i,n)}goto(e,i=-1e9){return this.cursor.goto(e,i),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=i,this.openStart=-1,this.next(),this}forward(e,i){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-i)<0;)this.removeActive(this.minActive);this.cursor.forward(e,i)}removeActive(e){Gp(this.active,e),Gp(this.activeTo,e),Gp(this.activeRank,e),this.minActive=zA(this.active,this.activeTo)}addActive(e){let i=0,{value:n,to:s,rank:r}=this.cursor;for(;i<this.activeRank.length&&(r-this.activeRank[i]||s-this.activeTo[i])>0;)i++;Kp(this.active,i,n),Kp(this.activeTo,i,s),Kp(this.activeRank,i,r),e&&Kp(e,i,this.cursor.from),this.minActive=zA(this.active,this.activeTo)}next(){let e=this.to,i=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),n&&Gp(n,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(n),this.cursor.next();else if(i&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=r,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=r.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let s=n.length-1;s>=0&&n[s]<e;s--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let i=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&i.push(this.active[n]);return i.reverse()}openEnd(e){let i=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)i++;return i}}function $A(t,e,i,n,s,r){t.goto(e),i.goto(n);let o=n+s,l=n,c=n-e,u=!!r.boundChange;for(let d=!1;;){let p=t.to+c-i.to,g=p||t.endSide-i.endSide,O=g<0?t.to+c:i.to,_=Math.min(O,o);if(t.point||i.point?(t.point&&i.point&&Px(t.point,i.point)&&tb(t.activeForPoint(t.to),i.activeForPoint(i.to))||r.comparePoint(l,_,t.point,i.point),d=!1):(d&&r.boundChange(l),_>l&&!tb(t.active,i.active)&&r.compareRange(l,_,t.active,i.active),u&&_<o&&(p||t.openEnd(O)!=i.openEnd(O))&&(d=!0)),O>o)break;l=O,g<=0&&t.next(),g>=0&&i.next()}}function tb(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(t[i]!=e[i]&&!Px(t[i],e[i]))return!1;return!0}function Gp(t,e){for(let i=e,n=t.length-1;i<n;i++)t[i]=t[i+1];t.pop()}function Kp(t,e,i){for(let n=t.length-1;n>=e;n--)t[n+1]=t[n];t[e]=i}function zA(t,e){let i=-1,n=1e9;for(let s=0;s<e.length;s++)(e[s]-n||t[s].endSide-t[i].endSide)<0&&(i=s,n=e[s]);return i}function Ys(t,e,i=t.length){let n=0;for(let s=0;s<i&&s<t.length;)t.charCodeAt(s)==9?(n+=e-n%e,s++):(n++,s=Di(t,s));return n}function ib(t,e,i,n){for(let s=0,r=0;;){if(r>=e)return s;if(s==t.length)break;r+=t.charCodeAt(s)==9?i-r%i:1,s=Di(t,s)}return n===!0?-1:t.length}const nb="ͼ",NA=typeof Symbol>"u"?"__"+nb:Symbol.for(nb),sb=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),jA=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class xa{constructor(e,i){this.rules=[];let{finish:n}=i||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,c,u){let d=[],p=/^@(\w+)\b/.exec(o[0]),g=p&&p[1]=="keyframes";if(p&&l==null)return c.push(o[0]+";");for(let O in l){let _=l[O];if(/&/.test(O))r(O.split(/,\s*/).map(b=>o.map(x=>b.replace(/&/,x))).reduce((b,x)=>b.concat(x)),_,c);else if(_&&typeof _=="object"){if(!p)throw new RangeError("The value of a property ("+O+") should be a primitive value.");r(s(O),_,d,g)}else _!=null&&d.push(O.replace(/_.*/,"").replace(/[A-Z]/g,b=>"-"+b.toLowerCase())+": "+_+";")}(d.length||g)&&c.push((n&&!p&&!u?o.map(n):o).join(", ")+" {"+d.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(`
63
+ `)}static newName(){let e=jA[NA]||1;return jA[NA]=e+1,nb+e.toString(36)}static mount(e,i,n){let s=e[sb],r=n&&n.nonce;s?r&&s.setNonce(r):s=new gq(e,r),s.mount(Array.isArray(i)?i:[i],e)}}let IA=new Map;class gq{constructor(e,i){let n=e.ownerDocument||e,s=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=IA.get(n);if(r)return e[sb]=r;this.sheet=new s.CSSStyleSheet,IA.set(n,this)}else this.styleTag=n.createElement("style"),i&&this.styleTag.setAttribute("nonce",i);this.modules=[],e[sb]=this}mount(e,i){let n=this.sheet,s=0,r=0;for(let o=0;o<e.length;o++){let l=e[o],c=this.modules.indexOf(l);if(c<r&&c>-1&&(this.modules.splice(c,1),r--,c=-1),c==-1){if(this.modules.splice(r++,0,l),n)for(let u=0;u<l.rules.length;u++)n.insertRule(l.rules[u],s++)}else{for(;r<c;)s+=this.modules[r++].rules.length;s+=l.rules.length,r++}}if(n)i.adoptedStyleSheets.indexOf(this.sheet)<0&&(i.adoptedStyleSheets=[this.sheet,...i.adoptedStyleSheets]);else{let o="";for(let c=0;c<this.modules.length;c++)o+=this.modules[c].getRules()+`
64
+ `;this.styleTag.textContent=o;let l=i.head||i;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 wa={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:"'"},Rf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Oq=typeof navigator<"u"&&/Mac/.test(navigator.platform),vq=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Hi=0;Hi<10;Hi++)wa[48+Hi]=wa[96+Hi]=String(Hi);for(var Hi=1;Hi<=24;Hi++)wa[Hi+111]="F"+Hi;for(var Hi=65;Hi<=90;Hi++)wa[Hi]=String.fromCharCode(Hi+32),Rf[Hi]=String.fromCharCode(Hi);for(var b_ in wa)Rf.hasOwnProperty(b_)||(Rf[b_]=wa[b_]);function _q(t){var e=Oq&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||vq&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",i=!e&&t.key||(t.shiftKey?Rf:wa)[t.keyCode]||t.key||"Unidentified";return i=="Esc"&&(i="Escape"),i=="Del"&&(i="Delete"),i=="Left"&&(i="ArrowLeft"),i=="Up"&&(i="ArrowUp"),i=="Right"&&(i="ArrowRight"),i=="Down"&&(i="ArrowDown"),i}function vt(){var t=arguments[0];typeof t=="string"&&(t=document.createElement(t));var e=1,i=arguments[1];if(i&&typeof i=="object"&&i.nodeType==null&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var s=i[n];typeof s=="string"?t.setAttribute(n,s):s!=null&&(t[n]=s)}e++}for(;e<arguments.length;e++)AD(t,arguments[e]);return t}function AD(t,e){if(typeof e=="string")t.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)t.appendChild(e);else if(Array.isArray(e))for(var i=0;i<e.length;i++)AD(t,e[i]);else throw new RangeError("Unsupported child node: "+e)}let mn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},rb=typeof document<"u"?document:{documentElement:{style:{}}};const ob=/Edge\/(\d+)/.exec(mn.userAgent),ED=/MSIE \d/.test(mn.userAgent),ab=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(mn.userAgent),fO=!!(ED||ab||ob),VA=!fO&&/gecko\/(\d+)/i.test(mn.userAgent),S_=!fO&&/Chrome\/(\d+)/.exec(mn.userAgent),yq="webkitFontSmoothing"in rb.documentElement.style,lb=!fO&&/Apple Computer/.test(mn.vendor),XA=lb&&(/Mobile\/\w+/.test(mn.userAgent)||mn.maxTouchPoints>2);var xe={mac:XA||/Mac/.test(mn.platform),windows:/Win/.test(mn.platform),linux:/Linux|X11/.test(mn.platform),ie:fO,ie_version:ED?rb.documentMode||6:ab?+ab[1]:ob?+ob[1]:0,gecko:VA,gecko_version:VA?+(/Firefox\/(\d+)/.exec(mn.userAgent)||[0,0])[1]:0,chrome:!!S_,chrome_version:S_?+S_[1]:0,ios:XA,android:/Android\b/.test(mn.userAgent),webkit_version:yq?+(/\bAppleWebKit\/(\d+)/.exec(mn.userAgent)||[0,0])[1]:0,safari:lb,safari_version:lb?+(/\bVersion\/(\d+(\.\d+)?)/.exec(mn.userAgent)||[0,0])[1]:0,tabSize:rb.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Qx(t,e){for(let i in t)i=="class"&&e.class?e.class+=" "+t.class:i=="style"&&e.style?e.style+=";"+t.style:e[i]=t[i];return e}const bg=Object.create(null);function Lx(t,e,i){if(t==e)return!0;t||(t=bg),e||(e=bg);let n=Object.keys(t),s=Object.keys(e);if(n.length-0!=s.length-0)return!1;for(let r of n)if(r!=i&&(s.indexOf(r)==-1||t[r]!==e[r]))return!1;return!0}function bq(t,e){for(let i=t.attributes.length-1;i>=0;i--){let n=t.attributes[i].name;e[n]==null&&t.removeAttribute(n)}for(let i in e){let n=e[i];i=="style"?t.style.cssText=n:t.getAttribute(i)!=n&&t.setAttribute(i,n)}}function ZA(t,e,i){let n=!1;if(e)for(let s in e)i&&s in i||(n=!0,s=="style"?t.style.cssText="":t.removeAttribute(s));if(i)for(let s in i)e&&e[s]==i[s]||(n=!0,s=="style"?t.style.cssText=i[s]:t.setAttribute(s,i[s]));return n}function Sq(t){let e=Object.create(null);for(let i=0;i<t.attributes.length;i++){let n=t.attributes[i];e[n.name]=n.value}return e}class Gs{eq(e){return!1}updateDOM(e,i){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,i,n){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var Ki=(function(t){return t[t.Text=0]="Text",t[t.WidgetBefore=1]="WidgetBefore",t[t.WidgetAfter=2]="WidgetAfter",t[t.WidgetRange=3]="WidgetRange",t})(Ki||(Ki={}));class Pe extends Sa{constructor(e,i,n,s){super(),this.startSide=e,this.endSide=i,this.widget=n,this.spec=s}get heightRelevant(){return!1}static mark(e){return new hd(e)}static widget(e){let i=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return i+=n&&!e.inlineOrder?i>0?3e8:-4e8:i>0?1e8:-1e8,new kl(e,i,i,n,e.widget||null,!1)}static replace(e){let i=!!e.block,n,s;if(e.isBlockGap)n=-5e8,s=4e8;else{let{start:r,end:o}=MD(e,i);n=(r?i?-3e8:-1:5e8)-1,s=(o?i?2e8:1:-6e8)+1}return new kl(e,n,s,i,e.widget||null,!0)}static line(e){return new ud(e)}static set(e,i=!1){return Ge.of(e,i)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Pe.none=Ge.empty;class hd extends Pe{constructor(e){let{start:i,end:n}=MD(e);super(i?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Qx(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||bg}eq(e){return this==e||e instanceof hd&&this.tagName==e.tagName&&Lx(this.attrs,e.attrs)}range(e,i=e){if(e>=i)throw new RangeError("Mark decorations may not be empty");return super.range(e,i)}}hd.prototype.point=!1;class ud extends Pe{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof ud&&this.spec.class==e.spec.class&&Lx(this.spec.attributes,e.spec.attributes)}range(e,i=e){if(i!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,i)}}ud.prototype.mapMode=Fi.TrackBefore;ud.prototype.point=!0;class kl extends Pe{constructor(e,i,n,s,r,o){super(i,n,r,e),this.block=s,this.isReplace=o,this.mapMode=s?i<=0?Fi.TrackBefore:Fi.TrackAfter:Fi.TrackDel}get type(){return this.startSide!=this.endSide?Ki.WidgetRange:this.startSide<=0?Ki.WidgetBefore:Ki.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof kl&&xq(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,i=e){if(this.isReplace&&(e>i||e==i&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&i!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,i)}}kl.prototype.point=!0;function MD(t,e=!1){let{inclusiveStart:i,inclusiveEnd:n}=t;return i==null&&(i=t.inclusive),n==null&&(n=t.inclusive),{start:i??e,end:n??e}}function xq(t,e){return t==e||!!(t&&e&&t.compare(e))}function Uc(t,e,i,n=0){let s=i.length-1;s>=0&&i[s]+n>=t?i[s]=Math.max(i[s],e):i.push(t,e)}class Qf extends Sa{constructor(e,i){super(),this.tagName=e,this.attributes=i}eq(e){return e==this||e instanceof Qf&&this.tagName==e.tagName&&Lx(this.attributes,e.attributes)}static create(e){return new Qf(e.tagName,e.attributes||bg)}static set(e,i=!1){return Ge.of(e,i)}}Qf.prototype.startSide=Qf.prototype.endSide=-1;function Lf(t){let e;return t.nodeType==11?e=t.getSelection?t:t.ownerDocument:e=t,e.getSelection()}function cb(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):!1}function pf(t,e){if(!e.anchorNode)return!1;try{return cb(t,e.anchorNode)}catch{return!1}}function mf(t){return t.nodeType==3?Bf(t,0,t.nodeValue.length).getClientRects():t.nodeType==1?t.getClientRects():[]}function gf(t,e,i,n){return i?qA(t,e,i,n,-1)||qA(t,e,i,n,1):!1}function Ca(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e}function Sg(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function qA(t,e,i,n,s){for(;;){if(t==i&&e==n)return!0;if(e==(s<0?0:yo(t))){if(t.nodeName=="DIV")return!1;let r=t.parentNode;if(!r||r.nodeType!=1)return!1;e=Ca(t)+(s<0?0:1),t=r}else if(t.nodeType==1){if(t=t.childNodes[e+(s<0?-1:0)],t.nodeType==1&&t.contentEditable=="false")return!1;e=s<0?yo(t):0}else return!1}}function yo(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function Df(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function wq(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 PD(t,e){let i=e.width/t.offsetWidth,n=e.height/t.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-t.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}function Cq(t,e,i,n,s,r,o,l){let c=t.ownerDocument,u=c.defaultView||window;for(let d=t,p=!1;d&&!p;)if(d.nodeType==1){let g,O=d==c.body,_=1,b=1;if(O)g=wq(u);else{if(/^(fixed|sticky)$/.test(getComputedStyle(d).position)&&(p=!0),d.scrollHeight<=d.clientHeight&&d.scrollWidth<=d.clientWidth){d=d.assignedSlot||d.parentNode;continue}let k=d.getBoundingClientRect();({scaleX:_,scaleY:b}=PD(d,k)),g={left:k.left,right:k.left+d.clientWidth*_,top:k.top,bottom:k.top+d.clientHeight*b}}let x=0,w=0;if(s=="nearest")e.top<g.top?(w=e.top-(g.top+o),i>0&&e.bottom>g.bottom+w&&(w=e.bottom-g.bottom+o)):e.bottom>g.bottom&&(w=e.bottom-g.bottom+o,i<0&&e.top-w<g.top&&(w=e.top-(g.top+o)));else{let k=e.bottom-e.top,T=g.bottom-g.top;w=(s=="center"&&k<=T?e.top+k/2-T/2:s=="start"||s=="center"&&i<0?e.top-o:e.bottom-T+o)-g.top}if(n=="nearest"?e.left<g.left?(x=e.left-(g.left+r),i>0&&e.right>g.right+x&&(x=e.right-g.right+r)):e.right>g.right&&(x=e.right-g.right+r,i<0&&e.left<g.left+x&&(x=e.left-(g.left+r))):x=(n=="center"?e.left+(e.right-e.left)/2-(g.right-g.left)/2:n=="start"==l?e.left-r:e.right-(g.right-g.left)+r)-g.left,x||w)if(O)u.scrollBy(x,w);else{let k=0,T=0;if(w){let A=d.scrollTop;d.scrollTop+=w/b,T=(d.scrollTop-A)*b}if(x){let A=d.scrollLeft;d.scrollLeft+=x/_,k=(d.scrollLeft-A)*_}e={left:e.left-k,top:e.top-T,right:e.right-k,bottom:e.bottom-T},k&&Math.abs(k-x)<1&&(n="nearest"),T&&Math.abs(T-w)<1&&(s="nearest")}if(O)break;(e.top<g.top||e.bottom>g.bottom||e.left<g.left||e.right>g.right)&&(e={left:Math.max(e.left,g.left),right:Math.min(e.right,g.right),top:Math.max(e.top,g.top),bottom:Math.min(e.bottom,g.bottom)}),d=d.assignedSlot||d.parentNode}else if(d.nodeType==11)d=d.host;else break}function kq(t){let e=t.ownerDocument,i,n;for(let s=t.parentNode;s&&!(s==e.body||i&&n);)if(s.nodeType==1)!n&&s.scrollHeight>s.clientHeight&&(n=s),!i&&s.scrollWidth>s.clientWidth&&(i=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:i,y:n}}class Tq{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:i,focusNode:n}=e;this.set(i,Math.min(e.anchorOffset,i?yo(i):0),n,Math.min(e.focusOffset,n?yo(n):0))}set(e,i,n,s){this.anchorNode=e,this.anchorOffset=i,this.focusNode=n,this.focusOffset=s}}let al=null;xe.safari&&xe.safari_version>=26&&(al=!1);function RD(t){if(t.setActive)return t.setActive();if(al)return t.focus(al);let e=[];for(let i=t;i&&(e.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(t.focus(al==null?{get preventScroll(){return al={preventScroll:!0},!0}}:void 0),!al){al=!1;for(let i=0;i<e.length;){let n=e[i++],s=e[i++],r=e[i++];n.scrollTop!=s&&(n.scrollTop=s),n.scrollLeft!=r&&(n.scrollLeft=r)}}}let WA;function Bf(t,e,i=e){let n=WA||(WA=document.createRange());return n.setEnd(t,i),n.setStart(t,e),n}function Yc(t,e,i,n){let s={key:e,code:e,keyCode:i,which:i,cancelable:!0};n&&({altKey:s.altKey,ctrlKey:s.ctrlKey,shiftKey:s.shiftKey,metaKey:s.metaKey}=n);let r=new KeyboardEvent("keydown",s);r.synthetic=!0,t.dispatchEvent(r);let o=new KeyboardEvent("keyup",s);return o.synthetic=!0,t.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function Aq(t){for(;t;){if(t&&(t.nodeType==9||t.nodeType==11&&t.host))return t;t=t.assignedSlot||t.parentNode}return null}function Eq(t,e){let i=e.focusNode,n=e.focusOffset;if(!i||e.anchorNode!=i||e.anchorOffset!=n)return!1;for(n=Math.min(n,yo(i));;)if(n){if(i.nodeType!=1)return!1;let s=i.childNodes[n-1];s.contentEditable=="false"?n--:(i=s,n=yo(i))}else{if(i==t)return!0;n=Ca(i),i=i.parentNode}}function QD(t){return t.scrollTop>Math.max(1,t.scrollHeight-t.clientHeight-4)}function LD(t,e){for(let i=t,n=e;;){if(i.nodeType==3&&n>0)return{node:i,offset:n};if(i.nodeType==1&&n>0){if(i.contentEditable=="false")return null;i=i.childNodes[n-1],n=yo(i)}else if(i.parentNode&&!Sg(i))n=Ca(i),i=i.parentNode;else return null}}function DD(t,e){for(let i=t,n=e;;){if(i.nodeType==3&&n<i.nodeValue.length)return{node:i,offset:n};if(i.nodeType==1&&n<i.childNodes.length){if(i.contentEditable=="false")return null;i=i.childNodes[n],n=0}else if(i.parentNode&&!Sg(i))n=Ca(i)+1,i=i.parentNode;else return null}}class qs{constructor(e,i,n=!0){this.node=e,this.offset=i,this.precise=n}static before(e,i){return new qs(e.parentNode,Ca(e),i)}static after(e,i){return new qs(e.parentNode,Ca(e)+1,i)}}var St=(function(t){return t[t.LTR=0]="LTR",t[t.RTL=1]="RTL",t})(St||(St={}));const Tl=St.LTR,Dx=St.RTL;function BD(t){let e=[];for(let i=0;i<t.length;i++)e.push(1<<+t[i]);return e}const Mq=BD("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Pq=BD("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),hb=Object.create(null),sr=[];for(let t of["()","[]","{}"]){let e=t.charCodeAt(0),i=t.charCodeAt(1);hb[e]=i,hb[i]=-e}function $D(t){return t<=247?Mq[t]:1424<=t&&t<=1524?2:1536<=t&&t<=1785?Pq[t-1536]:1774<=t&&t<=2220?4:8192<=t&&t<=8204?256:64336<=t&&t<=65023?4:1}const Rq=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class _r{get dir(){return this.level%2?Dx:Tl}constructor(e,i,n){this.from=e,this.to=i,this.level=n}side(e,i){return this.dir==i==e?this.to:this.from}forward(e,i){return e==(this.dir==i)}static find(e,i,n,s){let r=-1;for(let o=0;o<e.length;o++){let l=e[o];if(l.from<=i&&l.to>=i){if(l.level==n)return o;(r<0||(s!=0?s<0?l.from<i:l.to>i:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function zD(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let n=t[i],s=e[i];if(n.from!=s.from||n.to!=s.to||n.direction!=s.direction||!zD(n.inner,s.inner))return!1}return!0}const bt=[];function Qq(t,e,i,n,s){for(let r=0;r<=n.length;r++){let o=r?n[r-1].to:e,l=r<n.length?n[r].from:i,c=r?256:s;for(let u=o,d=c,p=c;u<l;u++){let g=$D(t.charCodeAt(u));g==512?g=d:g==8&&p==4&&(g=16),bt[u]=g==4?2:g,g&7&&(p=g),d=g}for(let u=o,d=c,p=c;u<l;u++){let g=bt[u];if(g==128)u<l-1&&d==bt[u+1]&&d&24?g=bt[u]=d:bt[u]=256;else if(g==64){let O=u+1;for(;O<l&&bt[O]==64;)O++;let _=u&&d==8||O<i&&bt[O]==8?p==1?1:8:256;for(let b=u;b<O;b++)bt[b]=_;u=O-1}else g==8&&p==1&&(bt[u]=1);d=g,g&7&&(p=g)}}}function Lq(t,e,i,n,s){let r=s==1?2:1;for(let o=0,l=0,c=0;o<=n.length;o++){let u=o?n[o-1].to:e,d=o<n.length?n[o].from:i;for(let p=u,g,O,_;p<d;p++)if(O=hb[g=t.charCodeAt(p)])if(O<0){for(let b=l-3;b>=0;b-=3)if(sr[b+1]==-O){let x=sr[b+2],w=x&2?s:x&4?x&1?r:s:0;w&&(bt[p]=bt[sr[b]]=w),l=b;break}}else{if(sr.length==189)break;sr[l++]=p,sr[l++]=g,sr[l++]=c}else if((_=bt[p])==2||_==1){let b=_==s;c=b?0:1;for(let x=l-3;x>=0;x-=3){let w=sr[x+2];if(w&2)break;if(b)sr[x+2]|=2;else{if(w&4)break;sr[x+2]|=4}}}}}function Dq(t,e,i,n){for(let s=0,r=n;s<=i.length;s++){let o=s?i[s-1].to:t,l=s<i.length?i[s].from:e;for(let c=o;c<l;){let u=bt[c];if(u==256){let d=c+1;for(;;)if(d==l){if(s==i.length)break;d=i[s++].to,l=s<i.length?i[s].from:e}else if(bt[d]==256)d++;else break;let p=r==1,g=(d<e?bt[d]:n)==1,O=p==g?p?1:2:n;for(let _=d,b=s,x=b?i[b-1].to:t;_>c;)_==x&&(_=i[--b].from,x=b?i[b-1].to:t),bt[--_]=O;c=d}else r=u,c++}}}function ub(t,e,i,n,s,r,o){let l=n%2?2:1;if(n%2==s%2)for(let c=e,u=0;c<i;){let d=!0,p=!1;if(u==r.length||c<r[u].from){let b=bt[c];b!=l&&(d=!1,p=b==16)}let g=!d&&l==1?[]:null,O=d?n:n+1,_=c;e:for(;;)if(u<r.length&&_==r[u].from){if(p)break e;let b=r[u];if(!d)for(let x=b.to,w=u+1;;){if(x==i)break e;if(w<r.length&&r[w].from==x)x=r[w++].to;else{if(bt[x]==l)break e;break}}if(u++,g)g.push(b);else{b.from>c&&o.push(new _r(c,b.from,O));let x=b.direction==Tl!=!(O%2);fb(t,x?n+1:n,s,b.inner,b.from,b.to,o),c=b.to}_=b.to}else{if(_==i||(d?bt[_]!=l:bt[_]==l))break;_++}g?ub(t,c,_,n+1,s,g,o):c<_&&o.push(new _r(c,_,O)),c=_}else for(let c=i,u=r.length;c>e;){let d=!0,p=!1;if(!u||c>r[u-1].to){let b=bt[c-1];b!=l&&(d=!1,p=b==16)}let g=!d&&l==1?[]:null,O=d?n:n+1,_=c;e:for(;;)if(u&&_==r[u-1].to){if(p)break e;let b=r[--u];if(!d)for(let x=b.from,w=u;;){if(x==e)break e;if(w&&r[w-1].to==x)x=r[--w].from;else{if(bt[x-1]==l)break e;break}}if(g)g.push(b);else{b.to<c&&o.push(new _r(b.to,c,O));let x=b.direction==Tl!=!(O%2);fb(t,x?n+1:n,s,b.inner,b.from,b.to,o),c=b.from}_=b.from}else{if(_==e||(d?bt[_-1]!=l:bt[_-1]==l))break;_--}g?ub(t,_,c,n+1,s,g,o):_<c&&o.push(new _r(_,c,O)),c=_}}function fb(t,e,i,n,s,r,o){let l=e%2?2:1;Qq(t,s,r,n,l),Lq(t,s,r,n,l),Dq(s,r,n,l),ub(t,s,r,e,i,n,o)}function Bq(t,e,i){if(!t)return[new _r(0,0,e==Dx?1:0)];if(e==Tl&&!i.length&&!Rq.test(t))return ND(t.length);if(i.length)for(;t.length>bt.length;)bt[bt.length]=256;let n=[],s=e==Tl?0:1;return fb(t,s,s,i,0,t.length,n),n}function ND(t){return[new _r(0,t,0)]}let jD="";function $q(t,e,i,n,s){var r;let o=n.head-t.from,l=_r.find(e,o,(r=n.bidiLevel)!==null&&r!==void 0?r:-1,n.assoc),c=e[l],u=c.side(s,i);if(o==u){let g=l+=s?1:-1;if(g<0||g>=e.length)return null;c=e[l=g],o=c.side(!s,i),u=c.side(s,i)}let d=Di(t.text,o,c.forward(s,i));(d<c.from||d>c.to)&&(d=u),jD=t.text.slice(Math.min(o,d),Math.max(o,d));let p=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return p&&d==u&&p.level+(s?0:1)<c.level?re.cursor(p.side(!s,i)+t.from,p.forward(s,i)?1:-1,p.level):re.cursor(d+t.from,c.forward(s,i)?-1:1,c.level)}function zq(t,e,i){for(let n=e;n<i;n++){let s=$D(t.charCodeAt(n));if(s==1)return Tl;if(s==2||s==4)return Dx}return Tl}const ID=Se.define(),VD=Se.define(),XD=Se.define(),ZD=Se.define(),db=Se.define(),qD=Se.define(),WD=Se.define(),Bx=Se.define(),$x=Se.define(),UD=Se.define({combine:t=>t.some(e=>e)}),YD=Se.define({combine:t=>t.some(e=>e)}),HD=Se.define();class Hc{constructor(e,i="nearest",n="nearest",s=5,r=5,o=!1){this.range=e,this.y=i,this.x=n,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new Hc(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 Hc(re.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Jp=ze.define({map:(t,e)=>t.map(e)}),FD=ze.define();function $n(t,e,i){let n=t.facet(ZD);n.length?n[0](e):window.onerror&&window.onerror(String(e),i,void 0,void 0,e)||(i?console.error(i+":",e):console.error(e))}const uo=Se.define({combine:t=>t.length?t[0]:!0});let Nq=0;const Nc=Se.define({combine(t){return t.filter((e,i)=>{for(let n=0;n<i;n++)if(t[n].plugin==e.plugin)return!1;return!0})}});class Jt{constructor(e,i,n,s,r){this.id=e,this.create=i,this.domEventHandlers=n,this.domEventObservers=s,this.baseExtensions=r(this),this.extension=this.baseExtensions.concat(Nc.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Nc.of({plugin:this,arg:e}))}static define(e,i){const{eventHandlers:n,eventObservers:s,provide:r,decorations:o}=i||{};return new Jt(Nq++,e,n,s,l=>{let c=[];return o&&c.push(dO.of(u=>{let d=u.plugin(l);return d?o(d):Pe.none})),r&&c.push(r(l)),c})}static fromClass(e,i){return Jt.define((n,s)=>new e(n,s),i)}}class x_{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 i=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(i)}catch(n){if($n(i.state,n,"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(i){$n(e.state,i,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var i;if(!((i=this.value)===null||i===void 0)&&i.destroy)try{this.value.destroy()}catch(n){$n(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const GD=Se.define(),zx=Se.define(),dO=Se.define(),KD=Se.define(),Nx=Se.define(),fd=Se.define(),JD=Se.define();function UA(t,e){let i=t.state.facet(JD);if(!i.length)return i;let n=i.map(r=>r instanceof Function?r(t):r),s=[];return Ge.spans(n,e.from,e.to,{point(){},span(r,o,l,c){let u=r-e.from,d=o-e.from,p=s;for(let g=l.length-1;g>=0;g--,c--){let O=l[g].spec.bidiIsolate,_;if(O==null&&(O=zq(e.text,u,d)),c>0&&p.length&&(_=p[p.length-1]).to==u&&_.direction==O)_.to=d,p=_.inner;else{let b={from:u,to:d,direction:O,inner:[]};p.push(b),p=b.inner}}}}),s}const eB=Se.define();function jx(t){let e=0,i=0,n=0,s=0;for(let r of t.state.facet(eB)){let o=r(t);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(i=Math.max(i,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:i,top:n,bottom:s}}const Fu=Se.define();class ks{constructor(e,i,n,s){this.fromA=e,this.toA=i,this.fromB=n,this.toB=s}join(e){return new ks(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 i=e.length,n=this;for(;i>0;i--){let s=e[i-1];if(!(s.fromA>n.toA)){if(s.toA<n.fromA)break;n=n.join(s),e.splice(i-1,1)}}return e.splice(i,0,n),e}static extendWithRanges(e,i){if(i.length==0)return e;let n=[];for(let s=0,r=0,o=0;;){let l=s<e.length?e[s].fromB:1e9,c=r<i.length?i[r]:1e9,u=Math.min(l,c);if(u==1e9)break;let d=u+o,p=u,g=d;for(;;)if(r<i.length&&i[r]<=p){let O=i[r+1];r+=2,p=Math.max(p,O);for(let _=s;_<e.length&&e[_].fromB<=p;_++)o=e[_].toA-e[_].toB;g=Math.max(g,O+o)}else if(s<e.length&&e[s].fromB<=p){let O=e[s++];p=Math.max(p,O.toB),g=Math.max(g,O.toA),o=O.toA-O.toB}else break;n.push(new ks(d,g,u,p))}return n}}class xg{constructor(e,i,n){this.view=e,this.state=i,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=vi.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,c)=>s.push(new ks(r,o,l,c))),this.changedRanges=s}static create(e,i,n){return new xg(e,i,n)}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 jq=[];class ui{constructor(e,i,n=0){this.dom=e,this.length=i,this.flags=n,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return jq}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 i=this.domAttrs;i&&bq(this.dom,i)}}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,i=this.posAtStart){let n=i;for(let s of this.children){if(s==e)return n;n+=s.length+s.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,i){return null}domPosFor(e,i){let n=Ca(this.dom),s=this.length?e>0:i>0;return new qs(this.parent.dom,n+(s?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 mO)return e;return null}static get(e){return e.cmTile}}class pO extends ui{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 i=this.dom,n=null,s,r=(e==null?void 0:e.node)==i?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,s=n?n.nextSibling:i.firstChild,r&&s!=l.dom&&(r.written=!0),l.dom.parentNode==i)for(;s&&s!=l.dom;)s=YA(s);else i.insertBefore(l.dom,s);n=l.dom}for(s=n?n.nextSibling:i.firstChild,r&&s&&(r.written=!0);s;)s=YA(s);this.length=o}}function YA(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class mO extends pO{constructor(e,i){super(i),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 i=ui.get(e);if(i&&this.owns(i))return i;e=e.parentNode}}blockTiles(e){for(let i=[],n=this,s=0,r=0;;)if(s==n.children.length){if(!i.length)return;n=n.parent,n.breakAfter&&r++,s=i.pop()}else{let o=n.children[s++];if(o instanceof mo)i.push(s),n=o,s=0;else{let l=r+o.length,c=e(o,r);if(c!==void 0)return c;r=l+o.breakAfter}}}resolveBlock(e,i){let n,s=-1,r,o=-1;if(this.blockTiles((l,c)=>{let u=c+l.length;if(e>=c&&e<=u){if(l.isWidget()&&i>=-1&&i<=1){if(l.flags&32)return!0;l.flags&16&&(n=void 0)}(c<e||e==u&&(i<-1?l.length:l.covers(1)))&&(!n||!l.isWidget()&&n.isWidget())&&(n=l,s=e-c),(u>e||e==c&&(i>1?l.length:l.covers(-1)))&&(!r||!l.isWidget()&&r.isWidget())&&(r=l,o=e-c)}}),!n&&!r)throw new Error("No tile at position "+e);return n&&i<0||!r?{tile:n,offset:s}:{tile:r,offset:o}}}class mo extends pO{constructor(e,i){super(e),this.wrapper=i}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,i){let n=new mo(i||document.createElement(e.tagName),e);return i||(n.flags|=4),n}}class rh extends pO{constructor(e,i){super(e),this.attrs=i}isLine(){return!0}static start(e,i,n){let s=new rh(i||document.createElement("div"),e);return(!i||!n)&&(s.flags|=4),s}get domAttrs(){return this.attrs}resolveInline(e,i,n){let s=null,r=-1,o=null,l=-1;function c(d,p){for(let g=0,O=0;g<d.children.length&&O<=p;g++){let _=d.children[g],b=O+_.length;b>=p&&(_.isComposite()?c(_,p-O):(!o||o.isHidden&&(i>0||n&&Vq(o,_)))&&(b>p||_.flags&32)?(o=_,l=p-O):(O<p||_.flags&16&&!_.isHidden)&&(s=_,r=p-O)),O=b}}c(this,e);let u=(i<0?s:o)||s||o;return u?{tile:u,offset:u==s?r:l}:null}coordsIn(e,i){let n=this.resolveInline(e,i,!0);return n?n.tile.coordsIn(Math.max(0,n.offset),i):Iq(this)}domIn(e,i){let n=this.resolveInline(e,i);if(n){let{tile:s,offset:r}=n;if(this.dom.contains(s.dom))return s.isText()?new qs(s.dom,Math.min(s.dom.nodeValue.length,r)):s.domPosFor(r,s.flags&16?1:s.flags&32?-1:i);let o=n.tile.parent,l=!1;for(let c of o.children){if(l)return new qs(c.dom,0);c==n.tile&&(l=!0)}}return new qs(this.dom,0)}}function Iq(t){let e=t.dom.lastChild;if(!e)return t.dom.getBoundingClientRect();let i=mf(e);return i[i.length-1]||null}function Vq(t,e){let i=t.coordsIn(0,1),n=e.coordsIn(0,1);return i&&n&&n.top<i.bottom}class Bn extends pO{constructor(e,i){super(e),this.mark=i}get domAttrs(){return this.mark.attrs}static of(e,i){let n=new Bn(i||document.createElement(e.tagName),e);return i||(n.flags|=4),n}}class gl extends ui{constructor(e,i){super(e,i.length),this.text=i}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,i){let n=this.dom.nodeValue.length;e>n&&(e=n);let s=e,r=e,o=0;e==0&&i<0||e==n&&i>=0?xe.chrome||xe.gecko||(e?(s--,o=1):r<n&&(r++,o=-1)):i<0?s--:r<n&&r++;let l=Bf(this.dom,s,r).getClientRects();if(!l.length)return null;let c=l[(o?o<0:i>=0)?0:l.length-1];return xe.safari&&!o&&c.width==0&&(c=Array.prototype.find.call(l,u=>u.width)||c),o?Df(c,o<0):c||null}static of(e,i){let n=new gl(i||document.createTextNode(e),e);return i||(n.flags|=2),n}}class Al extends ui{constructor(e,i,n,s){super(e,i,s),this.widget=n}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,i){return this.coordsInWidget(e,i,!1)}coordsInWidget(e,i,n){let s=this.widget.coordsAt(this.dom,e,i);if(s)return s;if(n)return Df(this.dom.getBoundingClientRect(),this.length?e==0:i<=0);{let r=this.dom.getClientRects(),o=null;if(!r.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let c=l?r.length-1:0;o=r[c],!(e>0?c==0:c==r.length-1||o.top<o.bottom);c+=l?-1:1);return Df(o,!l)}}get overrideDOMText(){if(!this.length)return at.empty;let{root:e}=this;if(!e)return at.empty;let i=this.posAtStart;return e.view.state.doc.slice(i,i+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,i,n,s,r){return r||(r=e.toDOM(i),e.editable||(r.contentEditable="false")),new Al(r,n,e,s)}}class wg extends ui{constructor(e){let i=document.createElement("img");i.className="cm-widgetBuffer",i.setAttribute("aria-hidden","true"),super(i,0,e)}get isHidden(){return!0}get overrideDOMText(){return at.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class Xq{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,i,n){let{tile:s,index:r,beforeBreak:o,parents:l}=this;for(;e||i>0;)if(s.isComposite())if(o){if(!e)break;n&&n.break(),e--,o=!1}else if(r==s.children.length){if(!e&&!l.length)break;n&&n.leave(s),o=!!s.breakAfter,{tile:s,index:r}=l.pop(),r++}else{let c=s.children[r],u=c.breakAfter;(i>0?c.length<=e:c.length<e)&&(!n||n.skip(c,0,c.length)!==!1||!c.isComposite)?(o=!!u,r++,e-=c.length):(l.push({tile:s,index:r}),s=c,r=0,n&&c.isComposite()&&n.enter(c))}else if(r==s.length)o=!!s.breakAfter,{tile:s,index:r}=l.pop(),r++;else if(e){let c=Math.min(e,s.length-r);n&&n.skip(s,r,r+c),e-=c,r+=c}else break;return this.tile=s,this.index=r,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class Zq{constructor(e,i,n,s){this.from=e,this.to=i,this.wrapper=n,this.rank=s}}class qq{constructor(e,i,n){this.cache=e,this.root=i,this.blockWrappers=n,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,i,n,s){var r;this.flushBuffer();let o=this.ensureMarks(i,n),l=o.lastChild;if(l&&l.isText()&&!(l.flags&8)&&l.length+e.length<512){this.cache.reused.set(l,2);let c=o.children[o.children.length-1]=new gl(l.dom,l.text+e);c.parent=o}else o.append(s||gl.of(e,(r=this.cache.find(gl))===null||r===void 0?void 0:r.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,i){let n=this.curLine;n.dom!=i.line.dom&&(n.setDOM(this.cache.reused.has(i.line)?w_(i.line.dom):i.line.dom),this.cache.reused.set(i.line,2));let s=n;for(let l=i.marks.length-1;l>=0;l--){let c=i.marks[l],u=s.lastChild;if(u instanceof Bn&&u.mark.eq(c.mark))u.dom!=c.dom&&u.setDOM(w_(c.dom)),s=u;else{if(this.cache.reused.get(c)){let p=ui.get(c.dom);p&&p.setDOM(w_(c.dom))}let d=Bn.of(c.mark,c.dom);s.append(d),s=d}this.cache.reused.set(c,2)}let r=ui.get(e.text);r&&this.cache.reused.set(r,2);let o=new gl(e.text,e.text.nodeValue);o.flags|=8,s.append(o)}addInlineWidget(e,i,n){let s=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);s||this.flushBuffer();let r=this.ensureMarks(i,n);!s&&!(e.flags&16)&&r.append(this.getBuffer(1)),r.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,i,n){this.flushBuffer(),this.ensureMarks(i,n).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 i=this.afterWidget||this.lastBlock;i.length+=e,this.pos+=e}addLineStart(e,i){var n;e||(e=tB);let s=rh.start(e,i||((n=this.cache.find(rh))===null||n===void 0?void 0:n.dom),!!i);this.getBlockPos().append(this.lastBlock=this.curLine=s)}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,i){var n;let s=this.curLine;for(let r=e.length-1;r>=0;r--){let o=e[r],l;if(i>0&&(l=s.lastChild)&&l instanceof Bn&&l.mark.eq(o))s=l,i--;else{let c=Bn.of(o,(n=this.cache.find(Bn,u=>u.mark.eq(o)))===null||n===void 0?void 0:n.dom);s.append(c),s=c,i=0}}return s}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!HA(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(xe.ios&&HA(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(C_,0,32)||new Al(C_.toDOM(),0,C_,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 i=new Zq(e.from,e.to,e.value,e.rank),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-i.rank||this.wrappers[n-1].to-i.to)<0;)n--;this.wrappers.splice(n,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let i=this.root;for(let n of this.wrappers){let s=i.lastChild;if(n.from<this.pos&&s instanceof mo&&s.wrapper.eq(n.wrapper))i=s;else{let r=mo.of(n.wrapper,(e=this.cache.find(mo,o=>o.wrapper.eq(n.wrapper)))===null||e===void 0?void 0:e.dom);i.append(r),i=r}}return i}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let i=2|(e<0?16:32),n=this.cache.find(wg,void 0,1);return n&&(n.flags=i),n||new wg(i)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class Wq{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:s,lineBreak:r,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=s;let l=this.textOff=Math.min(e,s.length);return r?null:s.slice(0,l)}let i=Math.min(this.text.length,this.textOff+e),n=this.text.slice(this.textOff,i);return this.textOff=i,n}}const Cg=[Al,rh,gl,Bn,wg,mo,mO];for(let t=0;t<Cg.length;t++)Cg[t].bucket=t;class Uq{constructor(e){this.view=e,this.buckets=Cg.map(()=>[]),this.index=Cg.map(()=>0),this.reused=new Map}add(e){let i=e.constructor.bucket,n=this.buckets[i];n.length<6?n.push(e):n[this.index[i]=(this.index[i]+1)%6]=e}find(e,i,n=2){let s=e.bucket,r=this.buckets[s],o=this.index[s];for(let l=r.length-1;l>=0;l--){let c=(l+o)%r.length,u=r[c];if((!i||i(u))&&!this.reused.has(u))return r.splice(c,1),c<o&&this.index[s]--,this.reused.set(u,n),u}return null}findWidget(e,i,n){let s=this.buckets[0];if(s.length)for(let r=0,o=0;;r++){if(r==s.length){if(o)return null;o=1,r=0}let l=s[r];if(!this.reused.has(l)&&(o==0?l.widget.compare(e):l.widget.constructor==e.constructor&&e.updateDOM(l.dom,this.view)))return s.splice(r,1),r<this.index[0]&&this.index[0]--,l.widget==e&&l.length==i&&(l.flags&497)==n?(this.reused.set(l,1),l):(this.reused.set(l,2),new Al(l.dom,i,e,l.flags&-498|n))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,i=2){if(!this.reused.has(e))return this.reused.set(e,i),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class Yq{constructor(e,i,n,s,r){this.view=e,this.decorations=s,this.disallowBlockEffectsFor=r,this.openWidget=!1,this.openMarks=0,this.cache=new Uq(e),this.text=new Wq(e.state.doc),this.builder=new qq(this.cache,new mO(e,e.contentDOM),Ge.iter(n)),this.cache.reused.set(i,2),this.old=new Xq(i),this.reuseWalker={skip:(o,l,c)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,i){let n=i&&this.getCompositionContext(i.text);for(let s=0,r=0,o=0;;){let l=o<e.length?e[o++]:null,c=l?l.fromA:this.old.root.length;if(c>s){let u=c-s;this.preserve(u,!o,!l),s=c,r+=u}if(!l)break;i&&l.fromA<=i.range.fromA&&l.toA>=i.range.toA?(this.forward(l.fromA,i.range.fromA,i.range.fromA<i.range.toA?1:-1),this.emit(r,i.range.fromB),this.cache.clear(),this.builder.addComposition(i,n),this.text.skip(i.range.toB-i.range.fromB),this.forward(i.range.fromA,l.toA),this.emit(i.range.toB,l.toB)):(this.forward(l.fromA,l.toA),this.emit(r,l.toB)),r=l.toB,s=l.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,i,n){let s=Gq(this.old),r=this.openMarks;this.old.advance(e,n?1:-1,{skip:(o,l,c)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(c-l);else{let u=c>0||l<o.length?Al.of(o.widget,this.view,c-l,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);u.flags&256?(u.flags&=-2,this.builder.addBlockWidget(u)):(this.builder.ensureLine(null),this.builder.addInlineWidget(u,s,r),r=s.length)}else if(o.isText())this.builder.ensureLine(null),!l&&c==o.length?this.builder.addText(o.text,s,r,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(l,c),s,r)),r=s.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof wg)this.cache.add(o);else if(o instanceof Bn)this.builder.ensureLine(null),this.builder.addMark(o,s,r),this.cache.reused.set(o,1),r=s.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Bn&&s.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?s.length&&(s.length=r=0):o instanceof Bn&&(s.shift(),r=Math.min(r,s.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,i){let n=null,s=this.builder,r=0,o=Ge.spans(this.decorations,e,i,{point:(l,c,u,d,p,g)=>{if(u instanceof kl){if(this.disallowBlockEffectsFor[g]){if(u.block)throw new RangeError("Block decorations may not be specified via plugins");if(c>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(r=d.length,p>d.length)s.continueWidget(c-l);else{let O=u.widget||(u.block?oh.block:oh.inline),_=Hq(u),b=this.cache.findWidget(O,c-l,_)||Al.of(O,this.view,c-l,_);u.block?(u.startSide>0&&s.addLineStartIfNotCovered(n),s.addBlockWidget(b)):(s.ensureLine(n),s.addInlineWidget(b,d,p))}n=null}else n=Fq(n,u);c>l&&this.text.skip(c-l)},span:(l,c,u,d)=>{for(let p=l;p<c;){let g=this.text.next(Math.min(512,c-p));g==null?(s.addLineStartIfNotCovered(n),s.addBreak(),p++):(s.ensureLine(n),s.addText(g,u,p==l?d:u.length),p+=g.length),n=null}}});s.addLineStartIfNotCovered(n),this.openWidget=o>r,this.openMarks=o}forward(e,i,n=1){i-e<=10?this.old.advance(i-e,n,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(i-e-10,-1),this.old.advance(5,n,this.reuseWalker))}getCompositionContext(e){let i=[],n=null;for(let s=e.parentNode;;s=s.parentNode){let r=ui.get(s);if(s==this.view.contentDOM)break;r instanceof Bn?i.push(r):r!=null&&r.isLine()?n=r:r instanceof mo||(s.nodeName=="DIV"&&!n&&s!=this.view.contentDOM?n=new rh(s,tB):n||i.push(Bn.of(new hd({tagName:s.nodeName.toLowerCase(),attributes:Sq(s)}),s)))}return{line:n,marks:i}}}function HA(t,e){let i=n=>{for(let s of n.children)if((e?s.isText():s.length)||i(s))return!0;return!1};return i(t)}function Hq(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 tB={class:"cm-line"};function Fq(t,e){let i=e.spec.attributes,n=e.spec.class;return!i&&!n||(t||(t={class:"cm-line"}),i&&Qx(i,t),n&&(t.class+=" "+n)),t}function Gq(t){let e=[];for(let i=t.parents.length;i>1;i--){let n=i==t.parents.length?t.tile:t.parents[i].tile;n instanceof Bn&&e.push(n.mark)}return e}function w_(t){let e=ui.get(t);return e&&e.setDOM(t.cloneNode()),t}class oh extends Gs{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}}oh.inline=new oh("span");oh.block=new oh("div");const C_=new class extends Gs{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class FA{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=Pe.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 mO(e,e.contentDOM),this.updateInner([new ks(0,0,0,e.state.doc.length)],null)}update(e){var i;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:d,toA:p})=>p<this.minWidthFrom||d>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 s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((i=this.domChanged)===null||i===void 0)&&i.newSel?s=this.domChanged.newSel.head:!oW(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?Jq(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){let{from:d,to:p}=this.hasComposition;n=new ks(d,p,e.changes.mapPos(d,-1),e.changes.mapPos(p,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(xe.ie||xe.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let c=iW(o,this.decorations,e.changes);c.length&&(n=ks.extendWithRanges(n,c));let u=sW(l,this.blockWrappers,e.changes);return u.length&&(n=ks.extendWithRanges(n,u)),r&&!n.some(d=>d.fromA<=r.range.fromA&&d.toA>=r.range.toA)&&(n=r.range.addToSet(n.slice())),this.tile.flags&2&&n.length==0?!1:(this.updateInner(n,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,i){this.view.viewState.mustMeasureContent=!0;let{observer:n}=this.view;n.ignore(()=>{if(i||e.length){let o=this.tile,l=new Yq(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=l.run(e,i),pb(o,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 r=xe.chrome||xe.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||n.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let s=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let r of this.tile.children)r.isWidget()&&r.widget instanceof k_&&s.push(r.dom);n.updateGaps(s)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let i of e.transactions)for(let n of i.effects)n.is(FD)&&(this.editContextFormatting=n.value)}updateSelection(e=!1,i=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:n}=this.tile,s=this.view.root.activeElement,r=s==n,o=!r&&!(this.view.state.facet(uo)||n.tabIndex>-1)&&pf(n,this.view.observer.selectionRange)&&!(s&&n.contains(s));if(!(r||i||o))return;let l=this.forceSelection;this.forceSelection=!1;let c=this.view.state.selection.main,u,d;if(c.empty?d=u=this.inlineDOMNearPos(c.anchor,c.assoc||1):(d=this.inlineDOMNearPos(c.head,c.head==c.from?1:-1),u=this.inlineDOMNearPos(c.anchor,c.anchor==c.from?1:-1)),xe.gecko&&c.empty&&!this.hasComposition&&Kq(u)){let g=document.createTextNode("");this.view.observer.ignore(()=>u.node.insertBefore(g,u.node.childNodes[u.offset]||null)),u=d=new qs(g,0),l=!0}let p=this.view.observer.selectionRange;(l||!p.focusNode||(!gf(u.node,u.offset,p.anchorNode,p.anchorOffset)||!gf(d.node,d.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,c))&&(this.view.observer.ignore(()=>{xe.android&&xe.chrome&&n.contains(p.focusNode)&&rW(p.focusNode,n)&&(n.blur(),n.focus({preventScroll:!0}));let g=Lf(this.view.root);if(g)if(c.empty){if(xe.gecko){let O=eW(u.node,u.offset);if(O&&O!=3){let _=(O==1?LD:DD)(u.node,u.offset);_&&(u=new qs(_.node,_.offset))}}g.collapse(u.node,u.offset),c.bidiLevel!=null&&g.caretBidiLevel!==void 0&&(g.caretBidiLevel=c.bidiLevel)}else if(g.extend){g.collapse(u.node,u.offset);try{g.extend(d.node,d.offset)}catch{}}else{let O=document.createRange();c.anchor>c.head&&([u,d]=[d,u]),O.setEnd(d.node,d.offset),O.setStart(u.node,u.offset),g.removeAllRanges(),g.addRange(O)}o&&this.view.root.activeElement==n&&(n.blur(),s&&s.focus())}),this.view.observer.setSelectionRange(u,d)),this.impreciseAnchor=u.precise?null:new qs(p.anchorNode,p.anchorOffset),this.impreciseHead=d.precise?null:new qs(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,i){return this.hasComposition&&i.empty&&gf(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==i.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,i=e.state.selection.main,n=Lf(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!n||!i.empty||!i.assoc||!n.modify)return;let o=this.lineAt(i.head,i.assoc);if(!o)return;let l=o.posAtStart;if(i.head==l||i.head==l+o.length)return;let c=this.coordsAt(i.head,-1),u=this.coordsAt(i.head,1);if(!c||!u||c.bottom>u.top)return;let d=this.domAtPos(i.head+i.assoc,i.assoc);n.collapse(d.node,d.offset),n.modify("move",i.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=i.from&&n.collapse(s,r)}posFromDOM(e,i){let n=this.tile.nearest(e);if(!n)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let s=n.posAtStart;if(n.isComposite()){let r;if(e==n.dom)r=n.dom.childNodes[i];else{let o=yo(e)==0?0:i==0?-1:1;for(;;){let l=e.parentNode;if(l==n.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?r=e:r=e.nextSibling}if(r==n.dom.firstChild)return s;for(;r&&!ui.get(r);)r=r.nextSibling;if(!r)return s+n.length;for(let o=0,l=s;;o++){let c=n.children[o];if(c.dom==r)return l;l+=c.length+c.breakAfter}}else return n.isText()?e==n.dom?s+i:s+(i?n.length:0):s}domAtPos(e,i){let{tile:n,offset:s}=this.tile.resolveBlock(e,i);return n.isWidget()?n.domPosFor(e,i):n.domIn(s,i)}inlineDOMNearPos(e,i){let n,s=-1,r=!1,o,l=-1,c=!1;return this.tile.blockTiles((u,d)=>{if(u.isWidget()){if(u.flags&32&&d>=e)return!0;u.flags&16&&(r=!0)}else{let p=d+u.length;if(d<=e&&(n=u,s=e-d,r=p<e),p>=e&&!o&&(o=u,l=e-d,c=d>e),d>e&&o)return!0}}),!n&&!o?this.domAtPos(e,i):(r&&o?n=null:c&&n&&(o=null),n&&i<0||!o?n.domIn(s,i):o.domIn(l,i))}coordsAt(e,i){let{tile:n,offset:s}=this.tile.resolveBlock(e,i);return n.isWidget()?n.widget instanceof k_?null:n.coordsInWidget(s,i,!0):n.coordsIn(s,i)}lineAt(e,i){let{tile:n}=this.tile.resolveBlock(e,i);return n.isLine()?n:null}coordsForChar(e){let{tile:i,offset:n}=this.tile.resolveBlock(e,1);if(!i.isLine())return null;function s(r,o){if(r.isComposite())for(let l of r.children){if(l.length>=o){let c=s(l,o);if(c)return c}if(o-=l.length,o<0)break}else if(r.isText()&&o<r.length){let l=Di(r.text,o);if(l==o)return null;let c=Bf(r.dom,o,l).getClientRects();for(let u=0;u<c.length;u++){let d=c[u];if(u==c.length-1||d.top<d.bottom&&d.left<d.right)return d}}return null}return s(i,n)}measureVisibleLineHeights(e){let i=[],{from:n,to:s}=e,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,c=this.view.textDirection==St.LTR,u=0,d=(p,g,O)=>{for(let _=0;_<p.children.length&&!(g>s);_++){let b=p.children[_],x=g+b.length,w=b.dom.getBoundingClientRect(),{height:k}=w;if(O&&!_&&(u+=w.top-O.top),b instanceof mo)x>n&&d(b,g,w);else if(g>=n&&(u>0&&i.push(-u),i.push(k+u),u=0,o)){let T=b.dom.lastChild,A=T?mf(T):[];if(A.length){let L=A[A.length-1],E=c?L.right-w.left:w.right-L.left;E>l&&(l=E,this.minWidth=r,this.minWidthFrom=g,this.minWidthTo=x)}}O&&_==p.children.length-1&&(u+=O.bottom-w.bottom),g=x+b.breakAfter}};return d(this.tile,0,null),i}textDirectionAt(e){let{tile:i}=this.tile.resolveBlock(e,1);return getComputedStyle(i.dom).direction=="rtl"?St.RTL:St.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,c;for(let u of o.children){if(!u.isText()||/[^ -~]/.test(u.text))return;let d=mf(u.dom);if(d.length!=1)return;l+=d[0].width,c=d[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:c}}});if(e)return e;let i=document.createElement("div"),n,s,r;return i.className="cm-line",i.style.width="99999px",i.style.position="absolute",i.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(i);let o=mf(i.firstChild)[0];n=i.getBoundingClientRect().height,s=o&&o.width?o.width/27:7,r=o&&o.height?o.height:n,i.remove()}),{lineHeight:n,charWidth:s,textHeight:r}}computeBlockGapDeco(){let e=[],i=this.view.viewState;for(let n=0,s=0;;s++){let r=s==i.viewports.length?null:i.viewports[s],o=r?r.from-1:this.view.state.doc.length;if(o>n){let l=(i.lineBlockAt(o).bottom-i.lineBlockAt(n).top)/this.view.scaleY;e.push(Pe.replace({widget:new k_(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return Pe.set(e)}updateDeco(){let e=1,i=this.view.state.facet(dO).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),n=!1,s=this.view.state.facet(Nx).map((r,o)=>{let l=typeof r=="function";return l&&(n=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=n,i.push(Ge.join(s))),this.decorations=[this.editContextFormatting,...i,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(KD).map(r=>typeof r=="function"?r(this.view):r)}scrollIntoView(e){if(e.isSnapshot){let u=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=u.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let u of this.view.state.facet(HD))try{if(u(this.view,e.range,e))return!0}catch(d){$n(this.view.state,d,"scroll handler")}let{range:i}=e,n=this.coordsAt(i.head,i.empty?i.assoc:i.head>i.anchor?-1:1),s;if(!n)return;!i.empty&&(s=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,s.left),top:Math.min(n.top,s.top),right:Math.max(n.right,s.right),bottom:Math.max(n.bottom,s.bottom)});let r=jx(this.view),o={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:l,offsetHeight:c}=this.view.scrollDOM;if(Cq(this.view.scrollDOM,o,i.head<i.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,l),-l),Math.max(Math.min(e.yMargin,c),-c),this.view.textDirection==St.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let u=this.view.docView.lineAt(i.head,1);u&&u.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let i=n=>n.isWidget()||n.children.some(i);return i(this.tile.resolveBlock(e,1).tile)}destroy(){pb(this.tile)}}function pb(t,e){let i=e==null?void 0:e.get(t);if(i!=1){i==null&&t.destroy();for(let n of t.children)pb(n,e)}}function Kq(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 iB(t,e){let i=t.observer.selectionRange;if(!i.focusNode)return null;let n=LD(i.focusNode,i.focusOffset),s=DD(i.focusNode,i.focusOffset),r=n||s;if(s&&n&&s.node!=n.node){let l=ui.get(s.node);if(!l||l.isText()&&l.text!=s.node.nodeValue)r=s;else if(t.docView.lastCompositionAfterCursor){let c=ui.get(n.node);!c||c.isText()&&c.text!=n.node.nodeValue||(r=s)}}if(t.docView.lastCompositionAfterCursor=r!=n,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function Jq(t,e,i){let n=iB(t,i);if(!n)return null;let{node:s,from:r,to:o}=n,l=s.nodeValue;if(/[\n\r]/.test(l)||t.state.doc.sliceString(n.from,n.to)!=l)return null;let c=e.invertedDesc;return{range:new ks(c.mapPos(r),c.mapPos(o),r,o),text:s}}function eW(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 tW=class{constructor(){this.changes=[]}compareRange(e,i){Uc(e,i,this.changes)}comparePoint(e,i){Uc(e,i,this.changes)}boundChange(e){Uc(e,e,this.changes)}};function iW(t,e,i){let n=new tW;return Ge.compare(t,e,i,n),n.changes}class nW{constructor(){this.changes=[]}compareRange(e,i){Uc(e,i,this.changes)}comparePoint(){}boundChange(e){Uc(e,e,this.changes)}}function sW(t,e,i){let n=new nW;return Ge.compare(t,e,i,n),n.changes}function rW(t,e){for(let i=t;i&&i!=e;i=i.assignedSlot||i.parentNode)if(i.nodeType==1&&i.contentEditable=="false")return!0;return!1}function oW(t,e){let i=!1;return e&&t.iterChangedRanges((n,s)=>{n<e.to&&s>e.from&&(i=!0)}),i}class k_ extends Gs{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 aW(t,e,i=1){let n=t.charCategorizer(e),s=t.doc.lineAt(e),r=e-s.from;if(s.length==0)return re.cursor(e);r==0?i=1:r==s.length&&(i=-1);let o=r,l=r;i<0?o=Di(s.text,r,!1):l=Di(s.text,r);let c=n(s.text.slice(o,l));for(;o>0;){let u=Di(s.text,o,!1);if(n(s.text.slice(u,o))!=c)break;o=u}for(;l<s.length;){let u=Di(s.text,l);if(n(s.text.slice(l,u))!=c)break;l=u}return re.range(o+s.from,l+s.from)}function lW(t,e,i,n,s){let r=Math.round((n-e.left)*t.defaultCharacterWidth);if(t.lineWrapping&&i.height>t.defaultLineHeight*1.5){let l=t.viewState.heightOracle.textHeight,c=Math.floor((s-i.top-(t.defaultLineHeight-l)*.5)/l);r+=c*t.viewState.heightOracle.lineLength}let o=t.state.sliceDoc(i.from,i.to);return i.from+ib(o,r,t.state.tabSize)}function mb(t,e,i){let n=t.lineBlockAt(e);if(Array.isArray(n.type)){let s;for(let r of n.type){if(r.from>e)break;if(!(r.to<e)){if(r.from<e&&r.to>e)return r;(!s||r.type==Ki.Text&&(s.type!=r.type||(i<0?r.from<e:r.to>e)))&&(s=r)}}return s||n}return n}function cW(t,e,i,n){let s=mb(t,e.head,e.assoc||-1),r=!n||s.type!=Ki.Text||!(t.lineWrapping||s.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=t.dom.getBoundingClientRect(),l=t.textDirectionAt(s.from),c=t.posAtCoords({x:i==(l==St.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(c!=null)return re.cursor(c,i?-1:1)}return re.cursor(i?s.to:s.from,i?-1:1)}function GA(t,e,i,n){let s=t.state.doc.lineAt(e.head),r=t.bidiSpans(s),o=t.textDirectionAt(s.from);for(let l=e,c=null;;){let u=$q(s,r,o,l,i),d=jD;if(!u){if(s.number==(i?t.state.doc.lines:1))return l;d=`
65
+ `,s=t.state.doc.line(s.number+(i?1:-1)),r=t.bidiSpans(s),u=t.visualLineSide(s,!i)}if(c){if(!c(d))return l}else{if(!n)return u;c=n(d)}l=u}}function hW(t,e,i){let n=t.state.charCategorizer(e),s=n(i);return r=>{let o=n(r);return s==Dt.Space&&(s=o),s==o}}function uW(t,e,i,n){let s=e.head,r=i?1:-1;if(s==(i?t.state.doc.length:0))return re.cursor(s,e.assoc);let o=e.goalColumn,l,c=t.contentDOM.getBoundingClientRect(),u=t.coordsAtPos(s,(e.empty?e.assoc:0)||(i?1:-1)),d=t.documentTop;if(u)o==null&&(o=u.left-c.left),l=r<0?u.top:u.bottom;else{let _=t.viewState.lineBlockAt(s);o==null&&(o=Math.min(c.right-c.left,t.defaultCharacterWidth*(s-_.from))),l=(r<0?_.top:_.bottom)+d}let p=c.left+o,g=n??t.viewState.heightOracle.textHeight>>1,O=gb(t,{x:p,y:l+g*r},!1,r);return re.cursor(O.pos,O.assoc,void 0,o)}function Of(t,e,i){for(;;){let n=0;for(let s of t)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let c=n||i||(e-r<o-e?-1:1);e=c<0?r:o,n=c}});if(!n)return e}}function nB(t,e){let i=null;for(let n=0;n<e.ranges.length;n++){let s=e.ranges[n],r=null;if(s.empty){let o=Of(t,s.from,0);o!=s.from&&(r=re.cursor(o,-1))}else{let o=Of(t,s.from,-1),l=Of(t,s.to,1);(o!=s.from||l!=s.to)&&(r=re.range(s.from==s.anchor?o:l,s.from==s.head?o:l))}r&&(i||(i=e.ranges.slice()),i[n]=r)}return i?re.create(i,e.mainIndex):e}function T_(t,e,i){let n=Of(t.state.facet(fd).map(s=>s(t)),i.from,e.head>i.from?-1:1);return n==i.from?i:re.cursor(n,n<i.from?1:-1)}class Or{constructor(e,i){this.pos=e,this.assoc=i}}function gb(t,e,i,n){let s=t.contentDOM.getBoundingClientRect(),r=s.top+t.viewState.paddingTop,{x:o,y:l}=e,c=l-r,u;for(;;){if(c<0)return new Or(0,1);if(c>t.viewState.docHeight)return new Or(t.state.doc.length,-1);if(u=t.elementAtHeight(c),n==null)break;if(u.type==Ki.Text){if(n<0?u.to<t.viewport.from:u.from>t.viewport.to)break;let g=t.docView.coordsAt(n<0?u.from:u.to,n>0?-1:1);if(g&&(n<0?g.top<=c+r:g.bottom>=c+r))break}let p=t.viewState.heightOracle.textHeight/2;c=n>0?u.bottom+p:u.top-p}if(t.viewport.from>=u.to||t.viewport.to<=u.from){if(i)return null;if(u.type==Ki.Text){let p=lW(t,s,u,o,l);return new Or(p,p==u.from?1:-1)}}if(u.type!=Ki.Text)return c<(u.top+u.bottom)/2?new Or(u.from,1):new Or(u.to,-1);let d=t.docView.lineAt(u.from,2);return(!d||d.length!=u.length)&&(d=t.docView.lineAt(u.from,-2)),new fW(t,o,l,t.textDirectionAt(u.from)).scanTile(d,u.from)}class fW{constructor(e,i,n,s){this.view=e,this.x=i,this.y=n,this.baseDir=s,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,i){let{line:n,spans:s}=this.bidiSpansAt(e);return s[_r.find(s,e-n.from,-1,i)].level==this.baseDir}dirAt(e,i){let{line:n,spans:s}=this.bidiSpansAt(e);return s[_r.find(s,e-n.from,-1,i)].dir}bidiIn(e,i){let{spans:n,line:s}=this.bidiSpansAt(e);return n.length>1||n.length&&(n[0].level!=this.baseDir||n[0].to+s.from<i)}scan(e,i){let n=0,s=e.length-1,r=new Set,o=this.bidiIn(e[0],e[s]),l,c,u=-1,d=1e9,p;e:for(;n<s;){let O=s-n,_=n+s>>1;t:if(r.has(_)){let x=n+Math.floor(Math.random()*O);for(let w=0;w<O;w++){if(!r.has(x)){_=x;break t}x++,x==s&&(x=n)}break e}r.add(_);let b=i(_);if(b)for(let x=0;x<b.length;x++){let w=b[x],k=0;if(w.bottom<this.y)(!l||l.bottom<w.bottom)&&(l=w),k=1;else if(w.top>this.y)(!c||c.top>w.top)&&(c=w),k=-1;else{let T=w.left>this.x?this.x-w.left:w.right<this.x?this.x-w.right:0,A=Math.abs(T);A<d&&(u=_,d=A,p=w),T&&(k=T<0==(this.baseDir==St.LTR)?-1:1)}k==-1&&(!o||this.baseDirAt(e[_],1))?s=_:k==1&&(!o||this.baseDirAt(e[_+1],-1))&&(n=_+1)}}if(!p){let O=l&&(!c||this.y-l.bottom<c.top-this.y)?l:c;return this.y=(O.top+O.bottom)/2,this.scan(e,i)}let g=(o?this.dirAt(e[u],1):this.baseDir)==St.LTR;return{i:u,after:this.x>(p.left+p.right)/2==g}}scanText(e,i){let n=[];for(let r=0;r<e.length;r=Di(e.text,r))n.push(i+r);n.push(i+e.length);let s=this.scan(n,r=>{let o=n[r]-i,l=n[r+1]-i;return Bf(e.dom,o,l).getClientRects()});return s.after?new Or(n[s.i+1],-1):new Or(n[s.i],1)}scanTile(e,i){if(!e.length)return new Or(i,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,i);if(l.isComposite())return this.scanTile(l,i)}let n=[i];for(let l=0,c=i;l<e.children.length;l++)n.push(c+=e.children[l].length);let s=this.scan(n,l=>{let c=e.children[l];return c.flags&48?null:(c.dom.nodeType==1?c.dom:Bf(c.dom,0,c.length)).getClientRects()}),r=e.children[s.i],o=n[s.i];return r.isText()?this.scanText(r,o):r.isComposite()?this.scanTile(r,o):s.after?new Or(n[s.i+1],-1):new Or(o,1)}}const Gu="￿";class dW{constructor(e,i){this.points=e,this.view=i,this.text="",this.lineSeparator=i.state.facet(et.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Gu}readRange(e,i){if(!e)return this;let n=e.parentNode;for(let s=e;;){this.findPointBefore(n,s);let r=this.text.length;this.readNode(s);let o=ui.get(s),l=s.nextSibling;if(l==i){o!=null&&o.breakAfter&&!l&&n!=this.view.contentDOM&&this.lineBreak();break}let c=ui.get(l);(o&&c?o.breakAfter:(o?o.breakAfter:Sg(s))||Sg(l)&&(s.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>r)&&!mW(l,i)&&this.lineBreak(),s=l}return this.findPointBefore(n,i),this}readTextNode(e){let i=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,i.length));for(let n=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=i.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=s.exec(i))&&(r=l.index,o=l[0].length),this.append(i.slice(n,r<0?i.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let c of this.points)c.node==e&&c.pos>this.text.length&&(c.pos-=o-1);n=r+o}}readNode(e){let i=ui.get(e),n=i&&i.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let s=n.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.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,i){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==i&&(n.pos=this.text.length)}findPointInside(e,i){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(pW(e,n.node,n.offset)?i:0))}}function pW(t,e,i){for(;;){if(!e||i<yo(e))return!1;if(e==t)return!0;i=Ca(e)+1,e=e.parentNode}}function mW(t,e){let i;for(;!(t==e||!t);t=t.nextSibling){let n=ui.get(t);if(!(n!=null&&n.isWidget()))return!1;n&&(i||(i=[])).push(n)}if(i)for(let n of i){let s=n.overrideDOMText;if(s!=null&&s.length)return!1}return!0}class KA{constructor(e,i){this.node=e,this.offset=i,this.pos=-1}}class gW{constructor(e,i,n,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=i>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&i>-1)this.newSel=null;else if(i>-1&&(this.bounds=sB(e.docView.tile,i,n,0))){let l=r||o?[]:vW(e),c=new dW(l,e);c.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=c.text,this.newSel=_W(l,this.bounds.from)}else{let l=e.observer.selectionRange,c=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!cb(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),u=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!cb(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),d=e.viewport;if((xe.ios||xe.chrome)&&e.state.selection.main.empty&&c!=u&&(d.from>0||d.to<e.state.doc.length)){let p=Math.min(c,u),g=Math.max(c,u),O=d.from-p,_=d.to-g;(O==0||O==1||p==0)&&(_==0||_==-1||g==e.state.doc.length)&&(c=0,u=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(re.range(u,c)):this.newSel=re.single(u,c)}}}function sB(t,e,i,n){if(t.isComposite()){let s=-1,r=-1,o=-1,l=-1;for(let c=0,u=n,d=n;c<t.children.length;c++){let p=t.children[c],g=u+p.length;if(u<e&&g>i)return sB(p,e,i,u);if(g>=e&&s==-1&&(s=c,r=u),u>i&&p.dom.parentNode==t.dom){o=c,l=d;break}d=g,u=g+p.breakAfter}return{from:r,to:l<0?n+t.length:l,startDOM:(s?t.children[s-1].dom.nextSibling:null)||t.dom.firstChild,endDOM:o<t.children.length&&o>=0?t.children[o].dom:null}}else return t.isText()?{from:n,to:n+t.length,startDOM:t.dom,endDOM:t.dom.nextSibling}:null}function rB(t,e){let i,{newSel:n}=e,s=t.state.selection.main,r=t.inputState.lastKeyTime>Date.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,c=s.from,u=null;(r===8||xe.android&&e.text.length<l-o)&&(c=s.to,u="end");let d=oB(t.state.doc.sliceString(o,l,Gu),e.text,c-o,u);d&&(xe.chrome&&r==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Gu+Gu&&d.toB--,i={from:o+d.from,to:o+d.toA,insert:at.of(e.text.slice(d.from,d.toB).split(Gu))})}else n&&(!t.hasFocus&&t.state.facet(uo)||kg(n,s))&&(n=null);if(!i&&!n)return!1;if(!i&&e.typeOver&&!s.empty&&n&&n.main.empty?i={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,s.to)}:(xe.mac||xe.android)&&i&&i.from==i.to&&i.from==s.head-1&&/^\. ?$/.test(i.insert.toString())&&t.contentDOM.getAttribute("autocorrect")=="off"?(n&&i.insert.length==2&&(n=re.single(n.main.anchor-1,n.main.head-1)),i={from:i.from,to:i.to,insert:at.of([i.insert.toString().replace("."," ")])}):i&&i.from>=s.from&&i.to<=s.to&&(i.from!=s.from||i.to!=s.to)&&s.to-s.from-(i.to-i.from)<=4?i={from:s.from,to:s.to,insert:t.state.doc.slice(s.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,s.to))}:t.state.doc.lineAt(s.from).to<s.to&&t.docView.lineHasWidget(s.to)&&t.inputState.insertingTextAt>Date.now()-50?i={from:s.from,to:s.to,insert:t.state.toText(t.inputState.insertingText)}:xe.chrome&&i&&i.from==i.to&&i.from==s.head&&i.insert.toString()==`
66
+ `&&t.lineWrapping&&(n&&(n=re.single(n.main.anchor-1,n.main.head-1)),i={from:s.from,to:s.to,insert:at.of([" "])}),i)return Ix(t,i,n,r);if(n&&!kg(n,s)){let o=!1,l="select";return t.inputState.lastSelectionTime>Date.now()-50&&(t.inputState.lastSelectionOrigin=="select"&&(o=!0),l=t.inputState.lastSelectionOrigin,l=="select.pointer"&&(n=nB(t.state.facet(fd).map(c=>c(t)),n))),t.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function Ix(t,e,i,n=-1){if(xe.ios&&t.inputState.flushIOSKey(e))return!0;let s=t.state.selection.main;if(xe.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&t.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Yc(t.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||n==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&Yc(t.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Yc(t.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();t.inputState.composing>=0&&t.inputState.composing++;let o,l=()=>o||(o=OW(t,e,i));return t.state.facet(qD).some(c=>c(t,e.from,e.to,r,l))||t.dispatch(l()),!0}function OW(t,e,i){let n,s=t.state,r=s.selection.main,o=-1;if(e.from==e.to&&e.from<r.from||e.from>r.to){let c=e.from<r.from?-1:1,u=c<0?r.from:r.to,d=Of(s.facet(fd).map(p=>p(t)),u,c);e.from==d&&(o=d)}if(o>-1)n={changes:e,selection:re.cursor(e.from+e.insert.length,-1)};else if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let c=r.from<e.from?s.sliceDoc(r.from,e.from):"",u=r.to>e.to?s.sliceDoc(e.to,r.to):"";n=s.replaceSelection(t.state.toText(c+e.insert.sliceString(0,void 0,t.state.lineBreak)+u))}else{let c=s.changes(e),u=i&&i.main.to<=c.newLength?i.main:void 0;if(s.selection.ranges.length>1&&(t.inputState.composing>=0||t.inputState.compositionPendingChange)&&e.to<=r.to+10&&e.to>=r.to-10){let d=t.state.sliceDoc(e.from,e.to),p,g=i&&iB(t,i.main.head);if(g){let _=e.insert.length-(e.to-e.from);p={from:g.from,to:g.to-_}}else p=t.state.doc.lineAt(r.head);let O=r.to-e.to;n=s.changeByRange(_=>{if(_.from==r.from&&_.to==r.to)return{changes:c,range:u||_.map(c)};let b=_.to-O,x=b-d.length;if(t.state.sliceDoc(x,b)!=d||b>=p.from&&x<=p.to)return{range:_};let w=s.changes({from:x,to:b,insert:e.insert}),k=_.to-r.to;return{changes:w,range:u?re.range(Math.max(0,u.anchor+k),Math.max(0,u.head+k)):_.map(w)}})}else n={changes:c,selection:u&&s.selection.replaceRange(u)}}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)),s.update(n,{userEvent:l,scrollIntoView:!0})}function oB(t,e,i,n){let s=Math.min(t.length,e.length),r=0;for(;r<s&&t.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&t.length==e.length)return null;let o=t.length,l=e.length;for(;o>0&&l>0&&t.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let c=Math.max(0,r-Math.min(o,l));i-=o+c-r}if(o<r&&t.length<e.length){let c=i<=r&&i>=o?r-i:0;r-=c,l=r+(l-o),o=r}else if(l<r){let c=i<=r&&i>=l?r-i:0;r-=c,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function vW(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}=t.observer.selectionRange;return i&&(e.push(new KA(i,n)),(s!=i||r!=n)&&e.push(new KA(s,r))),e}function _W(t,e){if(t.length==0)return null;let i=t[0].pos,n=t.length==2?t[1].pos:i;return i>-1&&n>-1?re.single(i+e,n+e):null}function kg(t,e){return e.head==t.main.head&&e.anchor==t.main.anchor}class yW{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&&DW(e.contentDOM.ownerDocument)}handleEvent(e){!AW(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,i){let n=this.handlers[e];if(n){for(let s of n.observers)s(this.view,i);for(let s of n.handlers){if(i.defaultPrevented)break;if(s(this.view,i)){i.preventDefault();break}}}}ensureHandlers(e){let i=bW(e),n=this.handlers,s=this.view.contentDOM;for(let r in i)if(r!="scroll"){let o=!i[r].handlers.length,l=n[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in n)r!="scroll"&&!i[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=i}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&&lB.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 i;return xe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((i=aB.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||SW.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=i||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let i=this.pendingIOSKey;return!i||i.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Yc(this.view.contentDOM,i.key,i.keyCode,i instanceof KeyboardEvent?i: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 JA(t,e){return(i,n)=>{try{return e.call(t,n,i)}catch(s){$n(i.state,s)}}}function bW(t){let e=Object.create(null);function i(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of t){let s=n.spec,r=s&&s.plugin.domEventHandlers,o=s&&s.plugin.domEventObservers;if(r)for(let l in r){let c=r[l];c&&i(l).handlers.push(JA(n.value,c))}if(o)for(let l in o){let c=o[l];c&&i(l).observers.push(JA(n.value,c))}}for(let n in Hs)i(n).handlers.push(Hs[n]);for(let n in Qs)i(n).observers.push(Qs[n]);return e}const aB=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],SW="dthko",lB=[16,17,18,20,91,92,224,225],em=6;function tm(t){return Math.max(0,t)*.7+8}function xW(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class wW{constructor(e,i,n,s){this.view=e,this.startEvent=i,this.style=n,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=i,this.scrollParents=kq(e.contentDOM),this.atoms=e.state.facet(fd).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=i.shiftKey,this.multiple=e.state.facet(et.allowMultipleSelections)&&CW(e,i),this.dragging=TW(e,i)&&uB(i)==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&&xW(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,n=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let c=jx(this.view);e.clientX-c.left<=s+em?i=-tm(s-e.clientX):e.clientX+c.right>=o-em&&(i=tm(e.clientX-o)),e.clientY-c.top<=r+em?n=-tm(r-e.clientY):e.clientY+c.bottom>=l-em&&(n=tm(e.clientY-l)),this.setScrollSpeed(i,n)}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,i){this.scrollSpeed={x:e,y:i},e||i?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:i}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),i&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=i,i=0),(e||i)&&this.view.win.scrollBy(e,i),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:i}=this,n=nB(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!n.eq(i.state.selection,this.dragging===!1))&&this.view.dispatch({selection:n,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(i=>i.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function CW(t,e){let i=t.state.facet(ID);return i.length?i[0](e):xe.mac?e.metaKey:e.ctrlKey}function kW(t,e){let i=t.state.facet(VD);return i.length?i[0](e):xe.mac?!e.altKey:!e.ctrlKey}function TW(t,e){let{main:i}=t.state.selection;if(i.empty)return!1;let n=Lf(t.root);if(!n||n.rangeCount==0)return!0;let s=n.getRangeAt(0).getClientRects();for(let r=0;r<s.length;r++){let o=s[r];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function AW(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let i=e.target,n;i!=t.contentDOM;i=i.parentNode)if(!i||i.nodeType==11||(n=ui.get(i))&&n.isWidget()&&!n.isHidden&&n.widget.ignoreEvent(e))return!1;return!0}const Hs=Object.create(null),Qs=Object.create(null),cB=xe.ie&&xe.ie_version<15||xe.ios&&xe.webkit_version<604;function EW(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.focus(),setTimeout(()=>{t.focus(),i.remove(),hB(t,i.value)},50)}function gO(t,e,i){for(let n of t.facet(e))i=n(i,t);return i}function hB(t,e){e=gO(t.state,Bx,e);let{state:i}=t,n,s=1,r=i.toText(e),o=r.lines==i.selection.ranges.length;if(Ob!=null&&i.selection.ranges.every(c=>c.empty)&&Ob==r.toString()){let c=-1;n=i.changeByRange(u=>{let d=i.doc.lineAt(u.from);if(d.from==c)return{range:u};c=d.from;let p=i.toText((o?r.line(s++).text:e)+i.lineBreak);return{changes:{from:d.from,insert:p},range:re.cursor(u.from+p.length)}})}else o?n=i.changeByRange(c=>{let u=r.line(s++);return{changes:{from:c.from,to:c.to,insert:u.text},range:re.cursor(c.from+u.length)}}):n=i.replaceSelection(r);t.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Qs.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop,t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Hs.keydown=(t,e)=>(t.inputState.setSelectionOrigin("select"),e.keyCode==27&&t.inputState.tabFocusMode!=0&&(t.inputState.tabFocusMode=Date.now()+2e3),!1);Qs.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now(),t.inputState.setSelectionOrigin("select.pointer")};Qs.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Hs.mousedown=(t,e)=>{if(t.observer.flush(),t.inputState.lastTouchTime>Date.now()-2e3)return!1;let i=null;for(let n of t.state.facet(XD))if(i=n(t,e),i)break;if(!i&&e.button==0&&(i=PW(t,e)),i){let n=!t.hasFocus;t.inputState.startMouseSelection(new wW(t,e,i,n)),n&&t.observer.ignore(()=>{RD(t.contentDOM);let r=t.root.activeElement;r&&!r.contains(t.contentDOM)&&r.blur()});let s=t.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}else t.inputState.setSelectionOrigin("select.pointer");return!1};function eE(t,e,i,n){if(n==1)return re.cursor(e,i);if(n==2)return aW(t.state,e,i);{let s=t.docView.lineAt(e,i),r=t.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return l<t.state.doc.length&&l==r.to&&l++,re.range(o,l)}}const MW=xe.ie&&xe.ie_version<=11;let tE=null,iE=0,nE=0;function uB(t){if(!MW)return t.detail;let e=tE,i=nE;return tE=t,nE=Date.now(),iE=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(iE+1)%3:1}function PW(t,e){let i=t.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),n=uB(e),s=t.state.selection;return{update(r){r.docChanged&&(i.pos=r.changes.mapPos(i.pos),s=s.map(r.changes))},get(r,o,l){let c=t.posAndSideAtCoords({x:r.clientX,y:r.clientY},!1),u,d=eE(t,c.pos,c.assoc,n);if(i.pos!=c.pos&&!o){let p=eE(t,i.pos,i.assoc,n),g=Math.min(p.from,d.from),O=Math.max(p.to,d.to);d=g<d.from?re.range(g,O):re.range(O,g)}return o?s.replaceRange(s.main.extend(d.from,d.to)):l&&n==1&&s.ranges.length>1&&(u=RW(s,c.pos))?u:l?s.addRange(d):re.create([d])}}}function RW(t,e){for(let i=0;i<t.ranges.length;i++){let{from:n,to:s}=t.ranges[i];if(n<=e&&s>=e)return re.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}Hs.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let s=t.docView.tile.nearest(e.target);if(s&&s.isWidget()){let r=s.posAtStart,o=r+s.length;(r>=i.to||o<=i.from)&&(i=re.range(r,o))}}let{inputState:n}=t;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=i,e.dataTransfer&&(e.dataTransfer.setData("Text",gO(t.state,$x,t.state.sliceDoc(i.from,i.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Hs.dragend=t=>(t.inputState.draggedContent=null,!1);function sE(t,e,i,n){if(i=gO(t.state,Bx,i),!i)return;let s=t.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=t.inputState,o=n&&r&&kW(t,e)?{from:r.from,to:r.to}:null,l={from:s,insert:i},c=t.state.changes(o?[o,l]:l);t.focus(),t.dispatch({changes:c,selection:{anchor:c.mapPos(s,-1),head:c.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),t.inputState.draggedContent=null}Hs.drop=(t,e)=>{if(!e.dataTransfer)return!1;if(t.state.readOnly)return!0;let i=e.dataTransfer.files;if(i&&i.length){let n=Array(i.length),s=0,r=()=>{++s==i.length&&sE(t,e,n.filter(o=>o!=null).join(t.state.lineBreak),!1)};for(let o=0;o<i.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),r()},l.readAsText(i[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return sE(t,e,n,!0),!0}return!1};Hs.paste=(t,e)=>{if(t.state.readOnly)return!0;t.observer.flush();let i=cB?null:e.clipboardData;return i?(hB(t,i.getData("text/plain")||i.getData("text/uri-list")),!0):(EW(t),!1)};function QW(t,e){let i=t.dom.parentNode;if(!i)return;let n=i.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),t.focus()},50)}function LW(t){let e=[],i=[],n=!1;for(let s of t.selection.ranges)s.empty||(e.push(t.sliceDoc(s.from,s.to)),i.push(s));if(!e.length){let s=-1;for(let{from:r}of t.selection.ranges){let o=t.doc.lineAt(r);o.number>s&&(e.push(o.text),i.push({from:o.from,to:Math.min(t.doc.length,o.to+1)})),s=o.number}n=!0}return{text:gO(t,$x,e.join(t.lineBreak)),ranges:i,linewise:n}}let Ob=null;Hs.copy=Hs.cut=(t,e)=>{if(!pf(t.contentDOM,t.observer.selectionRange))return!1;let{text:i,ranges:n,linewise:s}=LW(t.state);if(!i&&!s)return!1;Ob=s?i:null,e.type=="cut"&&!t.state.readOnly&&t.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let r=cB?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",i),!0):(QW(t,i),!1)};const fB=Rr.define();function dB(t,e){let i=[];for(let n of t.facet(WD)){let s=n(t,e);s&&i.push(s)}return i.length?t.update({effects:i,annotations:fB.of(!0)}):null}function pB(t){setTimeout(()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=dB(t.state,e);i?t.dispatch(i):t.update([])}},10)}Qs.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),pB(t)};Qs.blur=t=>{t.observer.clearSelectionRange(),pB(t)};Qs.compositionstart=Qs.compositionupdate=t=>{t.observer.editContext||(t.inputState.compositionFirstChange==null&&(t.inputState.compositionFirstChange=!0),t.inputState.composing<0&&(t.inputState.composing=0))};Qs.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))};Qs.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Hs.beforeinput=(t,e)=>{var i,n;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(t.inputState.insertingText=e.data,t.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&t.observer.editContext){let r=(i=e.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain"),o=e.getTargetRanges();if(r&&o.length){let l=o[0],c=t.posAtDOM(l.startContainer,l.startOffset),u=t.posAtDOM(l.endContainer,l.endOffset);return Ix(t,{from:c,to:u,insert:t.state.toText(r)},null),!0}}let s;if(xe.chrome&&xe.android&&(s=aB.find(r=>r.inputType==e.inputType))&&(t.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let r=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+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(()=>Qs.compositionend(t,e),20),!1};const rE=new Set;function DW(t){rE.has(t)||(rE.add(t),t.addEventListener("copy",()=>{}),t.addEventListener("cut",()=>{}))}const oE=["pre-wrap","normal","pre-line","break-spaces"];let ah=!1;function aE(){ah=!1}class BW{constructor(e){this.lineWrapping=e,this.doc=at.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,i){let n=this.doc.lineAt(i).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((i-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}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 oE.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let i=!1;for(let n=0;n<e.length;n++){let s=e[n];s<0?n++:this.heightSamples[Math.floor(s*10)]||(i=!0,this.heightSamples[Math.floor(s*10)]=!0)}return i}refresh(e,i,n,s,r,o){let l=oE.indexOf(e)>-1,c=Math.abs(i-this.lineHeight)>.3||this.lineWrapping!=l||Math.abs(n-this.charWidth)>.1;if(this.lineWrapping=l,this.lineHeight=i,this.charWidth=n,this.textHeight=s,this.lineLength=r,c){this.heightSamples={};for(let u=0;u<o.length;u++){let d=o[u];d<0?u++:this.heightSamples[Math.floor(d*10)]=!0}}return c}}class $W{constructor(e,i){this.from=e,this.heights=i,this.index=0}get more(){return this.index<this.heights.length}}class Zs{constructor(e,i,n,s,r){this.from=e,this.length=i,this.top=n,this.height=s,this._content=r}get type(){return typeof this._content=="number"?Ki.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 kl?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let i=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new Zs(this.from,this.length+e.length,this.top,this.height+e.height,i)}}var Ct=(function(t){return t[t.ByPos=0]="ByPos",t[t.ByHeight=1]="ByHeight",t[t.ByPosNoHeight=2]="ByPosNoHeight",t})(Ct||(Ct={}));const Xm=.001;class _n{constructor(e,i,n=2){this.length=e,this.height=i,this.flags=n}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)>Xm&&(ah=!0),this.height=e)}replace(e,i,n){return _n.of(n)}decomposeLeft(e,i){i.push(this)}decomposeRight(e,i){i.push(this)}applyChanges(e,i,n,s){let r=this,o=n.doc;for(let l=s.length-1;l>=0;l--){let{fromA:c,toA:u,fromB:d,toB:p}=s[l],g=r.lineAt(c,Ct.ByPosNoHeight,n.setDoc(i),0,0),O=g.to>=u?g:r.lineAt(u,Ct.ByPosNoHeight,n,0,0);for(p+=O.to-u,u=O.to;l>0&&g.from<=s[l-1].toA;)c=s[l-1].fromA,d=s[l-1].fromB,l--,c<g.from&&(g=r.lineAt(c,Ct.ByPosNoHeight,n,0,0));d+=g.from-c,c=g.from;let _=Vx.build(n.setDoc(o),e,d,p);r=Tg(r,r.replace(c,u,_))}return r.updateHeight(n,0)}static empty(){return new ts(0,0,0)}static of(e){if(e.length==1)return e[0];let i=0,n=e.length,s=0,r=0;for(;;)if(i==n)if(s>r*2){let l=e[i-1];l.break?e.splice(--i,1,l.left,null,l.right):e.splice(--i,1,l.left,l.right),n+=1+l.break,s-=l.size}else if(r>s*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,r-=l.size}else break;else if(s<r){let l=e[i++];l&&(s+=l.size)}else{let l=e[--n];l&&(r+=l.size)}let o=0;return e[i-1]==null?(o=1,i--):e[i]==null&&(o=1,n++),new NW(_n.of(e.slice(0,i)),o,_n.of(e.slice(n)))}}function Tg(t,e){return t==e?t:(t.constructor!=e.constructor&&(ah=!0),e)}_n.prototype.size=1;const zW=Pe.replace({});class mB extends _n{constructor(e,i,n){super(e,i),this.deco=n,this.spaceAbove=0}mainBlock(e,i){return new Zs(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,i,n,s){return this.spaceAbove&&e<n+this.spaceAbove?new Zs(s,0,n,this.spaceAbove,zW):this.mainBlock(n,s)}lineAt(e,i,n,s,r){let o=this.mainBlock(s,r);return this.spaceAbove?this.blockAt(0,n,s,r).join(o):o}forEachLine(e,i,n,s,r,o){e<=r+this.length&&i>=r&&o(this.lineAt(0,Ct.ByPos,n,s,r))}setMeasuredHeight(e){let i=e.heights[e.index++];i<0?(this.spaceAbove=-i,i=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(i)}updateHeight(e,i=0,n=!1,s){return s&&s.from<=i&&s.more&&this.setMeasuredHeight(s),this.outdated=!1,this}toString(){return`block(${this.length})`}}class ts extends mB{constructor(e,i,n){super(e,i,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=n}mainBlock(e,i){return new Zs(i,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,i,n){let s=n[0];return n.length==1&&(s instanceof ts||s instanceof Wi&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof Wi?s=new ts(s.length,this.height,this.spaceAbove):s.height=this.height,this.outdated||(s.outdated=!1),s):_n.of(n)}updateHeight(e,i=0,n=!1,s){return s&&s.from<=i&&s.more?this.setMeasuredHeight(s):(n||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 Wi extends _n{constructor(e){super(e,0)}heightMetrics(e,i){let n=e.doc.lineAt(i).number,s=e.doc.lineAt(i+this.length).number,r=s-n+1,o,l=0;if(e.lineWrapping){let c=Math.min(this.height,e.lineHeight*r);o=c/r,this.length>r+1&&(l=(this.height-c)/(this.length-r-1))}else o=this.height/r;return{firstLine:n,lastLine:s,perLine:o,perChar:l}}blockAt(e,i,n,s){let{firstLine:r,lastLine:o,perLine:l,perChar:c}=this.heightMetrics(i,s);if(i.lineWrapping){let u=s+(e<i.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length)),d=i.doc.lineAt(u),p=l+d.length*c,g=Math.max(n,e-p/2);return new Zs(d.from,d.length,g,p,0)}else{let u=Math.max(0,Math.min(o-r,Math.floor((e-n)/l))),{from:d,length:p}=i.doc.line(r+u);return new Zs(d,p,n+l*u,l,0)}}lineAt(e,i,n,s,r){if(i==Ct.ByHeight)return this.blockAt(e,n,s,r);if(i==Ct.ByPosNoHeight){let{from:O,to:_}=n.doc.lineAt(e);return new Zs(O,_-O,0,0,0)}let{firstLine:o,perLine:l,perChar:c}=this.heightMetrics(n,r),u=n.doc.lineAt(e),d=l+u.length*c,p=u.number-o,g=s+l*p+c*(u.from-r-p);return new Zs(u.from,u.length,Math.max(s,Math.min(g,s+this.height-d)),d,0)}forEachLine(e,i,n,s,r,o){e=Math.max(e,r),i=Math.min(i,r+this.length);let{firstLine:l,perLine:c,perChar:u}=this.heightMetrics(n,r);for(let d=e,p=s;d<=i;){let g=n.doc.lineAt(d);if(d==e){let _=g.number-l;p+=c*_+u*(e-r-_)}let O=c+u*g.length;o(new Zs(g.from,g.length,p,O,0)),p+=O,d=g.to+1}}replace(e,i,n){let s=this.length-i;if(s>0){let r=n[n.length-1];r instanceof Wi?n[n.length-1]=new Wi(r.length+s):n.push(null,new Wi(s-1))}if(e>0){let r=n[0];r instanceof Wi?n[0]=new Wi(e+r.length):n.unshift(new Wi(e-1),null)}return _n.of(n)}decomposeLeft(e,i){i.push(new Wi(e-1),null)}decomposeRight(e,i){i.push(null,new Wi(this.length-e-1))}updateHeight(e,i=0,n=!1,s){let r=i+this.length;if(s&&s.from<=i+this.length&&s.more){let o=[],l=Math.max(i,s.from),c=-1;for(s.from>i&&o.push(new Wi(s.from-i-1).updateHeight(e,i));l<=r&&s.more;){let d=e.doc.lineAt(l).length;o.length&&o.push(null);let p=s.heights[s.index++],g=0;p<0&&(g=-p,p=s.heights[s.index++]),c==-1?c=p:Math.abs(p-c)>=Xm&&(c=-2);let O=new ts(d,p,g);O.outdated=!1,o.push(O),l+=d+1}l<=r&&o.push(null,new Wi(r-l).updateHeight(e,l));let u=_n.of(o);return(c<0||Math.abs(u.height-this.height)>=Xm||Math.abs(c-this.heightMetrics(e,i).perLine)>=Xm)&&(ah=!0),Tg(this,u)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(i,i+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class NW extends _n{constructor(e,i,n){super(e.length+i+n.length,e.height+n.height,i|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,i,n,s){let r=n+this.left.height;return e<r?this.left.blockAt(e,i,n,s):this.right.blockAt(e,i,r,s+this.left.length+this.break)}lineAt(e,i,n,s,r){let o=s+this.left.height,l=r+this.left.length+this.break,c=i==Ct.ByHeight?e<o:e<l,u=c?this.left.lineAt(e,i,n,s,r):this.right.lineAt(e,i,n,o,l);if(this.break||(c?u.to<l:u.from>l))return u;let d=i==Ct.ByPosNoHeight?Ct.ByPosNoHeight:Ct.ByPos;return c?u.join(this.right.lineAt(l,d,n,o,l)):this.left.lineAt(l,d,n,s,r).join(u)}forEachLine(e,i,n,s,r,o){let l=s+this.left.height,c=r+this.left.length+this.break;if(this.break)e<c&&this.left.forEachLine(e,i,n,s,r,o),i>=c&&this.right.forEachLine(e,i,n,l,c,o);else{let u=this.lineAt(c,Ct.ByPos,n,s,r);e<u.from&&this.left.forEachLine(e,u.from-1,n,s,r,o),u.to>=e&&u.from<=i&&o(u),i>u.to&&this.right.forEachLine(u.to+1,i,n,l,c,o)}}replace(e,i,n){let s=this.left.length+this.break;if(i<s)return this.balanced(this.left.replace(e,i,n),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-s,i-s,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of n)r.push(l);if(e>0&&lE(r,o-1),i<this.length){let l=r.length;this.decomposeRight(i,r),lE(r,l)}return _n.of(r)}decomposeLeft(e,i){let n=this.left.length;if(e<=n)return this.left.decomposeLeft(e,i);i.push(this.left),this.break&&(n++,e>=n&&i.push(null)),e>n&&this.right.decomposeLeft(e-n,i)}decomposeRight(e,i){let n=this.left.length,s=n+this.break;if(e>=s)return this.right.decomposeRight(e-s,i);e<n&&this.left.decomposeRight(e,i),this.break&&e<s&&i.push(null),i.push(this.right)}balanced(e,i){return e.size>2*i.size||i.size>2*e.size?_n.of(this.break?[e,null,i]:[e,i]):(this.left=Tg(this.left,e),this.right=Tg(this.right,i),this.setHeight(e.height+i.height),this.outdated=e.outdated||i.outdated,this.size=e.size+i.size,this.length=e.length+this.break+i.length,this)}updateHeight(e,i=0,n=!1,s){let{left:r,right:o}=this,l=i+r.length+this.break,c=null;return s&&s.from<=i+r.length&&s.more?c=r=r.updateHeight(e,i,n,s):r.updateHeight(e,i,n),s&&s.from<=l+o.length&&s.more?c=o=o.updateHeight(e,l,n,s):o.updateHeight(e,l,n),c?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function lE(t,e){let i,n;t[e]==null&&(i=t[e-1])instanceof Wi&&(n=t[e+1])instanceof Wi&&t.splice(e-1,3,new Wi(i.length+1+n.length))}const jW=5;class Vx{constructor(e,i){this.pos=e,this.oracle=i,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,i){if(this.lineStart>-1){let n=Math.min(i,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof ts?s.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new ts(n-this.pos,-1,0)),this.writtenTo=n,i>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=i}point(e,i,n){if(e<i||n.heightRelevant){let s=n.widget?n.widget.estimatedHeight:0,r=n.widget?n.widget.lineBreaks:0;s<0&&(s=this.oracle.lineHeight);let o=i-e;n.block?this.addBlock(new mB(o,s,n)):(o||r||s>=jW)&&this.addLineDeco(s,r,o)}else i>e&&this.span(e,i);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:i}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=i,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 ts(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,i){let n=new Wi(i-e);return this.oracle.doc.lineAt(e).to==i&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof ts)return e;let i=new ts(0,-1,0);return this.nodes.push(i),i}addBlock(e){this.enterLine();let i=e.deco;i&&i.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,i&&i.endSide>0&&(this.covering=e)}addLineDeco(e,i,n){let s=this.ensureLine();s.length+=n,s.collapsed+=n,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=i,this.writtenTo=this.pos=this.pos+n}finish(e){let i=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(i instanceof ts)&&!this.isCovered?this.nodes.push(new ts(0,-1,0)):(this.writtenTo<this.pos||i==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let n=e;for(let s of this.nodes)s instanceof ts&&s.updateHeight(this.oracle,n),n+=s?s.length:1;return this.nodes}static build(e,i,n,s){let r=new Vx(n,e);return Ge.spans(i,n,s,r,0),r.finish(n)}}function IW(t,e,i){let n=new VW;return Ge.compare(t,e,i,n,0),n.changes}class VW{constructor(){this.changes=[]}compareRange(){}comparePoint(e,i,n,s){(e<i||n&&n.heightRelevant||s&&s.heightRelevant)&&Uc(e,i,this.changes,5)}}function XW(t,e){let i=t.getBoundingClientRect(),n=t.ownerDocument,s=n.defaultView||window,r=Math.max(0,i.left),o=Math.min(s.innerWidth,i.right),l=Math.max(0,i.top),c=Math.min(s.innerHeight,i.bottom);for(let u=t.parentNode;u&&u!=n.body;)if(u.nodeType==1){let d=u,p=window.getComputedStyle(d);if((d.scrollHeight>d.clientHeight||d.scrollWidth>d.clientWidth)&&p.overflow!="visible"){let g=d.getBoundingClientRect();r=Math.max(r,g.left),o=Math.min(o,g.right),l=Math.max(l,g.top),c=Math.min(u==t.parentNode?s.innerHeight:c,g.bottom)}u=p.position=="absolute"||p.position=="fixed"?d.offsetParent:d.parentNode}else if(u.nodeType==11)u=u.host;else break;return{left:r-i.left,right:Math.max(r,o)-i.left,top:l-(i.top+e),bottom:Math.max(l,c)-(i.top+e)}}function ZW(t){let e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left<i.innerWidth&&e.right>0&&e.top<i.innerHeight&&e.bottom>0}function qW(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class A_{constructor(e,i,n,s){this.from=e,this.to=i,this.size=n,this.displaySize=s}static same(e,i){if(e.length!=i.length)return!1;for(let n=0;n<e.length;n++){let s=e[n],r=i[n];if(s.from!=r.from||s.to!=r.to||s.size!=r.size)return!1}return!0}draw(e,i){return Pe.replace({widget:new WW(this.displaySize*(i?e.scaleY:e.scaleX),i)}).range(this.from,this.to)}}class WW extends Gs{constructor(e,i){super(),this.size=e,this.vertical=i}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 cE{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=hE,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=St.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=e.facet(zx).some(n=>typeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new BW(i),this.stateDeco=uE(e),this.heightMap=_n.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle.setDoc(e.doc),[new ks(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Pe.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:i}=this.state.selection;for(let n=0;n<=1;n++){let s=n?i.head:i.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new im(r,o))}}return this.viewports=e.sort((n,s)=>n.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?hE:new Xx(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(Ku(e,this.scaler))})}update(e,i=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=uE(this.state);let s=e.changedRanges,r=ks.extendWithRanges(s,IW(n,this.stateDeco,e?e.changes:vi.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);aE(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||ah)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let c=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(i&&(i.range.head<c.from||i.range.head>c.to)||!this.viewportIsAppropriate(c))&&(c=this.getViewport(0,i));let u=c.from!=this.viewport.from||c.to!=this.viewport.to;this.viewport=c,e.flags|=this.updateForViewport(),(u||!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),i&&(this.scrollTarget=i),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(YD)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let i=e.contentDOM,n=window.getComputedStyle(i),s=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?St.RTL:St.LTR;let o=this.heightOracle.mustRefreshForWrapping(r)||this.mustMeasureContent==="refresh",l=i.getBoundingClientRect(),c=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let u=0,d=0;if(l.width&&l.height){let{scaleX:A,scaleY:L}=PD(i,l);(A>.005&&Math.abs(this.scaleX-A)>.005||L>.005&&Math.abs(this.scaleY-L)>.005)&&(this.scaleX=A,this.scaleY=L,u|=16,o=c=!0)}let p=(parseInt(n.paddingTop)||0)*this.scaleY,g=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=g)&&(this.paddingTop=p,this.paddingBottom=g,u|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(c=!0),this.editorWidth=e.scrollDOM.clientWidth,u|=16);let O=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=O&&(this.scrollAnchorHeight=-1,this.scrollTop=O),this.scrolledToBottom=QD(e.scrollDOM);let _=(this.printing?qW:XW)(i,this.paddingTop),b=_.top-this.pixelViewport.top,x=_.bottom-this.pixelViewport.bottom;this.pixelViewport=_;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView&&(this.inView=w,w&&(c=!0)),!this.inView&&!this.scrollTarget&&!ZW(e.dom))return 0;let k=l.width;if((this.contentDOMWidth!=k||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,u|=16),c){let A=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(A)&&(o=!0),o||s.lineWrapping&&Math.abs(k-this.contentDOMWidth)>s.charWidth){let{lineHeight:L,charWidth:E,textHeight:z}=e.docView.measureTextSize();o=L>0&&s.refresh(r,L,E,z,Math.max(5,k/E),A),o&&(e.docView.minWidth=0,u|=16)}b>0&&x>0?d=Math.max(b,x):b<0&&x<0&&(d=Math.min(b,x)),aE();for(let L of this.viewports){let E=L.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(L);this.heightMap=(o?_n.empty().applyChanges(this.stateDeco,at.empty,this.heightOracle,[new ks(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new $W(L.from,E))}ah&&(u|=2)}let T=!this.viewportIsAppropriate(this.viewport,d)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return T&&(u&2&&(u|=this.updateScaler()),this.viewport=this.getViewport(d,this.scrollTarget),u|=this.updateForViewport()),(u&2||T)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),u|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),u}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,i){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,c=new im(s.lineAt(o-n*1e3,Ct.ByHeight,r,0,0).from,s.lineAt(l+(1-n)*1e3,Ct.ByHeight,r,0,0).to);if(i){let{head:u}=i.range;if(u<c.from||u>c.to){let d=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=s.lineAt(u,Ct.ByPos,r,0,0),g;i.y=="center"?g=(p.top+p.bottom)/2-d/2:i.y=="start"||i.y=="nearest"&&u<c.from?g=p.top:g=p.bottom-d,c=new im(s.lineAt(g-1e3/2,Ct.ByHeight,r,0,0).from,s.lineAt(g+d+1e3/2,Ct.ByHeight,r,0,0).to)}}return c}mapViewport(e,i){let n=i.mapPos(e.from,-1),s=i.mapPos(e.to,1);return new im(this.heightMap.lineAt(n,Ct.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(s,Ct.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:i},n=0){if(!this.inView)return!0;let{top:s}=this.heightMap.lineAt(e,Ct.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(i,Ct.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(e==0||s<=o-Math.max(10,Math.min(-n,250)))&&(i==this.state.doc.length||r>=l+Math.max(10,Math.min(n,250)))&&s>o-2*1e3&&r<l+2*1e3}mapLineGaps(e,i){if(!e.length||i.empty)return e;let n=[];for(let s of e)i.touchesRange(s.from,s.to)||n.push(new A_(i.mapPos(s.from),i.mapPos(s.to),s.size,s.displaySize));return n}ensureLineGaps(e,i){let n=this.heightOracle.lineWrapping,s=n?1e4:2e3,r=s>>1,o=s<<1;if(this.defaultTextDirection!=St.LTR&&!n)return[];let l=[],c=(d,p,g,O)=>{if(p-d<r)return;let _=this.state.selection.main,b=[_.from];_.empty||b.push(_.to);for(let w of b)if(w>d&&w<p){c(d,w-10,g,O),c(w+10,p,g,O);return}let x=YW(e,w=>w.from>=g.from&&w.to<=g.to&&Math.abs(w.from-d)<r&&Math.abs(w.to-p)<r&&!b.some(k=>w.from<k&&w.to>k));if(!x){if(p<g.to&&i&&n&&i.visibleRanges.some(T=>T.from<=p&&T.to>=p)){let T=i.moveToLineBoundary(re.cursor(p),!1,!0).head;T>d&&(p=T)}let w=this.gapSize(g,d,p,O),k=n||w<2e6?w:2e6;x=new A_(d,p,w,k)}l.push(x)},u=d=>{if(d.length<o||d.type!=Ki.Text)return;let p=UW(d.from,d.to,this.stateDeco);if(p.total<o)return;let g=this.scrollTarget?this.scrollTarget.range.head:null,O,_;if(n){let b=s/this.heightOracle.lineLength*this.heightOracle.lineHeight,x,w;if(g!=null){let k=sm(p,g),T=((this.visibleBottom-this.visibleTop)/2+b)/d.height;x=k-T,w=k+T}else x=(this.visibleTop-d.top-b)/d.height,w=(this.visibleBottom-d.top+b)/d.height;O=nm(p,x),_=nm(p,w)}else{let b=p.total*this.heightOracle.charWidth,x=s*this.heightOracle.charWidth,w=0;if(b>2e6)for(let E of e)E.from>=d.from&&E.from<d.to&&E.size!=E.displaySize&&E.from*this.heightOracle.charWidth+w<this.pixelViewport.left&&(w=E.size-E.displaySize);let k=this.pixelViewport.left+w,T=this.pixelViewport.right+w,A,L;if(g!=null){let E=sm(p,g),z=((T-k)/2+x)/b;A=E-z,L=E+z}else A=(k-x)/b,L=(T+x)/b;O=nm(p,A),_=nm(p,L)}O>d.from&&c(d.from,O,d,p),_<d.to&&c(_,d.to,d,p)};for(let d of this.viewportLines)Array.isArray(d.type)?d.type.forEach(u):u(d);return l}gapSize(e,i,n,s){let r=sm(s,n)-sm(s,i);return this.heightOracle.lineWrapping?e.height*r:s.total*this.heightOracle.charWidth*r}updateLineGaps(e){A_.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=Pe.set(e.map(i=>i.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let i=this.stateDeco;this.lineGaps.length&&(i=i.concat(this.lineGapDeco));let n=[];Ge.spans(i,this.viewport.from,this.viewport.to,{span(r,o){n.push({from:r,to:o})},point(){}},20);let s=0;if(n.length!=this.visibleRanges.length)s=12;else for(let r=0;r<n.length&&!(s&8);r++){let o=this.visibleRanges[r],l=n[r];(o.from!=l.from||o.to!=l.to)&&(s|=4,e&&e.mapPos(o.from,-1)==l.from&&e.mapPos(o.to,1)==l.to||(s|=8))}return this.visibleRanges=n,s}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(i=>i.from<=e&&i.to>=e)||Ku(this.heightMap.lineAt(e,Ct.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(i=>i.top<=e&&i.bottom>=e)||Ku(this.heightMap.lineAt(this.scaler.fromDOM(e),Ct.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let i=this.lineBlockAtHeight(e+8);return i.from>=this.viewport.from||this.viewportLines[0].top-e>200?i:this.viewportLines[0]}elementAtHeight(e){return Ku(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 im{constructor(e,i){this.from=e,this.to=i}}function UW(t,e,i){let n=[],s=t,r=0;return Ge.spans(i,t,e,{span(){},point(o,l){o>s&&(n.push({from:s,to:o}),r+=o-s),s=l}},20),s<e&&(n.push({from:s,to:e}),r+=e-s),{total:r,ranges:n}}function nm({total:t,ranges:e},i){if(i<=0)return e[0].from;if(i>=1)return e[e.length-1].to;let n=Math.floor(t*i);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(n<=l)return r+n;n-=l}}function sm(t,e){let i=0;for(let{from:n,to:s}of t.ranges){if(e<=s){i+=e-n;break}i+=s-n}return i/t.total}function YW(t,e){for(let i of t)if(e(i))return i}const hE={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};function uE(t){let e=t.facet(dO).filter(n=>typeof n!="function"),i=t.facet(Nx).filter(n=>typeof n!="function");return i.length&&e.push(Ge.join(i)),e}class Xx{constructor(e,i,n){let s=0,r=0,o=0;this.viewports=n.map(({from:l,to:c})=>{let u=i.lineAt(l,Ct.ByPos,e,0,0).top,d=i.lineAt(c,Ct.ByPos,e,0,0).bottom;return s+=d-u,{from:l,to:c,top:u,bottom:d,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(i.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let i=0,n=0,s=0;;i++){let r=i<this.viewports.length?this.viewports[i]:null;if(!r||e<r.top)return s+(e-n)*this.scale;if(e<=r.bottom)return r.domTop+(e-r.top);n=r.bottom,s=r.domBottom}}fromDOM(e){for(let i=0,n=0,s=0;;i++){let r=i<this.viewports.length?this.viewports[i]:null;if(!r||e<r.domTop)return n+(e-s)/this.scale;if(e<=r.domBottom)return r.top+(e-r.domTop);n=r.bottom,s=r.domBottom}}eq(e){return e instanceof Xx?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((i,n)=>i.from==e.viewports[n].from&&i.to==e.viewports[n].to):!1}}function Ku(t,e){if(e.scale==1)return t;let i=e.toDOM(t.top),n=e.toDOM(t.bottom);return new Zs(t.from,t.length,i,n-i,Array.isArray(t._content)?t._content.map(s=>Ku(s,e)):t._content)}const rm=Se.define({combine:t=>t.join(" ")}),vb=Se.define({combine:t=>t.indexOf(!0)>-1}),_b=xa.newName(),gB=xa.newName(),OB=xa.newName(),vB={"&light":"."+gB,"&dark":"."+OB};function yb(t,e,i){return new xa(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,s=>{if(s=="&")return t;if(!i||!i[s])throw new RangeError(`Unsupported selector: ${s}`);return i[s]}):t+" "+n}})}const HW=yb("."+_b,{"&":{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"}},vB),FW={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},E_=xe.ie&&xe.ie_version<=11;class GW{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new Tq,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(i=>{for(let n of i)this.queue.push(n);(xe.ie&&xe.ie_version<=11||xe.ios&&e.composing)&&i.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.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 JW(e),e.state.facet(uo)&&(e.contentDOM.editContext=this.editContext.editContext)),E_&&(this.onCharData=i=>{this.queue.push({target:i.target,type:"characterData",oldValue:i.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 i;((i=this.view.docView)===null||i===void 0?void 0:i.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(i=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),i.length>0&&i[i.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(i=>{i.length>0&&i[i.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((i,n)=>i!=e[n]))){this.gapIntersection.disconnect();for(let i of e)this.gapIntersection.observe(i);this.gaps=e}}onSelectionChange(e){let i=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,s=this.selectionRange;if(n.state.facet(uo)?n.root.activeElement!=this.dom:!pf(this.dom,s))return;let r=s.anchorNode&&n.docView.tile.nearest(s.anchorNode);if(r&&r.isWidget()&&r.widget.ignoreEvent(e)){i||(this.selectionChanged=!1);return}(xe.ie&&xe.ie_version<=11||xe.android&&xe.chrome)&&!n.state.selection.main.empty&&s.focusNode&&gf(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,i=Lf(e.root);if(!i)return!1;let n=xe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&KW(this.view,i)||i;if(!n||this.selectionRange.eq(n))return!1;let s=pf(this.dom,n);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&Eq(this.dom,n)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(n),s&&(this.selectionChanged=!0),!0)}setSelectionRange(e,i){this.selectionRange.set(e.node,e.offset,i.node,i.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,i=null;for(let n=this.dom;n;)if(n.nodeType==1)!i&&e<this.scrollTargets.length&&this.scrollTargets[e]==n?e++:i||(i=this.scrollTargets.slice(0,e)),i&&i.push(n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;if(e<this.scrollTargets.length&&!i&&(i=this.scrollTargets.slice(0,e)),i){for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);for(let n of this.scrollTargets=i)n.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,FW),E_&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),E_&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,i){var n;if(!this.delayedAndroidKey){let s=()=>{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Yc(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:i,force:this.lastChange<Date.now()-50||!!(!((n=this.delayedAndroidKey)===null||n===void 0)&&n.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 i=-1,n=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),i==-1?{from:i,to:n}=o:(i=Math.min(o.from,i),n=Math.max(o.to,n)))}return{from:i,to:n,typeOver:s}}readChange(){let{from:e,to:i,typeOver:n}=this.processRecords(),s=this.selectionChanged&&pf(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new gW(this.view,e,i,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let i=this.readChange();if(!i)return this.view.requestMeasure(),!1;let n=this.view.state,s=rB(this.view,i);return this.view.state==n&&(i.domChanged||i.newSel&&!kg(this.view.state.selection,i.newSel.main))&&this.view.update([]),s}readMutation(e){let i=this.view.docView.tile.nearest(e.target);if(!i||i.isWidget())return null;if(i.markDirty(e.type=="attributes"),e.type=="childList"){let n=fE(i,e.previousSibling||e.target.previousSibling,-1),s=fE(i,e.nextSibling||e.target.nextSibling,1);return{from:n?i.posAfter(n):i.posAtStart,to:s?i.posBefore(s):i.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:i.posAtStart,to:i.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(uo)!=e.state.facet(uo)&&(e.view.contentDOM.editContext=e.state.facet(uo)?this.editContext.editContext:null))}destroy(){var e,i,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(i=this.gapIntersection)===null||i===void 0||i.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let s of this.scrollTargets)s.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 fE(t,e,i){for(;e;){let n=ui.get(e);if(n&&n.parent==t)return n;let s=e.parentNode;e=s!=t.dom?s:i>0?e.nextSibling:e.previousSibling}return null}function dE(t,e){let i=e.startContainer,n=e.startOffset,s=e.endContainer,r=e.endOffset,o=t.docView.domAtPos(t.state.selection.main.anchor,1);return gf(o.node,o.offset,s,r)&&([i,n,s,r]=[s,r,i,n]),{anchorNode:i,anchorOffset:n,focusNode:s,focusOffset:r}}function KW(t,e){if(e.getComposedRanges){let s=e.getComposedRanges(t.root)[0];if(s)return dE(t,s)}let i=null;function n(s){s.preventDefault(),s.stopImmediatePropagation(),i=s.getTargetRanges()[0]}return t.contentDOM.addEventListener("beforeinput",n,!0),t.dom.ownerDocument.execCommand("indent"),t.contentDOM.removeEventListener("beforeinput",n,!0),i?dE(t,i):null}class JW{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let i=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=n=>{let s=e.state.selection.main,{anchor:r,head:o}=s,l=this.toEditorPos(n.updateRangeStart),c=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let u=c-l>n.text.length;l==this.from&&r<this.from?l=r:c==this.to&&r>this.to&&(c=r);let d=oB(e.state.sliceDoc(l,c),n.text,(u?s.from:s.to)-l,u?"end":null);if(!d){let g=re.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));kg(g,s)||e.dispatch({selection:g,userEvent:"select"});return}let p={from:d.from+l,to:d.toA+l,insert:at.of(n.text.slice(d.from,d.toB).split(`
67
+ `))};if((xe.mac||xe.android)&&p.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:l,to:c,insert:at.of([n.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let g=this.to-this.from+(p.to-p.from+p.insert.length);Ix(e,p,re.single(this.toEditorPos(n.selectionStart,g),this.toEditorPos(n.selectionEnd,g)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(i.text.slice(Math.max(0,n.updateRangeStart-1),Math.min(i.text.length,n.updateRangeStart+1)))&&this.handlers.compositionend(n)},this.handlers.characterboundsupdate=n=>{let s=[],r=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o<l;o++){let c=e.coordsForChar(o);r=c&&new DOMRect(c.left,c.top,c.right-c.left,c.bottom-c.top)||r||new DOMRect,s.push(r)}i.updateCharacterBounds(n.rangeStart,s)},this.handlers.textformatupdate=n=>{let s=[];for(let r of n.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let c=this.toEditorPos(r.rangeStart),u=this.toEditorPos(r.rangeEnd);if(c<u){let d=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(l)?1:2}px`;s.push(Pe.mark({attributes:{style:d}}).range(c,u))}}}e.dispatch({effects:FD.of(Pe.set(s))})},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:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)i.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let s=Lf(n.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let i=0,n=!1,s=this.pendingContextChange;return e.changes.iterChanges((r,o,l,c,u)=>{if(n)return;let d=u.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(u)){s=this.pendingContextChange=null,i+=d,this.to+=d;return}else s=null,this.revertPending(e.state);if(r+=i,o+=i,o<=this.from)this.from+=d,this.to+=d;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+u.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),u.toString()),this.to+=d}i+=d}),s&&!n&&this.revertPending(e.state),!n}update(e){let i=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.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||i)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:i}=e.selection.main;this.from=Math.max(0,i-1e4),this.to=Math.min(e.doc.length,i+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 i=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(i.from),this.toContextPos(i.from+i.insert.length),e.doc.sliceString(i.from,i.to))}setSelection(e){let{main:i}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,i.anchor))),s=this.toContextPos(i.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(n,s)}rangeIsValid(e){let{head:i}=e.selection.main;return!(this.from>0&&i-this.from<500||this.to<e.doc.length&&this.to-i<500||this.to-this.from>1e4*3)}toEditorPos(e,i=this.to-this.from){e=Math.min(e,i);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let i=this.composing;return i&&i.drifted?i.contextBase+(e-i.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class ve{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 i;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:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(s=>s.forEach(r=>n(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||Aq(e.parent)||document,this.viewState=new cE(e.state||et.create(e)),e.scrollTo&&e.scrollTo.is(Jp)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Nc).map(s=>new x_(s));for(let s of this.plugins)s.update(this);this.observer=new GW(this),this.inputState=new yW(this),this.inputState.ensureHandlers(this.plugins),this.docView=new FA(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((i=document.fonts)===null||i===void 0)&&i.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let i=e.length==1&&e[0]instanceof hi?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(i,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let i=!1,n=!1,s,r=this.state;for(let g of e){if(g.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=g.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,c=null;e.some(g=>g.annotation(fB))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,c=dB(r,o),c||(l=1));let u=this.observer.delayedAndroidKey,d=null;if(u?(this.observer.clearDelayedAndroidKey(),d=this.observer.readChange(),(d&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(d=null)):this.observer.clear(),r.facet(et.phrases)!=this.state.facet(et.phrases))return this.setState(r);s=xg.create(this,r,e),s.flags|=l;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let g of e){if(p&&(p=p.map(g.changes)),g.scrollIntoView){let{main:O}=g.state.selection;p=new Hc(O.empty?O:re.cursor(O.head,O.head>O.anchor?-1:1))}for(let O of g.effects)O.is(Jp)&&(p=O.value.clip(this.state))}this.viewState.update(s,p),this.bidiCache=Ag.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),i=this.docView.update(s),this.state.facet(Fu)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(i,e.some(g=>g.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(rm)!=s.state.facet(rm)&&(this.viewState.mustMeasureContent=!0),(i||n||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),i&&this.docViewUpdate(),!s.empty)for(let g of this.state.facet(db))try{g(s)}catch(O){$n(this.state,O,"update listener")}(c||d)&&Promise.resolve().then(()=>{c&&this.state==c.startState&&this.dispatch(c),d&&!rB(this,d)&&u.force&&Yc(this.contentDOM,u.key,u.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 i=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new cE(e),this.plugins=e.facet(Nc).map(n=>new x_(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new FA(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}i&&this.focus(),this.requestMeasure()}updatePlugins(e){let i=e.startState.facet(Nc),n=e.state.facet(Nc);if(i!=n){let s=[];for(let r of n){let o=i.indexOf(r);if(o<0)s.push(new x_(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s<this.plugins.length;s++)this.plugins[s].update(this);i!=n&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let i=e.value;if(i&&i.docViewUpdate)try{i.docViewUpdate(this)}catch(n){$n(this.state,n,"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 i=null,n=this.scrollDOM,s=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(QD(n))r=-1,o=this.viewState.heightMap.height;else{let O=this.viewState.scrollAnchorAt(s);r=O.from,o=O.top}this.updateState=1;let c=this.viewState.measure(this);if(!c&&!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 u=[];c&4||([this.measureRequests,u]=[u,this.measureRequests]);let d=u.map(O=>{try{return O.read(this)}catch(_){return $n(this.state,_),pE}}),p=xg.create(this,this.state,[]),g=!1;p.flags|=c,i?i.flags|=c:i=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),g=this.docView.update(p),g&&this.docViewUpdate());for(let O=0;O<u.length;O++)if(d[O]!=pE)try{let _=u[O];_.write&&_.write(d[O],this)}catch(_){$n(this.state,_)}if(g&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let _=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(_>1||_<-1){s=s+_,n.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(i&&!i.empty)for(let l of this.state.facet(db))l(i)}get themeClasses(){return _b+" "+(this.state.facet(vb)?OB:gB)+" "+this.state.facet(rm)}updateAttrs(){let e=mE(this,GD,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),i={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(uo)?"true":"false",class:"cm-content",style:`${xe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(i["aria-readonly"]="true"),mE(this,zx,i);let n=this.observer.ignore(()=>{let s=ZA(this.contentDOM,this.contentAttrs,i),r=ZA(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=i,n}showAnnouncements(e){let i=!0;for(let n of e)for(let s of n.effects)if(s.is(ve.announce)){i&&(this.announceDOM.textContent=""),i=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Fu);let e=this.state.facet(ve.cspNonce);xa.mount(this.root,this.styleModules.concat(HW).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 i=0;i<this.measureRequests.length;i++)if(this.measureRequests[i].key===e.key){this.measureRequests[i]=e;return}}this.measureRequests.push(e)}}plugin(e){let i=this.pluginMap.get(e);return(i===void 0||i&&i.plugin!=e)&&this.pluginMap.set(e,i=this.plugins.find(n=>n.plugin==e)||null),i&&i.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,i,n){return T_(this,e,GA(this,e,i,n))}moveByGroup(e,i){return T_(this,e,GA(this,e,i,n=>hW(this,e.head,n)))}visualLineSide(e,i){let n=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=n[i?n.length-1:0];return re.cursor(r.side(i,s)+e.from,r.forward(!i,s)?1:-1)}moveToLineBoundary(e,i,n=!0){return cW(this,e,i,n)}moveVertically(e,i,n){return T_(this,e,uW(this,e,i,n))}domAtPos(e,i=1){return this.docView.domAtPos(e,i)}posAtDOM(e,i=0){return this.docView.posFromDOM(e,i)}posAtCoords(e,i=!0){this.readMeasured();let n=gb(this,e,i);return n&&n.pos}posAndSideAtCoords(e,i=!0){return this.readMeasured(),gb(this,e,i)}coordsAtPos(e,i=1){this.readMeasured();let n=this.docView.coordsAt(e,i);if(!n||n.left==n.right)return n;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[_r.find(r,e-s.from,-1,i)];return Df(n,o.dir==St.LTR==i>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(UD)||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>eU)return ND(e.length);let i=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==i&&(r.fresh||zD(r.isolates,n=UA(this,e))))return r.order;n||(n=UA(this,e));let s=Bq(e.text,i,n);return this.bidiCache.push(new Ag(e.from,e.to,i,n,!0,s)),s}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(()=>{RD(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,i={}){return Jp.of(new Hc(typeof e=="number"?re.cursor(e):e,i.y,i.x,i.yMargin,i.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:i}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Jp.of(new Hc(re.cursor(n.from),"start","start",n.top-e,i,!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 Jt.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return Jt.define(()=>({}),{eventObservers:e})}static theme(e,i){let n=xa.newName(),s=[rm.of(n),Fu.of(yb(`.${n}`,e))];return i&&i.dark&&s.push(vb.of(!0)),s}static baseTheme(e){return So.lowest(Fu.of(yb("."+_b,e,vB)))}static findFromDOM(e){var i;let n=e.querySelector(".cm-content"),s=n&&ui.get(n)||ui.get(e);return((i=s==null?void 0:s.root)===null||i===void 0?void 0:i.view)||null}}ve.styleModule=Fu;ve.inputHandler=qD;ve.clipboardInputFilter=Bx;ve.clipboardOutputFilter=$x;ve.scrollHandler=HD;ve.focusChangeEffect=WD;ve.perLineTextDirection=UD;ve.exceptionSink=ZD;ve.updateListener=db;ve.editable=uo;ve.mouseSelectionStyle=XD;ve.dragMovesSelection=VD;ve.clickAddsSelectionRange=ID;ve.decorations=dO;ve.blockWrappers=KD;ve.outerDecorations=Nx;ve.atomicRanges=fd;ve.bidiIsolatedRanges=JD;ve.scrollMargins=eB;ve.darkTheme=vb;ve.cspNonce=Se.define({combine:t=>t.length?t[0]:""});ve.contentAttributes=zx;ve.editorAttributes=GD;ve.lineWrapping=ve.contentAttributes.of({class:"cm-lineWrapping"});ve.announce=ze.define();const eU=4096,pE={};class Ag{constructor(e,i,n,s,r,o){this.from=e,this.to=i,this.dir=n,this.isolates=s,this.fresh=r,this.order=o}static update(e,i){if(i.empty&&!e.some(r=>r.fresh))return e;let n=[],s=e.length?e[e.length-1].dir:St.LTR;for(let r=Math.max(0,e.length-10);r<e.length;r++){let o=e[r];o.dir==s&&!i.touchesRange(o.from,o.to)&&n.push(new Ag(i.mapPos(o.from,1),i.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return n}}function mE(t,e,i){for(let n=t.state.facet(e),s=n.length-1;s>=0;s--){let r=n[s],o=typeof r=="function"?r(t):r;o&&Qx(o,i)}return i}const tU=xe.mac?"mac":xe.windows?"win":xe.linux?"linux":"key";function iU(t,e){const i=t.split(/-(?!$)/);let n=i[i.length-1];n=="Space"&&(n=" ");let s,r,o,l;for(let c=0;c<i.length-1;++c){const u=i[c];if(/^(cmd|meta|m)$/i.test(u))l=!0;else if(/^a(lt)?$/i.test(u))s=!0;else if(/^(c|ctrl|control)$/i.test(u))r=!0;else if(/^s(hift)?$/i.test(u))o=!0;else if(/^mod$/i.test(u))e=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+u)}return s&&(n="Alt-"+n),r&&(n="Ctrl-"+n),l&&(n="Meta-"+n),o&&(n="Shift-"+n),n}function om(t,e,i){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),i!==!1&&e.shiftKey&&(t="Shift-"+t),t}const nU=So.default(ve.domEventHandlers({keydown(t,e){return yB(_B(e.state),t,e,"editor")}})),Ll=Se.define({enables:nU}),gE=new WeakMap;function _B(t){let e=t.facet(Ll),i=gE.get(e);return i||gE.set(e,i=oU(e.reduce((n,s)=>n.concat(s),[]))),i}function sU(t,e,i){return yB(_B(t.state),e,t,i)}let ma=null;const rU=4e3;function oU(t,e=tU){let i=Object.create(null),n=Object.create(null),s=(o,l)=>{let c=n[o];if(c==null)n[o]=l;else if(c!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,c,u,d)=>{var p,g;let O=i[o]||(i[o]=Object.create(null)),_=l.split(/ (?!$)/).map(w=>iU(w,e));for(let w=1;w<_.length;w++){let k=_.slice(0,w).join(" ");s(k,!0),O[k]||(O[k]={preventDefault:!0,stopPropagation:!1,run:[T=>{let A=ma={view:T,prefix:k,scope:o};return setTimeout(()=>{ma==A&&(ma=null)},rU),!0}]})}let b=_.join(" ");s(b,!1);let x=O[b]||(O[b]={preventDefault:!1,stopPropagation:!1,run:((g=(p=O._any)===null||p===void 0?void 0:p.run)===null||g===void 0?void 0:g.slice())||[]});c&&x.run.push(c),u&&(x.preventDefault=!0),d&&(x.stopPropagation=!0)};for(let o of t){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let u of l){let d=i[u]||(i[u]=Object.create(null));d._any||(d._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=o;for(let g in d)d[g].run.push(O=>p(O,bb))}let c=o[e]||o.key;if(c)for(let u of l)r(u,c,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(u,"Shift-"+c,o.shift,o.preventDefault,o.stopPropagation)}return i}let bb=null;function yB(t,e,i,n){bb=e;let s=_q(e),r=Ln(s,0),o=gr(r)==s.length&&s!=" ",l="",c=!1,u=!1,d=!1;ma&&ma.view==i&&ma.scope==n&&(l=ma.prefix+" ",lB.indexOf(e.keyCode)<0&&(u=!0,ma=null));let p=new Set,g=x=>{if(x){for(let w of x.run)if(!p.has(w)&&(p.add(w),w(i)))return x.stopPropagation&&(d=!0),!0;x.preventDefault&&(x.stopPropagation&&(d=!0),u=!0)}return!1},O=t[n],_,b;return O&&(g(O[l+om(s,e,!o)])?c=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(xe.windows&&e.ctrlKey&&e.altKey)&&!(xe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(_=wa[e.keyCode])&&_!=s?(g(O[l+om(_,e,!0)])||e.shiftKey&&(b=Rf[e.keyCode])!=s&&b!=_&&g(O[l+om(b,e,!1)]))&&(c=!0):o&&e.shiftKey&&g(O[l+om(s,e,!0)])&&(c=!0),!c&&g(O._any)&&(c=!0)),u&&(c=!0),c&&d&&e.stopPropagation(),bb=null,c}class dd{constructor(e,i,n,s,r){this.className=e,this.left=i,this.top=n,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,i){return i.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,i,n){if(n.empty){let s=e.coordsAtPos(n.head,n.assoc||1);if(!s)return[];let r=bB(e);return[new dd(i,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return aU(e,i,n)}}function bB(t){let e=t.scrollDOM.getBoundingClientRect();return{left:(t.textDirection==St.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX)-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function OE(t,e,i,n){let s=t.coordsAtPos(e,i*2);if(!s)return n;let r=t.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=t.posAtCoords({x:r.left+1,y:o}),c=t.posAtCoords({x:r.right-1,y:o});return l==null||c==null?n:{from:Math.max(n.from,Math.min(l,c)),to:Math.min(n.to,Math.max(l,c))}}function aU(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let n=Math.max(i.from,t.viewport.from),s=Math.min(i.to,t.viewport.to),r=t.textDirection==St.LTR,o=t.contentDOM,l=o.getBoundingClientRect(),c=bB(t),u=o.querySelector(".cm-line"),d=u&&window.getComputedStyle(u),p=l.left+(d?parseInt(d.paddingLeft)+Math.min(0,parseInt(d.textIndent)):0),g=l.right-(d?parseInt(d.paddingRight):0),O=mb(t,n,1),_=mb(t,s,-1),b=O.type==Ki.Text?O:null,x=_.type==Ki.Text?_:null;if(b&&(t.lineWrapping||O.widgetLineBreaks)&&(b=OE(t,n,1,b)),x&&(t.lineWrapping||_.widgetLineBreaks)&&(x=OE(t,s,-1,x)),b&&x&&b.from==x.from&&b.to==x.to)return k(T(i.from,i.to,b));{let L=b?T(i.from,null,b):A(O,!1),E=x?T(null,i.to,x):A(_,!0),z=[];return(b||O).to<(x||_).from-(b&&x?1:0)||O.widgetLineBreaks>1&&L.bottom+t.defaultLineHeight/2<E.top?z.push(w(p,L.bottom,g,E.top)):L.bottom<E.top&&t.elementAtHeight((L.bottom+E.top)/2).type==Ki.Text&&(L.bottom=E.top=(L.bottom+E.top)/2),k(L).concat(z).concat(k(E))}function w(L,E,z,N){return new dd(e,L-c.left,E-c.top,Math.max(0,z-L),N-E)}function k({top:L,bottom:E,horizontal:z}){let N=[];for(let q=0;q<z.length;q+=2)N.push(w(z[q],L,z[q+1],E));return N}function T(L,E,z){let N=1e9,q=-1e9,J=[];function U(D,j,$,X,H){let F=t.coordsAtPos(D,D==z.to?-2:2),M=t.coordsAtPos($,$==z.from?2:-2);!F||!M||(N=Math.min(F.top,M.top,N),q=Math.max(F.bottom,M.bottom,q),H==St.LTR?J.push(r&&j?p:F.left,r&&X?g:M.right):J.push(!r&&X?p:M.left,!r&&j?g:F.right))}let R=L??z.from,B=E??z.to;for(let D of t.visibleRanges)if(D.to>R&&D.from<B)for(let j=Math.max(D.from,R),$=Math.min(D.to,B);;){let X=t.state.doc.lineAt(j);for(let H of t.bidiSpans(X)){let F=H.from+X.from,M=H.to+X.from;if(F>=$)break;M>j&&U(Math.max(F,j),L==null&&F<=R,Math.min(M,$),E==null&&M>=B,H.dir)}if(j=X.to+1,j>=$)break}return J.length==0&&U(R,L==null,B,E==null,t.textDirection),{top:N,bottom:q,horizontal:J}}function A(L,E){let z=l.top+(E?L.top:L.bottom);return{top:z,bottom:z,horizontal:[]}}}function lU(t,e){return t.constructor==e.constructor&&t.eq(e)}class cU{constructor(e,i){this.view=e,this.layer=i,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),i.above&&this.dom.classList.add("cm-layer-above"),i.class&&this.dom.classList.add(i.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),i.mount&&i.mount(this.dom,e)}update(e){e.startState.facet(Zm)!=e.state.facet(Zm)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let i=0,n=e.facet(Zm);for(;i<n.length&&n[i]!=this.layer;)i++;this.dom.style.zIndex=String((this.layer.above?150:-1)-i)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:e,scaleY:i}=this.view;(e!=this.scaleX||i!=this.scaleY)&&(this.scaleX=e,this.scaleY=i,this.dom.style.transform=`scale(${1/e}, ${1/i})`)}draw(e){if(e.length!=this.drawn.length||e.some((i,n)=>!lU(i,this.drawn[n]))){let i=this.dom.firstChild,n=0;for(let s of e)s.update&&i&&s.constructor&&this.drawn[n].constructor&&s.update(i,this.drawn[n])?(i=i.nextSibling,n++):this.dom.insertBefore(s.draw(),i);for(;i;){let s=i.nextSibling;i.remove(),i=s}this.drawn=e,xe.safari&&xe.safari_version>=26&&(this.dom.style.display=this.dom.firstChild?"":"none")}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const Zm=Se.define();function SB(t){return[Jt.define(e=>new cU(e,t)),Zm.of(t)]}const $f=Se.define({combine(t){return Qr(t,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,i)=>Math.min(e,i),drawRangeCursor:(e,i)=>e||i})}});function hU(t={}){return[$f.of(t),uU,fU,dU,YD.of(!0)]}function xB(t){return t.startState.facet($f)!=t.state.facet($f)}const uU=SB({above:!0,markers(t){let{state:e}=t,i=e.facet($f),n=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty||i.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:re.cursor(s.head,s.head>s.anchor?-1:1);for(let c of dd.forRange(t,o,l))n.push(c)}}return n},update(t,e){t.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let i=xB(t);return i&&vE(t.state,e),t.docChanged||t.selectionSet||i},mount(t,e){vE(e.state,t)},class:"cm-cursorLayer"});function vE(t,e){e.style.animationDuration=t.facet($f).cursorBlinkRate+"ms"}const fU=SB({above:!1,markers(t){return t.state.selection.ranges.map(e=>e.empty?[]:dd.forRange(t,"cm-selectionBackground",e)).reduce((e,i)=>e.concat(i))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||xB(t)},class:"cm-selectionLayer"}),dU=So.highest(ve.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),wB=ze.define({map(t,e){return t==null?null:e.mapPos(t)}}),Ju=Bi.define({create(){return null},update(t,e){return t!=null&&(t=e.changes.mapPos(t)),e.effects.reduce((i,n)=>n.is(wB)?n.value:i,t)}}),pU=Jt.fromClass(class{constructor(t){this.view=t,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(Ju);i==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(t.startState.field(Ju)!=i||t.docChanged||t.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:t}=this,e=t.state.field(Ju),i=e!=null&&t.coordsAtPos(e);if(!i)return null;let n=t.scrollDOM.getBoundingClientRect();return{left:i.left-n.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-n.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:i}=this.view;t?(this.cursor.style.left=t.left/e+"px",this.cursor.style.top=t.top/i+"px",this.cursor.style.height=t.height/i+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(t){this.view.state.field(Ju)!=t&&this.view.dispatch({effects:wB.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function mU(){return[Ju,pU]}function _E(t,e,i,n,s){e.lastIndex=0;for(let r=t.iterRange(i,n),o=i,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function gU(t,e){let i=t.visibleRanges;if(i.length==1&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let n=[];for(let{from:s,to:r}of i)s=Math.max(t.state.doc.lineAt(s).from,s-e),r=Math.min(t.state.doc.lineAt(r).to,r+e),n.length&&n[n.length-1].to>=s?n[n.length-1].to=r:n.push({from:s,to:r});return n}class OU{constructor(e){const{regexp:i,decoration:n,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!i.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=i,s)this.addMatch=(l,c,u,d)=>s(d,u,u+l[0].length,l,c);else if(typeof n=="function")this.addMatch=(l,c,u,d)=>{let p=n(l,c,u);p&&d(u,u+l[0].length,p)};else if(n)this.addMatch=(l,c,u,d)=>d(u,u+l[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let i=new _o,n=i.add.bind(i);for(let{from:s,to:r}of gU(e,this.maxLength))_E(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,n));return i.finish()}updateDeco(e,i){let n=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,c)=>{c>=e.view.viewport.from&&l<=e.view.viewport.to&&(n=Math.min(l,n),s=Math.max(c,s))}),e.viewportMoved||s-n>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,i.map(e.changes),n,s):i}updateRange(e,i,n,s){for(let r of e.visibleRanges){let o=Math.max(r.from,n),l=Math.min(r.to,s);if(l>=o){let c=e.state.doc.lineAt(o),u=c.to<l?e.state.doc.lineAt(l):c,d=Math.max(r.from,c.from),p=Math.min(r.to,u.to);if(this.boundary){for(;o>c.from;o--)if(this.boundary.test(c.text[o-1-c.from])){d=o;break}for(;l<u.to;l++)if(this.boundary.test(u.text[l-u.from])){p=l;break}}let g=[],O,_=(b,x,w)=>g.push(w.range(b,x));if(c==u)for(this.regexp.lastIndex=d-c.from;(O=this.regexp.exec(c.text))&&O.index<p-c.from;)this.addMatch(O,e,O.index+c.from,_);else _E(e.state.doc,this.regexp,d,p,(b,x)=>this.addMatch(x,e,b,_));i=i.update({filterFrom:d,filterTo:p,filter:(b,x)=>b<d||x>p,add:g})}}return i}}const Sb=/x/.unicode!=null?"gu":"g",vU=new RegExp(`[\0-\b
68
+ --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,Sb),_U={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let M_=null;function yU(){var t;if(M_==null&&typeof document<"u"&&document.body){let e=document.body.style;M_=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return M_||!1}const qm=Se.define({combine(t){let e=Qr(t,{render:null,specialChars:vU,addSpecialChars:null});return(e.replaceTabs=!yU())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Sb)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Sb)),e}});function bU(t={}){return[qm.of(t),SU()]}let yE=null;function SU(){return yE||(yE=Jt.fromClass(class{constructor(t){this.view=t,this.decorations=Pe.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(t.state.facet(qm)),this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new OU({regexp:t.specialChars,decoration:(e,i,n)=>{let{doc:s}=i.state,r=Ln(e[0],0);if(r==9){let o=s.lineAt(n),l=i.state.tabSize,c=Ys(o.text,l,n-o.from);return Pe.replace({widget:new kU((l-c%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=Pe.replace({widget:new CU(t,r)}))},boundary:t.replaceTabs?void 0:/[^]/})}update(t){let e=t.state.facet(qm);t.startState.facet(qm)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(t.view)):this.decorations=this.decorator.updateDeco(t,this.decorations)}},{decorations:t=>t.decorations}))}const xU="•";function wU(t){return t>=32?xU:t==10?"␤":String.fromCharCode(9216+t)}class CU extends Gs{constructor(e,i){super(),this.options=e,this.code=i}eq(e){return e.code==this.code}toDOM(e){let i=wU(this.code),n=e.state.phrase("Control character")+" "+(_U[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,n,i);if(s)return s;let r=document.createElement("span");return r.textContent=i,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class kU extends Gs{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function TU(){return EU}const AU=Pe.line({class:"cm-activeLine"}),EU=Jt.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,i=[];for(let n of t.state.selection.ranges){let s=t.lineBlockAt(n.head);s.from>e&&(i.push(AU.range(s.from)),e=s.from)}return Pe.set(i)}},{decorations:t=>t.decorations});class MU extends Gs{constructor(e){super(),this.content=e}toDOM(e){let i=document.createElement("span");return i.className="cm-placeholder",i.style.pointerEvents="none",i.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),i.setAttribute("aria-hidden","true"),i}coordsAt(e){let i=e.firstChild?mf(e.firstChild):[];if(!i.length)return null;let n=window.getComputedStyle(e.parentNode),s=Df(i[0],n.direction!="rtl"),r=parseInt(n.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function PU(t){let e=Jt.fromClass(class{constructor(i){this.view=i,this.placeholder=t?Pe.set([Pe.widget({widget:new MU(t),side:1}).range(0)]):Pe.none}get decorations(){return this.view.state.doc.length?Pe.none:this.placeholder}},{decorations:i=>i.decorations});return typeof t=="string"?[e,ve.contentAttributes.of({"aria-placeholder":t})]:e}const xb=2e3;function RU(t,e,i){let n=Math.min(e.line,i.line),s=Math.max(e.line,i.line),r=[];if(e.off>xb||i.off>xb||e.col<0||i.col<0){let o=Math.min(e.off,i.off),l=Math.max(e.off,i.off);for(let c=n;c<=s;c++){let u=t.doc.line(c);u.length<=l&&r.push(re.range(u.from+o,u.to+l))}}else{let o=Math.min(e.col,i.col),l=Math.max(e.col,i.col);for(let c=n;c<=s;c++){let u=t.doc.line(c),d=ib(u.text,o,t.tabSize,!0);if(d<0)r.push(re.cursor(u.to));else{let p=ib(u.text,l,t.tabSize);r.push(re.range(u.from+d,u.from+p))}}}return r}function QU(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}function bE(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},!1),n=t.state.doc.lineAt(i),s=i-n.from,r=s>xb?-1:s==n.length?QU(t,e.clientX):Ys(n.text,t.state.tabSize,i-n.from);return{line:n.number,col:r,off:s}}function LU(t,e){let i=bE(t,e),n=t.state.selection;return i?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(i.line).from),o=s.state.doc.lineAt(r);i={line:o.number,col:i.col,off:Math.min(i.off,o.length)},n=n.map(s.changes)}},get(s,r,o){let l=bE(t,s);if(!l)return n;let c=RU(t.state,i,l);return c.length?o?re.create(c.concat(n.ranges)):re.create(c):n}}:null}function DU(t){let e=(i=>i.altKey&&i.button==0);return ve.mouseSelectionStyle.of((i,n)=>e(n)?LU(i,n):null)}const BU={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]},$U={style:"cursor: crosshair"};function zU(t={}){let[e,i]=BU[t.key||"Alt"],n=Jt.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||i(s))},keyup(s){(s.keyCode==e||!i(s))&&this.set(!1)},mousemove(s){this.set(i(s))}}});return[n,ve.contentAttributes.of(s=>{var r;return!((r=s.plugin(n))===null||r===void 0)&&r.isDown?$U:null})]}const am="-10000px";class CB{constructor(e,i,n,s){this.facet=i,this.createTooltipView=n,this.removeTooltipView=s,this.input=e.state.facet(i),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=n(o,r))}update(e,i){var n;let s=e.state.facet(this.facet),r=s.filter(c=>c);if(s===this.input){for(let c of this.tooltipViews)c.update&&c.update(e);return!1}let o=[],l=i?[]:null;for(let c=0;c<r.length;c++){let u=r[c],d=-1;if(u){for(let p=0;p<this.tooltips.length;p++){let g=this.tooltips[p];g&&g.create==u.create&&(d=p)}if(d<0)o[c]=this.createTooltipView(u,c?o[c-1]:null),l&&(l[c]=!!u.above);else{let p=o[c]=this.tooltipViews[d];l&&(l[c]=i[d]),p.update&&p.update(e)}}}for(let c of this.tooltipViews)o.indexOf(c)<0&&(this.removeTooltipView(c),(n=c.destroy)===null||n===void 0||n.call(c));return i&&(l.forEach((c,u)=>i[u]=c),i.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}}function NU(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const P_=Se.define({combine:t=>{var e,i,n;return{position:xe.ios?"absolute":((e=t.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((i=t.find(s=>s.parent))===null||i===void 0?void 0:i.parent)||null,tooltipSpace:((n=t.find(s=>s.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||NU}}}),SE=new WeakMap,Zx=Jt.fromClass(class{constructor(t){this.view=t,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=t.state.facet(P_);this.position=e.position,this.parent=e.parent,this.classes=t.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new CB(t,qx,(i,n)=>this.createTooltip(i,n),i=>{this.resizeObserver&&this.resizeObserver.unobserve(i.dom),i.dom.remove()}),this.above=this.manager.tooltips.map(i=>!!i.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(i=>{Date.now()>this.lastTransaction-50&&i.length>0&&i[i.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(t){t.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(t,this.above);e&&this.observeIntersection();let i=e||t.geometryChanged,n=t.state.facet(P_);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;i=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);i=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);i&&this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view),n=e?e.dom:null;if(i.dom.classList.add("cm-tooltip"),t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",i.dom.appendChild(s)}return i.dom.style.position=this.position,i.dom.style.top=am,i.dom.style.left="0px",this.container.insertBefore(i.dom,n),i.mount&&i.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(i.dom),i}destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(t=n.destroy)===null||t===void 0||t.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(i=this.intersectionObserver)===null||i===void 0||i.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(xe.safari){let o=r.getBoundingClientRect();i=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else i=!!r.offsetParent&&r.offsetParent!=this.container.ownerDocument.body}if(i||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(t=r.width/this.parent.offsetWidth,e=r.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),s=jx(this.view);return{visible:{left:n.left+s.left,top:n.top+s.top,right:n.right-s.right,bottom:n.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(P_).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:i,space:n,scaleX:s,scaleY:r}=t,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let c=this.manager.tooltips[l],u=this.manager.tooltipViews[l],{dom:d}=u,p=t.pos[l],g=t.size[l];if(!p||c.clip!==!1&&(p.bottom<=Math.max(i.top,n.top)||p.top>=Math.min(i.bottom,n.bottom)||p.right<Math.max(i.left,n.left)-.1||p.left>Math.min(i.right,n.right)+.1)){d.style.top=am;continue}let O=c.arrow?u.dom.querySelector(".cm-tooltip-arrow"):null,_=O?7:0,b=g.right-g.left,x=(e=SE.get(u))!==null&&e!==void 0?e:g.bottom-g.top,w=u.offset||IU,k=this.view.textDirection==St.LTR,T=g.width>n.right-n.left?k?n.left:n.right-g.width:k?Math.max(n.left,Math.min(p.left-(O?14:0)+w.x,n.right-b)):Math.min(Math.max(n.left,p.left-b+(O?14:0)-w.x),n.right-b),A=this.above[l];!c.strictSide&&(A?p.top-x-_-w.y<n.top:p.bottom+x+_+w.y>n.bottom)&&A==n.bottom-p.bottom>p.top-n.top&&(A=this.above[l]=!A);let L=(A?p.top-n.top:n.bottom-p.bottom)-_;if(L<x&&u.resize!==!1){if(L<this.view.defaultLineHeight){d.style.top=am;continue}SE.set(u,x),d.style.height=(x=L)/r+"px"}else d.style.height&&(d.style.height="");let E=A?p.top-x-_-w.y:p.bottom+_+w.y,z=T+b;if(u.overlap!==!0)for(let N of o)N.left<z&&N.right>T&&N.top<E+x&&N.bottom>E&&(E=A?N.top-x-2-_:N.bottom+_+2);if(this.position=="absolute"?(d.style.top=(E-t.parent.top)/r+"px",xE(d,(T-t.parent.left)/s)):(d.style.top=E/r+"px",xE(d,T/s)),O){let N=p.left+(k?w.x:-w.x)-(T+14-7);O.style.left=N/s+"px"}u.overlap!==!0&&o.push({left:T,top:E,right:z,bottom:E+x}),d.classList.toggle("cm-tooltip-above",A),d.classList.toggle("cm-tooltip-below",!A),u.positioned&&u.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let t of this.manager.tooltipViews)t.dom.style.top=am}},{eventObservers:{scroll(){this.maybeMeasure()}}});function xE(t,e){let i=parseInt(t.style.left,10);(isNaN(i)||Math.abs(e-i)>1)&&(t.style.left=e+"px")}const jU=ve.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),IU={x:0,y:0},qx=Se.define({enables:[Zx,jU]}),Eg=Se.define({combine:t=>t.reduce((e,i)=>e.concat(i),[])});class OO{static create(e){return new OO(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new CB(e,Eg,(i,n)=>this.createHostedView(i,n),i=>i.dom.remove())}createHostedView(e,i){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,i?i.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let i of this.manager.tooltipViews)i.mount&&i.mount(e);this.mounted=!0}positioned(e){for(let i of this.manager.tooltipViews)i.positioned&&i.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let i of this.manager.tooltipViews)(e=i.destroy)===null||e===void 0||e.call(i)}passProp(e){let i;for(let n of this.manager.tooltipViews){let s=n[e];if(s!==void 0){if(i===void 0)i=s;else if(i!==s)return}}return i}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const VU=qx.compute([Eg],t=>{let e=t.facet(Eg);return e.length===0?null:{pos:Math.min(...e.map(i=>i.pos)),end:Math.max(...e.map(i=>{var n;return(n=i.end)!==null&&n!==void 0?n:i.pos})),create:OO.create,above:e[0].above,arrow:e.some(i=>i.arrow)}});class XU{constructor(e,i,n,s,r){this.view=e,this.source=i,this.field=n,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;e<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-e):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:e,lastMove:i}=this,n=e.docView.tile.nearest(i.target);if(!n)return;let s,r=1;if(n.isWidget())s=n.posAtStart;else{if(s=e.posAtCoords(i),s==null)return;let l=e.coordsAtPos(s);if(!l||i.y<l.top||i.y>l.bottom||i.x<l.left-e.defaultCharacterWidth||i.x>l.right+e.defaultCharacterWidth)return;let c=e.bidiSpans(e.state.doc.lineAt(s)).find(d=>d.from<=s&&d.to>=s),u=c&&c.dir==St.RTL?-1:1;r=i.x<l.left?-u:u}let o=this.source(e,s,r);if(o!=null&&o.then){let l=this.pending={pos:s};o.then(c=>{this.pending==l&&(this.pending=null,c&&!(Array.isArray(c)&&!c.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(c)?c:[c])}))},c=>$n(e.state,c,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(Zx),i=e?e.manager.tooltips.findIndex(n=>n.create==OO.create):-1;return i>-1?e.manager.tooltipViews[i]:null}mousemove(e){var i,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:r}=this;if(s.length&&r&&!ZU(r.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,l=(n=(i=s[0])===null||i===void 0?void 0:i.end)!==null&&n!==void 0?n:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!qU(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:i}=this;if(i.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let i=n=>{e.removeEventListener("mouseleave",i),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",i)}destroy(){clearTimeout(this.hoverTimeout),clearTimeout(this.restartTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const lm=4;function ZU(t,e){let{left:i,right:n,top:s,bottom:r}=t.getBoundingClientRect(),o;if(o=t.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();s=Math.min(l.top,s),r=Math.max(l.bottom,r)}return e.clientX>=i-lm&&e.clientX<=n+lm&&e.clientY>=s-lm&&e.clientY<=r+lm}function qU(t,e,i,n,s,r){let o=t.scrollDOM.getBoundingClientRect(),l=t.documentTop+t.documentPadding.top+t.contentHeight;if(o.left>n||o.right<n||o.top>s||Math.min(o.bottom,l)<s)return!1;let c=t.posAtCoords({x:n,y:s},!1);return c>=e&&c<=i}function WU(t,e={}){let i=ze.define(),n=Bi.define({create(){return[]},update(s,r){if(s.length&&(e.hideOnChange&&(r.docChanged||r.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(r,o))),r.docChanged)){let o=[];for(let l of s){let c=r.changes.mapPos(l.pos,-1,Fi.TrackDel);if(c!=null){let u=Object.assign(Object.create(null),l);u.pos=c,u.end!=null&&(u.end=r.changes.mapPos(u.end)),o.push(u)}}s=o}for(let o of r.effects)o.is(i)&&(s=o.value),o.is(UU)&&(s=[]);return s},provide:s=>Eg.from(s)});return{active:n,extension:[n,Jt.define(s=>new XU(s,t,n,i,e.hoverTime||300)),VU]}}function kB(t,e){let i=t.plugin(Zx);if(!i)return null;let n=i.manager.tooltips.indexOf(e);return n<0?null:i.manager.tooltipViews[n]}const UU=ze.define(),wE=Se.define({combine(t){let e,i;for(let n of t)e=e||n.topContainer,i=i||n.bottomContainer;return{topContainer:e,bottomContainer:i}}});function Wx(t,e){let i=t.plugin(TB),n=i?i.specs.indexOf(e):-1;return n>-1?i.panels[n]:null}const TB=Jt.fromClass(class{constructor(t){this.input=t.state.facet(zf),this.specs=this.input.filter(i=>i),this.panels=this.specs.map(i=>i(t));let e=t.state.facet(wE);this.top=new cm(t,!0,e.topContainer),this.bottom=new cm(t,!1,e.bottomContainer),this.top.sync(this.panels.filter(i=>i.top)),this.bottom.sync(this.panels.filter(i=>!i.top));for(let i of this.panels)i.dom.classList.add("cm-panel"),i.mount&&i.mount()}update(t){let e=t.state.facet(wE);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new cm(t.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new cm(t.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let i=t.state.facet(zf);if(i!=this.input){let n=i.filter(c=>c),s=[],r=[],o=[],l=[];for(let c of n){let u=this.specs.indexOf(c),d;u<0?(d=c(t.view),l.push(d)):(d=this.panels[u],d.update&&d.update(t)),s.push(d),(d.top?r:o).push(d)}this.specs=n,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let c of l)c.dom.classList.add("cm-panel"),c.mount&&c.mount()}else for(let n of this.panels)n.update&&n.update(t)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:t=>ve.scrollMargins.of(e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}})});class cm{constructor(e,i,n){this.view=e,this.top=i,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let i of this.panels)i.destroy&&e.indexOf(i)<0&&i.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let i=this.container||this.view.dom;i.insertBefore(this.dom,this.top?i.firstChild:null)}let e=this.dom.firstChild;for(let i of this.panels)if(i.dom.parentNode==this.dom){for(;e!=i.dom;)e=CE(e);e=e.nextSibling}else this.dom.insertBefore(i.dom,e);for(;e;)e=CE(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function CE(t){let e=t.nextSibling;return t.remove(),e}const zf=Se.define({enables:TB});function YU(t,e){let i,n=new Promise(o=>i=o),s=o=>HU(o,e,i);t.state.field(R_,!1)?t.dispatch({effects:AB.of(s)}):t.dispatch({effects:ze.appendConfig.of(R_.init(()=>[s]))});let r=EB.of(s);return{close:r,result:n.then(o=>((t.win.queueMicrotask||(c=>t.win.setTimeout(c,10)))(()=>{t.state.field(R_).indexOf(s)>-1&&t.dispatch({effects:r})}),o))}}const R_=Bi.define({create(){return[]},update(t,e){for(let i of e.effects)i.is(AB)?t=[i.value].concat(t):i.is(EB)&&(t=t.filter(n=>n!=i.value));return t},provide:t=>zf.computeN([t],e=>e.field(t))}),AB=ze.define(),EB=ze.define();function HU(t,e,i){let n=e.content?e.content(t,()=>o(null)):null;if(!n){if(n=vt("form"),e.input){let l=vt("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),n.appendChild(vt("label",(e.label||"")+": ",l))}else n.appendChild(document.createTextNode(e.label||""));n.appendChild(document.createTextNode(" ")),n.appendChild(vt("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let s=n.nodeName=="FORM"?[n]:n.querySelectorAll("form");for(let l=0;l<s.length;l++){let c=s[l];c.addEventListener("keydown",u=>{u.keyCode==27?(u.preventDefault(),o(null)):u.keyCode==13&&(u.preventDefault(),o(c))}),c.addEventListener("submit",u=>{u.preventDefault(),o(c)})}let r=vt("div",n,vt("button",{onclick:()=>o(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(r.className=e.class),r.classList.add("cm-dialog");function o(l){r.contains(r.ownerDocument.activeElement)&&t.focus(),i(l)}return{dom:r,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=n.querySelector(e.focus):l=n.querySelector("input")||n.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class bo extends Sa{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}bo.prototype.elementClass="";bo.prototype.toDOM=void 0;bo.prototype.mapMode=Fi.TrackBefore;bo.prototype.startSide=bo.prototype.endSide=-1;bo.prototype.point=!0;const Wm=Se.define(),FU=Se.define(),GU={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>Ge.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},vf=Se.define();function KU(t){return[MB(),vf.of({...GU,...t})]}const kE=Se.define({combine:t=>t.some(e=>e)});function MB(t){return[JU]}const JU=Jt.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(vf).map(e=>new AE(t,e)),this.fixed=!t.state.facet(kE);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,i=t.view.viewport,n=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(n<(i.to-i.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(kE)!=!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 i=Ge.iter(this.view.state.facet(Wm),this.view.viewport.from),n=[],s=this.gutters.map(r=>new eY(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Ki.Text&&o){wb(i,n,l.from);for(let c of s)c.line(this.view,l,n);o=!1}else if(l.widget)for(let c of s)c.widget(this.view,l)}else if(r.type==Ki.Text){wb(i,n,r.from);for(let o of s)o.line(this.view,r,n)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();t&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(t){let e=t.startState.facet(vf),i=t.state.facet(vf),n=t.docChanged||t.heightChanged||t.viewportChanged||!Ge.eq(t.startState.facet(Wm),t.state.facet(Wm),t.view.viewport.from,t.view.viewport.to);if(e==i)for(let s of this.gutters)s.update(t)&&(n=!0);else{n=!0;let s=[];for(let r of i){let o=e.indexOf(r);o<0?s.push(new AE(this.view,r)):(this.gutters[o].update(t),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)r.config.side=="after"?this.getDOMAfter().appendChild(r.dom):this.dom.appendChild(r.dom);this.gutters=s}return n}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:t=>ve.scrollMargins.of(e=>{let i=e.plugin(t);if(!i||i.gutters.length==0||!i.fixed)return null;let n=i.dom.offsetWidth*e.scaleX,s=i.domAfter?i.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==St.LTR?{left:n,right:s}:{right:n,left:s}})});function TE(t){return Array.isArray(t)?t:[t]}function wb(t,e,i){for(;t.value&&t.from<=i;)t.from==i&&e.push(t.value),t.next()}class eY{constructor(e,i,n){this.gutter=e,this.height=n,this.i=0,this.cursor=Ge.iter(e.markers,i.from)}addElement(e,i,n){let{gutter:s}=this,r=(i.top-this.height)/e.scaleY,o=i.height/e.scaleY;if(this.i==s.elements.length){let l=new PB(e,o,r,n);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,n);this.height=i.bottom,this.i++}line(e,i,n){let s=[];wb(this.cursor,s,i.from),n.length&&(s=s.concat(n));let r=this.gutter.config.lineMarker(e,i,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,i,s)}widget(e,i){let n=this.gutter.config.widgetMarker(e,i.widget,i),s=n?[n]:null;for(let r of e.state.facet(FU)){let o=r(e,i.widget,i);o&&(s||(s=[])).push(o)}s&&this.addElement(e,i,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let i=e.elements.pop();e.dom.removeChild(i.dom),i.destroy()}}}class AE{constructor(e,i){this.view=e,this.config=i,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in i.domEventHandlers)this.dom.addEventListener(n,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let c=r.getBoundingClientRect();o=(c.top+c.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);i.domEventHandlers[n](e,l,s)&&s.preventDefault()});this.markers=TE(i.markers(e)),i.initialSpacer&&(this.spacer=new PB(e,0,0,[i.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let i=this.markers;if(this.markers=TE(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let n=e.view.viewport;return!Ge.eq(this.markers,i,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class PB{constructor(e,i,n,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,i,n,s)}update(e,i,n,s){this.height!=i&&(this.height=i,this.dom.style.height=i+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),tY(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,i){let n="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,c=r<i.length?i[r++]:null,u=!1;if(c){let d=c.elementClass;d&&(n+=" "+d);for(let p=o;p<this.markers.length;p++)if(this.markers[p].compare(c)){l=p,u=!0;break}}else l=this.markers.length;for(;o<l;){let d=this.markers[o++];if(d.toDOM){d.destroy(s);let p=s.nextSibling;s.remove(),s=p}}if(!c)break;c.toDOM&&(u?s=s.nextSibling:this.dom.insertBefore(c.toDOM(e),s)),u&&o++}this.dom.className=n,this.markers=i}destroy(){this.setMarkers(null,[])}}function tY(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++)if(!t[i].compare(e[i]))return!1;return!0}const iY=Se.define(),nY=Se.define(),jc=Se.define({combine(t){return Qr(t,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,i){let n=Object.assign({},e);for(let s in i){let r=n[s],o=i[s];n[s]=r?(l,c,u)=>r(l,c,u)||o(l,c,u):o}return n}})}});class Q_ extends bo{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function L_(t,e){return t.state.facet(jc).formatNumber(e,t.state)}const sY=vf.compute([jc],t=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(iY)},lineMarker(e,i,n){return n.some(s=>s.toDOM)?null:new Q_(L_(e,e.state.doc.lineAt(i.from).number))},widgetMarker:(e,i,n)=>{for(let s of e.state.facet(nY)){let r=s(e,i,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(jc)!=e.state.facet(jc),initialSpacer(e){return new Q_(L_(e,EE(e.state.doc.lines)))},updateSpacer(e,i){let n=L_(i.view,EE(i.view.state.doc.lines));return n==e.number?e:new Q_(n)},domEventHandlers:t.facet(jc).domEventHandlers,side:"before"}));function rY(t={}){return[jc.of(t),MB(),sY]}function EE(t){let e=9;for(;e<t;)e=e*10+9;return e}const oY=new class extends bo{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},aY=Wm.compute(["selection"],t=>{let e=[],i=-1;for(let n of t.selection.ranges){let s=t.doc.lineAt(n.head).from;s>i&&(i=s,e.push(oY.range(s)))}return Ge.of(e)});function lY(){return aY}const RB=1024;let cY=0;class Ts{constructor(e,i){this.from=e,this.to=i}}class Ne{constructor(e={}){this.id=cY++,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=_i.match(e)),i=>{let n=e(i);return n===void 0?null:[this,n]}}}Ne.closedBy=new Ne({deserialize:t=>t.split(" ")});Ne.openedBy=new Ne({deserialize:t=>t.split(" ")});Ne.group=new Ne({deserialize:t=>t.split(" ")});Ne.isolate=new Ne({deserialize:t=>{if(t&&t!="rtl"&&t!="ltr"&&t!="auto")throw new RangeError("Invalid value for isolate: "+t);return t||"auto"}});Ne.contextHash=new Ne({perNode:!0});Ne.lookAhead=new Ne({perNode:!0});Ne.mounted=new Ne({perNode:!0});class Fc{constructor(e,i,n,s=!1){this.tree=e,this.overlay=i,this.parser=n,this.bracketed=s}static get(e){return e&&e.props&&e.props[Ne.mounted.id]}}const hY=Object.create(null);class _i{constructor(e,i,n,s=0){this.name=e,this.props=i,this.id=n,this.flags=s}static define(e){let i=e.props&&e.props.length?Object.create(null):hY,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new _i(e.name||"",i,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");i[r[0].id]=r[1]}}return s}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 i=this.prop(Ne.group);return i?i.indexOf(e)>-1:!1}return this.id==e}static match(e){let i=Object.create(null);for(let n in e)for(let s of n.split(" "))i[s]=e[n];return n=>{for(let s=n.prop(Ne.group),r=-1;r<(s?s.length:0);r++){let o=i[r<0?n.name:s[r]];if(o)return o}}}}_i.none=new _i("",Object.create(null),0,8);class pd{constructor(e){this.types=e;for(let i=0;i<e.length;i++)if(e[i].id!=i)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let i=[];for(let n of this.types){let s=null;for(let r of e){let o=r(n);if(o){s||(s=Object.assign({},n.props));let l=o[1],c=o[0];c.combine&&c.id in s&&(l=c.combine(s[c.id],l)),s[c.id]=l}}i.push(s?new _i(n.name,s,n.id,n.flags):n)}return new pd(i)}}const hm=new WeakMap,ME=new WeakMap;var ut;(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"})(ut||(ut={}));class ct{constructor(e,i,n,s,r){if(this.type=e,this.children=i,this.positions=n,this.length=s,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let e=Fc.get(this);if(e&&!e.overlay)return e.tree.toString();let i="";for(let n of this.children){let s=n.toString();s&&(i&&(i+=","),i+=s)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(i.length?"("+i+")":""):i}cursor(e=0){return new Mg(this.topNode,e)}cursorAt(e,i=0,n=0){let s=hm.get(this)||this.topNode,r=new Mg(s);return r.moveTo(e,i),hm.set(this,r._tree),r}get topNode(){return new on(this,0,0,null)}resolve(e,i=0){let n=Nf(hm.get(this)||this.topNode,e,i,!1);return hm.set(this,n),n}resolveInner(e,i=0){let n=Nf(ME.get(this)||this.topNode,e,i,!0);return ME.set(this,n),n}resolveStack(e,i=0){return dY(this,e,i)}iterate(e){let{enter:i,leave:n,from:s=0,to:r=this.length}=e,o=e.mode||0,l=(o&ut.IncludeAnonymous)>0;for(let c=this.cursor(o|ut.IncludeAnonymous);;){let u=!1;if(c.from<=r&&c.to>=s&&(!l&&c.type.isAnonymous||i(c)!==!1)){if(c.firstChild())continue;u=!0}for(;u&&n&&(l||!c.type.isAnonymous)&&n(c),!c.nextSibling();){if(!c.parent())return;u=!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 i in this.props)e.push([+i,this.props[i]]);return e}balance(e={}){return this.children.length<=8?this:Hx(_i.none,this.children,this.positions,0,this.children.length,0,this.length,(i,n,s)=>new ct(this.type,i,n,s,this.propValues),e.makeTree||((i,n,s)=>new ct(_i.none,i,n,s)))}static build(e){return pY(e)}}ct.empty=new ct(_i.none,[],[],0);class Ux{constructor(e,i){this.buffer=e,this.index=i}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 Ux(this.buffer,this.index)}}class ka{constructor(e,i,n){this.buffer=e,this.length=i,this.set=n}get type(){return _i.none}toString(){let e=[];for(let i=0;i<this.buffer.length;)e.push(this.childString(i)),i=this.buffer[i+3];return e.join(",")}childString(e){let i=this.buffer[e],n=this.buffer[e+3],s=this.set.types[i],r=s.name;if(/\W/.test(r)&&!s.isError&&(r=JSON.stringify(r)),e+=4,n==e)return r;let o=[];for(;e<n;)o.push(this.childString(e)),e=this.buffer[e+3];return r+"("+o.join(",")+")"}findChild(e,i,n,s,r){let{buffer:o}=this,l=-1;for(let c=e;c!=i&&!(QB(r,s,o[c+1],o[c+2])&&(l=c,n>0));c=o[c+3]);return l}slice(e,i,n){let s=this.buffer,r=new Uint16Array(i-e),o=0;for(let l=e,c=0;l<i;){r[c++]=s[l++],r[c++]=s[l++]-n;let u=r[c++]=s[l++]-n;r[c++]=s[l++]-e,o=Math.max(o,u)}return new ka(r,o,this.set)}}function QB(t,e,i,n){switch(t){case-2:return i<e;case-1:return n>=e&&i<e;case 0:return i<e&&n>e;case 1:return i<=e&&n>e;case 2:return n>e;case 4:return!0}}function Nf(t,e,i,n){for(var s;t.from==t.to||(i<1?t.from>=e:t.from>e)||(i>-1?t.to<=e:t.to<e);){let o=!n&&t instanceof on&&t.index<0?null:t.parent;if(!o)return t;t=o}let r=n?0:ut.IgnoreOverlays;if(n)for(let o=t,l=o.parent;l;o=l,l=o.parent)o instanceof on&&o.index<0&&((s=l.enter(e,i,r))===null||s===void 0?void 0:s.from)!=o.from&&(t=l);for(;;){let o=t.enter(e,i,r);if(!o)return t;t=o}}class LB{cursor(e=0){return new Mg(this,e)}getChild(e,i=null,n=null){let s=PE(this,e,i,n);return s.length?s[0]:null}getChildren(e,i=null,n=null){return PE(this,e,i,n)}resolve(e,i=0){return Nf(this,e,i,!1)}resolveInner(e,i=0){return Nf(this,e,i,!0)}matchContext(e){return Cb(this.parent,e)}enterUnfinishedNodesBefore(e){let i=this.childBefore(e),n=this;for(;i;){let s=i.lastChild;if(!s||s.to!=i.to)break;s.type.isError&&s.from==s.to?(n=i,i=s.prevSibling):i=s}return n}get node(){return this}get next(){return this.parent}}class on extends LB{constructor(e,i,n,s){super(),this._tree=e,this.from=i,this.index=n,this._parent=s}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,i,n,s,r=0){for(let o=this;;){for(let{children:l,positions:c}=o._tree,u=i>0?l.length:-1;e!=u;e+=i){let d=l[e],p=c[e]+o.from,g;if(!(!(r&ut.EnterBracketed&&d instanceof ct&&(g=Fc.get(d))&&!g.overlay&&g.bracketed&&n>=p&&n<=p+d.length)&&!QB(s,n,p,p+d.length))){if(d instanceof ka){if(r&ut.ExcludeBuffers)continue;let O=d.findChild(0,d.buffer.length,i,n-p,s);if(O>-1)return new yr(new uY(o,d,e,p),null,O)}else if(r&ut.IncludeAnonymous||!d.type.isAnonymous||Yx(d)){let O;if(!(r&ut.IgnoreMounts)&&(O=Fc.get(d))&&!O.overlay)return new on(O.tree,p,e,o);let _=new on(d,p,e,o);return r&ut.IncludeAnonymous||!_.type.isAnonymous?_:_.nextChild(i<0?d.children.length-1:0,i,n,s,r)}}}if(r&ut.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+i:e=i<0?-1:o._parent._tree.children.length,o=o._parent,!o))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,i,n=0){let s;if(!(n&ut.IgnoreOverlays)&&(s=Fc.get(this._tree))&&s.overlay){let r=e-this.from,o=n&ut.EnterBracketed&&s.bracketed;for(let{from:l,to:c}of s.overlay)if((i>0||o?l<=r:l<r)&&(i<0||o?c>=r:c>r))return new on(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,i,n)}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 PE(t,e,i,n){let s=t.cursor(),r=[];if(!s.firstChild())return r;if(i!=null){for(let o=!1;!o;)if(o=s.type.is(i),!s.nextSibling())return r}for(;;){if(n!=null&&s.type.is(n))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return n==null?r:[]}}function Cb(t,e,i=e.length-1){for(let n=t;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[i]&&e[i]!=n.name)return!1;i--}}return!0}class uY{constructor(e,i,n,s){this.parent=e,this.buffer=i,this.index=n,this.start=s}}class yr extends LB{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,i,n){super(),this.context=e,this._parent=i,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,i,n){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,i-this.context.start,n);return r<0?null:new yr(this.context,this,r)}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,i,n=0){if(n&ut.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],i>0?1:-1,e-this.context.start,i);return r<0?null:new yr(this.context,this,r)}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,i=e.buffer[this.index+3];return i<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new yr(this.context,this._parent,i):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,i=this._parent?this._parent.index+4:0;return this.index==i?this.externalSibling(-1):new yr(this.context,this._parent,e.findChild(i,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],i=[],{buffer:n}=this.context,s=this.index+4,r=n.buffer[this.index+3];if(r>s){let o=n.buffer[this.index+1];e.push(n.slice(s,r,o)),i.push(0)}return new ct(this.type,e,i,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function DB(t){if(!t.length)return null;let e=0,i=t[0];for(let r=1;r<t.length;r++){let o=t[r];(o.from>i.from||o.to<i.to)&&(i=o,e=r)}let n=i instanceof on&&i.index<0?null:i.parent,s=t.slice();return n?s[e]=n:s.splice(e,1),new fY(s,i)}class fY{constructor(e,i){this.heads=e,this.node=i}get next(){return DB(this.heads)}}function dY(t,e,i){let n=t.resolveInner(e,i),s=null;for(let r=n instanceof on?n:n.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(s||(s=[n])).push(o.resolve(e,i)),r=o}else{let o=Fc.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let l=new on(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[n])).push(Nf(l,e,i,!1))}}return s?DB(s):n}class Mg{get name(){return this.type.name}constructor(e,i=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=i&~ut.EnterBracketed,e instanceof on)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.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,i){this.index=e;let{start:n,buffer:s}=this.buffer;return this.type=i||s.set.types[s.buffer[e]],this.from=n+s.buffer[e+1],this.to=n+s.buffer[e+2],!0}yield(e){return e?e instanceof on?(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,i,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,i,n,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,i-this.buffer.start,n);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}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,i,n=this.mode){return this.buffer?n&ut.ExcludeBuffers?!1:this.enterChild(1,e,i):this.yield(this._tree.enter(e,i,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&ut.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&ut.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:i}=this.buffer,n=this.stack.length-1;if(e<0){let s=n<0?0:this.stack[n]+4;if(this.index!=s)return this.yieldBuf(i.findChild(s,this.index,-1,0,4))}else{let s=i.buffer[this.index+3];if(s<(n<0?i.buffer.length:i.buffer[this.stack[n]+3]))return this.yieldBuf(s)}return n<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 i,n,{buffer:s}=this;if(s){if(e>0){if(this.index<s.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(s.buffer.buffer[r+3]<this.index)return!1;({index:i,parent:n}=s)}else({index:i,_parent:n}=this._tree);for(;n;{index:i,_parent:n}=n)if(i>-1)for(let r=i+e,o=e<0?-1:n._tree.children.length;r!=o;r+=e){let l=n._tree.children[r];if(this.mode&ut.IncludeAnonymous||l instanceof ka||!l.type.isAnonymous||Yx(l))return!1}return!0}move(e,i){if(i&&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,i=0){for(;(this.from==this.to||(i<1?this.from>=e:this.from>e)||(i>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,i););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,i=null,n=0;if(e&&e.context==this.buffer)e:for(let s=this.index,r=this.stack.length;r>=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;i=o,n=r+1;break e}s=this.stack[--r]}for(let s=n;s<this.stack.length;s++)i=new yr(this.buffer,i,this.stack[s]);return this.bufferNode=new yr(this.buffer,i,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,i){for(let n=0;;){let s=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){n++;continue}this.type.isAnonymous||(s=!0)}for(;;){if(s&&i&&i(this),s=this.type.isAnonymous,!n)return;if(this.nextSibling())break;this.parent(),n--,s=!0}}}matchContext(e){if(!this.buffer)return Cb(this.node.parent,e);let{buffer:i}=this.buffer,{types:n}=i.set;for(let s=e.length-1,r=this.stack.length-1;s>=0;r--){if(r<0)return Cb(this._tree,e,s);let o=n[i.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}}function Yx(t){return t.children.some(e=>e instanceof ka||!e.type.isAnonymous||Yx(e))}function pY(t){var e;let{buffer:i,nodeSet:n,maxBufferLength:s=RB,reused:r=[],minRepeatType:o=n.types.length}=t,l=Array.isArray(i)?new Ux(i,i.length):i,c=n.types,u=0,d=0;function p(L,E,z,N,q,J){let{id:U,start:R,end:B,size:D}=l,j=d,$=u;if(D<0)if(l.next(),D==-1){let I=r[U];z.push(I),N.push(R-L);return}else if(D==-3){u=U;return}else if(D==-4){d=U;return}else throw new RangeError(`Unrecognized record size: ${D}`);let X=c[U],H,F,M=R-L;if(B-R<=s&&(F=x(l.pos-E,q))){let I=new Uint16Array(F.size-F.skip),K=l.pos-F.size,Q=I.length;for(;l.pos>K;)Q=w(F.start,I,Q);H=new ka(I,B-F.start,n),M=F.start-L}else{let I=l.pos-D;l.next();let K=[],Q=[],ue=U>=o?U:-1,he=0,fe=B;for(;l.pos>I;)ue>=0&&l.id==ue&&l.size>=0?(l.end<=fe-s&&(_(K,Q,R,he,l.end,fe,ue,j,$),he=K.length,fe=l.end),l.next()):J>2500?g(R,I,K,Q):p(R,I,K,Q,ue,J+1);if(ue>=0&&he>0&&he<K.length&&_(K,Q,R,he,R,fe,ue,j,$),K.reverse(),Q.reverse(),ue>-1&&he>0){let Oe=O(X,$);H=Hx(X,K,Q,0,K.length,0,B-R,Oe,Oe)}else H=b(X,K,Q,B-R,j-B,$)}z.push(H),N.push(M)}function g(L,E,z,N){let q=[],J=0,U=-1;for(;l.pos>E;){let{id:R,start:B,end:D,size:j}=l;if(j>4)l.next();else{if(U>-1&&B<U)break;U<0&&(U=D-s),q.push(R,B,D),J++,l.next()}}if(J){let R=new Uint16Array(J*4),B=q[q.length-2];for(let D=q.length-3,j=0;D>=0;D-=3)R[j++]=q[D],R[j++]=q[D+1]-B,R[j++]=q[D+2]-B,R[j++]=j;z.push(new ka(R,q[2]-B,n)),N.push(B-L)}}function O(L,E){return(z,N,q)=>{let J=0,U=z.length-1,R,B;if(U>=0&&(R=z[U])instanceof ct){if(!U&&R.type==L&&R.length==q)return R;(B=R.prop(Ne.lookAhead))&&(J=N[U]+R.length+B)}return b(L,z,N,q,J,E)}}function _(L,E,z,N,q,J,U,R,B){let D=[],j=[];for(;L.length>N;)D.push(L.pop()),j.push(E.pop()+z-q);L.push(b(n.types[U],D,j,J-q,R-J,B)),E.push(q-z)}function b(L,E,z,N,q,J,U){if(J){let R=[Ne.contextHash,J];U=U?[R].concat(U):[R]}if(q>25){let R=[Ne.lookAhead,q];U=U?[R].concat(U):[R]}return new ct(L,E,z,N,U)}function x(L,E){let z=l.fork(),N=0,q=0,J=0,U=z.end-s,R={size:0,start:0,skip:0};e:for(let B=z.pos-L;z.pos>B;){let D=z.size;if(z.id==E&&D>=0){R.size=N,R.start=q,R.skip=J,J+=4,N+=4,z.next();continue}let j=z.pos-D;if(D<0||j<B||z.start<U)break;let $=z.id>=o?4:0,X=z.start;for(z.next();z.pos>j;){if(z.size<0)if(z.size==-3||z.size==-4)$+=4;else break e;else z.id>=o&&($+=4);z.next()}q=X,N+=D,J+=$}return(E<0||N==L)&&(R.size=N,R.start=q,R.skip=J),R.size>4?R:void 0}function w(L,E,z){let{id:N,start:q,end:J,size:U}=l;if(l.next(),U>=0&&N<o){let R=z;if(U>4){let B=l.pos-(U-4);for(;l.pos>B;)z=w(L,E,z)}E[--z]=R,E[--z]=J-L,E[--z]=q-L,E[--z]=N}else U==-3?u=N:U==-4&&(d=N);return z}let k=[],T=[];for(;l.pos>0;)p(t.start||0,t.bufferStart||0,k,T,-1,0);let A=(e=t.length)!==null&&e!==void 0?e:k.length?T[0]+k[0].length:0;return new ct(c[t.topID],k.reverse(),T.reverse(),A)}const RE=new WeakMap;function Um(t,e){if(!t.isAnonymous||e instanceof ka||e.type!=t)return 1;let i=RE.get(e);if(i==null){i=1;for(let n of e.children){if(n.type!=t||!(n instanceof ct)){i=1;break}i+=Um(t,n)}RE.set(e,i)}return i}function Hx(t,e,i,n,s,r,o,l,c){let u=0;for(let _=n;_<s;_++)u+=Um(t,e[_]);let d=Math.ceil(u*1.5/8),p=[],g=[];function O(_,b,x,w,k){for(let T=x;T<w;){let A=T,L=b[T],E=Um(t,_[T]);for(T++;T<w;T++){let z=Um(t,_[T]);if(E+z>=d)break;E+=z}if(T==A+1){if(E>d){let z=_[A];O(z.children,z.positions,0,z.children.length,b[A]+k);continue}p.push(_[A])}else{let z=b[T-1]+_[T-1].length-L;p.push(Hx(t,_,b,A,T,L,z,null,c))}g.push(L+k-r)}}return O(e,i,n,s,0),(l||c)(p,g,o)}class BB{constructor(){this.map=new WeakMap}setBuffer(e,i,n){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(i,n)}getBuffer(e,i){let n=this.map.get(e);return n&&n.get(i)}set(e,i){e instanceof yr?this.setBuffer(e.context.buffer,e.index,i):e instanceof on&&this.map.set(e.tree,i)}get(e){return e instanceof yr?this.getBuffer(e.context.buffer,e.index):e instanceof on?this.map.get(e.tree):void 0}cursorSet(e,i){e.buffer?this.setBuffer(e.buffer.buffer,e.index,i):this.map.set(e.tree,i)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class go{constructor(e,i,n,s,r=!1,o=!1){this.from=e,this.to=i,this.tree=n,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,i=[],n=!1){let s=[new go(0,e.length,e,0,!1,n)];for(let r of i)r.to>e.length&&s.push(r);return s}static applyChanges(e,i,n=128){if(!i.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,c=0,u=0;;l++){let d=l<i.length?i[l]:null,p=d?d.fromA:1e9;if(p-c>=n)for(;o&&o.from<p;){let g=o;if(c>=g.from||p<=g.to||u){let O=Math.max(g.from,c)-u,_=Math.min(g.to,p)-u;g=O>=_?null:new go(O,_,g.tree,g.offset+u,l>0,!!d)}if(g&&s.push(g),o.to>p)break;o=r<e.length?e[r++]:null}if(!d)break;c=d.toA,u=d.toA-d.toB}return s}}class Fx{startParse(e,i,n){return typeof e=="string"&&(e=new mY(e)),n=n?n.length?n.map(s=>new Ts(s.from,s.to)):[new Ts(0,0)]:[new Ts(0,e.length)],this.createParse(e,i||[],n)}parse(e,i,n){let s=this.startParse(e,i,n);for(;;){let r=s.advance();if(r)return r}}}class mY{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,i){return this.string.slice(e,i)}}function $B(t){return(e,i,n,s)=>new OY(e,t,i,n,s)}class QE{constructor(e,i,n,s,r,o){this.parser=e,this.parse=i,this.overlay=n,this.bracketed=s,this.target=r,this.from=o}}function LE(t){if(!t.length||t.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(t))}class gY{constructor(e,i,n,s,r,o,l,c){this.parser=e,this.predicate=i,this.mounts=n,this.index=s,this.start=r,this.bracketed=o,this.target=l,this.prev=c,this.depth=0,this.ranges=[]}}const kb=new Ne({perNode:!0});class OY{constructor(e,i,n,s,r){this.nest=i,this.input=n,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new ct(n.type,n.children,n.positions,n.length,n.propValues.concat([[kb,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],i=e.parse.advance();if(i){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[Ne.mounted.id]=new Fc(i,e.overlay,e.parser,e.bracketed),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].from<e&&(e=Math.min(e,this.inner[i].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let i=this.innerDone;i<this.inner.length;i++)this.inner[i].parse.stopAt(e)}startInner(){let e=new yY(this.fragments),i=null,n=null,s=new Mg(new on(this.baseTree,this.ranges[0].from,0,null),ut.IncludeAnonymous|ut.IgnoreMounts);e:for(let r,o;;){let l=!0,c;if(this.stoppedAt!=null&&s.from>=this.stoppedAt)l=!1;else if(e.hasNode(s)){if(i){let u=i.mounts.find(d=>d.frag.from<=s.from&&d.frag.to>=s.to&&d.mount.overlay);if(u)for(let d of u.mount.overlay){let p=d.from+u.pos,g=d.to+u.pos;p>=s.from&&g<=s.to&&!i.ranges.some(O=>O.from<g&&O.to>p)&&i.ranges.push({from:p,to:g})}}l=!1}else if(n&&(o=vY(n.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.from<s.to||!r.overlay)){s.tree||(_Y(s),i&&i.depth++,n&&n.depth++);let u=e.findMounts(s.from,r.parser);if(typeof r.overlay=="function")i=new gY(r.parser,r.overlay,u,this.inner.length,s.from,!!r.bracketed,s.tree,i);else{let d=$E(this.ranges,r.overlay||(s.from<s.to?[new Ts(s.from,s.to)]:[]));d.length&&LE(d),(d.length||!r.overlay)&&this.inner.push(new QE(r.parser,d.length?r.parser.startParse(this.input,zE(u,d),d):r.parser.startParse(""),r.overlay?r.overlay.map(p=>new Ts(p.from-s.from,p.to-s.from)):null,!!r.bracketed,s.tree,d.length?d[0].from:s.from)),r.overlay?d.length&&(n={ranges:d,depth:0,prev:n}):l=!1}}else if(i&&(c=i.predicate(s))&&(c===!0&&(c=new Ts(s.from,s.to)),c.from<c.to)){let u=i.ranges.length-1;u>=0&&i.ranges[u].to==c.from?i.ranges[u]={from:i.ranges[u].from,to:c.to}:i.ranges.push(c)}if(l&&s.firstChild())i&&i.depth++,n&&n.depth++;else for(;!s.nextSibling();){if(!s.parent())break e;if(i&&!--i.depth){let u=$E(this.ranges,i.ranges);u.length&&(LE(u),this.inner.splice(i.index,0,new QE(i.parser,i.parser.startParse(this.input,zE(i.mounts,u),u),i.ranges.map(d=>new Ts(d.from-i.start,d.to-i.start)),i.bracketed,i.target,u[0].from))),i=i.prev}n&&!--n.depth&&(n=n.prev)}}}}function vY(t,e,i){for(let n of t){if(n.from>=i)break;if(n.to>e)return n.from<=e&&n.to>=i?2:1}return 0}function DE(t,e,i,n,s,r){if(e<i){let o=t.buffer[e+1];n.push(t.slice(e,i,o)),s.push(o-r)}}function _Y(t){let{node:e}=t,i=[],n=e.context.buffer;do i.push(t.index),t.parent();while(!t.tree);let s=t.tree,r=s.children.indexOf(n),o=s.children[r],l=o.buffer,c=[r];function u(d,p,g,O,_,b){let x=i[b],w=[],k=[];DE(o,d,x,w,k,O);let T=l[x+1],A=l[x+2];c.push(w.length);let L=b?u(x+4,l[x+3],o.set.types[l[x]],T,A-T,b-1):e.toTree();return w.push(L),k.push(T-O),DE(o,l[x+3],p,w,k,O),new ct(g,w,k,_)}s.children[r]=u(0,l.length,_i.none,0,o.length,i.length-1);for(let d of c){let p=t.tree.children[d],g=t.tree.positions[d];t.yield(new on(p,g+t.from,d,t._tree))}}class BE{constructor(e,i){this.offset=i,this.done=!1,this.cursor=e.cursor(ut.IncludeAnonymous|ut.IgnoreMounts)}moveTo(e){let{cursor:i}=this,n=e-this.offset;for(;!this.done&&i.from<n;)i.to>=e&&i.enter(n,1,ut.IgnoreOverlays|ut.ExcludeBuffers)||i.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 i=this.cursor.tree;;){if(i==e.tree)return!0;if(i.children.length&&i.positions[0]==0&&i.children[0]instanceof ct)i=i.children[0];else break}return!1}}let yY=class{constructor(e){var i;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(i=n.tree.prop(kb))!==null&&i!==void 0?i:n.to,this.inner=new BE(n.tree,-n.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 i=this.curFrag=this.fragments[this.fragI];this.curTo=(e=i.tree.prop(kb))!==null&&e!==void 0?e:i.to,this.inner=new BE(i.tree,-i.offset)}}findMounts(e,i){var n;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(n=r.tree)===null||n===void 0?void 0:n.prop(Ne.mounted);if(o&&o.parser==i)for(let l=this.fragI;l<this.fragments.length;l++){let c=this.fragments[l];if(c.from>=r.to)break;c.tree==this.curFrag.tree&&s.push({frag:c,pos:r.from-c.offset,mount:o})}}}return s}};function $E(t,e){let i=null,n=e;for(let s=1,r=0;s<t.length;s++){let o=t[s-1].to,l=t[s].from;for(;r<n.length;r++){let c=n[r];if(c.from>=l)break;c.to<=o||(i||(n=i=e.slice()),c.from<o?(i[r]=new Ts(c.from,o),c.to>l&&i.splice(r+1,0,new Ts(l,c.to))):c.to>l?i[r--]=new Ts(l,c.to):i.splice(r--,1))}}return n}function bY(t,e,i,n){let s=0,r=0,o=!1,l=!1,c=-1e9,u=[];for(;;){let d=s==t.length?1e9:o?t[s].to:t[s].from,p=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let g=Math.max(c,i),O=Math.min(d,p,n);g<O&&u.push(new Ts(g,O))}if(c=Math.min(d,p),c==1e9)break;d==c&&(o?(o=!1,s++):o=!0),p==c&&(l?(l=!1,r++):l=!0)}return u}function zE(t,e){let i=[];for(let{pos:n,mount:s,frag:r}of t){let o=n+(s.overlay?s.overlay[0].from:0),l=o+s.tree.length,c=Math.max(r.from,o),u=Math.min(r.to,l);if(s.overlay){let d=s.overlay.map(g=>new Ts(g.from+n,g.to+n)),p=bY(e,d,c,u);for(let g=0,O=c;;g++){let _=g==p.length,b=_?u:p[g].from;if(b>O&&i.push(new go(O,b,s.tree,-o,r.from>=O||r.openStart,r.to<=b||r.openEnd)),_)break;O=p[g].to}}else i.push(new go(c,u,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return i}let SY=0;class ns{constructor(e,i,n,s){this.name=e,this.set=i,this.base=n,this.modified=s,this.id=SY++}toString(){let{name:e}=this;for(let i of this.modified)i.name&&(e=`${i.name}(${e})`);return e}static define(e,i){let n=typeof e=="string"?e:"?";if(e instanceof ns&&(i=e),i!=null&&i.base)throw new Error("Can not derive from a modified tag");let s=new ns(n,[],null,[]);if(s.set.push(s),i)for(let r of i.set)s.set.push(r);return s}static defineModifier(e){let i=new Pg(e);return n=>n.modified.indexOf(i)>-1?n:Pg.get(n.base||n,n.modified.concat(i).sort((s,r)=>s.id-r.id))}}let xY=0;class Pg{constructor(e){this.name=e,this.instances=[],this.id=xY++}static get(e,i){if(!i.length)return e;let n=i[0].instances.find(l=>l.base==e&&wY(i,l.modified));if(n)return n;let s=[],r=new ns(e.name,s,e,i);for(let l of i)l.instances.push(r);let o=CY(i);for(let l of e.set)if(!l.modified.length)for(let c of o)s.push(Pg.get(l,c));return r}}function wY(t,e){return t.length==e.length&&t.every((i,n)=>i==e[n])}function CY(t){let e=[[]];for(let i=0;i<t.length;i++)for(let n=0,s=e.length;n<s;n++)e.push(e[n].concat(t[i]));return e.sort((i,n)=>n.length-i.length)}function _h(t){let e=Object.create(null);for(let i in t){let n=t[i];Array.isArray(n)||(n=[n]);for(let s of i.split(" "))if(s){let r=[],o=2,l=s;for(let p=0;;){if(l=="..."&&p>0&&p+3==s.length){o=1;break}let g=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!g)throw new RangeError("Invalid path: "+s);if(r.push(g[0]=="*"?"":g[0][0]=='"'?JSON.parse(g[0]):g[0]),p+=g[0].length,p==s.length)break;let O=s[p++];if(p==s.length&&O=="!"){o=0;break}if(O!="/")throw new RangeError("Invalid path: "+s);l=s.slice(p)}let c=r.length-1,u=r[c];if(!u)throw new RangeError("Invalid path: "+s);let d=new jf(n,o,c>0?r.slice(0,c):null);e[u]=d.sort(e[u])}}return zB.add(e)}const zB=new Ne({combine(t,e){let i,n,s;for(;t||e;){if(!t||e&&t.depth>=e.depth?(s=e,e=e.next):(s=t,t=t.next),i&&i.mode==s.mode&&!s.context&&!i.context)continue;let r=new jf(s.tags,s.mode,s.context);i?i.next=r:n=r,i=r}return n}});class jf{constructor(e,i,n,s){this.tags=e,this.mode=i,this.context=n,this.next=s}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}}jf.empty=new jf([],2,null);function NB(t,e){let i=Object.create(null);for(let r of t)if(!Array.isArray(r.tag))i[r.tag.id]=r.class;else for(let o of r.tag)i[o.id]=r.class;let{scope:n,all:s=null}=e||{};return{style:r=>{let o=s;for(let l of r)for(let c of l.set){let u=i[c.id];if(u){o=o?o+" "+u:u;break}}return o},scope:n}}function kY(t,e){let i=null;for(let n of t){let s=n.style(e);s&&(i=i?i+" "+s:s)}return i}function TY(t,e,i,n=0,s=t.length){let r=new AY(n,Array.isArray(e)?e:[e],i);r.highlightRange(t.cursor(),n,s,"",r.highlighters),r.flush(s)}class AY{constructor(e,i,n){this.at=e,this.highlighters=i,this.span=n,this.class=""}startSpan(e,i){i!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=i)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,i,n,s,r){let{type:o,from:l,to:c}=e;if(l>=n||c<=i)return;o.isTop&&(r=this.highlighters.filter(O=>!O.scope||O.scope(o)));let u=s,d=EY(e)||jf.empty,p=kY(r,d.tags);if(p&&(u&&(u+=" "),u+=p,d.mode==1&&(s+=(s?" ":"")+p)),this.startSpan(Math.max(i,l),u),d.opaque)return;let g=e.tree&&e.tree.prop(Ne.mounted);if(g&&g.overlay){let O=e.node.enter(g.overlay[0].from+l,1),_=this.highlighters.filter(x=>!x.scope||x.scope(g.tree.type)),b=e.firstChild();for(let x=0,w=l;;x++){let k=x<g.overlay.length?g.overlay[x]:null,T=k?k.from+l:c,A=Math.max(i,w),L=Math.min(n,T);if(A<L&&b)for(;e.from<L&&(this.highlightRange(e,A,L,s,r),this.startSpan(Math.min(L,e.to),u),!(e.to>=T||!e.nextSibling())););if(!k||T>n)break;w=k.to+l,w>i&&(this.highlightRange(O.cursor(),Math.max(i,k.from+l),Math.min(n,w),"",_),this.startSpan(Math.min(n,w),u))}b&&e.parent()}else if(e.firstChild()){g&&(s="");do if(!(e.to<=i)){if(e.from>=n)break;this.highlightRange(e,i,n,s,r),this.startSpan(Math.min(n,e.to),u)}while(e.nextSibling());e.parent()}}}function EY(t){let e=t.type.prop(zB);for(;e&&e.context&&!t.matchContext(e.context);)e=e.next;return e||null}const _e=ns.define,um=_e(),fa=_e(),NE=_e(fa),jE=_e(fa),da=_e(),fm=_e(da),D_=_e(da),ur=_e(),tl=_e(ur),rr=_e(),or=_e(),Tb=_e(),Au=_e(Tb),dm=_e(),V={comment:um,lineComment:_e(um),blockComment:_e(um),docComment:_e(um),name:fa,variableName:_e(fa),typeName:NE,tagName:_e(NE),propertyName:jE,attributeName:_e(jE),className:_e(fa),labelName:_e(fa),namespace:_e(fa),macroName:_e(fa),literal:da,string:fm,docString:_e(fm),character:_e(fm),attributeValue:_e(fm),number:D_,integer:_e(D_),float:_e(D_),bool:_e(da),regexp:_e(da),escape:_e(da),color:_e(da),url:_e(da),keyword:rr,self:_e(rr),null:_e(rr),atom:_e(rr),unit:_e(rr),modifier:_e(rr),operatorKeyword:_e(rr),controlKeyword:_e(rr),definitionKeyword:_e(rr),moduleKeyword:_e(rr),operator:or,derefOperator:_e(or),arithmeticOperator:_e(or),logicOperator:_e(or),bitwiseOperator:_e(or),compareOperator:_e(or),updateOperator:_e(or),definitionOperator:_e(or),typeOperator:_e(or),controlOperator:_e(or),punctuation:Tb,separator:_e(Tb),bracket:Au,angleBracket:_e(Au),squareBracket:_e(Au),paren:_e(Au),brace:_e(Au),content:ur,heading:tl,heading1:_e(tl),heading2:_e(tl),heading3:_e(tl),heading4:_e(tl),heading5:_e(tl),heading6:_e(tl),contentSeparator:_e(ur),list:_e(ur),quote:_e(ur),emphasis:_e(ur),strong:_e(ur),link:_e(ur),monospace:_e(ur),strikethrough:_e(ur),inserted:_e(),deleted:_e(),changed:_e(),invalid:_e(),meta:dm,documentMeta:_e(dm),annotation:_e(dm),processingInstruction:_e(dm),definition:ns.defineModifier("definition"),constant:ns.defineModifier("constant"),function:ns.defineModifier("function"),standard:ns.defineModifier("standard"),local:ns.defineModifier("local"),special:ns.defineModifier("special")};for(let t in V){let e=V[t];e instanceof ns&&(e.name=t)}NB([{tag:V.link,class:"tok-link"},{tag:V.heading,class:"tok-heading"},{tag:V.emphasis,class:"tok-emphasis"},{tag:V.strong,class:"tok-strong"},{tag:V.keyword,class:"tok-keyword"},{tag:V.atom,class:"tok-atom"},{tag:V.bool,class:"tok-bool"},{tag:V.url,class:"tok-url"},{tag:V.labelName,class:"tok-labelName"},{tag:V.inserted,class:"tok-inserted"},{tag:V.deleted,class:"tok-deleted"},{tag:V.literal,class:"tok-literal"},{tag:V.string,class:"tok-string"},{tag:V.number,class:"tok-number"},{tag:[V.regexp,V.escape,V.special(V.string)],class:"tok-string2"},{tag:V.variableName,class:"tok-variableName"},{tag:V.local(V.variableName),class:"tok-variableName tok-local"},{tag:V.definition(V.variableName),class:"tok-variableName tok-definition"},{tag:V.special(V.variableName),class:"tok-variableName2"},{tag:V.definition(V.propertyName),class:"tok-propertyName tok-definition"},{tag:V.typeName,class:"tok-typeName"},{tag:V.namespace,class:"tok-namespace"},{tag:V.className,class:"tok-className"},{tag:V.macroName,class:"tok-macroName"},{tag:V.propertyName,class:"tok-propertyName"},{tag:V.operator,class:"tok-operator"},{tag:V.comment,class:"tok-comment"},{tag:V.meta,class:"tok-meta"},{tag:V.invalid,class:"tok-invalid"},{tag:V.punctuation,class:"tok-punctuation"}]);var B_;const Ol=new Ne;function Gx(t){return Se.define({combine:t?e=>e.concat(t):void 0})}const Kx=new Ne;class As{constructor(e,i,n=[],s=""){this.data=e,this.name=s,et.prototype.hasOwnProperty("tree")||Object.defineProperty(et.prototype,"tree",{get(){return xt(this)}}),this.parser=i,this.extension=[Ta.of(this),et.languageData.of((r,o,l)=>{let c=IE(r,o,l),u=c.type.prop(Ol);if(!u)return[];let d=r.facet(u),p=c.type.prop(Kx);if(p){let g=c.resolve(o-c.from,l);for(let O of p)if(O.test(g,r)){let _=r.facet(O.facet);return O.type=="replace"?_:_.concat(d)}}return d})].concat(n)}isActiveAt(e,i,n=-1){return IE(e,i,n).type.prop(Ol)==this.data}findRegions(e){let i=e.facet(Ta);if((i==null?void 0:i.data)==this.data)return[{from:0,to:e.doc.length}];if(!i||!i.allowsNesting)return[];let n=[],s=(r,o)=>{if(r.prop(Ol)==this.data){n.push({from:o,to:o+r.length});return}let l=r.prop(Ne.mounted);if(l){if(l.tree.prop(Ol)==this.data){if(l.overlay)for(let c of l.overlay)n.push({from:c.from+o,to:c.to+o});else n.push({from:o,to:o+r.length});return}else if(l.overlay){let c=n.length;if(s(l.tree,l.overlay[0].from+o),n.length>c)return}}for(let c=0;c<r.children.length;c++){let u=r.children[c];u instanceof ct&&s(u,r.positions[c]+o)}};return s(xt(e),0),n}get allowsNesting(){return!0}}As.setState=ze.define();function IE(t,e,i){let n=t.facet(Ta),s=xt(t).topNode;if(!n||n.allowsNesting)for(let r=s;r;r=r.enter(e,i,ut.ExcludeBuffers|ut.EnterBracketed))r.type.isTop&&(s=r);return s}class lh extends As{constructor(e,i,n){super(e,i,[],n),this.parser=i}static define(e){let i=Gx(e.languageData);return new lh(i,e.parser.configure({props:[Ol.add(n=>n.isTop?i:void 0)]}),e.name)}configure(e,i){return new lh(this.data,this.parser.configure(e),i||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function xt(t){let e=t.field(As.state,!1);return e?e.tree:ct.empty}class MY{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,i){let n=this.cursorPos-this.string.length;return e<n||i>=this.cursorPos?this.doc.sliceString(e,i):this.string.slice(e-n,i-n)}}let Eu=null;class If{constructor(e,i,n=[],s,r,o,l,c){this.parser=e,this.state=i,this.fragments=n,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=c,this.parse=null,this.tempSkipped=[]}static create(e,i,n){return new If(e,i,[],ct.empty,0,n,[],null)}startParse(){return this.parser.startParse(new MY(this.state.doc),this.fragments)}work(e,i){return i!=null&&i>=this.state.doc.length&&(i=void 0),this.tree!=ct.empty&&this.isDone(i??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),i!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>i)&&i<this.state.doc.length&&this.parse.stopAt(i);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(go.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(n=this.parse.stoppedAt)!==null&&n!==void 0?n:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(i??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,i;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(i=this.parse.advance()););}),this.treeLen=e,this.tree=i,this.fragments=this.withoutTempSkipped(go.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let i=Eu;Eu=this;try{return e()}finally{Eu=i}}withoutTempSkipped(e){for(let i;i=this.tempSkipped.pop();)e=VE(e,i.from,i.to);return e}changes(e,i){let{fragments:n,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let c=[];if(e.iterChangedRanges((u,d,p,g)=>c.push({fromA:u,toA:d,fromB:p,toB:g})),n=go.applyChanges(n,c),s=ct.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let u of this.skipped){let d=e.mapPos(u.from,1),p=e.mapPos(u.to,-1);d<p&&l.push({from:d,to:p})}}}return new If(this.parser,i,n,s,r,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let i=this.skipped.length;for(let n=0;n<this.skipped.length;n++){let{from:s,to:r}=this.skipped[n];s<e.to&&r>e.from&&(this.fragments=VE(this.fragments,s,r),this.skipped.splice(n--,1))}return this.skipped.length>=i?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,i){this.skipped.push({from:e,to:i})}static getSkippingParser(e){return new class extends Fx{createParse(i,n,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let c=Eu;if(c){for(let u of s)c.tempSkipped.push(u);e&&(c.scheduleOn=c.scheduleOn?Promise.all([c.scheduleOn,e]):e)}return this.parsedPos=o,new ct(_i.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let i=this.fragments;return this.treeLen>=e&&i.length&&i[0].from==0&&i[0].to>=e}static get(){return Eu}}function VE(t,e,i){return go.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}class ch{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let i=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),i.viewport.to);return i.work(20,n)||i.takeTree(),new ch(i)}static init(e){let i=Math.min(3e3,e.doc.length),n=If.create(e.facet(Ta).parser,e,{from:0,to:i});return n.work(20,i)||n.takeTree(),new ch(n)}}As.state=Bi.define({create:ch.init,update(t,e){for(let i of e.effects)if(i.is(As.setState))return i.value;return e.startState.facet(Ta)!=e.state.facet(Ta)?ch.init(e.state):t.apply(e)}});let jB=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(jB=t=>{let e=-1,i=setTimeout(()=>{e=requestIdleCallback(t,{timeout:400})},100);return()=>e<0?clearTimeout(i):cancelIdleCallback(e)});const $_=typeof navigator<"u"&&(!((B_=navigator.scheduling)===null||B_===void 0)&&B_.isInputPending)?()=>navigator.scheduling.isInputPending():null,PY=Jt.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 i=this.view.state.field(As.state).context;(i.updateViewport(e.view.viewport)||this.view.viewport.to>i.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(i)}scheduleWork(){if(this.working)return;let{state:e}=this.view,i=e.field(As.state);(i.tree!=i.context.tree||!i.context.isDone(e.doc.length))&&(this.working=jB(this.work))}work(e){this.working=null;let i=Date.now();if(this.chunkEnd<i&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=i+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:n,viewport:{to:s}}=this.view,r=n.field(As.state);if(r.tree==r.context.tree&&r.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!$_?Math.max(25,e.timeRemaining()-5):1e9),l=r.context.treeLen<s&&n.doc.length>s+1e3,c=r.context.work(()=>$_&&$_()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-i,(c||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:As.setState.of(new ch(r.context))})),this.chunkBudget>0&&!(c&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(i=>$n(this.view.state,i)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Ta=Se.define({combine(t){return t.length?t[0]:null},enables:t=>[As.state,PY,ve.contentAttributes.compute([t],e=>{let i=e.facet(t);return i&&i.name?{"data-language":i.name}:{}})]});class Vf{constructor(e,i=[]){this.language=e,this.support=i,this.extension=[e,i]}}class Rg{constructor(e,i,n,s,r,o=void 0){this.name=e,this.alias=i,this.extensions=n,this.filename=s,this.loadFunc=r,this.support=o,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:i,support:n}=e;if(!i){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");i=()=>Promise.resolve(n)}return new Rg(e.name,(e.alias||[]).concat(e.name).map(s=>s.toLowerCase()),e.extensions||[],e.filename,i,n)}static matchFilename(e,i){for(let s of e)if(s.filename&&s.filename.test(i))return s;let n=/\.([^.]+)$/.exec(i);if(n){for(let s of e)if(s.extensions.indexOf(n[1])>-1)return s}return null}static matchLanguageName(e,i,n=!0){i=i.toLowerCase();for(let s of e)if(s.alias.some(r=>r==i))return s;if(n)for(let s of e)for(let r of s.alias){let o=i.indexOf(r);if(o>-1&&(r.length>2||!/\w/.test(i[o-1])&&!/\w/.test(i[o+r.length])))return s}return null}}const RY=Se.define(),yh=Se.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(i=>i!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Qg(t){let e=t.facet(yh);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function Xf(t,e){let i="",n=t.tabSize,s=t.facet(yh)[0];if(s==" "){for(;e>=n;)i+=" ",e-=n;s=" "}for(let r=0;r<e;r++)i+=s;return i}function Jx(t,e){t instanceof et&&(t=new vO(t));for(let n of t.state.facet(RY)){let s=n(t,e);if(s!==void 0)return s}let i=xt(t.state);return i.length>=e?QY(t,i,e):null}class vO{constructor(e,i={}){this.state=e,this.options=i,this.unit=Qg(e)}lineAt(e,i=1){let n=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=n.from&&s<=n.to?r&&s==e?{text:"",from:e}:(i<0?s<e:s<=e)?{text:n.text.slice(s-n.from),from:s}:{text:n.text.slice(0,s-n.from),from:n.from}:n}textAfterPos(e,i=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:n,from:s}=this.lineAt(e,i);return n.slice(e-s,Math.min(n.length,e+100-s))}column(e,i=1){let{text:n,from:s}=this.lineAt(e,i),r=this.countColumn(n,e-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,i=e.length){return Ys(e,this.state.tabSize,i)}lineIndent(e,i=1){let{text:n,from:s}=this.lineAt(e,i),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const md=new Ne;function QY(t,e,i){let n=e.resolveStack(i),s=e.resolveInner(i,-1).resolve(i,0).enterUnfinishedNodesBefore(i);if(s!=n.node){let r=[];for(let o=s;o&&!(o.from<n.node.from||o.to>n.node.to||o.from==n.node.from&&o.type==n.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)n={node:r[o],next:n}}return IB(n,t,i)}function IB(t,e,i){for(let n=t;n;n=n.next){let s=DY(n.node);if(s)return s(ew.create(e,i,n))}return 0}function LY(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function DY(t){let e=t.type.prop(md);if(e)return e;let i=t.firstChild,n;if(i&&(n=i.type.prop(Ne.closedBy))){let s=t.lastChild,r=s&&n.indexOf(s.name)>-1;return o=>VB(o,!0,1,void 0,r&&!LY(o)?s.from:void 0)}return t.parent==null?BY:null}function BY(){return 0}class ew extends vO{constructor(e,i,n){super(e.state,e.options),this.base=e,this.pos=i,this.context=n}get node(){return this.context.node}static create(e,i,n){return new ew(e,i,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let i=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(i.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if($Y(n,e))break;i=this.state.doc.lineAt(n.from)}return this.lineIndent(i.from)}continue(){return IB(this.context.next,this.base,this.pos)}}function $Y(t,e){for(let i=e;i;i=i.parent)if(t==i)return!0;return!1}function zY(t){let e=t.node,i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;let s=t.options.simulateBreak,r=t.state.doc.lineAt(i.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=i.to;;){let c=e.childAfter(l);if(!c||c==n)return null;if(!c.type.isSkipped){if(c.from>=o)return null;let u=/^ */.exec(r.text.slice(i.to-r.from))[0].length;return{from:i.from,to:i.to+u}}l=c.to}}function NY({closing:t,align:e=!0,units:i=1}){return n=>VB(n,e,i,t)}function VB(t,e,i,n,s){let r=t.textAfter,o=r.match(/^\s*/)[0].length,l=n&&r.slice(o,o+n.length)==n||s==t.pos+o,c=e?zY(t):null;return c?l?t.column(c.from):t.column(c.to):t.baseIndent+(l?0:t.unit*i)}const jY=t=>t.baseIndent;function Ym({except:t,units:e=1}={}){return i=>{let n=t&&t.test(i.textAfter);return i.baseIndent+(n?0:e*i.unit)}}const IY=200;function VY(){return et.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let i=t.newDoc,{head:n}=t.newSelection.main,s=i.lineAt(n);if(n>s.from+IY)return t;let r=i.sliceString(s.from,n);if(!e.some(u=>u.test(r)))return t;let{state:o}=t,l=-1,c=[];for(let{head:u}of o.selection.ranges){let d=o.doc.lineAt(u);if(d.from==l)continue;l=d.from;let p=Jx(o,d.from);if(p==null)continue;let g=/^\s*/.exec(d.text)[0],O=Xf(o,p);g!=O&&c.push({from:d.from,to:d.from+g.length,insert:O})}return c.length?[t,{changes:c,sequential:!0}]:t})}const XB=Se.define(),bh=new Ne;function ZB(t){let e=t.firstChild,i=t.lastChild;return e&&e.to<i.from?{from:e.to,to:i.type.isError?t.to:i.from}:null}function XY(t,e,i){let n=xt(t);if(n.length<i)return null;let s=n.resolveStack(i,1),r=null;for(let o=s;o;o=o.next){let l=o.node;if(l.to<=i||l.from>i)continue;if(r&&l.from<e)break;let c=l.type.prop(bh);if(c&&(l.to<n.length-50||n.length==t.doc.length||!ZY(l))){let u=c(l,t);u&&u.from<=i&&u.from>=e&&u.to>i&&(r=u)}}return r}function ZY(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function Lg(t,e,i){for(let n of t.facet(XB)){let s=n(t,e,i);if(s)return s}return XY(t,e,i)}function qB(t,e){let i=e.mapPos(t.from,1),n=e.mapPos(t.to,-1);return i>=n?void 0:{from:i,to:n}}const _O=ze.define({map:qB}),gd=ze.define({map:qB});function WB(t){let e=[];for(let{head:i}of t.state.selection.ranges)e.some(n=>n.from<=i&&n.to>=i)||e.push(t.lineBlockAt(i));return e}const El=Bi.define({create(){return Pe.none},update(t,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((i,n)=>t=XE(t,i,n)),t=t.map(e.changes);for(let i of e.effects)if(i.is(_O)&&!qY(t,i.value.from,i.value.to)){let{preparePlaceholder:n}=e.state.facet(HB),s=n?Pe.replace({widget:new KY(n(e.state,i.value))}):ZE;t=t.update({add:[s.range(i.value.from,i.value.to)]})}else i.is(gd)&&(t=t.update({filter:(n,s)=>i.value.from!=n||i.value.to!=s,filterFrom:i.value.from,filterTo:i.value.to}));return e.selection&&(t=XE(t,e.selection.main.head)),t},provide:t=>ve.decorations.from(t),toJSON(t,e){let i=[];return t.between(0,e.doc.length,(n,s)=>{i.push(n,s)}),i},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let i=0;i<t.length;){let n=t[i++],s=t[i++];if(typeof n!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");e.push(ZE.range(n,s))}return Pe.set(e,!0)}});function XE(t,e,i=e){let n=!1;return t.between(e,i,(s,r)=>{s<i&&r>e&&(n=!0)}),n?t.update({filterFrom:e,filterTo:i,filter:(s,r)=>s>=i||r<=e}):t}function Dg(t,e,i){var n;let s=null;return(n=t.field(El,!1))===null||n===void 0||n.between(e,i,(r,o)=>{(!s||s.from>r)&&(s={from:r,to:o})}),s}function qY(t,e,i){let n=!1;return t.between(e,e,(s,r)=>{s==e&&r==i&&(n=!0)}),n}function UB(t,e){return t.field(El,!1)?e:e.concat(ze.appendConfig.of(FB()))}const WY=t=>{for(let e of WB(t)){let i=Lg(t.state,e.from,e.to);if(i)return t.dispatch({effects:UB(t.state,[_O.of(i),YB(t,i)])}),!0}return!1},UY=t=>{if(!t.state.field(El,!1))return!1;let e=[];for(let i of WB(t)){let n=Dg(t.state,i.from,i.to);n&&e.push(gd.of(n),YB(t,n,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function YB(t,e,i=!0){let n=t.state.doc.lineAt(e.from).number,s=t.state.doc.lineAt(e.to).number;return ve.announce.of(`${t.state.phrase(i?"Folded lines":"Unfolded lines")} ${n} ${t.state.phrase("to")} ${s}.`)}const YY=t=>{let{state:e}=t,i=[];for(let n=0;n<e.doc.length;){let s=t.lineBlockAt(n),r=Lg(e,s.from,s.to);r&&i.push(_O.of(r)),n=(r?t.lineBlockAt(r.to):s).to+1}return i.length&&t.dispatch({effects:UB(t.state,i)}),!!i.length},HY=t=>{let e=t.state.field(El,!1);if(!e||!e.size)return!1;let i=[];return e.between(0,t.state.doc.length,(n,s)=>{i.push(gd.of({from:n,to:s}))}),t.dispatch({effects:i}),!0},FY=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:WY},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:UY},{key:"Ctrl-Alt-[",run:YY},{key:"Ctrl-Alt-]",run:HY}],GY={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},HB=Se.define({combine(t){return Qr(t,GY)}});function FB(t){return[El,tH]}function GB(t,e){let{state:i}=t,n=i.facet(HB),s=o=>{let l=t.lineBlockAt(t.posAtDOM(o.target)),c=Dg(t.state,l.from,l.to);c&&t.dispatch({effects:gd.of(c)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,s,e);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",i.phrase("folded code")),r.title=i.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}const ZE=Pe.replace({widget:new class extends Gs{toDOM(t){return GB(t,null)}}});class KY extends Gs{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return GB(e,this.value)}}const JY={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class z_ extends bo{constructor(e,i){super(),this.config=e,this.open=i}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let i=document.createElement("span");return i.textContent=this.open?this.config.openText:this.config.closedText,i.title=e.state.phrase(this.open?"Fold line":"Unfold line"),i}}function eH(t={}){let e={...JY,...t},i=new z_(e,!0),n=new z_(e,!1),s=Jt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Ta)!=o.state.facet(Ta)||o.startState.field(El,!1)!=o.state.field(El,!1)||xt(o.startState)!=xt(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new _o;for(let c of o.viewportLineBlocks){let u=Dg(o.state,c.from,c.to)?n:Lg(o.state,c.from,c.to)?i:null;u&&l.add(c.from,c.from,u)}return l.finish()}}),{domEventHandlers:r}=e;return[s,KU({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||Ge.empty},initialSpacer(){return new z_(e,!1)},domEventHandlers:{...r,click:(o,l,c)=>{if(r.click&&r.click(o,l,c))return!0;let u=Dg(o.state,l.from,l.to);if(u)return o.dispatch({effects:gd.of(u)}),!0;let d=Lg(o.state,l.from,l.to);return d?(o.dispatch({effects:_O.of(d)}),!0):!1}}}),FB()]}const tH=ve.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Od{constructor(e,i){this.specs=e;let n;function s(l){let c=xa.newName();return(n||(n=Object.create(null)))["."+c]=l,c}const r=typeof i.all=="string"?i.all:i.all?s(i.all):void 0,o=i.scope;this.scope=o instanceof As?l=>l.prop(Ol)==o.data:o?l=>l==o:void 0,this.style=NB(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=n?new xa(n):null,this.themeType=i.themeType}static define(e,i){return new Od(e,i||{})}}const Ab=Se.define(),KB=Se.define({combine(t){return t.length?[t[0]]:null}});function N_(t){let e=t.facet(Ab);return e.length?e:t.facet(KB)}function JB(t,e){let i=[nH],n;return t instanceof Od&&(t.module&&i.push(ve.styleModule.of(t.module)),n=t.themeType),e!=null&&e.fallback?i.push(KB.of(t)):n?i.push(Ab.computeN([ve.darkTheme],s=>s.facet(ve.darkTheme)==(n=="dark")?[t]:[])):i.push(Ab.of(t)),i}class iH{constructor(e){this.markCache=Object.create(null),this.tree=xt(e.state),this.decorations=this.buildDeco(e,N_(e.state)),this.decoratedTo=e.viewport.to}update(e){let i=xt(e.state),n=N_(e.state),s=n!=N_(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);i.length<r.to&&!s&&i.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(i!=this.tree||e.viewportChanged||s)&&(this.tree=i,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,i){if(!i||!this.tree.length)return Pe.none;let n=new _o;for(let{from:s,to:r}of e.visibleRanges)TY(this.tree,i,(o,l,c)=>{n.add(o,l,this.markCache[c]||(this.markCache[c]=Pe.mark({class:c})))},s,r);return n.finish()}}const nH=So.high(Jt.fromClass(iH,{decorations:t=>t.decorations})),sH=Od.define([{tag:V.meta,color:"#404740"},{tag:V.link,textDecoration:"underline"},{tag:V.heading,textDecoration:"underline",fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strong,fontWeight:"bold"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.keyword,color:"#708"},{tag:[V.atom,V.bool,V.url,V.contentSeparator,V.labelName],color:"#219"},{tag:[V.literal,V.inserted],color:"#164"},{tag:[V.string,V.deleted],color:"#a11"},{tag:[V.regexp,V.escape,V.special(V.string)],color:"#e40"},{tag:V.definition(V.variableName),color:"#00f"},{tag:V.local(V.variableName),color:"#30a"},{tag:[V.typeName,V.namespace],color:"#085"},{tag:V.className,color:"#167"},{tag:[V.special(V.variableName),V.macroName],color:"#256"},{tag:V.definition(V.propertyName),color:"#00c"},{tag:V.comment,color:"#940"},{tag:V.invalid,color:"#f00"}]),rH=ve.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),e$=1e4,t$="()[]{}",i$=Se.define({combine(t){return Qr(t,{afterCursor:!0,brackets:t$,maxScanDistance:e$,renderMatch:lH})}}),oH=Pe.mark({class:"cm-matchingBracket"}),aH=Pe.mark({class:"cm-nonmatchingBracket"});function lH(t){let e=[],i=t.matched?oH:aH;return e.push(i.range(t.start.from,t.start.to)),t.end&&e.push(i.range(t.end.from,t.end.to)),e}const cH=Bi.define({create(){return Pe.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let i=[],n=e.state.facet(i$);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=br(e.state,s.head,-1,n)||s.head>0&&br(e.state,s.head-1,1,n)||n.afterCursor&&(br(e.state,s.head,1,n)||s.head<e.state.doc.length&&br(e.state,s.head+1,-1,n));r&&(i=i.concat(n.renderMatch(r,e.state)))}return Pe.set(i,!0)},provide:t=>ve.decorations.from(t)}),hH=[cH,rH];function uH(t={}){return[i$.of(t),hH]}const n$=new Ne;function Eb(t,e,i){let n=t.prop(e<0?Ne.openedBy:Ne.closedBy);if(n)return n;if(t.name.length==1){let s=i.indexOf(t.name);if(s>-1&&s%2==(e<0?1:0))return[i[s+e]]}return null}function Mb(t){let e=t.type.prop(n$);return e?e(t.node):t}function br(t,e,i,n={}){let s=n.maxScanDistance||e$,r=n.brackets||t$,o=xt(t),l=o.resolveInner(e,i);for(let c=l;c;c=c.parent){let u=Eb(c.type,i,r);if(u&&c.from<c.to){let d=Mb(c);if(d&&(i>0?e>=d.from&&e<d.to:e>d.from&&e<=d.to))return fH(t,e,i,c,d,u,r)}}return dH(t,e,i,o,l.type,s,r)}function fH(t,e,i,n,s,r,o){let l=n.parent,c={from:s.from,to:s.to},u=0,d=l==null?void 0:l.cursor();if(d&&(i<0?d.childBefore(n.from):d.childAfter(n.to)))do if(i<0?d.to<=n.from:d.from>=n.to){if(u==0&&r.indexOf(d.type.name)>-1&&d.from<d.to){let p=Mb(d);return{start:c,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(Eb(d.type,i,o))u++;else if(Eb(d.type,-i,o)){if(u==0){let p=Mb(d);return{start:c,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}u--}}while(i<0?d.prevSibling():d.nextSibling());return{start:c,matched:!1}}function dH(t,e,i,n,s,r,o){let l=i<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),c=o.indexOf(l);if(c<0||c%2==0!=i>0)return null;let u={from:i<0?e-1:e,to:i>0?e+1:e},d=t.doc.iterRange(e,i>0?t.doc.length:0),p=0;for(let g=0;!d.next().done&&g<=r;){let O=d.value;i<0&&(g+=O.length);let _=e+g*i;for(let b=i>0?0:O.length-1,x=i>0?O.length:-1;b!=x;b+=i){let w=o.indexOf(O[b]);if(!(w<0||n.resolveInner(_+b,1).type!=s))if(w%2==0==i>0)p++;else{if(p==1)return{start:u,end:{from:_+b,to:_+b+1},matched:w>>1==c>>1};p--}}i>0&&(g+=O.length)}return d.done?{start:u,matched:!1}:null}const pH=Object.create(null),qE=[_i.none],WE=[],UE=Object.create(null),mH=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"]])mH[t]=gH(pH,e);function j_(t,e){WE.indexOf(t)>-1||(WE.push(t),console.warn(e))}function gH(t,e){let i=[];for(let l of e.split(" ")){let c=[];for(let u of l.split(".")){let d=t[u]||V[u];d?typeof d=="function"?c.length?c=c.map(d):j_(u,`Modifier ${u} used at start of tag`):c.length?j_(u,`Tag ${u} used as modifier`):c=Array.isArray(d)?d:[d]:j_(u,`Unknown highlighting tag ${u}`)}for(let u of c)i.push(u)}if(!i.length)return 0;let n=e.replace(/ /g,"_"),s=n+" "+i.map(l=>l.id),r=UE[s];if(r)return r.id;let o=UE[s]=_i.define({id:qE.length,name:n,props:[_h({[n]:i})]});return qE.push(o),o.id}St.RTL,St.LTR;const OH=t=>{let{state:e}=t,i=e.doc.lineAt(e.selection.main.from),n=iw(t.state,i.from);return n.line?vH(t):n.block?yH(t):!1};function tw(t,e){return({state:i,dispatch:n})=>{if(i.readOnly)return!1;let s=t(e,i);return s?(n(i.update(s)),!0):!1}}const vH=tw(xH,0),_H=tw(s$,0),yH=tw((t,e)=>s$(t,e,SH(e)),0);function iw(t,e){let i=t.languageDataAt("commentTokens",e,1);return i.length?i[0]:{}}const Mu=50;function bH(t,{open:e,close:i},n,s){let r=t.sliceDoc(n-Mu,n),o=t.sliceDoc(s,s+Mu),l=/\s*$/.exec(r)[0].length,c=/^\s*/.exec(o)[0].length,u=r.length-l;if(r.slice(u-e.length,u)==e&&o.slice(c,c+i.length)==i)return{open:{pos:n-l,margin:l&&1},close:{pos:s+c,margin:c&&1}};let d,p;s-n<=2*Mu?d=p=t.sliceDoc(n,s):(d=t.sliceDoc(n,n+Mu),p=t.sliceDoc(s-Mu,s));let g=/^\s*/.exec(d)[0].length,O=/\s*$/.exec(p)[0].length,_=p.length-O-i.length;return d.slice(g,g+e.length)==e&&p.slice(_,_+i.length)==i?{open:{pos:n+g+e.length,margin:/\s/.test(d.charAt(g+e.length))?1:0},close:{pos:s-O-i.length,margin:/\s/.test(p.charAt(_-1))?1:0}}:null}function SH(t){let e=[];for(let i of t.selection.ranges){let n=t.doc.lineAt(i.from),s=i.to<=n.to?n:t.doc.lineAt(i.to);s.from>n.from&&s.from==i.to&&(s=i.to==n.to+1?n:t.doc.lineAt(i.to-1));let r=e.length-1;r>=0&&e[r].to>n.from?e[r].to=s.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return e}function s$(t,e,i=e.selection.ranges){let n=i.map(r=>iw(e,r.from).block);if(!n.every(r=>r))return null;let s=i.map((r,o)=>bH(e,n[o],r.from,r.to));if(t!=2&&!s.every(r=>r))return{changes:e.changes(i.map((r,o)=>s[o]?[]:[{from:r.from,insert:n[o].open+" "},{from:r.to,insert:" "+n[o].close}]))};if(t!=1&&s.some(r=>r)){let r=[];for(let o=0,l;o<s.length;o++)if(l=s[o]){let c=n[o],{open:u,close:d}=l;r.push({from:u.pos-c.open.length,to:u.pos+u.margin},{from:d.pos-d.margin,to:d.pos+c.close.length})}return{changes:r}}return null}function xH(t,e,i=e.selection.ranges){let n=[],s=-1;e:for(let{from:r,to:o}of i){let l=n.length,c=1e9,u;for(let d=r;d<=o;){let p=e.doc.lineAt(d);if(u==null&&(u=iw(e,p.from).line,!u))continue e;if(p.from>s&&(r==o||o>p.from)){s=p.from;let g=/^\s*/.exec(p.text)[0].length,O=g==p.length,_=p.text.slice(g,g+u.length)==u?g:-1;g<p.text.length&&g<c&&(c=g),n.push({line:p,comment:_,token:u,indent:g,empty:O,single:!1})}d=p.to+1}if(c<1e9)for(let d=l;d<n.length;d++)n[d].indent<n[d].line.text.length&&(n[d].indent=c);n.length==l+1&&(n[l].single=!0)}if(t!=2&&n.some(r=>r.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:c,indent:u,empty:d,single:p}of n)(p||!d)&&r.push({from:l.from+u,insert:c+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(t!=1&&n.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:c}of n)if(l>=0){let u=o.from+l,d=u+c.length;o.text[d-o.from]==" "&&d++,r.push({from:u,to:d})}return{changes:r}}return null}const Pb=Rr.define(),wH=Rr.define(),CH=Se.define(),r$=Se.define({combine(t){return Qr(t,{minDepth:100,newGroupDelay:500,joinToEvent:(e,i)=>i},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,i)=>(n,s)=>e(n,s)||i(n,s)})}}),o$=Bi.define({create(){return Sr.empty},update(t,e){let i=e.state.facet(r$),n=e.annotation(Pb);if(n){let c=zn.fromTransaction(e,n.selection),u=n.side,d=u==0?t.undone:t.done;return c?d=Bg(d,d.length,i.minDepth,c):d=c$(d,e.startState.selection),new Sr(u==0?n.rest:d,u==0?d:n.rest)}let s=e.annotation(wH);if((s=="full"||s=="before")&&(t=t.isolate()),e.annotation(hi.addToHistory)===!1)return e.changes.empty?t:t.addMapping(e.changes.desc);let r=zn.fromTransaction(e),o=e.annotation(hi.time),l=e.annotation(hi.userEvent);return r?t=t.addChanges(r,o,l,i,e):e.selection&&(t=t.addSelection(e.startState.selection,o,l,i.newGroupDelay)),(s=="full"||s=="after")&&(t=t.isolate()),t},toJSON(t){return{done:t.done.map(e=>e.toJSON()),undone:t.undone.map(e=>e.toJSON())}},fromJSON(t){return new Sr(t.done.map(zn.fromJSON),t.undone.map(zn.fromJSON))}});function kH(t={}){return[o$,r$.of(t),ve.domEventHandlers({beforeinput(e,i){let n=e.inputType=="historyUndo"?a$:e.inputType=="historyRedo"?Rb:null;return n?(e.preventDefault(),n(i)):!1}})]}function yO(t,e){return function({state:i,dispatch:n}){if(!e&&i.readOnly)return!1;let s=i.field(o$,!1);if(!s)return!1;let r=s.pop(t,i,e);return r?(n(r),!0):!1}}const a$=yO(0,!1),Rb=yO(1,!1),TH=yO(0,!0),AH=yO(1,!0);class zn{constructor(e,i,n,s,r){this.changes=e,this.effects=i,this.mapped=n,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new zn(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,i,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(i=this.mapped)===null||i===void 0?void 0:i.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new zn(e.changes&&vi.fromJSON(e.changes),[],e.mapped&&Cr.fromJSON(e.mapped),e.startSelection&&re.fromJSON(e.startSelection),e.selectionsAfter.map(re.fromJSON))}static fromTransaction(e,i){let n=Es;for(let s of e.startState.facet(CH)){let r=s(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new zn(e.changes.invert(e.startState.doc),n,void 0,i||e.startState.selection,Es)}static selection(e){return new zn(void 0,Es,void 0,void 0,e)}}function Bg(t,e,i,n){let s=e+1>i+20?e-i-1:0,r=t.slice(s,e);return r.push(n),r}function EH(t,e){let i=[],n=!1;return t.iterChangedRanges((s,r)=>i.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let c=0;c<i.length;){let u=i[c++],d=i[c++];l>=u&&o<=d&&(n=!0)}}),n}function MH(t,e){return t.ranges.length==e.ranges.length&&t.ranges.filter((i,n)=>i.empty!=e.ranges[n].empty).length===0}function l$(t,e){return t.length?e.length?t.concat(e):t:e}const Es=[],PH=200;function c$(t,e){if(t.length){let i=t[t.length-1],n=i.selectionsAfter.slice(Math.max(0,i.selectionsAfter.length-PH));return n.length&&n[n.length-1].eq(e)?t:(n.push(e),Bg(t,t.length-1,1e9,i.setSelAfter(n)))}else return[zn.selection([e])]}function RH(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}function I_(t,e){if(!t.length)return t;let i=t.length,n=Es;for(;i;){let s=QH(t[i-1],e,n);if(s.changes&&!s.changes.empty||s.effects.length){let r=t.slice(0,i);return r[i-1]=s,r}else e=s.mapped,i--,n=s.selectionsAfter}return n.length?[zn.selection(n)]:Es}function QH(t,e,i){let n=l$(t.selectionsAfter.length?t.selectionsAfter.map(l=>l.map(e)):Es,i);if(!t.changes)return zn.selection(n);let s=t.changes.map(e),r=e.mapDesc(t.changes,!0),o=t.mapped?t.mapped.composeDesc(r):r;return new zn(s,ze.mapEffects(t.effects,e),o,t.startSelection.map(r),n)}const LH=/^(input\.type|delete)($|\.)/;class Sr{constructor(e,i,n=0,s=void 0){this.done=e,this.undone=i,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new Sr(this.done,this.undone):this}addChanges(e,i,n,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||LH.test(n))&&(!l.selectionsAfter.length&&i-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,EH(l.changes,e.changes))||n=="input.type.compose")?o=Bg(o,o.length-1,s.minDepth,new zn(e.changes.compose(l.changes),l$(ze.mapEffects(e.effects,l.changes),l.effects),l.mapped,l.startSelection,Es)):o=Bg(o,o.length,s.minDepth,e),new Sr(o,Es,i,n)}addSelection(e,i,n,s){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Es;return r.length>0&&i-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&MH(r[r.length-1],e)?this:new Sr(c$(this.done,e),this.undone,i,n)}addMapping(e){return new Sr(I_(this.done,e),I_(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,i,n){let s=e==0?this.done:this.undone;if(s.length==0)return null;let r=s[s.length-1],o=r.selectionsAfter[0]||(r.startSelection?r.startSelection.map(r.changes.invertedDesc,1):i.selection);if(n&&r.selectionsAfter.length)return i.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:Pb.of({side:e,rest:RH(s),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let l=s.length==1?Es:s.slice(0,s.length-1);return r.mapped&&(l=I_(l,r.mapped)),i.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:Pb.of({side:e,rest:l,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Sr.empty=new Sr(Es,Es);const DH=[{key:"Mod-z",run:a$,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Rb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Rb,preventDefault:!0},{key:"Mod-u",run:TH,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:AH,preventDefault:!0}];function Sh(t,e){return re.create(t.ranges.map(e),t.mainIndex)}function Ks(t,e){return t.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Js({state:t,dispatch:e},i){let n=Sh(t.selection,i);return n.eq(t.selection,!0)?!1:(e(Ks(t,n)),!0)}function bO(t,e){return re.cursor(e?t.to:t.from)}function h$(t,e){return Js(t,i=>i.empty?t.moveByChar(i,e):bO(i,e))}function an(t){return t.textDirectionAt(t.state.selection.main.head)==St.LTR}const u$=t=>h$(t,!an(t)),f$=t=>h$(t,an(t));function d$(t,e){return Js(t,i=>i.empty?t.moveByGroup(i,e):bO(i,e))}const BH=t=>d$(t,!an(t)),$H=t=>d$(t,an(t));function zH(t,e,i){if(e.type.prop(i))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(t.sliceDoc(e.from,e.to)))||e.firstChild}function SO(t,e,i){let n=xt(t).resolveInner(e.head),s=i?Ne.closedBy:Ne.openedBy;for(let c=e.head;;){let u=i?n.childAfter(c):n.childBefore(c);if(!u)break;zH(t,u,s)?n=u:c=i?u.to:u.from}let r=n.type.prop(s),o,l;return r&&(o=i?br(t,n.from,1):br(t,n.to,-1))&&o.matched?l=i?o.end.to:o.end.from:l=i?n.to:n.from,re.cursor(l,i?-1:1)}const NH=t=>Js(t,e=>SO(t.state,e,!an(t))),jH=t=>Js(t,e=>SO(t.state,e,an(t)));function p$(t,e){return Js(t,i=>{if(!i.empty)return bO(i,e);let n=t.moveVertically(i,e);return n.head!=i.head?n:t.moveToLineBoundary(i,e)})}const m$=t=>p$(t,!1),g$=t=>p$(t,!0);function O$(t){let e=t.scrollDOM.clientHeight<t.scrollDOM.scrollHeight-2,i=0,n=0,s;if(e){for(let r of t.state.facet(ve.scrollMargins)){let o=r(t);o!=null&&o.top&&(i=Math.max(o==null?void 0:o.top,i)),o!=null&&o.bottom&&(n=Math.max(o==null?void 0:o.bottom,n))}s=t.scrollDOM.clientHeight-i-n}else s=(t.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:i,marginBottom:n,selfScroll:e,height:Math.max(t.defaultLineHeight,s-5)}}function v$(t,e){let i=O$(t),{state:n}=t,s=Sh(n.selection,o=>o.empty?t.moveVertically(o,e,i.height):bO(o,e));if(s.eq(n.selection))return!1;let r;if(i.selfScroll){let o=t.coordsAtPos(n.selection.main.head),l=t.scrollDOM.getBoundingClientRect(),c=l.top+i.marginTop,u=l.bottom-i.marginBottom;o&&o.top>c&&o.bottom<u&&(r=ve.scrollIntoView(s.main.head,{y:"start",yMargin:o.top-c}))}return t.dispatch(Ks(n,s),{effects:r}),!0}const YE=t=>v$(t,!1),Qb=t=>v$(t,!0);function Ra(t,e,i){let n=t.lineBlockAt(e.head),s=t.moveToLineBoundary(e,i);if(s.head==e.head&&s.head!=(i?n.to:n.from)&&(s=t.moveToLineBoundary(e,i,!1)),!i&&s.head==n.from&&n.length){let r=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;r&&e.head!=n.from+r&&(s=re.cursor(n.from+r))}return s}const IH=t=>Js(t,e=>Ra(t,e,!0)),VH=t=>Js(t,e=>Ra(t,e,!1)),XH=t=>Js(t,e=>Ra(t,e,!an(t))),ZH=t=>Js(t,e=>Ra(t,e,an(t))),qH=t=>Js(t,e=>re.cursor(t.lineBlockAt(e.head).from,1)),WH=t=>Js(t,e=>re.cursor(t.lineBlockAt(e.head).to,-1));function UH(t,e,i){let n=!1,s=Sh(t.selection,r=>{let o=br(t,r.head,-1)||br(t,r.head,1)||r.head>0&&br(t,r.head-1,1)||r.head<t.doc.length&&br(t,r.head+1,-1);if(!o||!o.end)return r;n=!0;let l=o.start.from==r.head?o.end.to:o.end.from;return re.cursor(l)});return n?(e(Ks(t,s)),!0):!1}const YH=({state:t,dispatch:e})=>UH(t,e);function Ls(t,e){let i=Sh(t.state.selection,n=>{let s=e(n);return re.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return i.eq(t.state.selection)?!1:(t.dispatch(Ks(t.state,i)),!0)}function _$(t,e){return Ls(t,i=>t.moveByChar(i,e))}const y$=t=>_$(t,!an(t)),b$=t=>_$(t,an(t));function S$(t,e){return Ls(t,i=>t.moveByGroup(i,e))}const HH=t=>S$(t,!an(t)),FH=t=>S$(t,an(t)),GH=t=>Ls(t,e=>SO(t.state,e,!an(t))),KH=t=>Ls(t,e=>SO(t.state,e,an(t)));function x$(t,e){return Ls(t,i=>t.moveVertically(i,e))}const w$=t=>x$(t,!1),C$=t=>x$(t,!0);function k$(t,e){return Ls(t,i=>t.moveVertically(i,e,O$(t).height))}const HE=t=>k$(t,!1),FE=t=>k$(t,!0),JH=t=>Ls(t,e=>Ra(t,e,!0)),eF=t=>Ls(t,e=>Ra(t,e,!1)),tF=t=>Ls(t,e=>Ra(t,e,!an(t))),iF=t=>Ls(t,e=>Ra(t,e,an(t))),nF=t=>Ls(t,e=>re.cursor(t.lineBlockAt(e.head).from)),sF=t=>Ls(t,e=>re.cursor(t.lineBlockAt(e.head).to)),GE=({state:t,dispatch:e})=>(e(Ks(t,{anchor:0})),!0),KE=({state:t,dispatch:e})=>(e(Ks(t,{anchor:t.doc.length})),!0),JE=({state:t,dispatch:e})=>(e(Ks(t,{anchor:t.selection.main.anchor,head:0})),!0),eM=({state:t,dispatch:e})=>(e(Ks(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0),rF=({state:t,dispatch:e})=>(e(t.update({selection:{anchor:0,head:t.doc.length},userEvent:"select"})),!0),oF=({state:t,dispatch:e})=>{let i=xO(t).map(({from:n,to:s})=>re.range(n,Math.min(s+1,t.doc.length)));return e(t.update({selection:re.create(i),userEvent:"select"})),!0},aF=({state:t,dispatch:e})=>{let i=Sh(t.selection,n=>{let s=xt(t),r=s.resolveStack(n.from,1);if(n.empty){let o=s.resolveStack(n.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from<n.from&&l.to>=n.to||l.to>n.to&&l.from<=n.from)&&o.next)return re.range(l.to,l.from)}return n});return i.eq(t.selection)?!1:(e(Ks(t,i)),!0)};function T$(t,e){let{state:i}=t,n=i.selection,s=i.selection.ranges.slice();for(let r of i.selection.ranges){let o=i.doc.lineAt(r.head);if(e?o.to<t.state.doc.length:o.from>0)for(let l=r;;){let c=t.moveVertically(l,e);if(c.head<o.from||c.head>o.to){s.some(u=>u.head==c.head)||s.push(c);break}else{if(c.head==l.head)break;l=c}}}return s.length==n.ranges.length?!1:(t.dispatch(Ks(i,re.create(s,s.length-1))),!0)}const lF=t=>T$(t,!1),cF=t=>T$(t,!0),hF=({state:t,dispatch:e})=>{let i=t.selection,n=null;return i.ranges.length>1?n=re.create([i.main]):i.main.empty||(n=re.create([re.cursor(i.main.head)])),n?(e(Ks(t,n)),!0):!1};function vd(t,e){if(t.state.readOnly)return!1;let i="delete.selection",{state:n}=t,s=n.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let c=e(r);c<o?(i="delete.backward",c=pm(t,c,!1)):c>o&&(i="delete.forward",c=pm(t,c,!0)),o=Math.min(o,c),l=Math.max(l,c)}else o=pm(t,o,!1),l=pm(t,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:re.cursor(o,o<r.head?-1:1)}});return s.changes.empty?!1:(t.dispatch(n.update(s,{scrollIntoView:!0,userEvent:i,effects:i=="delete.selection"?ve.announce.of(n.phrase("Selection deleted")):void 0})),!0)}function pm(t,e,i){if(t instanceof ve)for(let n of t.state.facet(ve.atomicRanges).map(s=>s(t)))n.between(e,e,(s,r)=>{s<e&&r>e&&(e=i?r:s)});return e}const A$=(t,e,i)=>vd(t,n=>{let s=n.from,{state:r}=t,o=r.doc.lineAt(s),l,c;if(i&&!e&&s>o.from&&s<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,s-o.from))){if(l[l.length-1]==" ")return s-1;let u=Ys(l,r.tabSize),d=u%Qg(r)||Qg(r);for(let p=0;p<d&&l[l.length-1-p]==" ";p++)s--;c=s}else c=Di(o.text,s-o.from,e,e)+o.from,c==s&&o.number!=(e?r.doc.lines:1)?c+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(c-o.from,s-o.from))&&(c=Di(o.text,c-o.from,!1,!1)+o.from);return c}),Lb=t=>A$(t,!1,!0),E$=t=>A$(t,!0,!1),M$=(t,e)=>vd(t,i=>{let n=i.head,{state:s}=t,r=s.doc.lineAt(n),o=s.charCategorizer(n);for(let l=null;;){if(n==(e?r.to:r.from)){n==i.head&&r.number!=(e?s.doc.lines:1)&&(n+=e?1:-1);break}let c=Di(r.text,n-r.from,e)+r.from,u=r.text.slice(Math.min(n,c)-r.from,Math.max(n,c)-r.from),d=o(u);if(l!=null&&d!=l)break;(u!=" "||n!=i.head)&&(l=d),n=c}return n}),P$=t=>M$(t,!1),uF=t=>M$(t,!0),fF=t=>vd(t,e=>{let i=t.lineBlockAt(e.head).to;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),dF=t=>vd(t,e=>{let i=t.moveToLineBoundary(e,!1).head;return e.head>i?i:Math.max(0,e.head-1)}),pF=t=>vd(t,e=>{let i=t.moveToLineBoundary(e,!0).head;return e.head<i?i:Math.min(t.state.doc.length,e.head+1)}),mF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:at.of(["",""])},range:re.cursor(n.from)}));return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0},gF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{if(!n.empty||n.from==0||n.from==t.doc.length)return{range:n};let s=n.from,r=t.doc.lineAt(s),o=s==r.from?s-1:Di(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:Di(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:t.doc.slice(s,l).append(t.doc.slice(o,s))},range:re.cursor(l)}});return i.changes.empty?!1:(e(t.update(i,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function xO(t){let e=[],i=-1;for(let n of t.selection.ranges){let s=t.doc.lineAt(n.from),r=t.doc.lineAt(n.to);if(!n.empty&&n.to==r.from&&(r=t.doc.lineAt(n.to-1)),i>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(n)}else e.push({from:s.from,to:r.to,ranges:[n]});i=r.number+1}return e}function R$(t,e,i){if(t.readOnly)return!1;let n=[],s=[];for(let r of xO(t)){if(i?r.to==t.doc.length:r.from==0)continue;let o=t.doc.lineAt(i?r.to+1:r.from-1),l=o.length+1;if(i){n.push({from:r.to,to:o.to},{from:r.from,insert:o.text+t.lineBreak});for(let c of r.ranges)s.push(re.range(Math.min(t.doc.length,c.anchor+l),Math.min(t.doc.length,c.head+l)))}else{n.push({from:o.from,to:r.from},{from:r.to,insert:t.lineBreak+o.text});for(let c of r.ranges)s.push(re.range(c.anchor-l,c.head-l))}}return n.length?(e(t.update({changes:n,scrollIntoView:!0,selection:re.create(s,t.selection.mainIndex),userEvent:"move.line"})),!0):!1}const OF=({state:t,dispatch:e})=>R$(t,e,!1),vF=({state:t,dispatch:e})=>R$(t,e,!0);function Q$(t,e,i){if(t.readOnly)return!1;let n=[];for(let r of xO(t))i?n.push({from:r.from,insert:t.doc.slice(r.from,r.to)+t.lineBreak}):n.push({from:r.to,insert:t.lineBreak+t.doc.slice(r.from,r.to)});let s=t.changes(n);return e(t.update({changes:s,selection:t.selection.map(s,i?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const _F=({state:t,dispatch:e})=>Q$(t,e,!1),yF=({state:t,dispatch:e})=>Q$(t,e,!0),bF=t=>{if(t.state.readOnly)return!1;let{state:e}=t,i=e.changes(xO(e).map(({from:s,to:r})=>(s>0?s--:r<e.doc.length&&r++,{from:s,to:r}))),n=Sh(e.selection,s=>{let r;if(t.lineWrapping){let o=t.lineBlockAt(s.head),l=t.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+t.documentTop-l.bottom+t.defaultLineHeight/2)}return t.moveVertically(s,!0,r)}).map(i);return t.dispatch({changes:i,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function SF(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i=xt(t).resolveInner(e),n=i.childBefore(e),s=i.childAfter(e),r;return n&&s&&n.to<=e&&s.from>=e&&(r=n.type.prop(Ne.closedBy))&&r.indexOf(s.name)>-1&&t.doc.lineAt(n.to).from==t.doc.lineAt(s.from).from&&!/\S/.test(t.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}const tM=L$(!1),xF=L$(!0);function L$(t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),c=!t&&r==o&&SF(e,r);t&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let u=new vO(e,{simulateBreak:r,simulateDoubleBreak:!!c}),d=Jx(u,r);for(d==null&&(d=Ys(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;c?{from:r,to:o}=c:r>l.from&&r<l.from+100&&!/\S/.test(l.text.slice(0,r))&&(r=l.from);let p=["",Xf(e,d)];return c&&p.push(Xf(e,u.lineIndent(l.from,-1))),{changes:{from:r,to:o,insert:at.of(p)},range:re.cursor(r+1+p[1].length)}});return i(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}}function nw(t,e){let i=-1;return t.changeByRange(n=>{let s=[];for(let o=n.from;o<=n.to;){let l=t.doc.lineAt(o);l.number>i&&(n.empty||n.to>l.from)&&(e(l,s,n),i=l.number),o=l.to+1}let r=t.changes(s);return{changes:s,range:re.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}})}const wF=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=Object.create(null),n=new vO(t,{overrideIndentation:r=>{let o=i[r];return o??-1}}),s=nw(t,(r,o,l)=>{let c=Jx(n,r.from);if(c==null)return;/\S/.test(r.text)||(c=0);let u=/^\s*/.exec(r.text)[0],d=Xf(t,c);(u!=d||l.from<r.from+u.length)&&(i[r.from]=c,o.push({from:r.from,to:r.from+u.length,insert:d}))});return s.changes.empty||e(t.update(s,{userEvent:"indent"})),!0},D$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(nw(t,(i,n)=>{n.push({from:i.from,insert:t.facet(yh)})}),{userEvent:"input.indent"})),!0),B$=({state:t,dispatch:e})=>t.readOnly?!1:(e(t.update(nw(t,(i,n)=>{let s=/^\s*/.exec(i.text)[0];if(!s)return;let r=Ys(s,t.tabSize),o=0,l=Xf(t,Math.max(0,r-Qg(t)));for(;o<s.length&&o<l.length&&s.charCodeAt(o)==l.charCodeAt(o);)o++;n.push({from:i.from+o,to:i.from+s.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),CF=t=>(t.setTabFocusMode(),!0),kF=[{key:"Ctrl-b",run:u$,shift:y$,preventDefault:!0},{key:"Ctrl-f",run:f$,shift:b$},{key:"Ctrl-p",run:m$,shift:w$},{key:"Ctrl-n",run:g$,shift:C$},{key:"Ctrl-a",run:qH,shift:nF},{key:"Ctrl-e",run:WH,shift:sF},{key:"Ctrl-d",run:E$},{key:"Ctrl-h",run:Lb},{key:"Ctrl-k",run:fF},{key:"Ctrl-Alt-h",run:P$},{key:"Ctrl-o",run:mF},{key:"Ctrl-t",run:gF},{key:"Ctrl-v",run:Qb}],TF=[{key:"ArrowLeft",run:u$,shift:y$,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:BH,shift:HH,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:XH,shift:tF,preventDefault:!0},{key:"ArrowRight",run:f$,shift:b$,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:$H,shift:FH,preventDefault:!0},{mac:"Cmd-ArrowRight",run:ZH,shift:iF,preventDefault:!0},{key:"ArrowUp",run:m$,shift:w$,preventDefault:!0},{mac:"Cmd-ArrowUp",run:GE,shift:JE},{mac:"Ctrl-ArrowUp",run:YE,shift:HE},{key:"ArrowDown",run:g$,shift:C$,preventDefault:!0},{mac:"Cmd-ArrowDown",run:KE,shift:eM},{mac:"Ctrl-ArrowDown",run:Qb,shift:FE},{key:"PageUp",run:YE,shift:HE},{key:"PageDown",run:Qb,shift:FE},{key:"Home",run:VH,shift:eF,preventDefault:!0},{key:"Mod-Home",run:GE,shift:JE},{key:"End",run:IH,shift:JH,preventDefault:!0},{key:"Mod-End",run:KE,shift:eM},{key:"Enter",run:tM,shift:tM},{key:"Mod-a",run:rF},{key:"Backspace",run:Lb,shift:Lb,preventDefault:!0},{key:"Delete",run:E$,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:P$,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:uF,preventDefault:!0},{mac:"Mod-Backspace",run:dF,preventDefault:!0},{mac:"Mod-Delete",run:pF,preventDefault:!0}].concat(kF.map(t=>({mac:t.key,run:t.run,shift:t.shift}))),AF=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:NH,shift:GH},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:jH,shift:KH},{key:"Alt-ArrowUp",run:OF},{key:"Shift-Alt-ArrowUp",run:_F},{key:"Alt-ArrowDown",run:vF},{key:"Shift-Alt-ArrowDown",run:yF},{key:"Mod-Alt-ArrowUp",run:lF},{key:"Mod-Alt-ArrowDown",run:cF},{key:"Escape",run:hF},{key:"Mod-Enter",run:xF},{key:"Alt-l",mac:"Ctrl-l",run:oF},{key:"Mod-i",run:aF,preventDefault:!0},{key:"Mod-[",run:B$},{key:"Mod-]",run:D$},{key:"Mod-Alt-\\",run:wF},{key:"Shift-Mod-k",run:bF},{key:"Shift-Mod-\\",run:YH},{key:"Mod-/",run:OH},{key:"Alt-A",run:_H},{key:"Ctrl-m",mac:"Shift-Alt-m",run:CF}].concat(TF),EF={key:"Tab",run:D$,shift:B$},iM=typeof String.prototype.normalize=="function"?t=>t.normalize("NFKD"):t=>t;class hh{constructor(e,i,n=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,s),this.bufferStart=n,this.normalize=r?l=>r(iM(l)):iM,this.query=this.normalize(i)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ln(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let i=Ax(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=gr(e);let s=this.normalize(i);if(s.length)for(let r=0,o=n;;r++){let l=s.charCodeAt(r),c=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(c)return this.value=c,this;break}o==n&&r<i.length&&i.charCodeAt(r)==l&&o++}}}match(e,i,n){let s=null;for(let r=0;r<this.matches.length;r+=2){let o=this.matches[r],l=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?s={from:this.matches[r+1],to:n}:(this.matches[r]++,l=!0)),l||(this.matches.splice(r,2),r-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?s={from:i,to:n}:this.matches.push(1,i)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}typeof Symbol<"u"&&(hh.prototype[Symbol.iterator]=function(){return this});const $$={from:-1,to:-1,match:/.*/.exec("")},sw="gm"+(/x/.unicode==null?"":"u");class z${constructor(e,i,n,s=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=$$,/\\[sWDnr]|\n|\r|\[\^/.test(i))return new N$(e,i,n,s,r);this.re=new RegExp(i,sw+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.iter=e.iter();let o=e.lineAt(s);this.curLineStart=o.from,this.matchPos=$g(e,s),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let i=this.matchPos<=this.to&&this.re.exec(this.curLine);if(i){let n=this.curLineStart+i.index,s=n+i[0].length;if(this.matchPos=$g(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,i)))return this.value={from:n,to:s,match:i},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const V_=new WeakMap;class Gc{constructor(e,i){this.from=e,this.text=i}get to(){return this.from+this.text.length}static get(e,i,n){let s=V_.get(e);if(!s||s.from>=n||s.to<=i){let l=new Gc(i,e.sliceString(i,n));return V_.set(e,l),l}if(s.from==i&&s.to==n)return s;let{text:r,from:o}=s;return o>i&&(r=e.sliceString(i,o)+r,o=i),s.to<n&&(r+=e.sliceString(s.to,n)),V_.set(e,new Gc(o,r)),new Gc(i,r.slice(i-o,n-o))}}class N${constructor(e,i,n,s,r){this.text=e,this.to=r,this.done=!1,this.value=$$,this.matchPos=$g(e,s),this.re=new RegExp(i,sw+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.flat=Gc.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,i=this.re.exec(this.flat.text);if(i&&!i[0]&&i.index==e&&(this.re.lastIndex=e+1,i=this.re.exec(this.flat.text)),i){let n=this.flat.from+i.index,s=n+i[0].length;if((this.flat.to>=this.to||i.index+i[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,i)))return this.value={from:n,to:s,match:i},this.matchPos=$g(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Gc.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(z$.prototype[Symbol.iterator]=N$.prototype[Symbol.iterator]=function(){return this});function MF(t){try{return new RegExp(t,sw),!0}catch{return!1}}function $g(t,e){if(e>=t.length)return e;let i=t.lineAt(e),n;for(;e<i.to&&(n=i.text.charCodeAt(e-i.from))>=56320&&n<57344;)e++;return e}const PF=t=>{let{state:e}=t,i=String(e.doc.lineAt(t.state.selection.main.head).number),{close:n,result:s}=YU(t,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:i},focus:!0,submitLabel:e.phrase("go")});return s.then(r=>{let o=r&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.elements.line.value);if(!o){t.dispatch({effects:n});return}let l=e.doc.lineAt(e.selection.main.head),[,c,u,d,p]=o,g=d?+d.slice(1):0,O=u?+u:l.number;if(u&&p){let x=O/100;c&&(x=x*(c=="-"?-1:1)+l.number/e.doc.lines),O=Math.round(e.doc.lines*x)}else u&&c&&(O=O*(c=="-"?-1:1)+l.number);let _=e.doc.line(Math.max(1,Math.min(e.doc.lines,O))),b=re.cursor(_.from+Math.max(0,Math.min(g,_.length)));t.dispatch({effects:[n,ve.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},RF={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},QF=Se.define({combine(t){return Qr(t,RF,{highlightWordAroundCursor:(e,i)=>e||i,minSelectionLength:Math.min,maxMatches:Math.min})}});function LF(t){return[NF,zF]}const DF=Pe.mark({class:"cm-selectionMatch"}),BF=Pe.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function nM(t,e,i,n){return(i==0||t(e.sliceDoc(i-1,i))!=Dt.Word)&&(n==e.doc.length||t(e.sliceDoc(n,n+1))!=Dt.Word)}function $F(t,e,i,n){return t(e.sliceDoc(i,i+1))==Dt.Word&&t(e.sliceDoc(n-1,n))==Dt.Word}const zF=Jt.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){(t.selectionSet||t.docChanged||t.viewportChanged)&&(this.decorations=this.getDeco(t.view))}getDeco(t){let e=t.state.facet(QF),{state:i}=t,n=i.selection;if(n.ranges.length>1)return Pe.none;let s=n.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return Pe.none;let c=i.wordAt(s.head);if(!c)return Pe.none;o=i.charCategorizer(s.head),r=i.sliceDoc(c.from,c.to)}else{let c=s.to-s.from;if(c<e.minSelectionLength||c>200)return Pe.none;if(e.wholeWords){if(r=i.sliceDoc(s.from,s.to),o=i.charCategorizer(s.head),!(nM(o,i,s.from,s.to)&&$F(o,i,s.from,s.to)))return Pe.none}else if(r=i.sliceDoc(s.from,s.to),!r)return Pe.none}let l=[];for(let c of t.visibleRanges){let u=new hh(i.doc,r,c.from,c.to);for(;!u.next().done;){let{from:d,to:p}=u.value;if((!o||nM(o,i,d,p))&&(s.empty&&d<=s.from&&p>=s.to?l.push(BF.range(d,p)):(d>=s.to||p<=s.from)&&l.push(DF.range(d,p)),l.length>e.maxMatches))return Pe.none}}return Pe.set(l)}},{decorations:t=>t.decorations}),NF=ve.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),jF=({state:t,dispatch:e})=>{let{selection:i}=t,n=re.create(i.ranges.map(s=>t.wordAt(s.head)||re.cursor(s.head)),i.mainIndex);return n.eq(i)?!1:(e(t.update({selection:n})),!0)};function IF(t,e){let{main:i,ranges:n}=t.selection,s=t.wordAt(i.head),r=s&&s.from==i.from&&s.to==i.to;for(let o=!1,l=new hh(t.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new hh(t.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(c=>c.from==l.value.from))continue;if(r){let c=t.wordAt(l.value.from);if(!c||c.from!=l.value.from||c.to!=l.value.to)continue}return l.value}}const VF=({state:t,dispatch:e})=>{let{ranges:i}=t.selection;if(i.some(r=>r.from===r.to))return jF({state:t,dispatch:e});let n=t.sliceDoc(i[0].from,i[0].to);if(t.selection.ranges.some(r=>t.sliceDoc(r.from,r.to)!=n))return!1;let s=IF(t,n);return s?(e(t.update({selection:t.selection.addRange(re.range(s.from,s.to),!1),effects:ve.scrollIntoView(s.to)})),!0):!1},xh=Se.define({combine(t){return Qr(t,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new iG(e),scrollToMatch:e=>ve.scrollIntoView(e)})}});class j${constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||MF(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(i,n)=>n=="n"?`
69
+ `:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new YF(this):new qF(this)}getCursor(e,i=0,n){let s=e.doc?e:et.create({doc:e});return n==null&&(n=s.doc.length),this.regexp?Rc(this,s,i,n):Pc(this,s,i,n)}}class I${constructor(e){this.spec=e}}function XF(t,e,i){return(n,s,r,o)=>{if(i&&!i(n,s,r,o))return!1;let l=n>=o&&s<=o+r.length?r.slice(n-o,s-o):e.doc.sliceString(n,s);return t(l,e,n,s)}}function Pc(t,e,i,n){let s;return t.wholeWord&&(s=ZF(e.doc,e.charCategorizer(e.selection.main.head))),t.test&&(s=XF(t.test,e,s)),new hh(e.doc,t.unquoted,i,n,t.caseSensitive?void 0:r=>r.toLowerCase(),s)}function ZF(t,e){return(i,n,s,r)=>((r>i||r+s.length<n)&&(r=Math.max(0,i-2),s=t.sliceString(r,Math.min(t.length,n+2))),(e(zg(s,i-r))!=Dt.Word||e(Ng(s,i-r))!=Dt.Word)&&(e(Ng(s,n-r))!=Dt.Word||e(zg(s,n-r))!=Dt.Word))}class qF extends I${constructor(e){super(e)}nextMatch(e,i,n){let s=Pc(this.spec,e,n,e.doc.length).nextOverlapping();if(s.done){let r=Math.min(e.doc.length,i+this.spec.unquoted.length);s=Pc(this.spec,e,0,r).nextOverlapping()}return s.done||s.value.from==i&&s.value.to==n?null:s.value}prevMatchInRange(e,i,n){for(let s=n;;){let r=Math.max(i,s-1e4-this.spec.unquoted.length),o=Pc(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==i)return null;s-=1e4}}prevMatch(e,i,n){let s=this.prevMatchInRange(e,0,i);return s||(s=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=i||s.to!=n)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,i){let n=Pc(this.spec,e,0,e.doc.length),s=[];for(;!n.next().done;){if(s.length>=i)return null;s.push(n.value)}return s}highlight(e,i,n,s){let r=Pc(this.spec,e,Math.max(0,i-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function WF(t,e,i){return(n,s,r)=>(!i||i(n,s,r))&&t(r[0],e,n,s)}function Rc(t,e,i,n){let s;return t.wholeWord&&(s=UF(e.charCategorizer(e.selection.main.head))),t.test&&(s=WF(t.test,e,s)),new z$(e.doc,t.search,{ignoreCase:!t.caseSensitive,test:s},i,n)}function zg(t,e){return t.slice(Di(t,e,!1),e)}function Ng(t,e){return t.slice(e,Di(t,e))}function UF(t){return(e,i,n)=>!n[0].length||(t(zg(n.input,n.index))!=Dt.Word||t(Ng(n.input,n.index))!=Dt.Word)&&(t(Ng(n.input,n.index+n[0].length))!=Dt.Word||t(zg(n.input,n.index+n[0].length))!=Dt.Word)}class YF extends I${nextMatch(e,i,n){let s=Rc(this.spec,e,n,e.doc.length).next();return s.done&&(s=Rc(this.spec,e,0,i).next()),s.done?null:s.value}prevMatchInRange(e,i,n){for(let s=1;;s++){let r=Math.max(i,n-s*1e4),o=Rc(this.spec,e,r,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==i||l.from>r+10))return l;if(r==i)return null}}prevMatch(e,i,n){return this.prevMatchInRange(e,0,i)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(i,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let s=n.length;s>0;s--){let r=+n.slice(0,s);if(r>0&&r<e.match.length)return e.match[r]+n.slice(s)}return i})}matchAll(e,i){let n=Rc(this.spec,e,0,e.doc.length),s=[];for(;!n.next().done;){if(s.length>=i)return null;s.push(n.value)}return s}highlight(e,i,n,s){let r=Rc(this.spec,e,Math.max(0,i-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Zf=ze.define(),rw=ze.define(),_a=Bi.define({create(t){return new X_(Db(t).create(),null)},update(t,e){for(let i of e.effects)i.is(Zf)?t=new X_(i.value.create(),t.panel):i.is(rw)&&(t=new X_(t.query,i.value?ow:null));return t},provide:t=>zf.from(t,e=>e.panel)});class X_{constructor(e,i){this.query=e,this.panel=i}}const HF=Pe.mark({class:"cm-searchMatch"}),FF=Pe.mark({class:"cm-searchMatch cm-searchMatch-selected"}),GF=Jt.fromClass(class{constructor(t){this.view=t,this.decorations=this.highlight(t.state.field(_a))}update(t){let e=t.state.field(_a);(e!=t.startState.field(_a)||t.docChanged||t.selectionSet||t.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:t,panel:e}){if(!e||!t.spec.valid)return Pe.none;let{view:i}=this,n=new _o;for(let s=0,r=i.visibleRanges,o=r.length;s<o;s++){let{from:l,to:c}=r[s];for(;s<o-1&&c>r[s+1].from-500;)c=r[++s].to;t.highlight(i.state,l,c,(u,d)=>{let p=i.state.selection.ranges.some(g=>g.from==u&&g.to==d);n.add(u,d,p?FF:HF)})}return n.finish()}},{decorations:t=>t.decorations});function _d(t){return e=>{let i=e.state.field(_a,!1);return i&&i.query.spec.valid?t(e,i):Z$(e)}}const jg=_d((t,{query:e})=>{let{to:i}=t.state.selection.main,n=e.nextMatch(t.state,i,i);if(!n)return!1;let s=re.single(n.from,n.to),r=t.state.facet(xh);return t.dispatch({selection:s,effects:[aw(t,n),r.scrollToMatch(s.main,t)],userEvent:"select.search"}),X$(t),!0}),Ig=_d((t,{query:e})=>{let{state:i}=t,{from:n}=i.selection.main,s=e.prevMatch(i,n,n);if(!s)return!1;let r=re.single(s.from,s.to),o=t.state.facet(xh);return t.dispatch({selection:r,effects:[aw(t,s),o.scrollToMatch(r.main,t)],userEvent:"select.search"}),X$(t),!0}),KF=_d((t,{query:e})=>{let i=e.matchAll(t.state,1e3);return!i||!i.length?!1:(t.dispatch({selection:re.create(i.map(n=>re.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),JF=({state:t,dispatch:e})=>{let i=t.selection;if(i.ranges.length>1||i.main.empty)return!1;let{from:n,to:s}=i.main,r=[],o=0;for(let l=new hh(t.doc,t.sliceDoc(n,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==n&&(o=r.length),r.push(re.range(l.value.from,l.value.to))}return e(t.update({selection:re.create(r,o),userEvent:"select.search.matches"})),!0},sM=_d((t,{query:e})=>{let{state:i}=t,{from:n,to:s}=i.selection.main;if(i.readOnly)return!1;let r=e.nextMatch(i,n,n);if(!r)return!1;let o=r,l=[],c,u,d=[];o.from==n&&o.to==s&&(u=i.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:u}),o=e.nextMatch(i,o.from,o.to),d.push(ve.announce.of(i.phrase("replaced match on line $",i.doc.lineAt(n).number)+".")));let p=t.state.changes(l);return o&&(c=re.single(o.from,o.to).map(p),d.push(aw(t,o)),d.push(i.facet(xh).scrollToMatch(c.main,t))),t.dispatch({changes:p,selection:c,effects:d,userEvent:"input.replace"}),!0}),eG=_d((t,{query:e})=>{if(t.state.readOnly)return!1;let i=e.matchAll(t.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!i.length)return!1;let n=t.state.phrase("replaced $ matches",i.length)+".";return t.dispatch({changes:i,effects:ve.announce.of(n),userEvent:"input.replace.all"}),!0});function ow(t){return t.state.facet(xh).createPanel(t)}function Db(t,e){var i,n,s,r,o;let l=t.selection.main,c=l.empty||l.to>l.from+100?"":t.sliceDoc(l.from,l.to);if(e&&!c)return e;let u=t.facet(xh);return new j$({search:((i=e==null?void 0:e.literal)!==null&&i!==void 0?i:u.literal)?c:c.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:u.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:u.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:u.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:u.wholeWord})}function V$(t){let e=Wx(t,ow);return e&&e.dom.querySelector("[main-field]")}function X$(t){let e=V$(t);e&&e==t.root.activeElement&&e.select()}const Z$=t=>{let e=t.state.field(_a,!1);if(e&&e.panel){let i=V$(t);if(i&&i!=t.root.activeElement){let n=Db(t.state,e.query.spec);n.valid&&t.dispatch({effects:Zf.of(n)}),i.focus(),i.select()}}else t.dispatch({effects:[rw.of(!0),e?Zf.of(Db(t.state,e.query.spec)):ze.appendConfig.of(sG)]});return!0},q$=t=>{let e=t.state.field(_a,!1);if(!e||!e.panel)return!1;let i=Wx(t,ow);return i&&i.dom.contains(t.root.activeElement)&&t.focus(),t.dispatch({effects:rw.of(!1)}),!0},tG=[{key:"Mod-f",run:Z$,scope:"editor search-panel"},{key:"F3",run:jg,shift:Ig,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:jg,shift:Ig,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:q$,scope:"editor search-panel"},{key:"Mod-Shift-l",run:JF},{key:"Mod-Alt-g",run:PF},{key:"Mod-d",run:VF,preventDefault:!0}];class iG{constructor(e){this.view=e;let i=this.query=e.state.field(_a).query.spec;this.commit=this.commit.bind(this),this.searchField=vt("input",{value:i.search,placeholder:Hn(e,"Find"),"aria-label":Hn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=vt("input",{value:i.replace,placeholder:Hn(e,"Replace"),"aria-label":Hn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=vt("input",{type:"checkbox",name:"case",form:"",checked:i.caseSensitive,onchange:this.commit}),this.reField=vt("input",{type:"checkbox",name:"re",form:"",checked:i.regexp,onchange:this.commit}),this.wordField=vt("input",{type:"checkbox",name:"word",form:"",checked:i.wholeWord,onchange:this.commit});function n(s,r,o){return vt("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=vt("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>jg(e),[Hn(e,"next")]),n("prev",()=>Ig(e),[Hn(e,"previous")]),n("select",()=>KF(e),[Hn(e,"all")]),vt("label",null,[this.caseField,Hn(e,"match case")]),vt("label",null,[this.reField,Hn(e,"regexp")]),vt("label",null,[this.wordField,Hn(e,"by word")]),...e.state.readOnly?[]:[vt("br"),this.replaceField,n("replace",()=>sM(e),[Hn(e,"replace")]),n("replaceAll",()=>eG(e),[Hn(e,"replace all")])],vt("button",{name:"close",onclick:()=>q$(e),"aria-label":Hn(e,"close"),type:"button"},["×"])])}commit(){let e=new j$({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Zf.of(e)}))}keydown(e){sU(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ig:jg)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),sM(this.view))}update(e){for(let i of e.transactions)for(let n of i.effects)n.is(Zf)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(xh).top}}function Hn(t,e){return t.state.phrase(e)}const mm=30,gm=/[\s\.,:;?!]/;function aw(t,{from:e,to:i}){let n=t.state.doc.lineAt(e),s=t.state.doc.lineAt(i).to,r=Math.max(n.from,e-mm),o=Math.min(s,i+mm),l=t.state.sliceDoc(r,o);if(r!=n.from){for(let c=0;c<mm;c++)if(!gm.test(l[c+1])&&gm.test(l[c])){l=l.slice(c);break}}if(o!=s){for(let c=l.length-1;c>l.length-mm;c--)if(!gm.test(l[c-1])&&gm.test(l[c])){l=l.slice(0,c);break}}return ve.announce.of(`${t.state.phrase("current match")}. ${l} ${t.state.phrase("on line")} ${n.number}.`)}const nG=ve.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),sG=[_a,So.low(GF),nG];class lw{constructor(e,i,n,s){this.state=e,this.pos=i,this.explicit=n,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let i=xt(this.state).resolveInner(this.pos,-1);for(;i&&e.indexOf(i.name)<0;)i=i.parent;return i?{from:i.from,to:this.pos,text:this.state.sliceDoc(i.from,this.pos),type:i.type}:null}matchBefore(e){let i=this.state.doc.lineAt(this.pos),n=Math.max(i.from,this.pos-250),s=i.text.slice(n-i.from,this.pos-i.from),r=s.search(U$(e,!1));return r<0?null:{from:n+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,i,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(i),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function rM(t){let e=Object.keys(t).join(""),i=/\w/.test(e);return i&&(e=e.replace(/\w/g,"")),`[${i?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function rG(t){let e=Object.create(null),i=Object.create(null);for(let{label:s}of t){e[s[0]]=!0;for(let r=1;r<s.length;r++)i[s[r]]=!0}let n=rM(e)+rM(i)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function W$(t){let e=t.map(s=>typeof s=="string"?{label:s}:s),[i,n]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:rG(e);return s=>{let r=s.matchBefore(n);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:i}:null}}function oG(t,e){return i=>{for(let n=xt(i.state).resolveInner(i.pos,-1);n;n=n.parent){if(t.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(i)}}class oM{constructor(e,i,n,s){this.completion=e,this.source=i,this.match=n,this.score=s}}function Sl(t){return t.selection.main.from}function U$(t,e){var i;let{source:n}=t,s=e&&n[0]!="^",r=n[n.length-1]!="$";return!s&&!r?t:new RegExp(`${s?"^":""}(?:${n})${r?"$":""}`,(i=t.flags)!==null&&i!==void 0?i:t.ignoreCase?"i":"")}const cw=Rr.define();function aG(t,e,i,n){let{main:s}=t.selection,r=i-s.from,o=n-s.from;return{...t.changeByRange(l=>{if(l!=s&&i!=n&&t.sliceDoc(l.from+r,l.from+o)!=t.sliceDoc(i,n))return{range:l};let c=t.toText(e);return{changes:{from:l.from+r,to:n==s.from?l.to:l.from+o,insert:c},range:re.cursor(l.from+r+c.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const aM=new WeakMap;function lG(t){if(!Array.isArray(t))return t;let e=aM.get(t);return e||aM.set(t,e=W$(t)),e}const Vg=ze.define(),qf=ze.define();class cG{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let i=0;i<e.length;){let n=Ln(e,i),s=gr(n);this.chars.push(n);let r=e.slice(i,i+s),o=r.toUpperCase();this.folded.push(Ln(o==r?r.toLowerCase():o,0)),i+=s}this.astral=e.length!=this.chars.length}ret(e,i){return this.score=e,this.matched=i,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:i,folded:n,any:s,precise:r,byWord:o}=this;if(i.length==1){let k=Ln(e,0),T=gr(k),A=T==e.length?0:-100;if(k!=i[0])if(k==n[0])A+=-200;else return null;return this.ret(A,[0,T])}let l=e.indexOf(this.pattern);if(l==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let c=i.length,u=0;if(l<0){for(let k=0,T=Math.min(e.length,200);k<T&&u<c;){let A=Ln(e,k);(A==i[u]||A==n[u])&&(s[u++]=k),k+=gr(A)}if(u<c)return null}let d=0,p=0,g=!1,O=0,_=-1,b=-1,x=/[a-z]/.test(e),w=!0;for(let k=0,T=Math.min(e.length,200),A=0;k<T&&p<c;){let L=Ln(e,k);l<0&&(d<c&&L==i[d]&&(r[d++]=k),O<c&&(L==i[O]||L==n[O]?(O==0&&(_=k),b=k+1,O++):O=0));let E,z=L<255?L>=48&&L<=57||L>=97&&L<=122?2:L>=65&&L<=90?1:0:(E=Ax(L))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!k||z==1&&x||A==0&&z!=0)&&(i[p]==L||n[p]==L&&(g=!0)?o[p++]=k:o.length&&(w=!1)),A=z,k+=gr(L)}return p==c&&o[0]==0&&w?this.result(-100+(g?-200:0),o,e):O==c&&_==0?this.ret(-200-e.length+(b==e.length?0:-100),[0,b]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):O==c?this.ret(-900-e.length,[_,b]):p==c?this.result(-100+(g?-200:0)+-700+(w?0:-1100),o,e):i.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,i,n){let s=[],r=0;for(let o of i){let l=o+(this.astral?gr(Ln(n,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-n.length,s)}}class hG{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let i=e.slice(0,this.pattern.length),n=i==this.pattern?0:i.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,i.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}}const Li=Se.define({combine(t){return Qr(t,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:uG,filterStrict:!1,compareCompletions:(e,i)=>(e.sortText||e.label).localeCompare(i.sortText||i.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,i)=>e&&i,closeOnBlur:(e,i)=>e&&i,icons:(e,i)=>e&&i,tooltipClass:(e,i)=>n=>lM(e(n),i(n)),optionClass:(e,i)=>n=>lM(e(n),i(n)),addToOptions:(e,i)=>e.concat(i),filterStrict:(e,i)=>e||i})}});function lM(t,e){return t?e?t+" "+e:t:e}function uG(t,e,i,n,s,r){let o=t.textDirection==St.RTL,l=o,c=!1,u="top",d,p,g=e.left-s.left,O=s.right-e.right,_=n.right-n.left,b=n.bottom-n.top;if(l&&g<Math.min(_,O)?l=!1:!l&&O<Math.min(_,g)&&(l=!0),_<=(l?g:O))d=Math.max(s.top,Math.min(i.top,s.bottom-b))-e.top,p=Math.min(400,l?g:O);else{c=!0,p=Math.min(400,(o?e.right:s.right-e.left)-30);let k=s.bottom-e.bottom;k>=b||k>e.top?d=i.bottom-e.top:(u="bottom",d=e.bottom-i.top)}let x=(e.bottom-e.top)/r.offsetHeight,w=(e.right-e.left)/r.offsetWidth;return{style:`${u}: ${d/x}px; max-width: ${p/w}px`,class:"cm-completionInfo-"+(c?o?"left-narrow":"right-narrow":l?"left":"right")}}function fG(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(i){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),i.type&&n.classList.add(...i.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(i,n,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=i.displayLabel||i.label,c=0;for(let u=0;u<r.length;){let d=r[u++],p=r[u++];d>c&&o.appendChild(document.createTextNode(l.slice(c,d)));let g=o.appendChild(document.createElement("span"));g.appendChild(document.createTextNode(l.slice(d,p))),g.className="cm-completionMatchedText",c=p}return c<l.length&&o.appendChild(document.createTextNode(l.slice(c))),o},position:50},{render(i){if(!i.detail)return null;let n=document.createElement("span");return n.className="cm-completionDetail",n.textContent=i.detail,n},position:80}),e.sort((i,n)=>i.position-n.position).map(i=>i.render)}function Z_(t,e,i){if(t<=i)return{from:0,to:t};if(e<0&&(e=0),e<=t>>1){let s=Math.floor(e/i);return{from:s*i,to:(s+1)*i}}let n=Math.floor((t-e)/i);return{from:t-(n+1)*i,to:t-n*i}}class dG{constructor(e,i,n){this.view=e,this.stateField=i,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:c=>this.placeInfo(c),key:this},this.space=null,this.currentClass="";let s=e.state.field(i),{options:r,selected:o}=s.open,l=e.state.facet(Li);this.optionContent=fG(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Z_(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",c=>{let{options:u}=e.state.field(i).open;for(let d=c.target,p;d&&d!=this.dom;d=d.parentNode)if(d.nodeName=="LI"&&(p=/-(\d+)$/.exec(d.id))&&+p[1]<u.length){this.applyCompletion(e,u[+p[1]]),c.preventDefault();return}}),this.dom.addEventListener("focusout",c=>{let u=e.state.field(this.stateField,!1);u&&u.tooltip&&e.state.facet(Li).closeOnBlur&&c.relatedTarget!=e.contentDOM&&e.dispatch({effects:qf.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,i){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,i,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var i;let n=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=s){let{options:r,selected:o,disabled:l}=n.open;(!s.open||s.open.options!=r)&&(this.range=Z_(r.length,o,e.state.facet(Li).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=((i=s.open)===null||i===void 0?void 0:i.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let i=this.tooltipClass(e);if(i!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of i.split(" "))n&&this.dom.classList.add(n);this.currentClass=i}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),i=e.open;(i.selected>-1&&i.selected<this.range.from||i.selected>=this.range.to)&&(this.range=Z_(i.options.length,i.selected,this.view.state.facet(Li).maxRenderedOptions),this.showOptions(i.options,e.id));let n=this.updateSelectedOption(i.selected);if(n){this.destroyInfo();let{completion:s}=i.options[i.selected],{info:r}=s;if(!r)return;let o=typeof r=="string"?document.createTextNode(r):r(s);if(!o)return;"then"in o?o.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,s)}).catch(l=>$n(this.view.state,l,"completion info")):(this.addInfoPane(o,s),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,i){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;n.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let i=null;for(let n=this.list.firstChild,s=this.range.from;n;n=n.nextSibling,s++)n.nodeName!="LI"||!n.id?s--:s==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),i=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return i&&mG(this.list,i),i}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let i=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(r.bottom,i.bottom)-10||s.bottom<Math.max(r.top,i.top)+10?null:this.view.state.facet(Li).positionInfo(this.view,i,s,n,r,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,i,n){const s=document.createElement("ul");s.id=i,s.setAttribute("role","listbox"),s.setAttribute("aria-expanded","true"),s.setAttribute("aria-label",this.view.state.phrase("Completions")),s.addEventListener("mousedown",o=>{o.target==s&&o.preventDefault()});let r=null;for(let o=n.from;o<n.to;o++){let{completion:l,match:c}=e[o],{section:u}=l;if(u){let g=typeof u=="string"?u:u.name;if(g!=r&&(o>n.from||n.from==0))if(r=g,typeof u!="string"&&u.header)s.appendChild(u.header(u));else{let O=s.appendChild(document.createElement("completion-section"));O.textContent=g}}const d=s.appendChild(document.createElement("li"));d.id=i+"-"+o,d.setAttribute("role","option");let p=this.optionClass(l);p&&(d.className=p);for(let g of this.optionContent){let O=g(l,this.view.state,this.view,c);O&&d.appendChild(O)}}return n.from&&s.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&s.classList.add("cm-completionListIncompleteBottom"),s}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function pG(t,e){return i=>new dG(i,t,e)}function mG(t,e){let i=t.getBoundingClientRect(),n=e.getBoundingClientRect(),s=i.height/t.offsetHeight;n.top<i.top?t.scrollTop-=(i.top-n.top)/s:n.bottom>i.bottom&&(t.scrollTop+=(n.bottom-i.bottom)/s)}function cM(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function gG(t,e){let i=[],n=null,s=null,r=d=>{i.push(d);let{section:p}=d.completion;if(p){n||(n=[]);let g=typeof p=="string"?p:p.name;n.some(O=>O.name==g)||n.push(typeof p=="string"?{name:g}:p)}},o=e.facet(Li);for(let d of t)if(d.hasResult()){let p=d.result.getMatch;if(d.result.filter===!1)for(let g of d.result.options)r(new oM(g,d.source,p?p(g):[],1e9-i.length));else{let g=e.sliceDoc(d.from,d.to),O,_=o.filterStrict?new hG(g):new cG(g);for(let b of d.result.options)if(O=_.match(b.label)){let x=b.displayLabel?p?p(b,O.matched):[]:O.matched,w=O.score+(b.boost||0);if(r(new oM(b,d.source,x,w)),typeof b.section=="object"&&b.section.rank==="dynamic"){let{name:k}=b.section;s||(s=Object.create(null)),s[k]=Math.max(w,s[k]||-1e9)}}}}if(n){let d=Object.create(null),p=0,g=(O,_)=>(O.rank==="dynamic"&&_.rank==="dynamic"?s[_.name]-s[O.name]:0)||(typeof O.rank=="number"?O.rank:1e9)-(typeof _.rank=="number"?_.rank:1e9)||(O.name<_.name?-1:1);for(let O of n.sort(g))p-=1e5,d[O.name]=p;for(let O of i){let{section:_}=O.completion;_&&(O.score+=d[typeof _=="string"?_:_.name])}}let l=[],c=null,u=o.compareCompletions;for(let d of i.sort((p,g)=>g.score-p.score||u(p.completion,g.completion))){let p=d.completion;!c||c.label!=p.label||c.detail!=p.detail||c.type!=null&&p.type!=null&&c.type!=p.type||c.apply!=p.apply||c.boost!=p.boost?l.push(d):cM(d.completion)>cM(c)&&(l[l.length-1]=d),c=d.completion}return l}class Ic{constructor(e,i,n,s,r,o){this.options=e,this.attrs=i,this.tooltip=n,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,i){return e==this.selected||e>=this.options.length?this:new Ic(this.options,hM(i,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,i,n,s,r,o){if(s&&!o&&e.some(u=>u.isPending))return s.setDisabled();let l=gG(e,i);if(!l.length)return s&&e.some(u=>u.isPending)?s.setDisabled():null;let c=i.facet(Li).selectOnOpen?0:-1;if(s&&s.selected!=c&&s.selected!=-1){let u=s.options[s.selected].completion;for(let d=0;d<l.length;d++)if(l[d].completion==u){c=d;break}}return new Ic(l,hM(n,c),{pos:e.reduce((u,d)=>d.hasResult()?Math.min(u,d.from):u,1e8),create:SG,above:r.aboveCursor},s?s.timestamp:Date.now(),c,!1)}map(e){return new Ic(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ic(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class Xg{constructor(e,i,n){this.active=e,this.id=i,this.open=n}static start(){return new Xg(yG,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:i}=e,n=i.facet(Li),r=(n.override||i.languageDataAt("autocomplete",Sl(i)).map(lG)).map(c=>(this.active.find(d=>d.source==c)||new Ms(c,this.active.some(d=>d.state!=0)?1:0)).update(e,n));r.length==this.active.length&&r.every((c,u)=>c==this.active[u])&&(r=this.active);let o=this.open,l=e.effects.some(c=>c.is(hw));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(c=>c.hasResult()&&e.changes.touchesRange(c.from,c.to))||!OG(r,this.active)||l?o=Ic.build(r,i,this.id,o,n,l):o&&o.disabled&&!r.some(c=>c.isPending)&&(o=null),!o&&r.every(c=>!c.isPending)&&r.some(c=>c.hasResult())&&(r=r.map(c=>c.hasResult()?new Ms(c.source,0):c));for(let c of e.effects)c.is(H$)&&(o=o&&o.setSelected(c.value,this.id));return r==this.active&&o==this.open?this:new Xg(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?vG:_G}}function OG(t,e){if(t==e)return!0;for(let i=0,n=0;;){for(;i<t.length&&!t[i].hasResult();)i++;for(;n<e.length&&!e[n].hasResult();)n++;let s=i==t.length,r=n==e.length;if(s||r)return s==r;if(t[i++].result!=e[n++].result)return!1}}const vG={"aria-autocomplete":"list"},_G={};function hM(t,e){let i={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":t};return e>-1&&(i["aria-activedescendant"]=t+"-"+e),i}const yG=[];function Y$(t,e){if(t.isUserEvent("input.complete")){let n=t.annotation(cw);if(n&&e.activateOnCompletion(n))return 12}let i=t.isUserEvent("input.type");return i&&e.activateOnTyping?5:i?1:t.isUserEvent("delete.backward")?2:t.selection?8:t.docChanged?16:0}class Ms{constructor(e,i,n=!1){this.source=e,this.state=i,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,i){let n=Y$(e,i),s=this;(n&8||n&16&&this.touches(e))&&(s=new Ms(s.source,0)),n&4&&s.state==0&&(s=new Ms(this.source,1)),s=s.updateFor(e,n);for(let r of e.effects)if(r.is(Vg))s=new Ms(s.source,1,r.value);else if(r.is(qf))s=new Ms(s.source,0);else if(r.is(hw))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,i){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Sl(e.state))}}class Kc extends Ms{constructor(e,i,n,s,r,o){super(e,3,i),this.limit=n,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,i){var n;if(!(i&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=Sl(e.state);if(l>o||!s||i&2&&(Sl(e.startState)==this.from||l<this.limit))return new Ms(this.source,i&4?1:0);let c=e.changes.mapPos(this.limit);return bG(s.validFor,e.state,r,o)?new Kc(this.source,this.explicit,c,s,r,o):s.update&&(s=s.update(s,r,o,new lw(e.state,l,!1)))?new Kc(this.source,this.explicit,c,s,s.from,(n=s.to)!==null&&n!==void 0?n:Sl(e.state)):new Ms(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Kc(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new Ms(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function bG(t,e,i,n){if(!t)return!1;let s=e.sliceDoc(i,n);return typeof t=="function"?t(s,i,n,e):U$(t,!0).test(s)}const hw=ze.define({map(t,e){return t.map(i=>i.map(e))}}),H$=ze.define(),Dn=Bi.define({create(){return Xg.start()},update(t,e){return t.update(e)},provide:t=>[qx.from(t,e=>e.tooltip),ve.contentAttributes.from(t,e=>e.attrs)]});function uw(t,e){const i=e.completion.apply||e.completion.label;let n=t.state.field(Dn).active.find(s=>s.source==e.source);return n instanceof Kc?(typeof i=="string"?t.dispatch({...aG(t.state,i,n.from,n.to),annotations:cw.of(e.completion)}):i(t,e.completion,n.from,n.to),!0):!1}const SG=pG(Dn,uw);function Om(t,e="option"){return i=>{let n=i.state.field(Dn,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<i.state.facet(Li).interactionDelay)return!1;let s=1,r;e=="page"&&(r=kB(i,n.open.tooltip))&&(s=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=n.open.options,l=n.open.selected>-1?n.open.selected+s*(t?1:-1):t?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),i.dispatch({effects:H$.of(l)}),!0}}const xG=t=>{let e=t.state.field(Dn,!1);return t.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<t.state.facet(Li).interactionDelay?!1:uw(t,e.open.options[e.open.selected])},q_=t=>t.state.field(Dn,!1)?(t.dispatch({effects:Vg.of(!0)}),!0):!1,wG=t=>{let e=t.state.field(Dn,!1);return!e||!e.active.some(i=>i.state!=0)?!1:(t.dispatch({effects:qf.of(null)}),!0)};class CG{constructor(e,i){this.active=e,this.context=i,this.time=Date.now(),this.updates=[],this.done=void 0}}const kG=50,TG=1e3,AG=Jt.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of t.state.field(Dn).active)e.isPending&&this.startQuery(e)}update(t){let e=t.state.field(Dn),i=t.state.facet(Li);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Dn)==e)return;let n=t.transactions.some(r=>{let o=Y$(r,i);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;r<this.running.length;r++){let o=this.running[r];if(n||o.context.abortOnDocChange&&t.docChanged||o.updates.length+t.transactions.length>kG&&Date.now()-o.time>TG){for(let l of o.context.abortListeners)try{l()}catch(c){$n(this.view.state,c)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...t.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),t.transactions.some(r=>r.effects.some(o=>o.is(Vg)))&&(this.pendingStart=!0);let s=this.pendingStart?50:i.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of t.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:t}=this.view,e=t.field(Dn);for(let i of e.active)i.isPending&&!this.running.some(n=>n.active.source==i.source)&&this.startQuery(i);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Li).updateSyncTime))}startQuery(t){let{state:e}=this.view,i=Sl(e),n=new lw(e,i,t.explicit,this.view),s=new CG(t,n);this.running.push(s),Promise.resolve(t.source(n)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:qf.of(null)}),$n(this.view.state,r)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Li).updateSyncTime))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],i=this.view.state.facet(Li),n=this.view.state.field(Dn);for(let s=0;s<this.running.length;s++){let r=this.running[s];if(r.done===void 0)continue;if(this.running.splice(s--,1),r.done){let l=Sl(r.updates.length?r.updates[0].startState:this.view.state),c=Math.min(l,r.done.from+(r.active.explicit?0:1)),u=new Kc(r.active.source,r.active.explicit,c,r.done,r.done.from,(t=r.done.to)!==null&&t!==void 0?t:l);for(let d of r.updates)u=u.update(d,i);if(u.hasResult()){e.push(u);continue}}let o=n.active.find(l=>l.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Ms(r.active.source,0);for(let c of r.updates)l=l.update(c,i);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:hw.of(e)})}},{eventHandlers:{blur(t){let e=this.view.state.field(Dn,!1);if(e&&e.tooltip&&this.view.state.facet(Li).closeOnBlur){let i=e.open&&kB(this.view,e.open.tooltip);(!i||!i.dom.contains(t.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qf.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Vg.of(!1)}),20),this.composing=0}}}),EG=typeof navigator=="object"&&/Win/.test(navigator.platform),MG=So.highest(ve.domEventHandlers({keydown(t,e){let i=e.state.field(Dn,!1);if(!i||!i.open||i.open.disabled||i.open.selected<0||t.key.length>1||t.ctrlKey&&!(EG&&t.altKey)||t.metaKey)return!1;let n=i.open.options[i.open.selected],s=i.active.find(o=>o.source==n.source),r=n.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(t.key)>-1&&uw(e,n),!1}})),F$=ve.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 PG{constructor(e,i,n,s){this.field=e,this.line=i,this.from=n,this.to=s}}class fw{constructor(e,i,n){this.field=e,this.from=i,this.to=n}map(e){let i=e.mapPos(this.from,-1,Fi.TrackDel),n=e.mapPos(this.to,1,Fi.TrackDel);return i==null||n==null?null:new fw(this.field,i,n)}}class dw{constructor(e,i){this.lines=e,this.fieldPositions=i}instantiate(e,i){let n=[],s=[i],r=e.doc.lineAt(i),o=/^\s*/.exec(r.text)[0];for(let c of this.lines){if(n.length){let u=o,d=/^\t*/.exec(c)[0].length;for(let p=0;p<d;p++)u+=e.facet(yh);s.push(i+u.length-d),c=u+c.slice(d)}n.push(c),i+=c.length+1}let l=this.fieldPositions.map(c=>new fw(c.field,s[c.line]+c.from,s[c.line]+c.to));return{text:n,ranges:l}}static parse(e){let i=[],n=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,c=r[2]||r[3]||"",u=-1,d=c.replace(/\\[{}]/g,p=>p[1]);for(let p=0;p<i.length;p++)(l!=null?i[p].seq==l:d&&i[p].name==d)&&(u=p);if(u<0){let p=0;for(;p<i.length&&(l==null||i[p].seq!=null&&i[p].seq<l);)p++;i.splice(p,0,{seq:l,name:d}),u=p;for(let g of s)g.field>=u&&g.field++}for(let p of s)if(p.line==n.length&&p.from>r.index){let g=r[2]?3+(r[1]||"").length:2;p.from-=g,p.to-=g}s.push(new PG(u,n.length,r.index,r.index+d.length)),o=o.slice(0,r.index)+c+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,c,u)=>{for(let d of s)d.line==n.length&&d.from>u&&(d.from--,d.to--);return c}),n.push(o)}return new dw(n,s)}}let RG=Pe.widget({widget:new class extends Gs{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),QG=Pe.mark({class:"cm-snippetField"});class wh{constructor(e,i){this.ranges=e,this.active=i,this.deco=Pe.set(e.map(n=>(n.from==n.to?RG:QG).range(n.from,n.to)),!0)}map(e){let i=[];for(let n of this.ranges){let s=n.map(e);if(!s)return null;i.push(s)}return new wh(i,this.active)}selectionInsideField(e){return e.ranges.every(i=>this.ranges.some(n=>n.field==this.active&&n.from<=i.from&&n.to>=i.to))}}const yd=ze.define({map(t,e){return t&&t.map(e)}}),LG=ze.define(),Wf=Bi.define({create(){return null},update(t,e){for(let i of e.effects){if(i.is(yd))return i.value;if(i.is(LG)&&t)return new wh(t.ranges,i.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>ve.decorations.from(t,e=>e?e.deco:Pe.none)});function pw(t,e){return re.create(t.filter(i=>i.field==e).map(i=>re.range(i.from,i.to)))}function DG(t){let e=dw.parse(t);return(i,n,s,r)=>{let{text:o,ranges:l}=e.instantiate(i.state,s),{main:c}=i.state.selection,u={changes:{from:s,to:r==c.from?c.to:r,insert:at.of(o)},scrollIntoView:!0,annotations:n?[cw.of(n),hi.userEvent.of("input.complete")]:void 0};if(l.length&&(u.selection=pw(l,0)),l.some(d=>d.field>0)){let d=new wh(l,0),p=u.effects=[yd.of(d)];i.state.field(Wf,!1)===void 0&&p.push(ze.appendConfig.of([Wf,jG,IG,F$]))}i.dispatch(i.state.update(u))}}function G$(t){return({state:e,dispatch:i})=>{let n=e.field(Wf,!1);if(!n||t<0&&n.active==0)return!1;let s=n.active+t,r=t>0&&!n.ranges.some(o=>o.field==s+t);return i(e.update({selection:pw(n.ranges,s),effects:yd.of(r?null:new wh(n.ranges,s)),scrollIntoView:!0})),!0}}const BG=({state:t,dispatch:e})=>t.field(Wf,!1)?(e(t.update({effects:yd.of(null)})),!0):!1,$G=G$(1),zG=G$(-1),NG=[{key:"Tab",run:$G,shift:zG},{key:"Escape",run:BG}],uM=Se.define({combine(t){return t.length?t[0]:NG}}),jG=So.highest(Ll.compute([uM],t=>t.facet(uM)));function Qn(t,e){return{...e,apply:DG(t)}}const IG=ve.domEventHandlers({mousedown(t,e){let i=e.state.field(Wf,!1),n;if(!i||(n=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let s=i.ranges.find(r=>r.from<=n&&r.to>=n);return!s||s.field==i.active?!1:(e.dispatch({selection:pw(i.ranges,s.field),effects:yd.of(i.ranges.some(r=>r.field>s.field)?new wh(i.ranges,s.field):null),scrollIntoView:!0}),!0)}}),Uf={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},vl=ze.define({map(t,e){let i=e.mapPos(t,-1,Fi.TrackAfter);return i??void 0}}),mw=new class extends Sa{};mw.startSide=1;mw.endSide=-1;const K$=Bi.define({create(){return Ge.empty},update(t,e){if(t=t.map(e.changes),e.selection){let i=e.state.doc.lineAt(e.selection.main.head);t=t.update({filter:n=>n>=i.from&&n<=i.to})}for(let i of e.effects)i.is(vl)&&(t=t.update({add:[mw.range(i.value,i.value+1)]}));return t}});function VG(){return[ZG,K$]}const W_="()[]{}<>«»»«[]{}";function J$(t){for(let e=0;e<W_.length;e+=2)if(W_.charCodeAt(e)==t)return W_.charAt(e+1);return Ax(t<128?t:t+1)}function e4(t,e){return t.languageDataAt("closeBrackets",e)[0]||Uf}const XG=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),ZG=ve.inputHandler.of((t,e,i,n)=>{if((XG?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let s=t.state.selection.main;if(n.length>2||n.length==2&&gr(Ln(n,0))==1||e!=s.from||i!=s.to)return!1;let r=UG(t.state,n);return r?(t.dispatch(r),!0):!1}),qG=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let n=e4(t,t.selection.main.head).brackets||Uf.brackets,s=null,r=t.changeByRange(o=>{if(o.empty){let l=YG(t.doc,o.head);for(let c of n)if(c==l&&wO(t.doc,o.head)==J$(Ln(c,0)))return{changes:{from:o.head-c.length,to:o.head+c.length},range:re.cursor(o.head-c.length)}}return{range:s=o}});return s||e(t.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},WG=[{key:"Backspace",run:qG}];function UG(t,e){let i=e4(t,t.selection.main.head),n=i.brackets||Uf.brackets;for(let s of n){let r=J$(Ln(s,0));if(e==s)return r==s?GG(t,s,n.indexOf(s+s+s)>-1,i):HG(t,s,r,i.before||Uf.before);if(e==r&&t4(t,t.selection.main.from))return FG(t,s,r)}return null}function t4(t,e){let i=!1;return t.field(K$).between(0,t.doc.length,n=>{n==e&&(i=!0)}),i}function wO(t,e){let i=t.sliceString(e,e+2);return i.slice(0,gr(Ln(i,0)))}function YG(t,e){let i=t.sliceString(e-2,e);return gr(Ln(i,0))==i.length?i:i.slice(1)}function HG(t,e,i,n){let s=null,r=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:i,from:o.to}],effects:vl.of(o.to+e.length),range:re.range(o.anchor+e.length,o.head+e.length)};let l=wO(t.doc,o.head);return!l||/\s/.test(l)||n.indexOf(l)>-1?{changes:{insert:e+i,from:o.head},effects:vl.of(o.head+e.length),range:re.cursor(o.head+e.length)}:{range:s=o}});return s?null:t.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function FG(t,e,i){let n=null,s=t.changeByRange(r=>r.empty&&wO(t.doc,r.head)==i?{changes:{from:r.head,to:r.head+i.length,insert:i},range:re.cursor(r.head+i.length)}:n={range:r});return n?null:t.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function GG(t,e,i,n){let s=n.stringPrefixes||Uf.stringPrefixes,r=null,o=t.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:vl.of(l.to+e.length),range:re.range(l.anchor+e.length,l.head+e.length)};let c=l.head,u=wO(t.doc,c),d;if(u==e){if(fM(t,c))return{changes:{insert:e+e,from:c},effects:vl.of(c+e.length),range:re.cursor(c+e.length)};if(t4(t,c)){let g=i&&t.sliceDoc(c,c+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:c,to:c+g.length,insert:g},range:re.cursor(c+g.length)}}}else{if(i&&t.sliceDoc(c-2*e.length,c)==e+e&&(d=dM(t,c-2*e.length,s))>-1&&fM(t,d))return{changes:{insert:e+e+e+e,from:c},effects:vl.of(c+e.length),range:re.cursor(c+e.length)};if(t.charCategorizer(c)(u)!=Dt.Word&&dM(t,c,s)>-1&&!KG(t,c,e,s))return{changes:{insert:e+e,from:c},effects:vl.of(c+e.length),range:re.cursor(c+e.length)}}return{range:r=l}});return r?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function fM(t,e){let i=xt(t).resolveInner(e+1);return i.parent&&i.from==e}function KG(t,e,i,n){let s=xt(t).resolveInner(e,-1),r=n.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=t.sliceDoc(s.from,Math.min(s.to,s.from+i.length+r)),c=l.indexOf(i);if(!c||c>-1&&n.indexOf(l.slice(0,c))>-1){let d=s.firstChild;for(;d&&d.from==s.from&&d.to-d.from>i.length+c;){if(t.sliceDoc(d.to-i.length,d.to)==i)return!1;d=d.firstChild}return!0}let u=s.to==e&&s.parent;if(!u)break;s=u}return!1}function dM(t,e,i){let n=t.charCategorizer(e);if(n(t.sliceDoc(e-1,e))!=Dt.Word)return e;for(let s of i){let r=e-s.length;if(t.sliceDoc(r,e)==s&&n(t.sliceDoc(r-1,r))!=Dt.Word)return r}return-1}function JG(t={}){return[MG,Dn,Li.of(t),AG,eK,F$]}const i4=[{key:"Ctrl-Space",run:q_},{mac:"Alt-`",run:q_},{mac:"Alt-i",run:q_},{key:"Escape",run:wG},{key:"ArrowDown",run:Om(!0)},{key:"ArrowUp",run:Om(!1)},{key:"PageDown",run:Om(!0,"page")},{key:"PageUp",run:Om(!1,"page")},{key:"Enter",run:xG}],eK=So.highest(Ll.computeN([Li],t=>t.facet(Li).defaultKeymap?[i4]:[]));class pM{constructor(e,i,n){this.from=e,this.to=i,this.diagnostic=n}}class ul{constructor(e,i,n){this.diagnostics=e,this.panel=i,this.selected=n}static init(e,i,n){let s=n.facet(Yf).markerFilter;s&&(e=s(e,n));let r=e.slice().sort((O,_)=>O.from-_.from||O.to-_.to),o=new _o,l=[],c=0,u=n.doc.iter(),d=0,p=n.doc.length;for(let O=0;;){let _=O==r.length?null:r[O];if(!_&&!l.length)break;let b,x;if(l.length)b=c,x=l.reduce((T,A)=>Math.min(T,A.to),_&&_.from>b?_.from:1e8);else{if(b=_.from,b>p)break;x=_.to,l.push(_),O++}for(;O<r.length;){let T=r[O];if(T.from==b&&(T.to>T.from||T.to==b))l.push(T),O++,x=Math.min(T.to,x);else{x=Math.min(T.from,x);break}}x=Math.min(x,p);let w=!1;if(l.some(T=>T.from==b&&(T.to==x||x==p))&&(w=b==x,!w&&x-b<10)){let T=b-(d+u.value.length);T>0&&(u.next(T),d=b);for(let A=b;;){if(A>=x){w=!0;break}if(!u.lineBreak&&d+u.value.length>A)break;A=d+u.value.length,d+=u.value.length,u.next()}}let k=dK(l);if(w)o.add(b,b,Pe.widget({widget:new cK(k),diagnostics:l.slice()}));else{let T=l.reduce((A,L)=>L.markClass?A+" "+L.markClass:A,"");o.add(b,x,Pe.mark({class:"cm-lintRange cm-lintRange-"+k+T,diagnostics:l.slice(),inclusiveEnd:l.some(A=>A.to>x)}))}if(c=x,c==p)break;for(let T=0;T<l.length;T++)l[T].to<=c&&l.splice(T--,1)}let g=o.finish();return new ul(g,i,Aa(g))}}function Aa(t,e=null,i=0){let n=null;return t.between(i,1e9,(s,r,{spec:o})=>{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new pM(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new pM(n.from,r,n.diagnostic)}}),n}function tK(t,e){let i=e.pos,n=e.end||i,s=t.state.facet(Yf).hideOn(t,i,n);if(s!=null)return s;let r=t.startState.doc.lineAt(e.pos);return!!(t.effects.some(o=>o.is(n4))||t.changes.touchesRange(r.from,Math.max(r.to,n)))}function iK(t,e){return t.field(ss,!1)?e:e.concat(ze.appendConfig.of(pK))}const n4=ze.define(),gw=ze.define(),s4=ze.define(),ss=Bi.define({create(){return new ul(Pe.none,null,null)},update(t,e){if(e.docChanged&&t.diagnostics.size){let i=t.diagnostics.map(e.changes),n=null,s=t.panel;if(t.selected){let r=e.changes.mapPos(t.selected.from,1);n=Aa(i,t.selected.diagnostic,r)||Aa(i,null,r)}!i.size&&s&&e.state.facet(Yf).autoPanel&&(s=null),t=new ul(i,s,n)}for(let i of e.effects)if(i.is(n4)){let n=e.state.facet(Yf).autoPanel?i.value.length?Hf.open:null:t.panel;t=ul.init(i.value,n,e.state)}else i.is(gw)?t=new ul(t.diagnostics,i.value?Hf.open:null,t.selected):i.is(s4)&&(t=new ul(t.diagnostics,t.panel,i.value));return t},provide:t=>[zf.from(t,e=>e.panel),ve.decorations.from(t,e=>e.diagnostics)]}),nK=Pe.mark({class:"cm-lintRange cm-lintRange-active"});function sK(t,e,i){let{diagnostics:n}=t.state.field(ss),s,r=-1,o=-1;n.between(e-(i<0?1:0),e+(i>0?1:0),(c,u,{spec:d})=>{if(e>=c&&e<=u&&(c==u||(e>c||i>0)&&(e<u||i<0)))return s=d.diagnostics,r=c,o=u,!1});let l=t.state.facet(Yf).tooltipFilter;return s&&l&&(s=l(s,t.state)),s?{pos:r,end:o,above:t.state.doc.lineAt(r).to<o,create(){return{dom:rK(t,s)}}}:null}function rK(t,e){return vt("ul",{class:"cm-tooltip-lint"},e.map(i=>o4(t,i,!1)))}const oK=t=>{let e=t.state.field(ss,!1);(!e||!e.panel)&&t.dispatch({effects:iK(t.state,[gw.of(!0)])});let i=Wx(t,Hf.open);return i&&i.dom.querySelector(".cm-panel-lint ul").focus(),!0},mM=t=>{let e=t.state.field(ss,!1);return!e||!e.panel?!1:(t.dispatch({effects:gw.of(!1)}),!0)},aK=t=>{let e=t.state.field(ss,!1);if(!e)return!1;let i=t.state.selection.main,n=Aa(e.diagnostics,null,i.to+1);return!n&&(n=Aa(e.diagnostics,null,0),!n||n.from==i.from&&n.to==i.to)?!1:(t.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)},lK=[{key:"Mod-Shift-m",run:oK,preventDefault:!0},{key:"F8",run:aK}],Yf=Se.define({combine(t){return{sources:t.map(e=>e.source).filter(e=>e!=null),...Qr(t.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:gM,tooltipFilter:gM,needsRefresh:(e,i)=>e?i?n=>e(n)||i(n):e:i,hideOn:(e,i)=>e?i?(n,s,r)=>e(n,s,r)||i(n,s,r):e:i,autoPanel:(e,i)=>e||i})}}});function gM(t,e){return t?e?(i,n)=>e(t(i,n),n):t:e}function r4(t){let e=[];if(t)e:for(let{name:i}of t){for(let n=0;n<i.length;n++){let s=i[n];if(/[a-zA-Z]/.test(s)&&!e.some(r=>r.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function o4(t,e,i){var n;let s=i?r4(e.actions):[];return vt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},vt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(t):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((r,o)=>{let l=!1,c=O=>{if(O.preventDefault(),l)return;l=!0;let _=Aa(t.state.field(ss).diagnostics,e);_&&r.apply(t,_.from,_.to)},{name:u}=r,d=s[o]?u.indexOf(s[o]):-1,p=d<0?u:[u.slice(0,d),vt("u",u.slice(d,d+1)),u.slice(d+1)],g=r.markClass?" "+r.markClass:"";return vt("button",{type:"button",class:"cm-diagnosticAction"+g,onclick:c,onmousedown:c,"aria-label":` Action: ${u}${d<0?"":` (access key "${s[o]})"`}.`},p)}),e.source&&vt("div",{class:"cm-diagnosticSource"},e.source))}class cK extends Gs{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return vt("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class OM{constructor(e,i){this.diagnostic=i,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=o4(e,i,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Hf{constructor(e){this.view=e,this.items=[];let i=s=>{if(!(s.ctrlKey||s.altKey||s.metaKey)){if(s.keyCode==27)mM(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=r4(r.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==s.keyCode){let c=Aa(this.view.state.field(ss).diagnostics,r);c&&r.actions[l].apply(e,c.from,c.to)}}else return;s.preventDefault()}},n=s=>{for(let r=0;r<this.items.length;r++)this.items[r].dom.contains(s.target)&&this.moveSelection(r)};this.list=vt("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:i,onclick:n}),this.dom=vt("div",{class:"cm-panel-lint"},this.list,vt("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>mM(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(ss).selected;if(!e)return-1;for(let i=0;i<this.items.length;i++)if(this.items[i].diagnostic==e.diagnostic)return i;return-1}update(){let{diagnostics:e,selected:i}=this.view.state.field(ss),n=0,s=!1,r=null,o=new Set;for(e.between(0,this.view.state.doc.length,(l,c,{spec:u})=>{for(let d of u.diagnostics){if(o.has(d))continue;o.add(d);let p=-1,g;for(let O=n;O<this.items.length;O++)if(this.items[O].diagnostic==d){p=O;break}p<0?(g=new OM(this.view,d),this.items.splice(n,0,g),s=!0):(g=this.items[p],p>n&&(this.items.splice(n,p-n),s=!0)),i&&g.diagnostic==i.diagnostic?g.dom.hasAttribute("aria-selected")||(g.dom.setAttribute("aria-selected","true"),r=g):g.dom.hasAttribute("aria-selected")&&g.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new OM(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:c})=>{let u=c.height/this.list.offsetHeight;l.top<c.top?this.list.scrollTop-=(c.top-l.top)/u:l.bottom>c.bottom&&(this.list.scrollTop+=(l.bottom-c.bottom)/u)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function i(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)i();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)i()}moveSelection(e){if(this.selectedIndex<0)return;let i=this.view.state.field(ss),n=Aa(i.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:s4.of(n)})}static open(e){return new Hf(e)}}function hK(t,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(t)}</svg>')`}function vm(t){return hK(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${t}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const uK=ve.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:vm("#d11")},".cm-lintRange-warning":{backgroundImage:vm("orange")},".cm-lintRange-info":{backgroundImage:vm("#999")},".cm-lintRange-hint":{backgroundImage:vm("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function fK(t){return t=="error"?4:t=="warning"?3:t=="info"?2:1}function dK(t){let e="hint",i=1;for(let n of t){let s=fK(n.severity);s>i&&(i=s,e=n.severity)}return e}const pK=[ss,ve.decorations.compute([ss],t=>{let{selected:e,panel:i}=t.field(ss);return!e||!i||e.from==e.to?Pe.none:Pe.set([nK.range(e.from,e.to)])}),WU(sK,{hideOn:tK}),uK];var vM=function(e){e===void 0&&(e={});var{crosshairCursor:i=!1}=e,n=[];e.closeBracketsKeymap!==!1&&(n=n.concat(WG)),e.defaultKeymap!==!1&&(n=n.concat(AF)),e.searchKeymap!==!1&&(n=n.concat(tG)),e.historyKeymap!==!1&&(n=n.concat(DH)),e.foldKeymap!==!1&&(n=n.concat(FY)),e.completionKeymap!==!1&&(n=n.concat(i4)),e.lintKeymap!==!1&&(n=n.concat(lK));var s=[];return e.lineNumbers!==!1&&s.push(rY()),e.highlightActiveLineGutter!==!1&&s.push(lY()),e.highlightSpecialChars!==!1&&s.push(bU()),e.history!==!1&&s.push(kH()),e.foldGutter!==!1&&s.push(eH()),e.drawSelection!==!1&&s.push(hU()),e.dropCursor!==!1&&s.push(mU()),e.allowMultipleSelections!==!1&&s.push(et.allowMultipleSelections.of(!0)),e.indentOnInput!==!1&&s.push(VY()),e.syntaxHighlighting!==!1&&s.push(JB(sH,{fallback:!0})),e.bracketMatching!==!1&&s.push(uH()),e.closeBrackets!==!1&&s.push(VG()),e.autocompletion!==!1&&s.push(JG()),e.rectangularSelection!==!1&&s.push(DU()),i!==!1&&s.push(zU()),e.highlightActiveLine!==!1&&s.push(TU()),e.highlightSelectionMatches!==!1&&s.push(LF()),e.tabSize&&typeof e.tabSize=="number"&&s.push(yh.of(" ".repeat(e.tabSize))),s.concat([Ll.of(n.flat())]).filter(Boolean)};const mK="#e5c07b",_M="#e06c75",gK="#56b6c2",OK="#ffffff",Hm="#abb2bf",Bb="#7d8799",vK="#61afef",_K="#98c379",yM="#d19a66",yK="#c678dd",bK="#21252b",bM="#2c313a",SM="#282c34",U_="#353a42",SK="#3E4451",xM="#528bff",xK=ve.theme({"&":{color:Hm,backgroundColor:SM},".cm-content":{caretColor:xM},".cm-cursor, .cm-dropCursor":{borderLeftColor:xM},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:SK},".cm-panels":{backgroundColor:bK,color:Hm},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:SM,color:Bb,border:"none"},".cm-activeLineGutter":{backgroundColor:bM},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:U_},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:U_,borderBottomColor:U_},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:bM,color:Hm}}},{dark:!0}),wK=Od.define([{tag:V.keyword,color:yK},{tag:[V.name,V.deleted,V.character,V.propertyName,V.macroName],color:_M},{tag:[V.function(V.variableName),V.labelName],color:vK},{tag:[V.color,V.constant(V.name),V.standard(V.name)],color:yM},{tag:[V.definition(V.name),V.separator],color:Hm},{tag:[V.typeName,V.className,V.number,V.changed,V.annotation,V.modifier,V.self,V.namespace],color:mK},{tag:[V.operator,V.operatorKeyword,V.url,V.escape,V.regexp,V.link,V.special(V.string)],color:gK},{tag:[V.meta,V.comment],color:Bb},{tag:V.strong,fontWeight:"bold"},{tag:V.emphasis,fontStyle:"italic"},{tag:V.strikethrough,textDecoration:"line-through"},{tag:V.link,color:Bb,textDecoration:"underline"},{tag:V.heading,fontWeight:"bold",color:_M},{tag:[V.atom,V.bool,V.special(V.variableName)],color:yM},{tag:[V.processingInstruction,V.string,V.inserted],color:_K},{tag:V.invalid,color:OK}]),a4=[xK,JB(wK)];var CK=ve.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),kK=function(e){e===void 0&&(e={});var{indentWithTab:i=!0,editable:n=!0,readOnly:s=!1,theme:r="light",placeholder:o="",basicSetup:l=!0}=e,c=[];switch(i&&c.unshift(Ll.of([EF])),l&&(typeof l=="boolean"?c.unshift(vM()):c.unshift(vM(l))),o&&c.unshift(PU(o)),r){case"light":c.push(CK);break;case"dark":c.push(a4);break;case"none":break;default:c.push(r);break}return n===!1&&c.push(ve.editable.of(!1)),s&&c.push(et.readOnly.of(!0)),[...c]},TK=t=>({line:t.state.doc.lineAt(t.state.selection.main.from),lineCount:t.state.doc.lines,lineBreak:t.state.lineBreak,length:t.state.doc.length,readOnly:t.state.readOnly,tabSize:t.state.tabSize,selection:t.state.selection,selectionAsSingle:t.state.selection.asSingle().main,ranges:t.state.selection.ranges,selectionCode:t.state.sliceDoc(t.state.selection.main.from,t.state.selection.main.to),selections:t.state.selection.ranges.map(e=>t.state.sliceDoc(e.from,e.to)),selectedText:t.state.selection.ranges.some(e=>!e.empty)});class AK{constructor(e,i){this.timeLeftMS=void 0,this.timeoutMS=void 0,this.isCancelled=!1,this.isTimeExhausted=!1,this.callbacks=[],this.timeLeftMS=i,this.timeoutMS=i,this.callbacks.push(e)}tick(){if(!this.isCancelled&&!this.isTimeExhausted&&(this.timeLeftMS--,this.timeLeftMS<=0)){this.isTimeExhausted=!0;var e=this.callbacks.slice();this.callbacks.length=0,e.forEach(i=>{try{i()}catch(n){console.error("TimeoutLatch callback error:",n)}})}}cancel(){this.isCancelled=!0,this.callbacks.length=0}reset(){this.timeLeftMS=this.timeoutMS,this.isCancelled=!1,this.isTimeExhausted=!1}get isDone(){return this.isCancelled||this.isTimeExhausted}}class wM{constructor(){this.interval=null,this.latches=new Set}add(e){this.latches.add(e),this.start()}remove(e){this.latches.delete(e),this.latches.size===0&&this.stop()}start(){this.interval===null&&(this.interval=setInterval(()=>{this.latches.forEach(e=>{e.tick(),e.isDone&&this.remove(e)})},1))}stop(){this.interval!==null&&(clearInterval(this.interval),this.interval=null)}}var Y_=null,EK=()=>typeof window>"u"?new wM:(Y_||(Y_=new wM),Y_),CM=Rr.define(),MK=200,PK=[];function RK(t){var{value:e,selection:i,onChange:n,onStatistics:s,onCreateEditor:r,onUpdate:o,extensions:l=PK,autoFocus:c,theme:u="light",height:d=null,minHeight:p=null,maxHeight:g=null,width:O=null,minWidth:_=null,maxWidth:b=null,placeholder:x="",editable:w=!0,readOnly:k=!1,indentWithTab:T=!0,basicSetup:A=!0,root:L,initialState:E}=t,[z,N]=Z.useState(),[q,J]=Z.useState(),[U,R]=Z.useState(),B=Z.useState(()=>({current:null}))[0],D=Z.useState(()=>({current:null}))[0],j=ve.theme({"&":{height:d,minHeight:p,maxHeight:g,width:O,minWidth:_,maxWidth:b},"& .cm-scroller":{height:"100% !important"}}),$=ve.updateListener.of(F=>{if(F.docChanged&&typeof n=="function"&&!F.transactions.some(K=>K.annotation(CM))){B.current?B.current.reset():(B.current=new AK(()=>{if(D.current){var K=D.current;D.current=null,K()}B.current=null},MK),EK().add(B.current));var M=F.state.doc,I=M.toString();n(I,F)}s&&s(TK(F))}),X=kK({theme:u,editable:w,readOnly:k,placeholder:x,indentWithTab:T,basicSetup:A}),H=[$,j,...X];return o&&typeof o=="function"&&H.push(ve.updateListener.of(o)),H=H.concat(l),Z.useLayoutEffect(()=>{if(z&&!U){var F={doc:e,selection:i,extensions:H},M=E?et.fromJSON(E.json,F,E.fields):et.create(F);if(R(M),!q){var I=new ve({state:M,parent:z,root:L});J(I),r&&r(I,M)}}return()=>{q&&(R(void 0),J(void 0))}},[z,U]),Z.useEffect(()=>{t.container&&N(t.container)},[t.container]),Z.useEffect(()=>()=>{q&&(q.destroy(),J(void 0)),B.current&&(B.current.cancel(),B.current=null)},[q]),Z.useEffect(()=>{c&&q&&q.focus()},[c,q]),Z.useEffect(()=>{q&&q.dispatch({effects:ze.reconfigure.of(H)})},[u,l,d,p,g,O,_,b,x,w,k,T,A,n,o]),Z.useEffect(()=>{if(e!==void 0){var F=q?q.state.doc.toString():"";if(q&&e!==F){var M=B.current&&!B.current.isDone,I=()=>{q&&e!==q.state.doc.toString()&&q.dispatch({changes:{from:0,to:q.state.doc.toString().length,insert:e||""},annotations:[CM.of(!0)]})};M?D.current=I:I()}}},[e,q]),{state:U,setState:R,view:q,setView:J,container:z,setContainer:N}}var QK=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],l4=Z.forwardRef((t,e)=>{var{className:i,value:n="",selection:s,extensions:r=[],onChange:o,onStatistics:l,onCreateEditor:c,onUpdate:u,autoFocus:d,theme:p="light",height:g,minHeight:O,maxHeight:_,width:b,minWidth:x,maxWidth:w,basicSetup:k,placeholder:T,indentWithTab:A,editable:L,readOnly:E,root:z,initialState:N}=t,q=FZ(t,QK),J=Z.useRef(null),{state:U,view:R,container:B,setContainer:D}=RK({root:z,value:n,autoFocus:d,theme:p,height:g,minHeight:O,maxHeight:_,width:b,minWidth:x,maxWidth:w,basicSetup:k,placeholder:T,indentWithTab:A,editable:L,readOnly:E,selection:s,onChange:o,onStatistics:l,onCreateEditor:c,onUpdate:u,extensions:r,initialState:N});Z.useImperativeHandle(e,()=>({editor:J.current,state:U,view:R}),[J,B,U,R]);var j=Z.useCallback(X=>{J.current=X,D(X)},[D]);if(typeof n!="string")throw new Error("value must be typeof string but got "+typeof n);var $=typeof p=="string"?"cm-theme-"+p:"cm-theme";return S.jsx("div",X1({ref:j,className:""+$+(i?" "+i:"")},q))});l4.displayName="CodeMirror";class Zg{static create(e,i,n,s,r){let o=s+(s<<8)+e+(i<<4)|0;return new Zg(e,i,n,o,r,[],[])}constructor(e,i,n,s,r,o,l){this.type=e,this.value=i,this.from=n,this.hash=s,this.end=r,this.children=o,this.positions=l,this.hashProp=[[Ne.contextHash,s]]}addChild(e,i){e.prop(Ne.contextHash)!=this.hash&&(e=new ct(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(i)}toTree(e,i=this.end){let n=this.children.length-1;return n>=0&&(i=Math.max(i,this.positions[n]+this.children[n].length+this.from)),new ct(e.types[this.type],this.children,this.positions,i-this.from).balance({makeTree:(s,r,o)=>new ct(_i.none,s,r,o,this.hashProp)})}}var pe;(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"})(pe||(pe={}));class LK{constructor(e,i){this.start=e,this.content=i,this.marks=[],this.parsers=[]}}class DK{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 _f(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,i=0,n=0){for(let s=i;s<e;s++)n+=this.text.charCodeAt(s)==9?4-n%4:1;return n}findColumn(e){let i=0;for(let n=0;i<this.text.length&&n<e;i++)n+=this.text.charCodeAt(i)==9?4-n%4:1;return i}scrub(){if(!this.baseIndent)return this.text;let e="";for(let i=0;i<this.basePos;i++)e+=" ";return e+this.text.slice(this.basePos)}}function kM(t,e,i){if(i.pos==i.text.length||t!=e.block&&i.indent>=e.stack[i.depth+1].value+i.baseIndent)return!0;if(i.indent>=i.baseIndent+4)return!1;let n=(t.type==pe.OrderedList?_w:vw)(i,e,!1);return n>0&&(t.type!=pe.BulletList||Ow(i,e,!1)<0)&&i.text.charCodeAt(i.pos+n-1)==t.value}const c4={[pe.Blockquote](t,e,i){return i.next!=62?!1:(i.markers.push(it(pe.QuoteMark,e.lineStart+i.pos,e.lineStart+i.pos+1)),i.moveBase(i.pos+(Ds(i.text.charCodeAt(i.pos+1))?2:1)),t.end=e.lineStart+i.text.length,!0)},[pe.ListItem](t,e,i){return i.indent<i.baseIndent+t.value&&i.next>-1?!1:(i.moveBaseColumn(i.baseIndent+t.value),!0)},[pe.OrderedList]:kM,[pe.BulletList]:kM,[pe.Document](){return!0}};function Ds(t){return t==32||t==9||t==10||t==13}function _f(t,e=0){for(;e<t.length&&Ds(t.charCodeAt(e));)e++;return e}function TM(t,e,i){for(;e>i&&Ds(t.charCodeAt(e-1));)e--;return e}function h4(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 i=e;i<t.text.length;i++)if(t.text.charCodeAt(i)==96)return-1}return e}function u4(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function Ow(t,e,i){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let n=1;for(let s=t.pos+1;s<t.text.length;s++){let r=t.text.charCodeAt(s);if(r==t.next)n++;else if(!Ds(r))return-1}return i&&t.next==45&&p4(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(v4.SetextHeading)>-1||n<3?-1:1}function f4(t,e){for(let i=t.stack.length-1;i>=0;i--)if(t.stack[i].type==e)return!0;return!1}function vw(t,e,i){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||Ds(t.text.charCodeAt(t.pos+1)))&&(!i||f4(e,pe.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function _w(t,e,i){let n=t.pos,s=t.next;for(;s>=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||n<t.text.length-1&&!Ds(t.text.charCodeAt(n+1))||i&&!f4(e,pe.OrderedList)&&(t.skipSpace(n+1)==t.text.length||n>t.pos+1||t.next!=49)?-1:n+1-t.pos}function d4(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 i=e-t.pos;return i>6?-1:i}function p4(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 i=e;for(;e<t.text.length&&Ds(t.text.charCodeAt(e));)e++;return e==t.text.length?i:-1}const $b=/^[ \t]*$/,m4=/-->/,g4=/\?>/,zb=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,m4],[/^\s*<\?/,g4],[/^\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,$b],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,$b]];function O4(t,e,i){if(t.next!=60)return-1;let n=t.text.slice(t.pos);for(let s=0,r=zb.length-(i?1:0);s<r;s++)if(zb[s][0].test(n))return s;return-1}function AM(t,e){let i=t.countIndent(e,t.pos,t.indent),n=t.countIndent(t.skipSpace(e),e,i);return n>=i+5?i+1:n}function ta(t,e,i){let n=t.length-1;n>=0&&t[n].to==e&&t[n].type==pe.CodeText?t[n].to=i:t.push(it(pe.CodeText,e,i))}const _m={LinkReference:void 0,IndentedCode(t,e){let i=e.baseIndent+4;if(e.indent<i)return!1;let n=e.findColumn(i),s=t.lineStart+n,r=t.lineStart+e.text.length,o=[],l=[];for(ta(o,s,r);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){ta(l,t.lineStart-1,t.lineStart);for(let c of e.markers)l.push(c)}else{if(e.indent<i)break;{if(l.length){for(let u of l)u.type==pe.CodeText?ta(o,u.from,u.to):o.push(u);l=[]}ta(o,t.lineStart-1,t.lineStart);for(let u of e.markers)o.push(u);r=t.lineStart+e.text.length;let c=t.lineStart+e.findColumn(e.baseIndent+4);c<r&&ta(o,c,r)}}return l.length&&(l=l.filter(c=>c.type!=pe.CodeText),l.length&&(e.markers=l.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-s).finish(pe.CodeBlock,r-s),s),!0},FencedCode(t,e){let i=h4(e);if(i<0)return!1;let n=t.lineStart+e.pos,s=e.next,r=i-e.pos,o=e.skipSpace(i),l=TM(e.text,e.text.length,o),c=[it(pe.CodeMark,n,n+r)];o<l&&c.push(it(pe.CodeInfo,t.lineStart+o,t.lineStart+l));for(let u=!0,d=!0,p=!1;t.nextLine()&&e.depth>=t.stack.length;u=!1){let g=e.pos;if(e.indent-e.baseIndent<4)for(;g<e.text.length&&e.text.charCodeAt(g)==s;)g++;if(g-e.pos>=r&&e.skipSpace(g)==e.text.length){for(let O of e.markers)c.push(O);d&&p&&ta(c,t.lineStart-1,t.lineStart),c.push(it(pe.CodeMark,t.lineStart+e.pos,t.lineStart+g)),t.nextLine();break}else{p=!0,u||(ta(c,t.lineStart-1,t.lineStart),d=!1);for(let b of e.markers)c.push(b);let O=t.lineStart+e.basePos,_=t.lineStart+e.text.length;O<_&&(ta(c,O,_),d=!1)}}return t.addNode(t.buffer.writeElements(c,-n).finish(pe.FencedCode,t.prevLineEnd()-n),n),!0},Blockquote(t,e){let i=u4(e);return i<0?!1:(t.startContext(pe.Blockquote,e.pos),t.addNode(pe.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+i),null)},HorizontalRule(t,e){if(Ow(e,t,!1)<0)return!1;let i=t.lineStart+e.pos;return t.nextLine(),t.addNode(pe.HorizontalRule,i),!0},BulletList(t,e){let i=vw(e,t,!1);if(i<0)return!1;t.block.type!=pe.BulletList&&t.startContext(pe.BulletList,e.basePos,e.next);let n=AM(e,e.pos+1);return t.startContext(pe.ListItem,e.basePos,n-e.baseIndent),t.addNode(pe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+i),e.moveBaseColumn(n),null},OrderedList(t,e){let i=_w(e,t,!1);if(i<0)return!1;t.block.type!=pe.OrderedList&&t.startContext(pe.OrderedList,e.basePos,e.text.charCodeAt(e.pos+i-1));let n=AM(e,e.pos+i);return t.startContext(pe.ListItem,e.basePos,n-e.baseIndent),t.addNode(pe.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+i),e.moveBaseColumn(n),null},ATXHeading(t,e){let i=d4(e);if(i<0)return!1;let n=e.pos,s=t.lineStart+n,r=TM(e.text,e.text.length,n),o=r;for(;o>n&&e.text.charCodeAt(o-1)==e.next;)o--;(o==r||o==n||!Ds(e.text.charCodeAt(o-1)))&&(o=e.text.length);let l=t.buffer.write(pe.HeaderMark,0,i).writeElements(t.parser.parseInline(e.text.slice(n+i+1,o),s+i+1),-s);o<e.text.length&&l.write(pe.HeaderMark,o-n,r-n);let c=l.finish(pe.ATXHeading1-1+i,e.text.length-n);return t.nextLine(),t.addNode(c,s),!0},HTMLBlock(t,e){let i=O4(e,t,!1);if(i<0)return!1;let n=t.lineStart+e.pos,s=zb[i][1],r=[],o=s!=$b;for(;!s.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let u of e.markers)r.push(u)}o&&t.nextLine();let l=s==m4?pe.CommentBlock:s==g4?pe.ProcessingInstructionBlock:pe.HTMLBlock,c=t.prevLineEnd();return t.addNode(t.buffer.writeElements(r,-n).finish(l,c-n),n),!0},SetextHeading:void 0};class BK{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,i,n){if(this.stage==-1)return!1;let s=n.content+`
70
+ `+i.scrub(),r=this.advance(s);return r>-1&&r<s.length?this.complete(e,n,r):!1}finish(e,i){return(this.stage==2||this.stage==3)&&_f(i.content,this.pos)==i.content.length?this.complete(e,i,i.content.length):!1}complete(e,i,n){return e.addLeafElement(i,it(pe.LinkReference,this.start,this.start+n,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(T4(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(it(pe.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(C4(e,_f(e,this.pos),this.start)))return-1}else if(this.stage==2){let i=_f(e,this.pos),n=0;if(i>this.pos){let s=k4(e,i,this.start);if(s){let r=H_(e,s.to-this.start);r>0&&(this.nextStage(s),n=r)}}return n||(n=H_(e,this.pos)),n>0&&n<e.length?n:-1}else return H_(e,this.pos)}}}function H_(t,e){for(;e<t.length;e++){let i=t.charCodeAt(e);if(i==10)break;if(!Ds(i))return-1}return e}class $K{nextLine(e,i,n){let s=i.depth<e.stack.length?-1:p4(i),r=i.next;if(s<0)return!1;let o=it(pe.HeaderMark,e.lineStart+i.pos,e.lineStart+s);return e.nextLine(),e.addLeafElement(n,it(r==61?pe.SetextHeading1:pe.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const v4={LinkReference(t,e){return e.content.charCodeAt(0)==91?new BK(e):null},SetextHeading(){return new $K}},zK=[(t,e)=>d4(e)>=0,(t,e)=>h4(e)>=0,(t,e)=>u4(e)>=0,(t,e)=>vw(e,t,!0)>=0,(t,e)=>_w(e,t,!0)>=0,(t,e)=>Ow(e,t,!0)>=0,(t,e)=>O4(e,t,!0)>=0],NK={text:"",end:0};class jK{constructor(e,i,n,s){this.parser=e,this.input=i,this.ranges=s,this.line=new DK,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=s[s.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=s[0].from,this.block=Zg.create(pe.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new XK(n,i):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 n=0;;){let s=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!s||e.markers[n].from<s.end);){let r=e.markers[n++];this.addNode(r.type,r.from,r.to)}if(!s)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 n of this.parser.blockParsers)if(n){let s=n(this,e);if(s!=!1){if(s==!0)return null;e.forward();continue e}}break}let i=new LK(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let s=n(this,i);s&&i.parsers.push(s)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,i))break e}for(let n of i.parsers)if(n.nextLine(this,e,i))return null;i.content+=`
71
+ `+e.scrub();for(let n of e.markers)i.marks.push(n)}return this.finishLeaf(i),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 i=this.fragments.takeNodes(this);return i?(this.absoluteLineStart+=i,this.lineStart=A4(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 i=NK;if(i.end=e,e>=this.to)i.text="";else if(i.text=this.lineChunkAt(e),i.end+=i.text.length,this.ranges.length>1){let n=this.absoluteLineStart,s=this.rangeI;for(;this.ranges[s].to<i.end;){s++;let r=this.ranges[s].from,o=this.lineChunkAt(r);i.end=r+o.length,i.text=i.text.slice(0,this.ranges[s-1].to-n)+o,n=i.end-i.text.length}}return i}readLine(){let{line:e}=this,{text:i,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(i);e.depth<this.stack.length;e.depth++){let s=this.stack[e.depth],r=this.parser.skipContextMarkup[s.type];if(!r)throw new Error("Unhandled block context "+pe[s.type]);let o=this.line.markers.length;if(!r(s,this,e)){this.line.markers.length>o&&(s.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let i=this.input.chunk(e),n;if(this.input.lineChunks)n=i==`
72
+ `?"":i;else{let s=i.indexOf(`
73
+ `);n=s<0?i:i.slice(0,s)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,i,n=0){this.block=Zg.create(e,n,this.lineStart+i,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,i,n=0){this.startContext(this.parser.getNodeType(e),i,n)}addNode(e,i,n){typeof e=="number"&&(e=new ct(this.parser.nodeSet.types[e],uh,uh,(n??this.prevLineEnd())-i)),this.block.addChild(e,i-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,i){this.addNode(this.buffer.writeElements(jb(i.children,e.marks),-i.from).finish(i.type,i.to-i.from),i.from)}finishContext(){let e=this.stack.pop(),i=this.stack[this.stack.length-1];i.addChild(e.toTree(this.parser.nodeSet),e.from-i.from),this.block=i}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?_4(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let n of e.parsers)if(n.finish(this,e))return;let i=jb(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(i,-e.start).finish(pe.Paragraph,e.content.length),e.start)}elt(e,i,n,s){return typeof e=="string"?it(this.parser.getNodeType(e),i,n,s):new S4(e,i)}get buffer(){return new b4(this.parser.nodeSet)}}function _4(t,e,i,n,s){let r=t[e].to,o=[],l=[],c=i.from+n;function u(d,p){for(;p?d>=r:d>r;){let g=t[e+1].from-r;n+=g,d+=g,e++,r=t[e].to}}for(let d=i.firstChild;d;d=d.nextSibling){u(d.from+n,!0);let p=d.from+n,g,O=s.get(d.tree);O?g=O:d.to+n>r?(g=_4(t,e,d,n,s),u(d.to+n,!1)):g=d.toTree(),o.push(g),l.push(p-c)}return u(i.to+n,!1),new ct(i.type,o,l,i.to+n-c,i.tree?i.tree.propValues:void 0)}class CO extends Fx{constructor(e,i,n,s,r,o,l,c,u){super(),this.nodeSet=e,this.blockParsers=i,this.leafBlockParsers=n,this.blockNames=s,this.endLeafBlock=r,this.skipContextMarkup=o,this.inlineParsers=l,this.inlineNames=c,this.wrappers=u,this.nodeTypes=Object.create(null);for(let d of e.types)this.nodeTypes[d.name]=d.id}createParse(e,i,n){let s=new jK(this,e,i,n);for(let r of this.wrappers)s=r(s,e,i,n);return s}configure(e){let i=Nb(e);if(!i)return this;let{nodeSet:n,skipContextMarkup:s}=this,r=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),l=this.blockNames.slice(),c=this.inlineParsers.slice(),u=this.inlineNames.slice(),d=this.endLeafBlock.slice(),p=this.wrappers;if(Pu(i.defineNodes)){s=Object.assign({},s);let g=n.types.slice(),O;for(let _ of i.defineNodes){let{name:b,block:x,composite:w,style:k}=typeof _=="string"?{name:_}:_;if(g.some(L=>L.name==b))continue;w&&(s[g.length]=(L,E,z)=>w(E,z,L.value));let T=g.length,A=w?["Block","BlockContext"]:x?T>=pe.ATXHeading1&&T<=pe.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;g.push(_i.define({id:T,name:b,props:A&&[[Ne.group,A]]})),k&&(O||(O={}),Array.isArray(k)||k instanceof ns?O[b]=k:Object.assign(O,k))}n=new pd(g),O&&(n=n.extend(_h(O)))}if(Pu(i.props)&&(n=n.extend(...i.props)),Pu(i.remove))for(let g of i.remove){let O=this.blockNames.indexOf(g),_=this.inlineNames.indexOf(g);O>-1&&(r[O]=o[O]=void 0),_>-1&&(c[_]=void 0)}if(Pu(i.parseBlock))for(let g of i.parseBlock){let O=l.indexOf(g.name);if(O>-1)r[O]=g.parse,o[O]=g.leaf;else{let _=g.before?ym(l,g.before):g.after?ym(l,g.after)+1:l.length-1;r.splice(_,0,g.parse),o.splice(_,0,g.leaf),l.splice(_,0,g.name)}g.endLeaf&&d.push(g.endLeaf)}if(Pu(i.parseInline))for(let g of i.parseInline){let O=u.indexOf(g.name);if(O>-1)c[O]=g.parse;else{let _=g.before?ym(u,g.before):g.after?ym(u,g.after)+1:u.length-1;c.splice(_,0,g.parse),u.splice(_,0,g.name)}}return i.wrap&&(p=p.concat(i.wrap)),new CO(n,r,o,l,d,s,c,u,p)}getNodeType(e){let i=this.nodeTypes[e];if(i==null)throw new RangeError(`Unknown node type '${e}'`);return i}parseInline(e,i){let n=new yw(this,e,i);e:for(let s=i;s<n.end;){let r=n.char(s);for(let o of this.inlineParsers)if(o){let l=o(n,r,s);if(l>=0){s=l;continue e}}s++}return n.resolveMarkers(0)}}function Pu(t){return t!=null&&t.length>0}function Nb(t){if(!Array.isArray(t))return t;if(t.length==0)return null;let e=Nb(t[0]);if(t.length==1)return e;let i=Nb(t.slice(1));if(!i||!e)return e||i;let n=(o,l)=>(o||uh).concat(l||uh),s=e.wrap,r=i.wrap;return{props:n(e.props,i.props),defineNodes:n(e.defineNodes,i.defineNodes),parseBlock:n(e.parseBlock,i.parseBlock),parseInline:n(e.parseInline,i.parseInline),remove:n(e.remove,i.remove),wrap:s?r?(o,l,c,u)=>s(r(o,l,c,u),l,c,u):s:r}}function ym(t,e){let i=t.indexOf(e);if(i<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return i}let y4=[_i.none];for(let t=1,e;e=pe[t];t++)y4[t]=_i.define({id:t,name:e,props:t>=pe.Escape?[]:[[Ne.group,t in c4?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const uh=[];class b4{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,i,n,s=0){return this.content.push(e,i,n,4+s*4),this}writeElements(e,i=0){for(let n of e)n.writeTo(this,i);return this}finish(e,i){return ct.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:i})}}let Ff=class{constructor(e,i,n,s=uh){this.type=e,this.from=i,this.to=n,this.children=s}writeTo(e,i){let n=e.content.length;e.writeElements(this.children,i),e.content.push(this.type,this.from+i,this.to+i,e.content.length+4-n)}toTree(e){return new b4(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class S4{constructor(e,i){this.tree=e,this.from=i}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return uh}writeTo(e,i){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+i,this.to+i,-1)}toTree(){return this.tree}}function it(t,e,i,n){return new Ff(t,e,i,n)}const x4={resolve:"Emphasis",mark:"EmphasisMark"},w4={resolve:"Emphasis",mark:"EmphasisMark"},fl={},qg={};class is{constructor(e,i,n,s){this.type=e,this.from=i,this.to=n,this.side=s}}const EM="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Gf=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Gf=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const F_={Escape(t,e,i){if(e!=92||i==t.end-1)return-1;let n=t.char(i+1);for(let s=0;s<EM.length;s++)if(EM.charCodeAt(s)==n)return t.append(it(pe.Escape,i,i+2));return-1},Entity(t,e,i){if(e!=38)return-1;let n=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(t.slice(i+1,i+31));return n?t.append(it(pe.Entity,i,i+1+n[0].length)):-1},InlineCode(t,e,i){if(e!=96||i&&t.char(i-1)==96)return-1;let n=i+1;for(;n<t.end&&t.char(n)==96;)n++;let s=n-i,r=0;for(;n<t.end;n++)if(t.char(n)==96){if(r++,r==s&&t.char(n+1)!=96)return t.append(it(pe.InlineCode,i,n+1,[it(pe.CodeMark,i,i+s),it(pe.CodeMark,n+1-s,n+1)]))}else r=0;return-1},HTMLTag(t,e,i){if(e!=60||i==t.end-1)return-1;let n=t.slice(i+1,t.end),s=/^(?:[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(n);if(s)return t.append(it(pe.Autolink,i,i+1+s[0].length,[it(pe.LinkMark,i,i+1),it(pe.URL,i+1,i+s[0].length),it(pe.LinkMark,i+s[0].length,i+1+s[0].length)]));let r=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(n);if(r)return t.append(it(pe.Comment,i,i+1+r[0].length));let o=/^\?[^]*?\?>/.exec(n);if(o)return t.append(it(pe.ProcessingInstruction,i,i+1+o[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(n);return l?t.append(it(pe.HTMLTag,i,i+1+l[0].length)):-1},Emphasis(t,e,i){if(e!=95&&e!=42)return-1;let n=i+1;for(;t.char(n)==e;)n++;let s=t.slice(i-1,i),r=t.slice(n,n+1),o=Gf.test(s),l=Gf.test(r),c=/\s|^$/.test(s),u=/\s|^$/.test(r),d=!u&&(!l||c||o),p=!c&&(!o||u||l),g=d&&(e==42||!p||o),O=p&&(e==42||!d||l);return t.append(new is(e==95?x4:w4,i,n,(g?1:0)|(O?2:0)))},HardBreak(t,e,i){if(e==92&&t.char(i+1)==10)return t.append(it(pe.HardBreak,i,i+2));if(e==32){let n=i+1;for(;t.char(n)==32;)n++;if(t.char(n)==10&&n>=i+2)return t.append(it(pe.HardBreak,i,n+1))}return-1},Link(t,e,i){return e==91?t.append(new is(fl,i,i+1,1)):-1},Image(t,e,i){return e==33&&t.char(i+1)==91?t.append(new is(qg,i,i+2,1)):-1},LinkEnd(t,e,i){if(e!=93)return-1;for(let n=t.parts.length-1;n>=0;n--){let s=t.parts[n];if(s instanceof is&&(s.type==fl||s.type==qg)){if(!s.side||t.skipSpace(s.to)==i&&!/[(\[]/.test(t.slice(i+1,i+2)))return t.parts[n]=null,-1;let r=t.takeContent(n),o=t.parts[n]=IK(t,r,s.type==fl?pe.Link:pe.Image,s.from,i+1);if(s.type==fl)for(let l=0;l<n;l++){let c=t.parts[l];c instanceof is&&c.type==fl&&(c.side=0)}return o.to}}return-1}};function IK(t,e,i,n,s){let{text:r}=t,o=t.char(s),l=s;if(e.unshift(it(pe.LinkMark,n,n+(i==pe.Image?2:1))),e.push(it(pe.LinkMark,s-1,s)),o==40){let c=t.skipSpace(s+1),u=C4(r,c-t.offset,t.offset),d;u&&(c=t.skipSpace(u.to),c!=u.to&&(d=k4(r,c-t.offset,t.offset),d&&(c=t.skipSpace(d.to)))),t.char(c)==41&&(e.push(it(pe.LinkMark,s,s+1)),l=c+1,u&&e.push(u),d&&e.push(d),e.push(it(pe.LinkMark,c,l)))}else if(o==91){let c=T4(r,s-t.offset,t.offset,!1);c&&(e.push(c),l=c.to)}return it(i,n,l,e)}function C4(t,e,i){if(t.charCodeAt(e)==60){for(let s=e+1;s<t.length;s++){let r=t.charCodeAt(s);if(r==62)return it(pe.URL,e+i,s+1+i);if(r==60||r==10)return!1}return null}else{let s=0,r=e;for(let o=!1;r<t.length;r++){let l=t.charCodeAt(r);if(Ds(l))break;if(o)o=!1;else if(l==40)s++;else if(l==41){if(!s)break;s--}else l==92&&(o=!0)}return r>e?it(pe.URL,e+i,r+i):r==t.length?null:!1}}function k4(t,e,i){let n=t.charCodeAt(e);if(n!=39&&n!=34&&n!=40)return!1;let s=n==40?41:n;for(let r=e+1,o=!1;r<t.length;r++){let l=t.charCodeAt(r);if(o)o=!1;else{if(l==s)return it(pe.LinkTitle,e+i,r+1+i);l==92&&(o=!0)}}return null}function T4(t,e,i,n){for(let s=!1,r=e+1,o=Math.min(t.length,r+999);r<o;r++){let l=t.charCodeAt(r);if(s)s=!1;else{if(l==93)return n?!1:it(pe.LinkLabel,e+i,r+1+i);if(n&&!Ds(l)&&(n=!1),l==91)return!1;l==92&&(s=!0)}}return null}class yw{constructor(e,i,n){this.parser=e,this.text=i,this.offset=n,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,i){return this.text.slice(e-this.offset,i-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,i,n,s,r){return this.append(new is(e,i,n,(s?1:0)|(r?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let i=this.parts[e];if(i instanceof is&&(i.type==fl||i.type==qg))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n<this.parts.length;n++){let s=this.parts[n];if(!(s instanceof is&&s.type.resolve&&s.side&2))continue;let r=s.type==x4||s.type==w4,o=s.to-s.from,l,c=n-1;for(;c>=e;c--){let b=this.parts[c];if(b instanceof is&&b.side&1&&b.type==s.type&&!(r&&(s.side&1||b.side&2)&&(b.to-b.from+o)%3==0&&((b.to-b.from)%3||o%3))){l=b;break}}if(!l)continue;let u=s.type.resolve,d=[],p=l.from,g=s.to;if(r){let b=Math.min(2,l.to-l.from,o);p=l.to-b,g=s.from+b,u=b==1?"Emphasis":"StrongEmphasis"}l.type.mark&&d.push(this.elt(l.type.mark,p,l.to));for(let b=c+1;b<n;b++)this.parts[b]instanceof Ff&&d.push(this.parts[b]),this.parts[b]=null;s.type.mark&&d.push(this.elt(s.type.mark,s.from,g));let O=this.elt(u,p,g,d);this.parts[c]=r&&l.from!=p?new is(l.type,l.from,p,l.side):null,(this.parts[n]=r&&s.to!=g?new is(s.type,g,s.to,s.side):null)?this.parts.splice(n,0,O):this.parts[n]=O}let i=[];for(let n=e;n<this.parts.length;n++){let s=this.parts[n];s instanceof Ff&&i.push(s)}return i}findOpeningDelimiter(e){for(let i=this.parts.length-1;i>=0;i--){let n=this.parts[i];if(n instanceof is&&n.type==e&&n.side&1)return i}return null}takeContent(e){let i=this.resolveMarkers(e);return this.parts.length=e,i}getDelimiterAt(e){let i=this.parts[e];return i instanceof is?i:null}skipSpace(e){return _f(this.text,e-this.offset)+this.offset}elt(e,i,n,s){return typeof e=="string"?it(this.parser.getNodeType(e),i,n,s):new S4(e,i)}}yw.linkStart=fl;yw.imageStart=qg;function jb(t,e){if(!e.length)return t;if(!t.length)return e;let i=t.slice(),n=0;for(let s of e){for(;n<i.length&&i[n].to<s.to;)n++;if(n<i.length&&i[n].from<s.from){let r=i[n];r instanceof Ff&&(i[n]=new Ff(r.type,r.from,r.to,jb(r.children,[s])))}else i.splice(n++,0,s)}return i}const VK=[pe.CodeBlock,pe.ListItem,pe.OrderedList,pe.BulletList];let XK=class{constructor(e,i){this.fragments=e,this.input=i,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,i){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 r=this.fragment.to;for(;r>0&&this.input.read(r-1,r)!=`
74
+ `;)r--;this.fragmentEnd=r?r-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let s=e+this.fragment.offset;for(;n.to<=s;)if(!n.parent())return!1;for(;;){if(n.from>=s)return this.fragment.from<=i;if(!n.childAfter(s))return!1}}matches(e){let i=this.cursor.tree;return i&&i.prop(Ne.contextHash)==e}takeNodes(e){let i=this.cursor,n=this.fragment.offset,s=this.fragmentEnd-(this.fragment.openEnd?1:0),r=e.absoluteLineStart,o=r,l=e.block.children.length,c=o,u=l;for(;;){if(i.to-n>s){if(i.type.isAnonymous&&i.firstChild())continue;break}let d=A4(i.from-n,e.ranges);if(i.to-n<=e.ranges[e.rangeI].to)e.addNode(i.tree,d);else{let p=new ct(e.parser.nodeSet.types[pe.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(p,i.tree),e.addNode(p,d)}if(i.type.is("Block")&&(VK.indexOf(i.type.id)<0?(o=i.to-n,l=e.block.children.length):(o=c,l=u),c=i.to-n,u=e.block.children.length),!i.nextSibling())break}for(;e.block.children.length>l;)e.block.children.pop(),e.block.positions.pop();return o-r}};function A4(t,e){let i=t;for(let n=1;n<e.length;n++){let s=e[n-1].to,r=e[n].from;s<t&&(i-=r-s)}return i}const ZK=_h({"Blockquote/...":V.quote,HorizontalRule:V.contentSeparator,"ATXHeading1/... SetextHeading1/...":V.heading1,"ATXHeading2/... SetextHeading2/...":V.heading2,"ATXHeading3/...":V.heading3,"ATXHeading4/...":V.heading4,"ATXHeading5/...":V.heading5,"ATXHeading6/...":V.heading6,"Comment CommentBlock":V.comment,Escape:V.escape,Entity:V.character,"Emphasis/...":V.emphasis,"StrongEmphasis/...":V.strong,"Link/... Image/...":V.link,"OrderedList/... BulletList/...":V.list,"BlockQuote/...":V.quote,"InlineCode CodeText":V.monospace,"URL Autolink":V.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":V.processingInstruction,"CodeInfo LinkLabel":V.labelName,LinkTitle:V.string,Paragraph:V.content}),qK=new CO(new pd(y4).extend(ZK),Object.keys(_m).map(t=>_m[t]),Object.keys(_m).map(t=>v4[t]),Object.keys(_m),zK,c4,Object.keys(F_).map(t=>F_[t]),Object.keys(F_),[]);function WK(t,e,i){let n=[];for(let s=t.firstChild,r=e;;s=s.nextSibling){let o=s?s.from:i;if(o>r&&n.push({from:r,to:o}),!s)break;r=s.to}return n}function UK(t){let{codeParser:e,htmlParser:i}=t;return{wrap:$B((s,r)=>{let o=s.type.id;if(e&&(o==pe.CodeBlock||o==pe.FencedCode)){let l="";if(o==pe.FencedCode){let u=s.node.getChild(pe.CodeInfo);u&&(l=r.read(u.from,u.to))}let c=e(l);if(c)return{parser:c,overlay:u=>u.type.id==pe.CodeText,bracketed:o==pe.FencedCode}}else if(i&&(o==pe.HTMLBlock||o==pe.HTMLTag||o==pe.CommentBlock))return{parser:i,overlay:WK(s.node,s.from,s.to)};return null})}}const YK={resolve:"Strikethrough",mark:"StrikethroughMark"},HK={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":V.strikethrough}},{name:"StrikethroughMark",style:V.processingInstruction}],parseInline:[{name:"Strikethrough",parse(t,e,i){if(e!=126||t.char(i+1)!=126||t.char(i+2)==126)return-1;let n=t.slice(i-1,i),s=t.slice(i+2,i+3),r=/\s|^$/.test(n),o=/\s|^$/.test(s),l=Gf.test(n),c=Gf.test(s);return t.addDelimiter(YK,i,i+2,!o&&(!c||r||l),!r&&(!l||o||c))},after:"Emphasis"}]};function yf(t,e,i=0,n,s=0){let r=0,o=!0,l=-1,c=-1,u=!1,d=()=>{n.push(t.elt("TableCell",s+l,s+c,t.parser.parseInline(e.slice(l,c),s+l)))};for(let p=i;p<e.length;p++){let g=e.charCodeAt(p);g==124&&!u?((!o||l>-1)&&r++,o=!1,n&&(l>-1&&d(),n.push(t.elt("TableDelimiter",p+s,p+s+1))),l=c=-1):(u||g!=32&&g!=9)&&(l<0&&(l=p),c=p+1),u=!u&&g==92}return l>-1&&(r++,n&&d()),r}function MM(t,e){for(let i=e;i<t.length;i++){let n=t.charCodeAt(i);if(n==124)return!0;n==92&&i++}return!1}const E4=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class PM{constructor(){this.rows=null}nextLine(e,i,n){if(this.rows==null){this.rows=!1;let s;if((i.next==45||i.next==58||i.next==124)&&E4.test(s=i.text.slice(i.pos))){let r=[];yf(e,n.content,0,r,n.start)==yf(e,s,i.pos)&&(this.rows=[e.elt("TableHeader",n.start,n.start+n.content.length,r),e.elt("TableDelimiter",e.lineStart+i.pos,e.lineStart+i.text.length)])}}else if(this.rows){let s=[];yf(e,i.text,i.pos,s,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+i.pos,e.lineStart+i.text.length,s))}return!1}finish(e,i){return this.rows?(e.addLeafElement(i,e.elt("Table",i.start,i.start+i.content.length,this.rows)),!0):!1}}const FK={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":V.heading}},"TableRow",{name:"TableCell",style:V.content},{name:"TableDelimiter",style:V.processingInstruction}],parseBlock:[{name:"Table",leaf(t,e){return MM(e.content,0)?new PM:null},endLeaf(t,e,i){if(i.parsers.some(s=>s instanceof PM)||!MM(e.text,e.basePos))return!1;let n=t.peekLine();return E4.test(n)&&yf(t,e.text,e.basePos)==yf(t,n,e.basePos)},before:"SetextHeading"}]};class GK{nextLine(){return!1}finish(e,i){return e.addLeafElement(i,e.elt("Task",i.start,i.start+i.content.length,[e.elt("TaskMarker",i.start,i.start+3),...e.parser.parseInline(i.content.slice(3),i.start+3)])),!0}}const KK={defineNodes:[{name:"Task",block:!0,style:V.list},{name:"TaskMarker",style:V.atom}],parseBlock:[{name:"TaskList",leaf(t,e){return/^\[[ xX]\][ \t]/.test(e.content)&&t.parentType().name=="ListItem"?new GK:null},after:"SetextHeading"}]},RM=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,QM=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,JK=/[\w-]+\.[\w-]+($|\/)/,LM=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,DM=/\/[a-zA-Z\d@.]+/gy;function BM(t,e,i,n){let s=0;for(let r=e;r<i;r++)t[r]==n&&s++;return s}function eJ(t,e){QM.lastIndex=e;let i=QM.exec(t);if(!i||JK.exec(i[0])[0].indexOf("_")>-1)return-1;let n=e+i[0].length;for(;;){let s=t[n-1],r;if(/[?!.,:*_~]/.test(s)||s==")"&&BM(t,e,n,")")>BM(t,e,n,"("))n--;else if(s==";"&&(r=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(t.slice(e,n))))n=e+r.index;else break}return n}function $M(t,e){LM.lastIndex=e;let i=LM.exec(t);if(!i)return-1;let n=i[0][i[0].length-1];return n=="_"||n=="-"?-1:e+i[0].length-(n=="."?1:0)}const tJ={parseInline:[{name:"Autolink",parse(t,e,i){let n=i-t.offset;if(n&&/\w/.test(t.text[n-1]))return-1;RM.lastIndex=n;let s=RM.exec(t.text),r=-1;if(!s)return-1;if(s[1]||s[2]){if(r=eJ(t.text,n+s[0].length),r>-1&&t.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(t.text.slice(n,r));r=n+o[0].length}}else s[3]?r=$M(t.text,n):(r=$M(t.text,n+s[0].length),r>-1&&s[0]=="xmpp:"&&(DM.lastIndex=r,s=DM.exec(t.text),s&&(r=s.index+s[0].length)));return r<0?-1:(t.addElement(t.elt("URL",i,r+t.offset)),r+t.offset)}}]},iJ=[FK,KK,HK,tJ];function M4(t,e,i){return(n,s,r)=>{if(s!=t||n.char(r+1)==t)return-1;let o=[n.elt(i,r,r+1)];for(let l=r+1;l<n.end;l++){let c=n.char(l);if(c==t)return n.addElement(n.elt(e,r,l+1,o.concat(n.elt(i,l,l+1))));if(c==92&&o.push(n.elt("Escape",l,l+++2)),Ds(c))break}return-1}}const nJ={defineNodes:[{name:"Superscript",style:V.special(V.content)},{name:"SuperscriptMark",style:V.processingInstruction}],parseInline:[{name:"Superscript",parse:M4(94,"Superscript","SuperscriptMark")}]},sJ={defineNodes:[{name:"Subscript",style:V.special(V.content)},{name:"SubscriptMark",style:V.processingInstruction}],parseInline:[{name:"Subscript",parse:M4(126,"Subscript","SubscriptMark")}]},rJ={defineNodes:[{name:"Emoji",style:V.character}],parseInline:[{name:"Emoji",parse(t,e,i){let n;return e!=58||!(n=/^[a-zA-Z_0-9]+:/.exec(t.slice(i+1,t.end)))?-1:t.addElement(t.elt("Emoji",i,i+1+n[0].length))}}]};var zM={};class Wg{constructor(e,i,n,s,r,o,l,c,u,d=0,p){this.p=e,this.stack=i,this.state=n,this.reducePos=s,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=c,this.curContext=u,this.lookAhead=d,this.parent=p}toString(){return`[${this.stack.filter((e,i)=>i%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,i,n=0){let s=e.parser.context;return new Wg(e,[],i,n,n,0,[],0,s?new NM(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,i){this.stack.push(this.state,i,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var i;let n=e>>19,s=e&65535,{parser:r}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),l=r.dynamicPrecedence(s);if(l&&(this.score+=l),n==0){this.pushState(r.getGoto(this.state,s,!0),this.reducePos),s<r.minRepeatTerm&&this.storeNode(s,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(s,this.reducePos);return}let c=this.stack.length-(n-1)*3-(e&262144?6:0),u=c?this.stack[c-2]:this.p.ranges[0].from,d=this.reducePos-u;d>=2e3&&!(!((i=this.p.parser.nodeSet.types[s])===null||i===void 0)&&i.isAnonymous)&&(u==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=d):this.p.lastBigReductionSize<d&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=u,this.p.lastBigReductionSize=d));let p=c?this.stack[c-1]:0,g=this.bufferBase+this.buffer.length-p;if(s<r.minRepeatTerm||e&131072){let O=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(s,u,O,g+4,!0)}if(e&262144)this.state=this.stack[c];else{let O=this.stack[c-3];this.state=r.getGoto(O,s,!0)}for(;this.stack.length>c;)this.stack.pop();this.reduceContext(s,u)}storeNode(e,i,n,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,l=this.buffer.length;if(l==0&&o.parent&&(l=o.bufferBase-o.parent.bufferBase,o=o.parent),l>0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(i==n)return;if(o.buffer[l-2]>=i){o.buffer[l-2]=n;return}}}if(!r||this.pos==n)this.buffer.push(e,i,n,s);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let l=!1;for(let c=o;c>0&&this.buffer[c-2]>n;c-=4)if(this.buffer[c-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4)}this.buffer[o]=e,this.buffer[o+1]=i,this.buffer[o+2]=n,this.buffer[o+3]=s}}shift(e,i,n,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let r=e,{parser:o}=this.p;this.pos=s;let l=o.stateFlag(r,1);!l&&(s>n||i<=o.maxNode)&&(this.reducePos=s),this.pushState(r,l?n:Math.min(n,this.reducePos)),this.shiftContext(i,n),i<=o.maxNode&&this.buffer.push(i,n,s,4)}else this.pos=s,this.shiftContext(i,n),i<=this.p.parser.maxNode&&this.buffer.push(i,n,s,4)}apply(e,i,n,s){e&65536?this.reduce(e):this.shift(e,i,n,s)}useNode(e,i){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(i,s),this.buffer.push(n,s,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,i=e.buffer.length;for(;i>0&&e.buffer[i-2]>e.reducePos;)i-=4;let n=e.buffer.slice(i),s=e.bufferBase+i;for(;e&&s==e.bufferBase;)e=e.parent;return new Wg(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,i){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,i,4),this.storeNode(0,this.pos,i,n?8:4),this.pos=this.reducePos=i,this.score-=190}canShift(e){for(let i=new oJ(this);;){let n=this.p.parser.stateSlot(i.state,4)||this.p.parser.hasAction(i.state,e);if(n==0)return!1;if((n&65536)==0)return!0;i.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let i=this.p.parser.nextStates(this.state);if(i.length>8||this.stack.length>=120){let s=[];for(let r=0,o;r<i.length;r+=2)(o=i[r+1])!=this.state&&this.p.parser.hasAction(o,e)&&s.push(i[r],o);if(this.stack.length<120)for(let r=0;s.length<8&&r<i.length;r+=2){let o=i[r+1];s.some((l,c)=>c&1&&l==o)||s.push(i[r],o)}i=s}let n=[];for(let s=0;s<i.length&&n.length<4;s+=2){let r=i[s+1];if(r==this.state)continue;let o=this.split();o.pushState(r,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(i[s],this.pos),o.reducePos=this.pos,o.score-=200,n.push(o)}return n}forceReduce(){let{parser:e}=this.p,i=e.stateSlot(this.state,5);if((i&65536)==0)return!1;if(!e.validAction(this.state,i)){let n=i>>19,s=i&65535,r=this.stack.length-n*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;i=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(i),!0}findForcedReduction(){let{parser:e}=this.p,i=[],n=(s,r)=>{if(!i.includes(s))return i.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let c=o&65535,u=this.stack.length-l*3;if(u>=0&&e.getGoto(this.stack[u],c,!1)>=0)return l<<19|65536|c}}else{let l=n(o,r+1);if(l!=null)return l}})};return n(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 i=0;i<this.stack.length;i+=3)if(this.stack[i]!=e.stack[i])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,i){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(i)))}reduceContext(e,i){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(i)))}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 i=new NM(this.curContext.tracker,e);i.hash!=this.curContext.hash&&this.emitContext(),this.curContext=i}}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 NM{constructor(e,i){this.tracker=e,this.context=i,this.hash=e.strict?e.hash(i):0}}class oJ{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let i=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],i,!0);this.state=s}}class Ug{constructor(e,i,n){this.stack=e,this.pos=i,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,i=e.bufferBase+e.buffer.length){return new Ug(e,i,i-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 Ug(this.stack,this.pos,this.index)}}function ef(t,e=Uint16Array){if(typeof t!="string")return t;let i=null;for(let n=0,s=0;n<t.length;){let r=0;for(;;){let o=t.charCodeAt(n++),l=!1;if(o==126){r=65535;break}o>=92&&o--,o>=34&&o--;let c=o-32;if(c>=46&&(c-=46,l=!0),r+=c,l)break;r*=46}i?i[s++]=r:i=new e(r)}return i}class Fm{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const jM=new Fm;class aJ{constructor(e,i){this.input=e,this.ranges=i,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=jM,this.rangeIndex=0,this.pos=this.chunkPos=i[0].from,this.range=i[0],this.end=i[i.length-1].to,this.readNext()}resolveOffset(e,i){let n=this.range,s=this.rangeIndex,r=this.pos+e;for(;r<n.from;){if(!s)return null;let o=this.ranges[--s];r-=n.from-o.to,n=o}for(;i<0?r>n.to:r>=n.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-n.to,n=o}return r}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let i of this.ranges)if(i.to>e)return Math.max(e,i.from);return this.end}peek(e){let i=this.chunkOff+e,n,s;if(i>=0&&i<this.chunk.length)n=this.pos+e,s=this.chunk.charCodeAt(i);else{let r=this.resolveOffset(e,1);if(r==null)return-1;if(n=r,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)s=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=n;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),s=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),s}acceptToken(e,i=0){let n=i?this.resolveOffset(i,-1):this.pos;if(n==null||n<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=n}acceptTokenTo(e,i){this.token.value=e,this.token.end=i}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:i}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=i,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),i=this.pos+e.length;this.chunk=i>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,i){if(i?(this.token=i,i.start=e,i.lookAhead=e+1,i.value=i.extended=-1):this.token=jM,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,i){if(e>=this.chunkPos&&i<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,i-this.chunkPos);if(e>=this.chunk2Pos&&i<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,i-this.chunk2Pos);if(e>=this.range.from&&i<=this.range.to)return this.input.read(e,i);let n="";for(let s of this.ranges){if(s.from>=i)break;s.to>e&&(n+=this.input.read(Math.max(s.from,e),Math.min(s.to,i)))}return n}}class Jc{constructor(e,i){this.data=e,this.id=i}token(e,i){let{parser:n}=i.p;P4(this.data,e,i,this.id,n.data,n.tokenPrecTable)}}Jc.prototype.contextual=Jc.prototype.fallback=Jc.prototype.extend=!1;class Yg{constructor(e,i,n){this.precTable=i,this.elseToken=n,this.data=typeof e=="string"?ef(e):e}token(e,i){let n=e.pos,s=0;for(;;){let r=e.next<0,o=e.resolveOffset(1,1);if(P4(this.data,e,i,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(r||s++,o==null)break;e.reset(o,e.token)}s&&(e.reset(n,e.token),e.acceptToken(this.elseToken,s))}}Yg.prototype.contextual=Jc.prototype.fallback=Jc.prototype.extend=!1;class os{constructor(e,i={}){this.token=e,this.contextual=!!i.contextual,this.fallback=!!i.fallback,this.extend=!!i.extend}}function P4(t,e,i,n,s,r){let o=0,l=1<<n,{dialect:c}=i.p.parser;e:for(;(l&t[o])!=0;){let u=t[o+1];for(let O=o+3;O<u;O+=2)if((t[O+1]&l)>0){let _=t[O];if(c.allows(_)&&(e.token.value==-1||e.token.value==_||lJ(_,e.token.value,s,r))){e.acceptToken(_);break}}let d=e.next,p=0,g=t[o+2];if(e.next<0&&g>p&&t[u+g*3-3]==65535){o=t[u+g*3-1];continue e}for(;p<g;){let O=p+g>>1,_=u+O+(O<<1),b=t[_],x=t[_+1]||65536;if(d<b)g=O;else if(d>=x)p=O+1;else{o=t[_+2],e.advance();continue e}}break}}function IM(t,e,i){for(let n=e,s;(s=t[n])!=65535;n++)if(s==i)return n-e;return-1}function lJ(t,e,i,n){let s=IM(i,n,e);return s<0||IM(i,n,t)<s}const Fn=typeof process<"u"&&zM&&/\bparse\b/.test(zM.LOG);let G_=null;function VM(t,e,i){let n=t.cursor(ut.IncludeAnonymous);for(n.moveTo(e);;)if(!(i<0?n.childBefore(e):n.childAfter(e)))for(;;){if((i<0?n.to<e:n.from>e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(t.length,Math.max(n.from+1,e+25));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class cJ{constructor(e,i){this.fragments=e,this.nodeSet=i,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?VM(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?VM(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 i=this.trees.length-1;if(i<0)return this.nextFragment(),null;let n=this.trees[i],s=this.index[i];if(s==n.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=n.children[s],o=this.start[i]+n.positions[s];if(o>e)return this.nextStart=o,null;if(r instanceof ct){if(o==e){if(o<this.safeFrom)return null;let l=o+r.length;if(l<=this.safeTo){let c=r.prop(Ne.lookAhead);if(!c||l+c<this.fragment.to)return r}}this.index[i]++,o+r.length>=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[i]++,this.nextStart=o+r.length}}}class hJ{constructor(e,i){this.stream=i,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Fm)}getActions(e){let i=0,n=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,c=0;for(let u=0;u<r.length;u++){if((1<<u&o)==0)continue;let d=r[u],p=this.tokens[u];if(!(n&&!d.fallback)&&((d.contextual||p.start!=e.pos||p.mask!=o||p.context!=l)&&(this.updateCachedToken(p,d,e),p.mask=o,p.context=l),p.lookAhead>p.end+25&&(c=Math.max(p.lookAhead,c)),p.value!=0)){let g=i;if(p.extended>-1&&(i=this.addActions(e,p.extended,p.end,i)),i=this.addActions(e,p.value,p.end,i),!d.extend&&(n=p,i>g))break}}for(;this.actions.length>i;)this.actions.pop();return c&&e.setLookAhead(c),!n&&e.pos==this.stream.end&&(n=new Fm,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,i=this.addActions(e,n.value,n.end,i)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let i=new Fm,{pos:n,p:s}=e;return i.start=n,i.end=Math.min(n+1,s.stream.end),i.value=n==s.stream.end?s.parser.eofTerm:0,i}updateCachedToken(e,i,n){let s=this.stream.clipPos(n.pos);if(i.token(this.stream.reset(s,e),n),e.value>-1){let{parser:r}=n.p;for(let o=0;o<r.specialized.length;o++)if(r.specialized[o]==e.value){let l=r.specializers[o](this.stream.read(e.start,e.end),n);if(l>=0&&n.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(s+1)}putAction(e,i,n,s){for(let r=0;r<s;r+=3)if(this.actions[r]==e)return s;return this.actions[s++]=e,this.actions[s++]=i,this.actions[s++]=n,s}addActions(e,i,n,s){let{state:r}=e,{parser:o}=e.p,{data:l}=o;for(let c=0;c<2;c++)for(let u=o.stateSlot(r,c?2:1);;u+=3){if(l[u]==65535)if(l[u+1]==1)u=ho(l,u+2);else{s==0&&l[u+1]==2&&(s=this.putAction(ho(l,u+2),i,n,s));break}l[u]==i&&(s=this.putAction(ho(l,u+1),i,n,s))}return s}}class uJ{constructor(e,i,n,s){this.parser=e,this.input=i,this.ranges=s,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 aJ(i,s),this.tokens=new hJ(e,this.stream),this.topTerm=e.top[1];let{from:r}=s[0];this.stacks=[Wg.start(this,e.top[0],r)],this.fragments=n.length&&this.stream.end-r>e.bufferLength*4?new cJ(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,i=this.minStackPos,n=this.stacks=[],s,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let l=e[o];for(;;){if(this.tokens.mainToken=null,l.pos>i)n.push(l);else{if(this.advanceStack(l,n,e))continue;{s||(s=[],r=[]),s.push(l);let c=this.tokens.getMainToken(l);r.push(c.value,c.end)}}break}}if(!n.length){let o=s&&dJ(s);if(o)return Fn&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Fn&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+i);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,n);if(o)return Fn&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,c)=>c.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>i)&&this.recovering--}else if(n.length>1){e:for(let o=0;o<n.length-1;o++){let l=n[o];for(let c=o+1;c<n.length;c++){let u=n[c];if(l.sameState(u)||l.buffer.length>500&&u.buffer.length>500)if((l.score-u.score||l.buffer.length-u.buffer.length)>0)n.splice(c--,1);else{n.splice(o--,1);continue e}}}n.length>12&&(n.sort((o,l)=>l.score-o.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let o=1;o<n.length;o++)n[o].pos<this.minStackPos&&(this.minStackPos=n[o].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,i,n){let s=e.pos,{parser:r}=this,o=Fn?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let u=e.curContext&&e.curContext.tracker.strict,d=u?e.curContext.hash:0;for(let p=this.fragments.nodeAt(s);p;){let g=this.parser.nodeSet.types[p.type.id]==p.type?r.getGoto(e.state,p.type.id):-1;if(g>-1&&p.length&&(!u||(p.prop(Ne.contextHash)||0)==d))return e.useNode(p,g),Fn&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(p.type.id)})`),!0;if(!(p instanceof ct)||p.children.length==0||p.positions[0]>0)break;let O=p.children[0];if(O instanceof ct&&p.positions[0]==0)p=O;else break}}let l=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),Fn&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let c=this.tokens.getActions(e);for(let u=0;u<c.length;){let d=c[u++],p=c[u++],g=c[u++],O=u==c.length||!n,_=O?e:e.split(),b=this.tokens.mainToken;if(_.apply(d,p,b?b.start:_.pos,g),Fn&&console.log(o+this.stackID(_)+` (via ${(d&65536)==0?"shift":`reduce of ${r.getName(d&65535)}`} for ${r.getName(p)} @ ${s}${_==e?"":", split"})`),O)return!0;_.pos>s?i.push(_):n.push(_)}return!1}advanceFully(e,i){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return XM(e,i),!0}}runRecovery(e,i,n){let s=null,r=!1;for(let o=0;o<e.length;o++){let l=e[o],c=i[o<<1],u=i[(o<<1)+1],d=Fn?this.stackID(l)+" -> ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),Fn&&console.log(d+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let p=l.split(),g=d;for(let O=0;O<10&&p.forceReduce()&&(Fn&&console.log(g+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,n));O++)Fn&&(g=this.stackID(p)+" -> ");for(let O of l.recoverByInsert(c))Fn&&console.log(d+this.stackID(O)+" (via recover-insert)"),this.advanceFully(O,n);this.stream.end>l.pos?(u==l.pos&&(u++,c=0),l.recoverByDelete(c,u),Fn&&console.log(d+this.stackID(l)+` (via recover-delete ${this.parser.getName(c)})`),XM(l,n)):(!s||s.score<p.score)&&(s=p)}return s}stackToTree(e){return e.close(),ct.build({buffer:Ug.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 i=(G_||(G_=new WeakMap)).get(e);return i||G_.set(e,i=String.fromCodePoint(this.nextStackID++)),i+e}}function XM(t,e){for(let i=0;i<e.length;i++){let n=e[i];if(n.pos==t.pos&&n.sameState(t)){e[i].score<t.score&&(e[i]=t);return}}e.push(t)}class fJ{constructor(e,i,n){this.source=e,this.flags=i,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}}const K_=t=>t;class R4{constructor(e){this.start=e.start,this.shift=e.shift||K_,this.reduce=e.reduce||K_,this.reuse=e.reuse||K_,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class fh extends Fx{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let i=e.nodeNames.split(" ");this.minRepeatTerm=i.length;for(let l=0;l<e.repeatNodeCount;l++)i.push("");let n=Object.keys(e.topRules).map(l=>e.topRules[l][1]),s=[];for(let l=0;l<i.length;l++)s.push([]);function r(l,c,u){s[l].push([c,c.deserialize(String(u))])}if(e.nodeProps)for(let l of e.nodeProps){let c=l[0];typeof c=="string"&&(c=Ne[c]);for(let u=1;u<l.length;){let d=l[u++];if(d>=0)r(d,c,l[u++]);else{let p=l[u+-d];for(let g=-d;g>0;g--)r(l[u++],c,p);u++}}}this.nodeSet=new pd(i.map((l,c)=>_i.define({name:c>=this.minRepeatTerm?void 0:l,id:c,props:s[c],top:n.indexOf(c)>-1,error:c==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(c)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=RB;let o=ef(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(ZM),this.states=ef(e.states,Uint32Array),this.data=ef(e.stateData),this.goto=ef(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(l=>typeof l=="number"?new Jc(o,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,i,n){let s=new uJ(this,e,i,n);for(let r of this.wrappers)s=r(s,e,i,n);return s}getGoto(e,i,n=!1){let s=this.goto;if(i>=s[0])return-1;for(let r=s[i+1];;){let o=s[r++],l=o&1,c=s[r++];if(l&&n)return c;for(let u=r+(o>>1);r<u;r++)if(s[r]==e)return c;if(l)return-1}}hasAction(e,i){let n=this.data;for(let s=0;s<2;s++)for(let r=this.stateSlot(e,s?2:1),o;;r+=3){if((o=n[r])==65535)if(n[r+1]==1)o=n[r=ho(n,r+2)];else{if(n[r+1]==2)return ho(n,r+2);break}if(o==i||o==0)return ho(n,r+1)}return 0}stateSlot(e,i){return this.states[e*6+i]}stateFlag(e,i){return(this.stateSlot(e,0)&i)>0}validAction(e,i){return!!this.allActions(e,n=>n==i?!0:null)}allActions(e,i){let n=this.stateSlot(e,4),s=n?i(n):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=ho(this.data,r+2);else break;s=i(ho(this.data,r+1))}return s}nextStates(e){let i=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=ho(this.data,n+2);else break;if((this.data[n+2]&1)==0){let s=this.data[n+1];i.some((r,o)=>o&1&&r==s)||i.push(this.data[n],s)}}return i}configure(e){let i=Object.assign(Object.create(fh.prototype),this);if(e.props&&(i.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);i.top=n}return e.tokenizers&&(i.tokenizers=this.tokenizers.map(n=>{let s=e.tokenizers.find(r=>r.from==n);return s?s.to:n})),e.specializers&&(i.specializers=this.specializers.slice(),i.specializerSpecs=this.specializerSpecs.map((n,s)=>{let r=e.specializers.find(l=>l.from==n.external);if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return i.specializers[s]=ZM(o),o})),e.contextTracker&&(i.context=e.contextTracker),e.dialect&&(i.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(i.strict=e.strict),e.wrap&&(i.wrappers=i.wrappers.concat(e.wrap)),e.bufferLength!=null&&(i.bufferLength=e.bufferLength),i}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 i=this.dynamicPrecedences;return i==null?0:i[e]||0}parseDialect(e){let i=Object.keys(this.dialects),n=i.map(()=>!1);if(e)for(let r of e.split(" ")){let o=i.indexOf(r);o>=0&&(n[o]=!0)}let s=null;for(let r=0;r<i.length;r++)if(!n[r])for(let o=this.dialects[i[r]],l;(l=this.data[o++])!=65535;)(s||(s=new Uint8Array(this.maxTerm+1)))[l]=1;return new fJ(e,n,s)}static deserialize(e){return new fh(e)}}function ho(t,e){return t[e]|t[e+1]<<16}function dJ(t){let e=null;for(let i of t){let n=i.p.stoppedAt;(i.pos==i.p.stream.end||n!=null&&i.pos>n)&&i.p.parser.stateFlag(i.state,2)&&(!e||e.score<i.score)&&(e=i)}return e}function ZM(t){if(t.external){let e=t.extend?1:0;return(i,n)=>t.external(i,n)<<1|e}return t.get}const pJ=55,mJ=1,gJ=56,OJ=2,vJ=57,_J=3,qM=4,yJ=5,bw=6,Q4=7,L4=8,D4=9,B4=10,bJ=11,SJ=12,xJ=13,J_=58,wJ=14,CJ=15,WM=59,$4=21,kJ=23,z4=24,TJ=25,Ib=27,N4=28,AJ=29,EJ=32,MJ=35,PJ=37,RJ=38,QJ=0,LJ=1,DJ={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},BJ={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},UM={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 $J(t){return t==45||t==46||t==58||t>=65&&t<=90||t==95||t>=97&&t<=122||t>=161}let YM=null,HM=null,FM=0;function Vb(t,e){let i=t.pos+e;if(FM==i&&HM==t)return YM;let n=t.peek(e),s="";for(;$J(n);)s+=String.fromCharCode(n),n=t.peek(++e);return HM=t,FM=i,YM=s?s.toLowerCase():n==zJ||n==NJ?void 0:null}const j4=60,Hg=62,Sw=47,zJ=63,NJ=33,jJ=45;function GM(t,e){this.name=t,this.parent=e}const IJ=[bw,B4,Q4,L4,D4],VJ=new R4({start:null,shift(t,e,i,n){return IJ.indexOf(e)>-1?new GM(Vb(n,1)||"",t):t},reduce(t,e){return e==$4&&t?t.parent:t},reuse(t,e,i,n){let s=e.type.id;return s==bw||s==PJ?new GM(Vb(n,1)||"",t):t},strict:!1}),XJ=new os((t,e)=>{if(t.next!=j4){t.next<0&&e.context&&t.acceptToken(J_);return}t.advance();let i=t.next==Sw;i&&t.advance();let n=Vb(t,0);if(n===void 0)return;if(!n)return t.acceptToken(i?CJ:wJ);let s=e.context?e.context.name:null;if(i){if(n==s)return t.acceptToken(bJ);if(s&&BJ[s])return t.acceptToken(J_,-2);if(e.dialectEnabled(QJ))return t.acceptToken(SJ);for(let r=e.context;r;r=r.parent)if(r.name==n)return;t.acceptToken(xJ)}else{if(n=="script")return t.acceptToken(Q4);if(n=="style")return t.acceptToken(L4);if(n=="textarea")return t.acceptToken(D4);if(DJ.hasOwnProperty(n))return t.acceptToken(B4);s&&UM[s]&&UM[s][n]?t.acceptToken(J_,-1):t.acceptToken(bw)}},{contextual:!0}),ZJ=new os(t=>{for(let e=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(WM);break}if(t.next==jJ)e++;else if(t.next==Hg&&e>=2){i>=3&&t.acceptToken(WM,-2);break}else e=0;t.advance()}});function qJ(t){for(;t;t=t.parent)if(t.name=="svg"||t.name=="math")return!0;return!1}const WJ=new os((t,e)=>{if(t.next==Sw&&t.peek(1)==Hg){let i=e.dialectEnabled(LJ)||qJ(e.context);t.acceptToken(i?yJ:qM,2)}else t.next==Hg&&t.acceptToken(qM,1)});function xw(t,e,i){let n=2+t.length;return new os(s=>{for(let r=0,o=0,l=0;;l++){if(s.next<0){l&&s.acceptToken(e);break}if(r==0&&s.next==j4||r==1&&s.next==Sw||r>=2&&r<n&&s.next==t.charCodeAt(r-2))r++,o++;else if(r==n&&s.next==Hg){l>o?s.acceptToken(e,-o):s.acceptToken(i,-(o-2));break}else if((s.next==10||s.next==13)&&l){s.acceptToken(e,1);break}else r=o=0;s.advance()}})}const UJ=xw("script",pJ,mJ),YJ=xw("style",gJ,OJ),HJ=xw("textarea",vJ,_J),FJ=_h({"Text RawText IncompleteTag IncompleteCloseTag":V.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":V.angleBracket,TagName:V.tagName,"MismatchedCloseTag/TagName":[V.tagName,V.invalid],AttributeName:V.attributeName,"AttributeValue UnquotedAttributeValue":V.attributeValue,Is:V.definitionOperator,"EntityReference CharacterReference":V.character,Comment:V.blockComment,ProcessingInst:V.processingInstruction,DoctypeDecl:V.documentMeta}),GJ=fh.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/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~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:VJ,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:[FJ],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<%l(t!Q*^V!b`!dpOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!Q*vP;=`<%l*V!R*|P;=`<%l&XW+UYlWOX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+PW+wP;=`<%l+P!Z+}P;=`<%l$q!a,]`aP!b`!dp!_^OX&XXY,QYZ,QZ]&X]^,Q^p&Xpq,Qqr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!_-ljiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q[/ebiSlWOX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+PS0rXiSqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0mS1bP;=`<%l0m[1hP;=`<%l/^!V1vciSaP!b`!dpOq&Xqr1krs&}sv1kvw0mwx(tx!P1k!P!Q&X!Q!^1k!^!_*V!_!a&X!a#s1k#s$f&X$f;'S1k;'S;=`3R<%l?Ah1k?Ah?BY&X?BY?Mn1k?MnO&X!V3UP;=`<%l1k!_3[P;=`<%l-_!Z3hV!ahaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}!_4WiiSlWd!ROX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst>]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!V<QciSOp7Sqr;{rs7Sst0mtw;{wx7Sx!P;{!P!Q7S!Q!];{!]!^=]!^!a7S!a#s;{#s$f7S$f;'S;{;'S;=`>P<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'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:[UJ,YJ,HJ,WJ,XJ,ZJ,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function I4(t,e){let i=Object.create(null);for(let n of t.getChildren(z4)){let s=n.getChild(TJ),r=n.getChild(Ib)||n.getChild(N4);s&&(i[e.read(s.from,s.to)]=r?r.type.id==Ib?e.read(r.from+1,r.to-1):e.read(r.from,r.to):"")}return i}function KM(t,e){let i=t.getChild(kJ);return i?e.read(i.from,i.to):" "}function ey(t,e,i){let n;for(let s of i)if(!s.attrs||s.attrs(n||(n=I4(t.node.parent.firstChild,e))))return{parser:s.parser,bracketed:!0};return null}function V4(t=[],e=[]){let i=[],n=[],s=[],r=[];for(let l of t)(l.tag=="script"?i:l.tag=="style"?n:l.tag=="textarea"?s:r).push(l);let o=e.length?Object.create(null):null;for(let l of e)(o[l.name]||(o[l.name]=[])).push(l);return $B((l,c)=>{let u=l.type.id;if(u==AJ)return ey(l,c,i);if(u==EJ)return ey(l,c,n);if(u==MJ)return ey(l,c,s);if(u==$4&&r.length){let d=l.node,p=d.firstChild,g=p&&KM(p,c),O;if(g){for(let _ of r)if(_.tag==g&&(!_.attrs||_.attrs(O||(O=I4(p,c))))){let b=d.lastChild,x=b.type.id==RJ?b.from:d.to;if(x>p.to)return{parser:_.parser,overlay:[{from:p.to,to:x}]}}}}if(o&&u==z4){let d=l.node,p;if(p=d.firstChild){let g=o[c.read(p.from,p.to)];if(g)for(let O of g){if(O.tagName&&O.tagName!=KM(d.parent,c))continue;let _=d.lastChild;if(_.type.id==Ib){let b=_.from+1,x=_.lastChild,w=_.to-(x&&x.isError?0:1);if(w>b)return{parser:O.parser,overlay:[{from:b,to:w}],bracketed:!0}}else if(_.type.id==N4)return{parser:O.parser,overlay:[{from:_.from,to:_.to}]}}}}return null})}const KJ=122,JM=1,JJ=123,eee=124,X4=2,tee=125,iee=3,nee=4,Z4=[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],see=58,ree=40,q4=95,oee=91,Gm=45,aee=46,lee=35,cee=37,hee=38,uee=92,fee=10,dee=42;function Kf(t){return t>=65&&t<=90||t>=97&&t<=122||t>=161}function ww(t){return t>=48&&t<=57}function eP(t){return ww(t)||t>=97&&t<=102||t>=65&&t<=70}const W4=(t,e,i)=>(n,s)=>{for(let r=!1,o=0,l=0;;l++){let{next:c}=n;if(Kf(c)||c==Gm||c==q4||r&&ww(c))!r&&(c!=Gm||l>0)&&(r=!0),o===l&&c==Gm&&o++,n.advance();else if(c==uee&&n.peek(1)!=fee){if(n.advance(),eP(n.next)){do n.advance();while(eP(n.next));n.next==32&&n.advance()}else n.next>-1&&n.advance();r=!0}else{r&&n.acceptToken(o==2&&s.canShift(X4)?e:c==ree?i:t);break}}},pee=new os(W4(JJ,X4,eee)),mee=new os(W4(tee,iee,nee)),gee=new os(t=>{if(Z4.includes(t.peek(-1))){let{next:e}=t;(Kf(e)||e==q4||e==lee||e==aee||e==dee||e==oee||e==see&&Kf(t.peek(1))||e==Gm||e==hee)&&t.acceptToken(KJ)}}),Oee=new os(t=>{if(!Z4.includes(t.peek(-1))){let{next:e}=t;if(e==cee&&(t.advance(),t.acceptToken(JM)),Kf(e)){do t.advance();while(Kf(t.next)||ww(t.next));t.acceptToken(JM)}}}),vee=_h({"AtKeyword import charset namespace keyframes media supports":V.definitionKeyword,"from to selector":V.keyword,NamespaceName:V.namespace,KeyframeName:V.labelName,KeyframeRangeName:V.operatorKeyword,TagName:V.tagName,ClassName:V.className,PseudoClassName:V.constant(V.className),IdName:V.labelName,"FeatureName PropertyName":V.propertyName,AttributeName:V.attributeName,NumberLiteral:V.number,KeywordQuery:V.keyword,UnaryQueryOp:V.operatorKeyword,"CallTag ValueName":V.atom,VariableName:V.variableName,Callee:V.operatorKeyword,Unit:V.unit,"UniversalSelector NestingSelector":V.definitionOperator,"MatchOp CompareOp":V.compareOperator,"ChildOp SiblingOp, LogicOp":V.logicOperator,BinOp:V.arithmeticOperator,Important:V.modifier,Comment:V.blockComment,ColorLiteral:V.color,"ParenthesizedContent StringLiteral":V.string,":":V.punctuation,"PseudoOp #":V.derefOperator,"; ,":V.separator,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace}),_ee={__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},yee={__proto__:null,or:98,and:98,not:106,only:106,layer:170},bee={__proto__:null,selector:112,layer:166},See={__proto__:null,"@import":162,"@media":174,"@charset":178,"@namespace":182,"@keyframes":188,"@supports":200,"@scope":204},xee={__proto__:null,to:207},wee=fh.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)|QdO,59VO%TQdO,5:[O%YQdO,5:^O%_QdO,5:aO%_QdO,5:cO%_QdO,5:dO%_QdO'#ErO*XQ`O,58}O*aQdO'#DzOOQS,58},58}OOQP'#Cn'#CnOOQO'#Dn'#DnOOQP,59V,59VO*hQ`O,59VO*mQ`O,59VOOQP'#Dq'#DqOOQP,5:[,5:[OOQO'#Ds'#DsO*rQpO,5:^O+]QaO,5:aO+sQaO,5:dOOQW'#DZ'#DZO,ZQhO'#DdO,xQhO'#FaO'tQhO'#DbO-WQ`O'#DhOOQW'#F['#F[O-]Q`O,5;SO-eQ`O'#DeOOQS-E8i-E8iOOQ['#Cs'#CsO-jQdO'#CtO.QQdO'#CzO.hQdO'#C}O/OQ!pO'#DPO1RQ!jO,5:jOOQO'#DU'#DUO*mQ`O'#DTO1cQ!nO'#FXO3`Q`O'#DVO3eQ`O'#DkOOQ['#FX'#FXO-`Q`O,5:pO3jQ!bO,5:rOOQS'#E['#E[O3rQ`O,5:tO3wQdO,5:tOOQO'#E_'#E_O4PQ`O,5:wO4UQhO,5:}O%_QdO'#DgOOQS,5;P,5;PO-eQ`O,5;PO4^QdO,5;PO4fQdO,5:gO4vQdO'#EtO5TQ`O,5;zO5TQ`O,5;zPOOO'#Ej'#EjP5`O&jO,58{POOO,58{,58{OOQP1G.n1G.nOOQP1G.q1G.qO*hQ`O1G.qO*mQ`O1G.qOOQP1G/v1G/vO5kQpO1G/xO5sQaO1G/{O6ZQaO1G/}O6qQaO1G0OO7XQaO,5;^OOQO-E8p-E8pOOQS1G.i1G.iO7cQ`O,5:fO7hQdO'#DoO7oQdO'#CrOOQP1G/x1G/xO&lQdO1G/xO7vQ!jO'#DZO8UQ!bO,59vO8^QhO,5:OOOQO'#F]'#F]O8XQ!bO,59zO'tQhO,59xO8fQhO'#EvO8sQ`O,5;{O9OQhO,59|O9uQhO'#DiOOQW,5:S,5:SOOQS1G0n1G0nOOQW,5:P,5:PO9|Q!fO'#FYOOQS'#FY'#FYOOQS'#Em'#EmO;^QdO,59`OOQ[,59`,59`O;tQdO,59fOOQ[,59f,59fO<[QdO,59iOOQ[,59i,59iOOQ[,59k,59kO&lQdO,59mO<rQhO'#EQOOQW'#EQ'#EQO=WQ`O1G0UO1[QhO1G0UOOQ[,59o,59oO'tQhO'#DXOOQ[,59q,59qO=]Q#tO,5:VOOQS1G0[1G0[OOQS1G0^1G0^OOQS1G0`1G0`O=hQ`O1G0`O=mQdO'#E`OOQS1G0c1G0cOOQS1G0i1G0iO=xQaO,5:RO-`Q`O1G0kOOQS1G0k1G0kO-eQ`O1G0kO>PQ!fO1G0ROOQO1G0R1G0ROOQO,5;`,5;`O>gQdO,5;`OOQO-E8r-E8rO>tQ`O1G1fPOOO-E8h-E8hPOOO1G.g1G.gOOQP7+$]7+$]OOQP7+%d7+%dO&lQdO7+%dOOQS1G0Q1G0QO?PQaO'#F_O?ZQ`O,5:ZO?`Q!fO'#ElO@^QdO'#FWO@hQ`O,59^O@mQ!bO7+%dO&lQdO1G/bO@uQhO1G/fOOQW1G/j1G/jOOQW1G/d1G/dOAWQhO,5;bOOQO-E8t-E8tOAfQhO'#DZOAtQhO'#F^OBPQ`O'#F^OBUQ`O,5:TOOQS-E8k-E8kOOQ[1G.z1G.zOOQ[1G/Q1G/QOOQ[1G/T1G/TOOQ[1G/X1G/XOBZQdO,5:lOOQS7+%p7+%pOB`Q`O7+%pOBeQhO'#DYOBmQ`O,59sO'tQhO,59sOOQ[1G/q1G/qOBuQ`O1G/qOOQS7+%z7+%zOBzQbO'#DPOOQO'#Eb'#EbOCYQ`O'#EaOOQO'#Ea'#EaOCeQ`O'#EwOCmQdO,5:zOOQS,5:z,5:zOOQ[1G/m1G/mOOQS7+&V7+&VO-`Q`O7+&VOCxQ!fO'#EsO&lQdO'#EsOEPQdO7+%mOOQO7+%m7+%mOOQO1G0z1G0zOEdQ!bO<<IOOElQdO'#EqOEvQ`O,5;yOOQP1G/u1G/uOOQS-E8j-E8jOFOQdO'#EpOFYQ`O,5;rOOQ]1G.x1G.xOOQP<<IO<<IOOFbQdO7+$|OOQO'#D]'#D]OFiQ!bO7+%QOFqQhO'#EoOF{Q`O,5;xO&lQdO,5;xOOQW1G/o1G/oOOQO'#ES'#ESOGTQ`O1G0WOOQS<<I[<<I[O&lQdO,59tOGnQhO1G/_OOQ[1G/_1G/_OGuQ`O1G/_OOQW-E8l-E8lOOQ[7+%]7+%]OOQO,5:{,5:{O=pQdO'#ExOCeQ`O,5;cOOQS,5;c,5;cOOQS-E8u-E8uOOQS1G0f1G0fOOQS<<Iq<<IqOG}Q!fO,5;_OOQS-E8q-E8qOOQO<<IX<<IXOOQPAN>jAN>jOIUQaO,5;]OOQO-E8o-E8oOI`QdO,5;[OOQO-E8n-E8nOOQW<<Hh<<HhOOQW<<Hl<<HlOIjQhO<<HlOI{QhO,5;ZOJWQ`O,5;ZOOQO-E8m-E8mOJ]QdO1G1dOBZQdO'#EuOJgQ`O7+%rOOQW7+%r7+%rOJoQ!bO1G/`OOQ[7+$y7+$yOJzQhO7+$yPKRQ`O'#EnOOQO,5;d,5;dOOQO-E8v-E8vOOQS1G0}1G0}OKWQ`OAN>WO&lQdO1G0uOK]Q`O7+'OOOQO,5;a,5;aOOQO-E8s-E8sOOQW<<I^<<I^OOQ[<<He<<HePOQW,5;Y,5;YOOQWG23rG23rOKeQdO7+&a",stateData:"Kx~O#sOS#tQQ~OW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#oRO~OQiOW[OZ[O]TO`VOaVOi]OjWOmXO!jYO!mZO!saO!ybO!{cO!}dO#QeO#WfO#YgO#ohO~O#m$SP~P!dO#tmO~O#ooO~O]qO`rOarOjsOmtO!juO!mwO#nvO~OpzO!^xO~P$SOc!QO#o|O#p}O~O#o!RO~O#o!TO~OW[OZ[O]TO`VOaVOjWOmXO!jYO!mZO#oRO~OS!]Oe!YO!V![O!Y!`O#q!XOp$TP~Ok$TP~P&POQ!jOe!cOm!dOp!eOr!mOt!mOz!kO!`!lO#o!bO#p!hO#}!fO~Ot!qO!`!lO#o!pO~Ot!sO#o!sO~OS!]Oe!YO!V![O!Y!`O#q!XO~Oe!vOpzO#Z!xO~O]YX`YX`!pXaYXjYXmYXpYX!^YX!jYX!mYX#nYX~O`!zO~Ok!{O#m$SXo$SX~O#m$SXo$SX~P!dO#u#OO#v#OO#w#QO~Oc#UO#o|O#p}O~OpzO!^xO~Oo$SP~P!dOe#`O~Oe#aO~Ol#bO!h#cO~O]qO`rOarOjsOmtO~Op!ia!^!ia!j!ia!m!ia#n!iad!ia~P*zOp!la!^!la!j!la!m!la#n!lad!la~P*zOR#gOS!]Oe!YOr#gOt#gO!V![O!Y!`O#q#dO#}!fO~O!R#iO!^#jOk$TXp$TX~Oe#mO~Ok#oOpzO~Oe!vO~O]#rO`#rOd#uOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl#wO~P&lO]#rO`#rOi#rOj#rOk#rOo#yO~P&lOP#zOSsXesXksXvsX!VsX!YsX!usX!wsX#qsX!TsXQsX]sX`sXdsXisXjsXmsXpsXrsXtsXzsX!`sX#osX#psX#}sXlsXosX!^sX!qsX#msX~Ov#{O!u#|O!w#}Ok$TP~P'tOe#aOS#{Xk#{Xv#{X!V#{X!Y#{X!u#{X!w#{X#q#{XQ#{X]#{X`#{Xd#{Xi#{Xj#{Xm#{Xp#{Xr#{Xt#{Xz#{X!`#{X#o#{X#p#{X#}#{Xl#{Xo#{X!^#{X!q#{X#m#{X~Oe$RO~Oe$TO~Ok$VOv#{O~Ok$WO~Ot$XO!`!lO~Op$YO~OpzO!R#iO~OpzO#Z$`O~O!q$bOk!oa#m!oao!oa~P&lOk#hX#m#hXo#hX~P!dOk!{O#m$Sao$Sa~O#u#OO#v#OO#w$hO~Ol$jO!h$kO~Op!ii!^!ii!j!ii!m!ii#n!iid!ii~P*zOp!ki!^!ki!j!ki!m!ki#n!kid!ki~P*zOp!li!^!li!j!li!m!li#n!lid!li~P*zOp#fa!^#fa~P$SOo$lO~Od$RP~P%_Od#zP~P&lO`!PXd}X!R}X!T!PX~O`$sO!T$tO~Od$uO!R#iO~Ok#jXp#jX!^#jX~P'tO!^#jOk$Tap$Ta~O!R#iOk!Uap!Ua!^!Uad!Ua`!Ua~OS!]Oe!YO!V![O!Y!`O#q$yO~Od$QP~P9dOv#{OQ#|X]#|X`#|Xd#|Xe#|Xi#|Xj#|Xk#|Xm#|Xp#|Xr#|Xt#|Xz#|X!`#|X#o#|X#p#|X#}#|Xl#|Xo#|X~O]#rO`#rOd%OOi#rOj#rOk#rO~P&lO]#rO`#rOi#rOj#rOk#rOl%PO~P&lO]#rO`#rOi#rOj#rOk#rOo%QO~P&lOe%SOS!tXk!tX!V!tX!Y!tX#q!tX~Ok%TO~Od%YOt%ZO!a%ZO~Ok%[O~Oo%cO#o%^O#}%]O~Od%dO~P$SOv#{O!^%hO!q%jOk!oi#m!oio!oi~P&lOk#ha#m#hao#ha~P!dOk!{O#m$Sio$Si~O!^%mOd$RX~P$SOd%oO~Ov#{OQ#`Xd#`Xe#`Xm#`Xp#`Xr#`Xt#`Xz#`X!^#`X!`#`X#o#`X#p#`X#}#`X~O!^%qOd#zX~P&lOd%sO~Ol%tOv#{O~OR#gOr#gOt#gO#q%vO#}!fO~O!R#iOk#jap#ja!^#ja~O`!PXd}X!R}X!^}X~O!R#iO!^%xOd$QX~O`%zO~Od%{O~O#o%|O~Ok&OO~O`&PO!R#iO~Od&ROk&QO~Od&UO~OP#zOpsX!^sXdsX~O#}%]Op#TX!^#TX~OpzO!^&WO~Oo&[O#o%^O#}%]O~Ov#{OQ#gXe#gXk#gXm#gXp#gXr#gXt#gXz#gX!^#gX!`#gX!q#gX#m#gX#o#gX#p#gX#}#gXo#gX~O!^%hO!q&`Ok!oq#m!oqo!oq~P&lOl&aOv#{O~Od#eX!^#eX~P%_O!^%mOd$Ra~Od#dX!^#dX~P&lO!^%qOd#za~Od&fO~P&lOd&gO!T&hO~Od#cX!^#cX~P9dO!^%xOd$Qa~O]&mOd&oO~OS#bae#ba!V#ba!Y#ba#q#ba~Od&qO~PG]Od&qOk&rO~Ov#{OQ#gae#gak#gam#gap#gar#gat#gaz#ga!^#ga!`#ga!q#ga#m#ga#o#ga#p#ga#}#gao#ga~Od#ea!^#ea~P$SOd#da!^#da~P&lOR#gOr#gOt#gO#q%vO#}%]O~O!R#iOd#ca!^#ca~O`&xO~O!^%xOd$Qi~P&lO]&mOd&|O~Ov#{Od|ik|i~Od&}O~PG]Ok'OO~Od'PO~O!^%xOd$Qq~Od#cq!^#cq~P&lO#s!a#t#}]#}v!m~",goto:"2h$UPPPPP$VP$YP$c$uP$cP%X$cPP%_PPP%e%o%oPPPPP%oPP%oP&]P%oP%o'W%oP't'w'}'}(^'}P'}P'}P'}'}P(m'}(yP(|PP)p)v$c)|$c*SP$cP$c$cP*Y*{+YP$YP+aP+dP$YP$YP$YP+j$YP+m+p+s+z$YP$YPP$YP,P,V,f,|-[-b-l-r-x.O.U.`.f.l.rPPPPPPPPPPP.x/R/w/z0|P1U1u2O2R2U2[RnQ_^OP`kz!{$dq[OPYZ`kuvwxz!v!{#`$d%mqSOPYZ`kuvwxz!v!{#`$d%mQpTR#RqQ!OVR#SrQ#S!QS$Q!i!jR$i#U!V!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'Q!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QU#g!Y$t&hU%`$Y%b&WR&V%_!V!iac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QR$S!kQ%W$RR&S%Xk!^]bf!Y![!g#i#j#m$P$R%X%xQ#e!YQ${#mQ%w$tQ&j%xR&w&hQ!ygQ#p!`Q$^!xR%f$`R#n!]!U!mac!c!d!e!z#a#c#t#v#x#{$a$k$p$s%h%i%q%u%z&P&d&l&x'QQ!qdR$X!rQ!PVR#TrQ#S!PR$i#TQ!SWR#VsQ!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:[vee],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'Y$JU$KV%Q$KV$KW'Y$KW&FU%Q&FU&FV'Y&FV;'S%Q;'S;=`%c<%lO%Qj)OUOy%Qz#]%Q#]#^)b#^;'S%Q;'S;=`%c<%lO%Qj)gU!a`Oy%Qz#a%Q#a#b)y#b;'S%Q;'S;=`%c<%lO%Qj*OU!a`Oy%Qz#d%Q#d#e*b#e;'S%Q;'S;=`%c<%lO%Qj*gU!a`Oy%Qz#c%Q#c#d*y#d;'S%Q;'S;=`%c<%lO%Qj+OU!a`Oy%Qz#f%Q#f#g+b#g;'S%Q;'S;=`%c<%lO%Qj+gU!a`Oy%Qz#h%Q#h#i+y#i;'S%Q;'S;=`%c<%lO%Qj,OU!a`Oy%Qz#T%Q#T#U,b#U;'S%Q;'S;=`%c<%lO%Qj,gU!a`Oy%Qz#b%Q#b#c,y#c;'S%Q;'S;=`%c<%lO%Qj-OU!a`Oy%Qz#h%Q#h#i-b#i;'S%Q;'S;=`%c<%lO%Qj-iS!qY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Q~-xWOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c<%lO-u~.gOt~~.jRO;'S-u;'S;=`.s;=`O-u~.vXOY-uZr-urs.bs#O-u#O#P.g#P;'S-u;'S;=`/c;=`<%l-u<%lO-u~/fP;=`<%l-uj/nYjYOy%Qz!Q%Q!Q![0^![!c%Q!c!i0^!i#T%Q#T#Z0^#Z;'S%Q;'S;=`%c<%lO%Qj0cY!a`Oy%Qz!Q%Q!Q![1R![!c%Q!c!i1R!i#T%Q#T#Z1R#Z;'S%Q;'S;=`%c<%lO%Qj1WY!a`Oy%Qz!Q%Q!Q![1v![!c%Q!c!i1v!i#T%Q#T#Z1v#Z;'S%Q;'S;=`%c<%lO%Qj1}YrY!a`Oy%Qz!Q%Q!Q![2m![!c%Q!c!i2m!i#T%Q#T#Z2m#Z;'S%Q;'S;=`%c<%lO%Qj2tYrY!a`Oy%Qz!Q%Q!Q![3d![!c%Q!c!i3d!i#T%Q#T#Z3d#Z;'S%Q;'S;=`%c<%lO%Qj3iY!a`Oy%Qz!Q%Q!Q![4X![!c%Q!c!i4X!i#T%Q#T#Z4X#Z;'S%Q;'S;=`%c<%lO%Qj4`YrY!a`Oy%Qz!Q%Q!Q![5O![!c%Q!c!i5O!i#T%Q#T#Z5O#Z;'S%Q;'S;=`%c<%lO%Qj5TY!a`Oy%Qz!Q%Q!Q![5s![!c%Q!c!i5s!i#T%Q#T#Z5s#Z;'S%Q;'S;=`%c<%lO%Qj5zSrY!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qd6ZUOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qd6tS!hS!a`Oy%Qz;'S%Q;'S;=`%c<%lO%Qb7VSZQOy%Qz;'S%Q;'S;=`%c<%lO%Q~7fWOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z<%lO7c~8RRO;'S7c;'S;=`8[;=`O7c~8_XOY7cZw7cwx.bx#O7c#O#P8O#P;'S7c;'S;=`8z;=`<%l7c<%lO7c~8}P;=`<%l7cj9VSeYOy%Qz;'S%Q;'S;=`%c<%lO%Q~9hOd~n9oUWQvWOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Qj:YWvW!mQOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj:wU!a`Oy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Qj;bY!a`#}YOy%Qz!Q%Q!Q![;Z![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj<VY!a`Oy%Qz{%Q{|<u|}%Q}!O<u!O!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj<zU!a`Oy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj=eU!a`#}YOy%Qz!Q%Q!Q![=^![;'S%Q;'S;=`%c<%lO%Qj>O[!a`#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%Qj>yS!^YOy%Qz;'S%Q;'S;=`%c<%lO%Qj?[WvWOy%Qz!O%Q!O!P:r!P!Q%Q!Q![=w![;'S%Q;'S;=`%c<%lO%Qj?yU]YOy%Qz!Q%Q!Q![;Z![;'S%Q;'S;=`%c<%lO%Q~@bTvWOy%Qz{@q{;'S%Q;'S;=`%c<%lO%Q~@xS!a`#t~Oy%Qz;'S%Q;'S;=`%c<%lO%QjAZ[#}YOy%Qz!O%Q!O!P;Z!P!Q%Q!Q![=w![!g%Q!g!h<Q!h#X%Q#X#Y<Q#Y;'S%Q;'S;=`%c<%lO%QjBUU`YOy%Qz![%Q![!]Bh!];'S%Q;'S;=`%c<%lO%QbBoSaQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjCQSkYOy%Qz;'S%Q;'S;=`%c<%lO%QhCcU!TWOy%Qz!_%Q!_!`Cu!`;'S%Q;'S;=`%c<%lO%QhC|S!TW!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QlDaS!TW!hSOy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[gee,Oee,pee,mee,1,2,3,4,new Yg("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},dynamicPrecedences:{76:1},specialized:[{term:124,get:t=>_ee[t]||-1},{term:125,get:t=>yee[t]||-1},{term:4,get:t=>bee[t]||-1},{term:25,get:t=>See[t]||-1},{term:123,get:t=>xee[t]||-1}],tokenPrec:1963});let ty=null;function iy(){if(!ty&&typeof document=="object"&&document.body){let{style:t}=document.body,e=[],i=new Set;for(let n in t)n!="cssText"&&n!="cssFloat"&&typeof t[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())),i.has(n)||(e.push(n),i.add(n)));ty=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return ty||[]}const tP=["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})),iP=["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}))),Cee=["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})),kee=["@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})),io=/^(\w[\w-]*|-\w[\w-]*|)$/,Tee=/^-(-[\w-]*)?$/;function Aee(t,e){var i;if((t.name=="("||t.type.isError)&&(t=t.parent||t),t.name!="ArgList")return!1;let n=(i=t.parent)===null||i===void 0?void 0:i.firstChild;return(n==null?void 0:n.name)!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}const nP=new BB,Eee=["Declaration"];function Mee(t){for(let e=t;;){if(e.type.isTop)return e;if(!(e=e.parent))return t}}function U4(t,e,i){if(e.to-e.from>4096){let n=nP.get(e);if(n)return n;let s=[],r=new Set,o=e.cursor(ut.IncludeAnonymous);if(o.firstChild())do for(let l of U4(t,o.node,i))r.has(l.label)||(r.add(l.label),s.push(l));while(o.nextSibling());return nP.set(e,s),s}else{let n=[],s=new Set;return e.cursor().iterate(r=>{var o;if(i(r)&&r.matchContext(Eee)&&((o=r.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=t.sliceString(r.from,r.to);s.has(l)||(s.add(l),n.push({label:l,type:"variable"}))}}),n}}const Pee=t=>e=>{let{state:i,pos:n}=e,s=xt(i).resolveInner(n,-1),r=s.type.isError&&s.from==s.to-1&&i.doc.sliceString(s.from,s.to)=="-";if(s.name=="PropertyName"||(r||s.name=="TagName")&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:iy(),validFor:io};if(s.name=="ValueName")return{from:s.from,options:iP,validFor:io};if(s.name=="PseudoClassName")return{from:s.from,options:tP,validFor:io};if(t(s)||(e.explicit||r)&&Aee(s,i.doc))return{from:t(s)||r?s.from:n,options:U4(i.doc,Mee(s),t),validFor:Tee};if(s.name=="TagName"){for(let{parent:c}=s;c;c=c.parent)if(c.name=="Block")return{from:s.from,options:iy(),validFor:io};return{from:s.from,options:Cee,validFor:io}}if(s.name=="AtKeyword")return{from:s.from,options:kee,validFor:io};if(!e.explicit)return null;let o=s.resolve(n),l=o.childBefore(n);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:tP,validFor:io}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:iP,validFor:io}:o.name=="Block"||o.name=="Styles"?{from:n,options:iy(),validFor:io}:null},Ree=Pee(t=>t.name=="VariableName"),Fg=lh.define({name:"css",parser:wee.configure({props:[md.add({Declaration:Ym()}),bh.add({"Block KeyframeList":ZB})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Qee(){return new Vf(Fg,Fg.data.of({autocomplete:Ree}))}const Lee=316,Dee=317,sP=1,Bee=2,$ee=3,zee=4,Nee=318,jee=320,Iee=321,Vee=5,Xee=6,Zee=0,Xb=[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],Y4=125,qee=59,Zb=47,Wee=42,Uee=43,Yee=45,Hee=60,Fee=44,Gee=63,Kee=46,Jee=91,ete=new R4({start:!1,shift(t,e){return e==Vee||e==Xee||e==jee?t:e==Iee},strict:!1}),tte=new os((t,e)=>{let{next:i}=t;(i==Y4||i==-1||e.context)&&t.acceptToken(Nee)},{contextual:!0,fallback:!0}),ite=new os((t,e)=>{let{next:i}=t,n;Xb.indexOf(i)>-1||i==Zb&&((n=t.peek(1))==Zb||n==Wee)||i!=Y4&&i!=qee&&i!=-1&&!e.context&&t.acceptToken(Lee)},{contextual:!0}),nte=new os((t,e)=>{t.next==Jee&&!e.context&&t.acceptToken(Dee)},{contextual:!0}),ste=new os((t,e)=>{let{next:i}=t;if(i==Uee||i==Yee){if(t.advance(),i==t.next){t.advance();let n=!e.context&&e.canShift(sP);t.acceptToken(n?sP:Bee)}}else i==Gee&&t.peek(1)==Kee&&(t.advance(),t.advance(),(t.next<48||t.next>57)&&t.acceptToken($ee))},{contextual:!0});function ny(t,e){return t>=65&&t<=90||t>=97&&t<=122||t==95||t>=192||!e&&t>=48&&t<=57}const rte=new os((t,e)=>{if(t.next!=Hee||!e.dialectEnabled(Zee)||(t.advance(),t.next==Zb))return;let i=0;for(;Xb.indexOf(t.next)>-1;)t.advance(),i++;if(ny(t.next,!0)){for(t.advance(),i++;ny(t.next,!1);)t.advance(),i++;for(;Xb.indexOf(t.next)>-1;)t.advance(),i++;if(t.next==Fee)return;for(let n=0;;n++){if(n==7){if(!ny(t.next,!0))return;break}if(t.next!="extends".charCodeAt(n))break;t.advance(),i++}}t.acceptToken(zee,-i)}),ote=_h({"get set async static":V.modifier,"for while do if else switch try catch finally return throw break continue default case defer":V.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":V.operatorKeyword,"let var const using function class extends":V.definitionKeyword,"import export from":V.moduleKeyword,"with debugger new":V.keyword,TemplateString:V.special(V.string),super:V.atom,BooleanLiteral:V.bool,this:V.self,null:V.null,Star:V.modifier,VariableName:V.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":V.function(V.variableName),VariableDefinition:V.definition(V.variableName),Label:V.labelName,PropertyName:V.propertyName,PrivatePropertyName:V.special(V.propertyName),"CallExpression/MemberExpression/PropertyName":V.function(V.propertyName),"FunctionDeclaration/VariableDefinition":V.function(V.definition(V.variableName)),"ClassDeclaration/VariableDefinition":V.definition(V.className),"NewExpression/VariableName":V.className,PropertyDefinition:V.definition(V.propertyName),PrivatePropertyDefinition:V.definition(V.special(V.propertyName)),UpdateOp:V.updateOperator,"LineComment Hashbang":V.lineComment,BlockComment:V.blockComment,Number:V.number,String:V.string,Escape:V.escape,ArithOp:V.arithmeticOperator,LogicOp:V.logicOperator,BitOp:V.bitwiseOperator,CompareOp:V.compareOperator,RegExp:V.regexp,Equals:V.definitionOperator,Arrow:V.function(V.punctuation),": Spread":V.punctuation,"( )":V.paren,"[ ]":V.squareBracket,"{ }":V.brace,"InterpolationStart InterpolationEnd":V.special(V.brace),".":V.derefOperator,", ;":V.separator,"@":V.meta,TypeName:V.typeName,TypeDefinition:V.definition(V.typeName),"type enum interface implements namespace module declare":V.definitionKeyword,"abstract global Privacy readonly override":V.modifier,"is keyof unique infer asserts":V.operatorKeyword,JSXAttributeValue:V.attributeValue,JSXText:V.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":V.angleBracket,"JSXIdentifier JSXNameSpacedName":V.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":V.attributeName,"JSXBuiltin/JSXIdentifier":V.standard(V.tagName)}),ate={__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},lte={__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},cte={__proto__:null,"<":193},hte=fh.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?_Q!0LsO'#IOO%[QlO'#IQO?jQ!0LsO'#ISO?uQ!0LsO'#IUO9uQ!0LrO'#IWO@QQ!0MxO'#CiOASQpO'#DlQOQ`OOO%[QlO'#EQOAjQ`O'#ETO:dQMhO'#EnOAuQ`O'#EnOBQQ!bO'#FeOOQ['#Cg'#CgOOQ!0Lb'#Dq'#DqOOQ!0Lb'#Jv'#JvO%[QlO'#JvOOQO'#Jy'#JyOOQO'#Ih'#IhOCQQpO'#EgOOQ!0Lb'#Ef'#EfOOQ!0Lb'#J}'#J}OC|Q!0MSO'#EgODWQpO'#EWOOQO'#Jx'#JxODlQpO'#JyOEyQpO'#EWODWQpO'#EgPFWO&2DjO'#CbPOOO)CD})CD}OOOO'#I`'#I`OFcO#tO,59UOOQ!0Lh,59U,59UOOOO'#Ia'#IaOFqO&jO,59UOGPQ!L^O'#DcOOOO'#Ic'#IcOGWO#@ItO,59{OOQ!0Lf,59{,59{OGfQlO'#IdOGyQ`O'#JtOIxQ!fO'#JtO+}QlO'#JtOJPQ`O,5:ROJgQ`O'#EpOJtQ`O'#KTOKPQ`O'#KSOKPQ`O'#KSOKXQ`O,5;^OK^Q`O'#KROOQ!0Ln,5:^,5:^OKeQlO,5:^OMcQ!0MxO,5:fONSQ`O,5:nONmQ!0LrO'#KQONtQ`O'#KPO9eQ`O'#KPO! YQ`O'#KPO! bQ`O,5;]O! gQ`O'#KPO!#lQ!fO'#JsOOQ!0Lh'#Ci'#CiO%[QlO'#ESO!$[Q!fO,5:sOOQS'#Jz'#JzOOQO-E<j-E<jO9kQ`O,5=_O!$rQ`O,5=_O!$wQlO,5;ZO!&zQMhO'#EkO!(eQ`O,5;ZO!(jQlO'#DyO!(tQpO,5;dO!(|QpO,5;dO%[QlO,5;dOOQ['#FT'#FTOOQ['#FV'#FVO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eO%[QlO,5;eOOQ['#FZ'#FZO!)[QlO,5;tOOQ!0Lf,5;y,5;yOOQ!0Lf,5;z,5;zOOQ!0Lf,5;|,5;|O%[QlO'#IpO!+_Q!0LrO,5<iO%[QlO,5;eO!&zQMhO,5;eO!+|QMhO,5;eO!-nQMhO'#E^O%[QlO,5;wOOQ!0Lf,5;{,5;{O!-uQ,UO'#FjO!.rQ,UO'#KXO!.^Q,UO'#KXO!.yQ,UO'#KXOOQO'#KX'#KXO!/_Q,UO,5<SOOOW,5<`,5<`O!/pQlO'#FvOOOW'#Io'#IoO7VO7dO,5<QO!/wQ,UO'#FxOOQ!0Lf,5<Q,5<QO!0hQ$IUO'#CyOOQ!0Lh'#C}'#C}O!0{O#@ItO'#DRO!1iQMjO,5<eO!1pQ`O,5<hO!3YQ(CWO'#GXO!3jQ`O'#GYO!3oQ`O'#GYO!5_Q(CWO'#G^O!6dQpO'#GbOOQO'#Gn'#GnO!,TQMhO'#GmOOQO'#Gp'#GpO!,TQMhO'#GoO!7VQ$IUO'#JlOOQ!0Lh'#Jl'#JlO!7aQ`O'#JkO!7oQ`O'#JjO!7wQ`O'#CuOOQ!0Lh'#C{'#C{O!8YQ`O'#C}OOQ!0Lh'#DV'#DVOOQ!0Lh'#DX'#DXO!8_Q`O,5<eO1SQ`O'#DZO!,TQMhO'#GPO!,TQMhO'#GRO!8gQ`O'#GTO!8lQ`O'#GUO!3oQ`O'#G[O!,TQMhO'#GaO<]Q`O'#JkO!8qQ`O'#EqO!9`Q`O,5<gOOQ!0Lb'#Cr'#CrO!9hQ`O'#ErO!:bQpO'#EsOOQ!0Lb'#KR'#KRO!:iQ!0LrO'#KaO9uQ!0LrO,5=cO`QlO,5>tOOQ['#Jh'#JhOOQ[,5>u,5>uOOQ[-E<]-E<]O!<hQ!0MxO,5:bO!:]QpO,5:`O!?RQ!0MxO,5:jO%[QlO,5:jO!AiQ!0MxO,5:lOOQO,5@z,5@zO!BYQMhO,5=_O!BhQ!0LrO'#JiO9`Q`O'#JiO!ByQ!0LrO,59ZO!CUQpO,59ZO!C^QMhO,59ZO:dQMhO,59ZO!CiQ`O,5;ZO!CqQ`O'#HbO!DVQ`O'#KdO%[QlO,5;}O!:]QpO,5<PO!D_Q`O,5=zO!DdQ`O,5=zO!DiQ`O,5=zO!DwQ`O,5=zO9uQ!0LrO,5=zO<]Q`O,5=jOOQO'#Cy'#CyO!EOQpO,5=gO!EWQMhO,5=hO!EcQ`O,5=jO!EhQ!bO,5=mO!EpQ`O'#K`O?YQ`O'#HWO9kQ`O'#HYO!EuQ`O'#HYO:dQMhO'#H[O!EzQ`O'#H[OOQ[,5=p,5=pO!FPQ`O'#H]O!FbQ`O'#CoO!FgQ`O,59PO!FqQ`O,59PO!HvQlO,59POOQ[,59P,59PO!IWQ!0LrO,59PO%[QlO,59PO!KcQlO'#HeOOQ['#Hf'#HfOOQ['#Hg'#HgO`QlO,5=}O!KyQ`O,5=}O`QlO,5>TO`QlO,5>VO!LOQ`O,5>XO`QlO,5>ZO!LTQ`O,5>^O!LYQlO,5>dOOQ[,5>j,5>jO%[QlO,5>jO9uQ!0LrO,5>lOOQ[,5>n,5>nO#!dQ`O,5>nOOQ[,5>p,5>pO#!dQ`O,5>pOOQ[,5>r,5>rO##QQpO'#D_O%[QlO'#JvO##sQpO'#JvO##}QpO'#DmO#$`QpO'#DmO#&qQlO'#DmO#&xQ`O'#JuO#'QQ`O,5:WO#'VQ`O'#EtO#'eQ`O'#KUO#'mQ`O,5;_O#'rQpO'#DmO#(PQpO'#EVOOQ!0Lf,5:o,5:oO%[QlO,5:oO#(WQ`O,5:oO?YQ`O,5;YO!CUQpO,5;YO!C^QMhO,5;YO:dQMhO,5;YO#(`Q`O,5@bO#(eQ07dO,5:sOOQO-E<f-E<fO#)kQ!0MSO,5;RODWQpO,5:rO#)uQpO,5:rODWQpO,5;RO!ByQ!0LrO,5:rOOQ!0Lb'#Ej'#EjOOQO,5;R,5;RO%[QlO,5;RO#*SQ!0LrO,5;RO#*_Q!0LrO,5;RO!CUQpO,5:rOOQO,5;X,5;XO#*mQ!0LrO,5;RPOOO'#I^'#I^P#+RO&2DjO,58|POOO,58|,58|OOOO-E<^-E<^OOQ!0Lh1G.p1G.pOOOO-E<_-E<_OOOO,59},59}O#+^Q!bO,59}OOOO-E<a-E<aOOQ!0Lf1G/g1G/gO#+cQ!fO,5?OO+}QlO,5?OOOQO,5?U,5?UO#+mQlO'#IdOOQO-E<b-E<bO#+zQ`O,5@`O#,SQ!fO,5@`O#,ZQ`O,5@nOOQ!0Lf1G/m1G/mO%[QlO,5@oO#,cQ`O'#IjOOQO-E<h-E<hO#,ZQ`O,5@nOOQ!0Lb1G0x1G0xOOQ!0Ln1G/x1G/xOOQ!0Ln1G0Y1G0YO%[QlO,5@lO#,wQ!0LrO,5@lO#-YQ!0LrO,5@lO#-aQ`O,5@kO9eQ`O,5@kO#-iQ`O,5@kO#-wQ`O'#ImO#-aQ`O,5@kOOQ!0Lb1G0w1G0wO!(tQpO,5:uO!)PQpO,5:uOOQS,5:w,5:wO#.iQdO,5:wO#.qQMhO1G2yO9kQ`O1G2yOOQ!0Lf1G0u1G0uO#/PQ!0MxO1G0uO#0UQ!0MvO,5;VOOQ!0Lh'#GW'#GWO#0rQ!0MzO'#JlO!$wQlO1G0uO#2}Q!fO'#JwO%[QlO'#JwO#3XQ`O,5:eOOQ!0Lh'#D_'#D_OOQ!0Lf1G1O1G1OO%[QlO1G1OOOQ!0Lf1G1f1G1fO#3^Q`O1G1OO#5rQ!0MxO1G1PO#5yQ!0MxO1G1PO#8aQ!0MxO1G1PO#8hQ!0MxO1G1PO#;OQ!0MxO1G1PO#=fQ!0MxO1G1PO#=mQ!0MxO1G1PO#=tQ!0MxO1G1PO#@[Q!0MxO1G1PO#@cQ!0MxO1G1PO#BpQ?MtO'#CiO#DkQ?MtO1G1`O#DrQ?MtO'#JsO#EVQ!0MxO,5?[OOQ!0Lb-E<n-E<nO#GdQ!0MxO1G1PO#HaQ!0MzO1G1POOQ!0Lf1G1P1G1PO#IdQMjO'#J|O#InQ`O,5:xO#IsQ!0MxO1G1cO#JgQ,UO,5<WO#JoQ,UO,5<XO#JwQ,UO'#FoO#K`Q`O'#FnOOQO'#KY'#KYOOQO'#In'#InO#KeQ,UO1G1nOOQ!0Lf1G1n1G1nOOOW1G1y1G1yO#KvQ?MtO'#JrO#LQQ`O,5<bO!)[QlO,5<bOOOW-E<m-E<mOOQ!0Lf1G1l1G1lO#LVQpO'#KXOOQ!0Lf,5<d,5<dO#L_QpO,5<dO#LdQMhO'#DTOOOO'#Ib'#IbO#LkO#@ItO,59mOOQ!0Lh,59m,59mO%[QlO1G2PO!8lQ`O'#IrO#LvQ`O,5<zOOQ!0Lh,5<w,5<wO!,TQMhO'#IuO#MdQMjO,5=XO!,TQMhO'#IwO#NVQMjO,5=ZO!&zQMhO,5=]OOQO1G2S1G2SO#NaQ!dO'#CrO#NtQ(CWO'#ErO$ |QpO'#GbO$!dQ!dO,5<sO$!kQ`O'#K[O9eQ`O'#K[O$!yQ`O,5<uO$#aQ!dO'#C{O!,TQMhO,5<tO$#kQ`O'#GZO$$PQ`O,5<tO$$UQ!dO'#GWO$$cQ!dO'#K]O$$mQ`O'#K]O!&zQMhO'#K]O$$rQ`O,5<xO$$wQlO'#JvO$%RQpO'#GcO#$`QpO'#GcO$%dQ`O'#GgO!3oQ`O'#GkO$%iQ!0LrO'#ItO$%tQpO,5<|OOQ!0Lp,5<|,5<|O$%{QpO'#GcO$&YQpO'#GdO$&kQpO'#GdO$&pQMjO,5=XO$'QQMjO,5=ZOOQ!0Lh,5=^,5=^O!,TQMhO,5@VO!,TQMhO,5@VO$'bQ`O'#IyO$'vQ`O,5@UO$(OQ`O,59aOOQ!0Lh,59i,59iO$(TQ`O,5@VO$)TQ$IYO,59uOOQ!0Lh'#Jp'#JpO$)vQMjO,5<kO$*iQMjO,5<mO@zQ`O,5<oOOQ!0Lh,5<p,5<pO$*sQ`O,5<vO$*xQMjO,5<{O$+YQ`O'#KPO!$wQlO1G2RO$+_Q`O1G2RO9eQ`O'#KSO9eQ`O'#EtO%[QlO'#EtO9eQ`O'#I{O$+dQ!0LrO,5@{OOQ[1G2}1G2}OOQ[1G4`1G4`OOQ!0Lf1G/|1G/|OOQ!0Lf1G/z1G/zO$-fQ!0MxO1G0UOOQ[1G2y1G2yO!&zQMhO1G2yO%[QlO1G2yO#.tQ`O1G2yO$/jQMhO'#EkOOQ!0Lb,5@T,5@TO$/wQ!0LrO,5@TOOQ[1G.u1G.uO!ByQ!0LrO1G.uO!CUQpO1G.uO!C^QMhO1G.uO$0YQ`O1G0uO$0_Q`O'#CiO$0jQ`O'#KeO$0rQ`O,5=|O$0wQ`O'#KeO$0|Q`O'#KeO$1[Q`O'#JRO$1jQ`O,5AOO$1rQ!fO1G1iOOQ!0Lf1G1k1G1kO9kQ`O1G3fO@zQ`O1G3fO$1yQ`O1G3fO$2OQ`O1G3fO!DiQ`O1G3fO9uQ!0LrO1G3fOOQ[1G3f1G3fO!EcQ`O1G3UO!&zQMhO1G3RO$2TQ`O1G3ROOQ[1G3S1G3SO!&zQMhO1G3SO$2YQ`O1G3SO$2bQpO'#HQOOQ[1G3U1G3UO!6_QpO'#I}O!EhQ!bO1G3XOOQ[1G3X1G3XOOQ[,5=r,5=rO$2jQMhO,5=tO9kQ`O,5=tO$%dQ`O,5=vO9`Q`O,5=vO!CUQpO,5=vO!C^QMhO,5=vO:dQMhO,5=vO$2xQ`O'#KcO$3TQ`O,5=wOOQ[1G.k1G.kO$3YQ!0LrO1G.kO@zQ`O1G.kO$3eQ`O1G.kO9uQ!0LrO1G.kO$5mQ!fO,5AQO$5zQ`O,5AQO9eQ`O,5AQO$6VQlO,5>PO$6^Q`O,5>POOQ[1G3i1G3iO`QlO1G3iOOQ[1G3o1G3oOOQ[1G3q1G3qO?TQ`O1G3sO$6cQlO1G3uO$:gQlO'#HtOOQ[1G3x1G3xO$:tQ`O'#HzO?YQ`O'#H|OOQ[1G4O1G4OO$:|QlO1G4OO9uQ!0LrO1G4UOOQ[1G4W1G4WOOQ!0Lb'#G_'#G_O9uQ!0LrO1G4YO9uQ!0LrO1G4[O$?TQ`O,5@bO!)[QlO,5;`O9eQ`O,5;`O?YQ`O,5:XO!)[QlO,5:XO!CUQpO,5:XO$?YQ?MtO,5:XOOQO,5;`,5;`O$?dQpO'#IeO$?zQ`O,5@aOOQ!0Lf1G/r1G/rO$@SQpO'#IkO$@^Q`O,5@pOOQ!0Lb1G0y1G0yO#$`QpO,5:XOOQO'#Ig'#IgO$@fQpO,5:qOOQ!0Ln,5:q,5:qO#(ZQ`O1G0ZOOQ!0Lf1G0Z1G0ZO%[QlO1G0ZOOQ!0Lf1G0t1G0tO?YQ`O1G0tO!CUQpO1G0tO!C^QMhO1G0tOOQ!0Lb1G5|1G5|O!ByQ!0LrO1G0^OOQO1G0m1G0mO%[QlO1G0mO$@mQ!0LrO1G0mO$@xQ!0LrO1G0mO!CUQpO1G0^ODWQpO1G0^O$AWQ!0LrO1G0mOOQO1G0^1G0^O$AlQ!0MxO1G0mPOOO-E<[-E<[POOO1G.h1G.hOOOO1G/i1G/iO$AvQ!bO,5<iO$BOQ!fO1G4jOOQO1G4p1G4pO%[QlO,5?OO$BYQ`O1G5zO$BbQ`O1G6YO$BjQ!fO1G6ZO9eQ`O,5?UO$BtQ!0MxO1G6WO%[QlO1G6WO$CUQ!0LrO1G6WO$CgQ`O1G6VO$CgQ`O1G6VO9eQ`O1G6VO$CoQ`O,5?XO9eQ`O,5?XOOQO,5?X,5?XO$DTQ`O,5?XO$+YQ`O,5?XOOQO-E<k-E<kOOQS1G0a1G0aOOQS1G0c1G0cO#.lQ`O1G0cOOQ[7+(e7+(eO!&zQMhO7+(eO%[QlO7+(eO$DcQ`O7+(eO$DnQMhO7+(eO$D|Q!0MzO,5=XO$GXQ!0MzO,5=ZO$IdQ!0MzO,5=XO$KuQ!0MzO,5=ZO$NWQ!0MzO,59uO%!]Q!0MzO,5<kO%$hQ!0MzO,5<mO%&sQ!0MzO,5<{OOQ!0Lf7+&a7+&aO%)UQ!0MxO7+&aO%)xQlO'#IfO%*VQ`O,5@cO%*_Q!fO,5@cOOQ!0Lf1G0P1G0PO%*iQ`O7+&jOOQ!0Lf7+&j7+&jO%*nQ?MtO,5:fO%[QlO7+&zO%*xQ?MtO,5:bO%+VQ?MtO,5:jO%+aQ?MtO,5:lO%+kQMhO'#IiO%+uQ`O,5@hOOQ!0Lh1G0d1G0dOOQO1G1r1G1rOOQO1G1s1G1sO%+}Q!jO,5<ZO!)[QlO,5<YOOQO-E<l-E<lOOQ!0Lf7+'Y7+'YOOOW7+'e7+'eOOOW1G1|1G1|O%,YQ`O1G1|OOQ!0Lf1G2O1G2OOOOO,59o,59oO%,_Q!dO,59oOOOO-E<`-E<`OOQ!0Lh1G/X1G/XO%,fQ!0MxO7+'kOOQ!0Lh,5?^,5?^O%-YQMhO1G2fP%-aQ`O'#IrPOQ!0Lh-E<p-E<pO%-}QMjO,5?aOOQ!0Lh-E<s-E<sO%.pQMjO,5?cOOQ!0Lh-E<u-E<uO%.zQ!dO1G2wO%/RQ!dO'#CrO%/iQMhO'#KSO$$wQlO'#JvOOQ!0Lh1G2_1G2_O%/sQ`O'#IqO%0[Q`O,5@vO%0[Q`O,5@vO%0dQ`O,5@vO%0oQ`O,5@vOOQO1G2a1G2aO%0}QMjO1G2`O$+YQ`O'#K[O!,TQMhO1G2`O%1_Q(CWO'#IsO%1lQ`O,5@wO!&zQMhO,5@wO%1tQ!dO,5@wOOQ!0Lh1G2d1G2dO%4UQ!fO'#CiO%4`Q`O,5=POOQ!0Lb,5<},5<}O%4hQpO,5<}OOQ!0Lb,5=O,5=OOCwQ`O,5<}O%4sQpO,5<}OOQ!0Lb,5=R,5=RO$+YQ`O,5=VOOQO,5?`,5?`OOQO-E<r-E<rOOQ!0Lp1G2h1G2hO#$`QpO,5<}O$$wQlO,5=PO%5RQ`O,5=OO%5^QpO,5=OO!,TQMhO'#IuO%6WQMjO1G2sO!,TQMhO'#IwO%6yQMjO1G2uO%7TQMjO1G5qO%7_QMjO1G5qOOQO,5?e,5?eOOQO-E<w-E<wOOQO1G.{1G.{O!,TQMhO1G5qO!,TQMhO1G5qO!:]QpO,59wO%[QlO,59wOOQ!0Lh,5<j,5<jO%7lQ`O1G2ZO!,TQMhO1G2bO%7qQ!0MxO7+'mOOQ!0Lf7+'m7+'mO!$wQlO7+'mO%8eQ`O,5;`OOQ!0Lb,5?g,5?gOOQ!0Lb-E<y-E<yO%8jQ!dO'#K^O#(ZQ`O7+(eO4UQ!fO7+(eO$DfQ`O7+(eO%8tQ!0MvO'#CiO%9XQ!0MvO,5=SO%9lQ`O,5=SO%9tQ`O,5=SOOQ!0Lb1G5o1G5oOOQ[7+$a7+$aO!ByQ!0LrO7+$aO!CUQpO7+$aO!$wQlO7+&aO%9yQ`O'#JQO%:bQ`O,5APOOQO1G3h1G3hO9kQ`O,5APO%:bQ`O,5APO%:jQ`O,5APOOQO,5?m,5?mOOQO-E=P-E=POOQ!0Lf7+'T7+'TO%:oQ`O7+)QO9uQ!0LrO7+)QO9kQ`O7+)QO@zQ`O7+)QO%:tQ`O7+)QOOQ[7+)Q7+)QOOQ[7+(p7+(pO%:yQ!0MvO7+(mO!&zQMhO7+(mO!E^Q`O7+(nOOQ[7+(n7+(nO!&zQMhO7+(nO%;TQ`O'#KbO%;`Q`O,5=lOOQO,5?i,5?iOOQO-E<{-E<{OOQ[7+(s7+(sO%<rQpO'#HZOOQ[1G3`1G3`O!&zQMhO1G3`O%[QlO1G3`O%<yQ`O1G3`O%=UQMhO1G3`O9uQ!0LrO1G3bO$%dQ`O1G3bO9`Q`O1G3bO!CUQpO1G3bO!C^QMhO1G3bO%=dQ`O'#JPO%=xQ`O,5@}O%>QQpO,5@}OOQ!0Lb1G3c1G3cOOQ[7+$V7+$VO@zQ`O7+$VO9uQ!0LrO7+$VO%>]Q`O7+$VO%[QlO1G6lO%[QlO1G6mO%>bQ!0LrO1G6lO%>lQlO1G3kO%>sQ`O1G3kO%>xQlO1G3kOOQ[7+)T7+)TO9uQ!0LrO7+)_O`QlO7+)aOOQ['#Kh'#KhOOQ['#JS'#JSO%?PQlO,5>`OOQ[,5>`,5>`O%[QlO'#HuO%?^Q`O'#HwOOQ[,5>f,5>fO9eQ`O,5>fOOQ[,5>h,5>hOOQ[7+)j7+)jOOQ[7+)p7+)pOOQ[7+)t7+)tOOQ[7+)v7+)vO%?cQpO1G5|O%?}Q?MtO1G0zO%@XQ`O1G0zOOQO1G/s1G/sO%@dQ?MtO1G/sO?YQ`O1G/sO!)[QlO'#DmOOQO,5?P,5?POOQO-E<c-E<cOOQO,5?V,5?VOOQO-E<i-E<iO!CUQpO1G/sOOQO-E<e-E<eOOQ!0Ln1G0]1G0]OOQ!0Lf7+%u7+%uO#(ZQ`O7+%uOOQ!0Lf7+&`7+&`O?YQ`O7+&`O!CUQpO7+&`OOQO7+%x7+%xO$AlQ!0MxO7+&XOOQO7+&X7+&XO%[QlO7+&XO%@nQ!0LrO7+&XO!ByQ!0LrO7+%xO!CUQpO7+%xO%@yQ!0LrO7+&XO%AXQ!0MxO7++rO%[QlO7++rO%AiQ`O7++qO%AiQ`O7++qOOQO1G4s1G4sO9eQ`O1G4sO%AqQ`O1G4sOOQS7+%}7+%}O#(ZQ`O<<LPO4UQ!fO<<LPO%BPQ`O<<LPOOQ[<<LP<<LPO!&zQMhO<<LPO%[QlO<<LPO%BXQ`O<<LPO%BdQ!0MzO,5?aO%DoQ!0MzO,5?cO%FzQ!0MzO1G2`O%I]Q!0MzO1G2sO%KhQ!0MzO1G2uO%MsQ!fO,5?QO%[QlO,5?QOOQO-E<d-E<dO%M}Q`O1G5}OOQ!0Lf<<JU<<JUO%NVQ?MtO1G0uO&!^Q?MtO1G1PO&!eQ?MtO1G1PO&$fQ?MtO1G1PO&$mQ?MtO1G1PO&&nQ?MtO1G1PO&(oQ?MtO1G1PO&(vQ?MtO1G1PO&(}Q?MtO1G1PO&+OQ?MtO1G1PO&+VQ?MtO1G1PO&+^Q!0MxO<<JfO&-UQ?MtO1G1PO&.RQ?MvO1G1PO&/UQ?MvO'#JlO&1[Q?MtO1G1cO&1iQ?MtO1G0UO&1sQMjO,5?TOOQO-E<g-E<gO!)[QlO'#FqOOQO'#KZ'#KZOOQO1G1u1G1uO&1}Q`O1G1tO&2SQ?MtO,5?[OOOW7+'h7+'hOOOO1G/Z1G/ZO&2^Q!dO1G4xOOQ!0Lh7+(Q7+(QP!&zQMhO,5?^O!,TQMhO7+(cO&2eQ`O,5?]O9eQ`O,5?]O$+YQ`O,5?]OOQO-E<o-E<oO&2sQ`O1G6bO&2sQ`O1G6bO&2{Q`O1G6bO&3WQMjO7+'zO&3hQ!dO,5?_O&3rQ`O,5?_O!&zQMhO,5?_OOQO-E<q-E<qO&3wQ!dO1G6cO&4RQ`O1G6cO&4ZQ`O1G2kO!&zQMhO1G2kOOQ!0Lb1G2i1G2iOOQ!0Lb1G2j1G2jO%4hQpO1G2iO!CUQpO1G2iOCwQ`O1G2iOOQ!0Lb1G2q1G2qO&4`QpO1G2iO&4nQ`O1G2kO$+YQ`O1G2jOCwQ`O1G2jO$$wQlO1G2kO&4vQ`O1G2jO&5jQMjO,5?aOOQ!0Lh-E<t-E<tO&6]QMjO,5?cOOQ!0Lh-E<v-E<vO!,TQMhO7++]O&6gQMjO7++]O&6qQMjO7++]OOQ!0Lh1G/c1G/cO&7OQ`O1G/cOOQ!0Lh7+'u7+'uO&7TQMjO7+'|O&7eQ!0MxO<<KXOOQ!0Lf<<KX<<KXO&8XQ`O1G0zO!&zQMhO'#IzO&8^Q`O,5@xO&:`Q!fO<<LPO!&zQMhO1G2nO&:gQ!0LrO1G2nOOQ[<<G{<<G{O!ByQ!0LrO<<G{O&:xQ!0MxO<<I{OOQ!0Lf<<I{<<I{OOQO,5?l,5?lO&;lQ`O,5?lO&;qQ`O,5?lOOQO-E=O-E=OO&<PQ`O1G6kO&<PQ`O1G6kO9kQ`O1G6kO@zQ`O<<LlOOQ[<<Ll<<LlO&<XQ`O<<LlO9uQ!0LrO<<LlO9kQ`O<<LlOOQ[<<LX<<LXO%:yQ!0MvO<<LXOOQ[<<LY<<LYO!E^Q`O<<LYO&<^QpO'#I|O&<iQ`O,5@|O!)[QlO,5@|OOQ[1G3W1G3WOOQO'#JO'#JOO9uQ!0LrO'#JOO&<qQpO,5=uOOQ[,5=u,5=uO&<xQpO'#EgO&=PQpO'#GeO&=UQ`O7+(zO&=ZQ`O7+(zOOQ[7+(z7+(zO!&zQMhO7+(zO%[QlO7+(zO&=cQ`O7+(zOOQ[7+(|7+(|O9uQ!0LrO7+(|O$%dQ`O7+(|O9`Q`O7+(|O!CUQpO7+(|O&=nQ`O,5?kOOQO-E<}-E<}OOQO'#H^'#H^O&=yQ`O1G6iO9uQ!0LrO<<GqOOQ[<<Gq<<GqO@zQ`O<<GqO&>RQ`O7+,WO&>WQ`O7+,XO%[QlO7+,WO%[QlO7+,XOOQ[7+)V7+)VO&>]Q`O7+)VO&>bQlO7+)VO&>iQ`O7+)VOOQ[<<Ly<<LyOOQ[<<L{<<L{OOQ[-E=Q-E=QOOQ[1G3z1G3zO&>nQ`O,5>aOOQ[,5>c,5>cO&>sQ`O1G4QO9eQ`O7+&fO!)[QlO7+&fOOQO7+%_7+%_O&>xQ?MtO1G6ZO?YQ`O7+%_OOQ!0Lf<<Ia<<IaOOQ!0Lf<<Iz<<IzO?YQ`O<<IzOOQO<<Is<<IsO$AlQ!0MxO<<IsO%[QlO<<IsOOQO<<Id<<IdO!ByQ!0LrO<<IdO&?SQ!0LrO<<IsO&?_Q!0MxO<= ^O&?oQ`O<= ]OOQO7+*_7+*_O9eQ`O7+*_OOQ[ANAkANAkO&?wQ!fOANAkO!&zQMhOANAkO#(ZQ`OANAkO4UQ!fOANAkO&@OQ`OANAkO%[QlOANAkO&@WQ!0MzO7+'zO&BiQ!0MzO,5?aO&DtQ!0MzO,5?cO&GPQ!0MzO7+'|O&IbQ!fO1G4lO&IlQ?MtO7+&aO&KpQ?MvO,5=XO&MwQ?MvO,5=ZO&NXQ?MvO,5=XO&NiQ?MvO,5=ZO&NyQ?MvO,59uO'#PQ?MvO,5<kO'%SQ?MvO,5<mO''hQ?MvO,5<{O')^Q?MtO7+'kO')kQ?MtO7+'mO')xQ`O,5<]OOQO7+'`7+'`OOQ!0Lh7+*d7+*dO')}QMjO<<K}OOQO1G4w1G4wO'*UQ`O1G4wO'*aQ`O1G4wO'*oQ`O7++|O'*oQ`O7++|O!&zQMhO1G4yO'*wQ!dO1G4yO'+RQ`O7++}O'+ZQ`O7+(VO'+fQ!dO7+(VOOQ!0Lb7+(T7+(TOOQ!0Lb7+(U7+(UO!CUQpO7+(TOCwQ`O7+(TO'+pQ`O7+(VO!&zQMhO7+(VO$+YQ`O7+(UO'+uQ`O7+(VOCwQ`O7+(UO'+}QMjO<<NwO!,TQMhO<<NwOOQ!0Lh7+$}7+$}O',XQ!dO,5?fOOQO-E<x-E<xO',cQ!0MvO7+(YO!&zQMhO7+(YOOQ[AN=gAN=gO9kQ`O1G5WOOQO1G5W1G5WO',sQ`O1G5WO',xQ`O7+,VO',xQ`O7+,VO9uQ!0LrOANBWO@zQ`OANBWOOQ[ANBWANBWO'-QQ`OANBWOOQ[ANAsANAsOOQ[ANAtANAtO'-VQ`O,5?hOOQO-E<z-E<zO'-bQ?MtO1G6hOOQO,5?j,5?jOOQO-E<|-E<|OOQ[1G3a1G3aO'-lQ`O,5=POOQ[<<Lf<<LfO!&zQMhO<<LfO&=UQ`O<<LfO'-qQ`O<<LfO%[QlO<<LfOOQ[<<Lh<<LhO9uQ!0LrO<<LhO$%dQ`O<<LhO9`Q`O<<LhO'-yQpO1G5VO'.UQ`O7+,TOOQ[AN=]AN=]O9uQ!0LrOAN=]OOQ[<= r<= rOOQ[<= s<= sO'.^Q`O<= rO'.cQ`O<= sOOQ[<<Lq<<LqO'.hQ`O<<LqO'.mQlO<<LqOOQ[1G3{1G3{O?YQ`O7+)lO'.tQ`O<<JQO'/PQ?MtO<<JQOOQO<<Hy<<HyOOQ!0LfAN?fAN?fOOQOAN?_AN?_O$AlQ!0MxOAN?_OOQOAN?OAN?OO%[QlOAN?_OOQO<<My<<MyOOQ[G27VG27VO!&zQMhOG27VO#(ZQ`OG27VO'/ZQ!fOG27VO4UQ!fOG27VO'/bQ`OG27VO'/jQ?MtO<<JfO'/wQ?MvO1G2`O'1mQ?MvO,5?aO'3pQ?MvO,5?cO'5sQ?MvO1G2sO'7vQ?MvO1G2uO'9yQ?MtO<<KXO':WQ?MtO<<I{OOQO1G1w1G1wO!,TQMhOANAiOOQO7+*c7+*cO':eQ`O7+*cO':pQ`O<= hO':xQ!dO7+*eOOQ!0Lb<<Kq<<KqO$+YQ`O<<KqOCwQ`O<<KqO';SQ`O<<KqO!&zQMhO<<KqOOQ!0Lb<<Ko<<KoO!CUQpO<<KoO';_Q!dO<<KqOOQ!0Lb<<Kp<<KpO';iQ`O<<KqO!&zQMhO<<KqO$+YQ`O<<KpO';nQMjOANDcO';xQ!0MvO<<KtOOQO7+*r7+*rO9kQ`O7+*rO'<YQ`O<= qOOQ[G27rG27rO9uQ!0LrOG27rO@zQ`OG27rO!)[QlO1G5SO'<bQ`O7+,SO'<jQ`O1G2kO&=UQ`OANBQOOQ[ANBQANBQO!&zQMhOANBQO'<oQ`OANBQOOQ[ANBSANBSO9uQ!0LrOANBSO$%dQ`OANBSOOQO'#H_'#H_OOQO7+*q7+*qOOQ[G22wG22wOOQ[ANE^ANE^OOQ[ANE_ANE_OOQ[ANB]ANB]O'<wQ`OANB]OOQ[<<MW<<MWO!)[QlOAN?lOOQOG24yG24yO$AlQ!0MxOG24yO#(ZQ`OLD,qOOQ[LD,qLD,qO!&zQMhOLD,qO'<|Q!fOLD,qO'=TQ?MvO7+'zO'>yQ?MvO,5?aO'@|Q?MvO,5?cO'CPQ?MvO7+'|O'DuQMjOG27TOOQO<<M}<<M}OOQ!0LbANA]ANA]O$+YQ`OANA]OCwQ`OANA]O'EVQ!dOANA]OOQ!0LbANAZANAZO'E^Q`OANA]O!&zQMhOANA]O'EiQ!dOANA]OOQ!0LbANA[ANA[OOQO<<N^<<N^OOQ[LD-^LD-^O9uQ!0LrOLD-^O'EsQ?MtO7+*nOOQO'#Gf'#GfOOQ[G27lG27lO&=UQ`OG27lO!&zQMhOG27lOOQ[G27nG27nO9uQ!0LrOG27nOOQ[G27wG27wO'E}Q?MtOG25WOOQOLD*eLD*eOOQ[!$(!]!$(!]O#(ZQ`O!$(!]O!&zQMhO!$(!]O'FXQ!0MzOG27TOOQ!0LbG26wG26wO$+YQ`OG26wO'HjQ`OG26wOCwQ`OG26wO'HuQ!dOG26wO!&zQMhOG26wOOQ[!$(!x!$(!xOOQ[LD-WLD-WO&=UQ`OLD-WOOQ[LD-YLD-YOOQ[!)9Ew!)9EwO#(ZQ`O!)9EwOOQ!0LbLD,cLD,cO$+YQ`OLD,cOCwQ`OLD,cO'H|Q`OLD,cO'IXQ!dOLD,cOOQ[!$(!r!$(!rOOQ[!.K;c!.K;cO'I`Q?MvOG27TOOQ!0Lb!$( }!$( }O$+YQ`O!$( }OCwQ`O!$( }O'KUQ`O!$( }OOQ!0Lb!)9Ei!)9EiO$+YQ`O!)9EiOCwQ`O!)9EiOOQ!0Lb!.K;T!.K;TO$+YQ`O!.K;TOOQ!0Lb!4/0o!4/0oO!)[QlO'#DzO1PQ`O'#EXO'KaQ!fO'#JrO'KhQ!L^O'#DvO'KoQlO'#EOO'KvQ!fO'#CiO'N^Q!fO'#CiO!)[QlO'#EQO'NnQlO,5;ZO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO,5;eO!)[QlO'#IpO(!qQ`O,5<iO!)[QlO,5;eO(!yQMhO,5;eO($dQMhO,5;eO!)[QlO,5;wO!&zQMhO'#GmO(!yQMhO'#GmO!&zQMhO'#GoO(!yQMhO'#GoO1SQ`O'#DZO1SQ`O'#DZO!&zQMhO'#GPO(!yQMhO'#GPO!&zQMhO'#GRO(!yQMhO'#GRO!&zQMhO'#GaO(!yQMhO'#GaO!)[QlO,5:jO($kQpO'#D_O($uQpO'#JvO!)[QlO,5@oO'NnQlO1G0uO(%PQ?MtO'#CiO!)[QlO1G2PO!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO(%ZQ!dO'#CrO!&zQMhO,5<tO(!yQMhO,5<tO'NnQlO1G2RO!)[QlO7+&zO!&zQMhO1G2`O(!yQMhO1G2`O!&zQMhO'#IuO(!yQMhO'#IuO!&zQMhO'#IwO(!yQMhO'#IwO!&zQMhO1G2bO(!yQMhO1G2bO'NnQlO7+'mO'NnQlO7+&aO!&zQMhOANAiO(!yQMhOANAiO(%nQ`O'#EoO(%sQ`O'#EoO(%{Q`O'#F]O(&QQ`O'#EyO(&VQ`O'#KTO(&bQ`O'#KRO(&mQ`O,5;ZO(&rQMjO,5<eO(&yQ`O'#GYO('OQ`O'#GYO('TQ`O,5<eO(']Q`O,5<gO('eQ`O,5;ZO('mQ?MtO1G1`O('tQ`O,5<tO('yQ`O,5<tO((OQ`O,5<vO((TQ`O,5<vO((YQ`O1G2RO((_Q`O1G0uO((dQMjO<<K}O((kQMjO<<K}O((rQMhO'#F|O9`Q`O'#F{OAuQ`O'#EnO!)[QlO,5;tO!3oQ`O'#GYO!3oQ`O'#GYO!3oQ`O'#G[O!3oQ`O'#G[O!,TQMhO7+(cO!,TQMhO7+(cO%.zQ!dO1G2wO%.zQ!dO1G2wO!&zQMhO,5=]O!&zQMhO,5=]",stateData:"()x~O'|OS'}OSTOS(ORQ~OPYOQYOSfOY!VOaqOdzOeyOl!POpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!uwO!xxO!|]O$W|O$niO%h}O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO&W!WO&^!XO&`!YO&b!ZO&d![O&g!]O&m!^O&s!_O&u!`O&w!aO&y!bO&{!cO(TSO(VTO(YUO(aVO(o[O~OWtO~P`OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa!wOs!nO!S!oO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!xO#W!pO#X!pO#[!zO#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O(O!{O~OP]XR]X[]Xa]Xj]Xr]X!Q]X!S]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X'z]X(a]X(r]X(y]X(z]X~O!g%RX~P(qO_!}O(V#PO(W!}O(X#PO~O_#QO(X#PO(Y#PO(Z#QO~Ox#SO!U#TO(b#TO(c#VO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T<ZO(VTO(YUO(aVO(o[O~O![#ZO!]#WO!Y(hP!Y(vP~P+}O!^#cO~P`OPYOQYOSfOd!jOe!iOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(VTO(YUO(aVO(o[O~Op#mO![#iO!|]O#i#lO#j#iO(T<[O!k(sP~P.iO!l#oO(T#nO~O!x#sO!|]O%h#tO~O#k#uO~O!g#vO#k#uO~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!]$_O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa(fX'z(fX'w(fX!k(fX!Y(fX!_(fX%i(fX!g(fX~P1qO#S$dO#`$eO$Q$eOP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX!_(gX%i(gX~Oa(gX'z(gX'w(gX!Y(gX!k(gXv(gX!g(gX~P4UO#`$eO~O$]$hO$_$gO$f$mO~OSfO!_$nO$i$oO$k$qO~Oh%VOj%dOk%dOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T$sO(VTO(YUO(a$uO(y$}O(z%POg(^P~Ol%[O~P7eO!l%eO~O!S%hO!_%iO(T%gO~O!g%mO~Oa%nO'z%nO~O!Q%rO~P%[O(U!lO~P%[O%n%vO~P%[Oh%VO!l%eO(T%gO(U!lO~Oe%}O!l%eO(T%gO~Oj$RO~O!_&PO(T%gO(U!lO(VTO(YUO`)WP~O!Q&SO!l&RO%j&VO&T&WO~P;SO!x#sO~O%s&YO!S)SX!_)SX(T)SX~O(T&ZO~Ol!PO!u&`O%j!QO%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO~Od&eOe&dO!x&bO%h&cO%{&aO~P<bOd&hOeyOl!PO!_&gO!u&`O!xxO!|]O%h}O%l!OO%m!OO%n!OO%q!RO%s!SO%v!TO%w!TO%y!UO~Ob&kO#`&nO%j&iO(U!lO~P=gO!l&oO!u&sO~O!l#oO~O!_XO~Oa%nO'x&{O'z%nO~Oa%nO'x'OO'z%nO~Oa%nO'x'QO'z%nO~O'w]X!Y]Xv]X!k]X&[]X!_]X%i]X!g]X~P(qO!b'_O!c'WO!d'WO(U!lO(VTO(YUO~Os'UO!S'TO!['XO(e'SO!^(iP!^(xP~P@nOn'bO!_'`O(T%gO~Oe'gO!l%eO(T%gO~O!Q&SO!l&RO~Os!nO!S!oO!|<VO#T!pO#U!pO#W!pO#X!pO(U!lO(VTO(YUO(e!mO(o!sO~O!b'mO!c'lO!d'lO#V!pO#['nO#]'nO~PBYOa%nOh%VO!g#vO!l%eO'z%nO(r'pO~O!p'tO#`'rO~PChOs!nO!S!oO(VTO(YUO(e!mO(o!sO~O!_XOs(mX!S(mX!b(mX!c(mX!d(mX!|(mX#T(mX#U(mX#V(mX#W(mX#X(mX#[(mX#](mX(U(mX(V(mX(Y(mX(e(mX(o(mX~O!c'lO!d'lO(U!lO~PDWO(P'xO(Q'xO(R'zO~O_!}O(V'|O(W!}O(X'|O~O_#QO(X'|O(Y'|O(Z#QO~Ov(OO~P%[Ox#SO!U#TO(b#TO(c(RO~O![(TO!Y'WX!Y'^X!]'WX!]'^X~P+}O!](VO!Y(hX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!](VO!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~O!Y(hX~PHRO!Y([O~O!Y(uX!](uX!g(uX!k(uX(r(uX~O#`(uX#k#dX!^(uX~PJUO#`(]O!Y(wX!](wX~O!](^O!Y(vX~O!Y(aO~O#`$eO~PJUO!^(bO~P`OR#zO!Q#yO!S#{O!l#xO(aVOP!na[!naj!nar!na!]!na!p!na#R!na#n!na#o!na#p!na#q!na#r!na#s!na#t!na#u!na#v!na#x!na#z!na#{!na(r!na(y!na(z!na~Oa!na'z!na'w!na!Y!na!k!nav!na!_!na%i!na!g!na~PKlO!k(cO~O!g#vO#`(dO(r'pO!](tXa(tX'z(tX~O!k(tX~PNXO!S%hO!_%iO!|]O#i(iO#j(hO(T%gO~O!](jO!k(sX~O!k(lO~O!S%hO!_%iO#j(hO(T%gO~OP(gXR(gX[(gXj(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~O!g#vO!k(gX~P! uOR(nO!Q(mO!l#xO#S$dO!|!{a!S!{a~O!x!{a%h!{a!_!{a#i!{a#j!{a(T!{a~P!#vO!x(rO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_XO!iuO!lZO!oYO!pYO!qYO!svO!u!gO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~O#k(xO~O![(zO!k(kP~P%[O(e(|O(o[O~O!S)OO!l#xO(e(|O(o[O~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]$_Oa$qa'z$qa'w$qa!k$qa!Y$qa!_$qa%i$qa!g$qa~Ol)dO~P!&zOh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O%]O!S${O!_$|O!i%bO!l$xO#j%cO$W%`O$t%^O$v%_O$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Og(pP~P!,TO!Q)iO!g)hO!_$^X$Z$^X$]$^X$_$^X$f$^X~O!g)hO!_({X$Z({X$]({X$_({X$f({X~O!Q)iO~P!.^O!Q)iO!_({X$Z({X$]({X$_({X$f({X~O!_)kO$Z)oO$])jO$_)jO$f)pO~O![)sO~P!)[O$]$hO$_$gO$f)wO~On$zX!Q$zX#S$zX'y$zX(y$zX(z$zX~OgmXg$zXnmX!]mX#`mX~P!0SOx)yO(b)zO(c)|O~On*VO!Q*OO'y*PO(y$}O(z%PO~Og)}O~P!1WOg*WO~Oh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S*YO!_*ZO!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op*`O![*^O(T*XO!k)OP~P!1uO#k*aO~O!l*bO~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(T*dO(VTO(YUO(a$uO(y$}O(z%PO~O![*gO!Y)PP~P!3tOr*sOs!nO!S*iO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO(e!mO~O!^*pO~P!5iO#S$dOn(`X!Q(`X'y(`X(y(`X(z(`X!](`X#`(`X~Og(`X$O(`X~P!6kOn*xO#`*wOg(_X!](_X~O!]*yOg(^X~Oj%dOk%dOl%dO(T&ZOg(^P~Os*|O~Og)}O(T&ZO~O!l+SO~O(T(vO~Op+WO!S%hO![#iO!_%iO!|]O#i#lO#j#iO(T%gO!k(sP~O!g#vO#k+XO~O!S%hO![+ZO!](^O!_%iO(T%gO!Y(vP~Os'[O!S+]O![+[O(VTO(YUO(e(|O~O!^(xP~P!9|O!]+^Oa)TX'z)TX~OP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO#z$WO#{$XO(aVO(r$YO(y#|O(z#}O~Oa!ja!]!ja'z!ja'w!ja!Y!ja!k!jav!ja!_!ja%i!ja!g!ja~P!:tOR#zO!Q#yO!S#{O!l#xO(aVOP!ra[!raj!rar!ra!]!ra!p!ra#R!ra#n!ra#o!ra#p!ra#q!ra#r!ra#s!ra#t!ra#u!ra#v!ra#x!ra#z!ra#{!ra(r!ra(y!ra(z!ra~Oa!ra'z!ra'w!ra!Y!ra!k!rav!ra!_!ra%i!ra!g!ra~P!=[OR#zO!Q#yO!S#{O!l#xO(aVOP!ta[!taj!tar!ta!]!ta!p!ta#R!ta#n!ta#o!ta#p!ta#q!ta#r!ta#s!ta#t!ta#u!ta#v!ta#x!ta#z!ta#{!ta(r!ta(y!ta(z!ta~Oa!ta'z!ta'w!ta!Y!ta!k!tav!ta!_!ta%i!ta!g!ta~P!?rOh%VOn+gO!_'`O%i+fO~O!g+iOa(]X!_(]X'z(]X!](]X~Oa%nO!_XO'z%nO~Oh%VO!l%eO~Oh%VO!l%eO(T%gO~O!g#vO#k(xO~Ob+tO%j+uO(T+qO(VTO(YUO!^)XP~O!]+vO`)WX~O[+zO~O`+{O~O!_&PO(T%gO(U!lO`)WP~O%j,OO~P;SOh%VO#`,SO~Oh%VOn,VO!_$|O~O!_,XO~O!Q,ZO!_XO~O%n%vO~O!x,`O~Oe,eO~Ob,fO(T#nO(VTO(YUO!^)VP~Oe%}O~O%j!QO(T&ZO~P=gO[,kO`,jO~OPYOQYOSfOdzOeyOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!iuO!lZO!oYO!pYO!qYO!svO!xxO!|]O$niO%h}O(VTO(YUO(aVO(o[O~O!_!eO!u!gO$W!kO(T!dO~P!FyO`,jOa%nO'z%nO~OPYOQYOSfOd!jOe!iOpkOrYOskOtkOzkO|YO!OYO!SWO!WkO!XkO!_!eO!iuO!lZO!oYO!pYO!qYO!svO!x!hO$W!kO$niO(T!dO(VTO(YUO(aVO(o[O~Oa,pOl!OO!uwO%l!OO%m!OO%n!OO~P!IcO!l&oO~O&^,vO~O!_,xO~O&o,zO&q,{OP&laQ&laS&laY&laa&lad&lae&lal&lap&lar&las&lat&laz&la|&la!O&la!S&la!W&la!X&la!_&la!i&la!l&la!o&la!p&la!q&la!s&la!u&la!x&la!|&la$W&la$n&la%h&la%j&la%l&la%m&la%n&la%q&la%s&la%v&la%w&la%y&la&W&la&^&la&`&la&b&la&d&la&g&la&m&la&s&la&u&la&w&la&y&la&{&la'w&la(T&la(V&la(Y&la(a&la(o&la!^&la&e&lab&la&j&la~O(T-QO~Oh!eX!]!RX!^!RX!g!RX!g!eX!l!eX#`!RX~O!]!eX!^!eX~P#!iO!g-VO#`-UOh(jX!]#hX!^#hX!g(jX!l(jX~O!](jX!^(jX~P##[Oh%VO!g-XO!l%eO!]!aX!^!aX~Os!nO!S!oO(VTO(YUO(e!mO~OP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_!eO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(VTO(YUO(aVO(o[O~O(T=QO~P#$qO!]-]O!^(iX~O!^-_O~O!g-VO#`-UO!]#hX!^#hX~O!]-`O!^(xX~O!^-bO~O!c-cO!d-cO(U!lO~P#$`O!^-fO~P'_On-iO!_'`O~O!Y-nO~Os!{a!b!{a!c!{a!d!{a#T!{a#U!{a#V!{a#W!{a#X!{a#[!{a#]!{a(U!{a(V!{a(Y!{a(e!{a(o!{a~P!#vO!p-sO#`-qO~PChO!c-uO!d-uO(U!lO~PDWOa%nO#`-qO'z%nO~Oa%nO!g#vO#`-qO'z%nO~Oa%nO!g#vO!p-sO#`-qO'z%nO(r'pO~O(P'xO(Q'xO(R-zO~Ov-{O~O!Y'Wa!]'Wa~P!:tO![.PO!Y'WX!]'WX~P%[O!](VO!Y(ha~O!Y(ha~PHRO!](^O!Y(va~O!S%hO![.TO!_%iO(T%gO!Y'^X!]'^X~O#`.VO!](ta!k(taa(ta'z(ta~O!g#vO~P#,wO!](jO!k(sa~O!S%hO!_%iO#j.ZO(T%gO~Op.`O!S%hO![.]O!_%iO!|]O#i._O#j.]O(T%gO!]'aX!k'aX~OR.dO!l#xO~Oh%VOn.gO!_'`O%i.fO~Oa#ci!]#ci'z#ci'w#ci!Y#ci!k#civ#ci!_#ci%i#ci!g#ci~P!:tOn>]O!Q*OO'y*PO(y$}O(z%PO~O#k#_aa#_a#`#_a'z#_a!]#_a!k#_a!_#_a!Y#_a~P#/sO#k(`XP(`XR(`X[(`Xa(`Xj(`Xr(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X'z(`X(a(`X(r(`X!k(`X!Y(`X'w(`Xv(`X!_(`X%i(`X!g(`X~P!6kO!].tO!k(kX~P!:tO!k.wO~O!Y.yO~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mia#mij#mir#mi!]#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#n#mi~P#3cO#n$OO~P#3cOP$[OR#zOr$aO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO[#mia#mij#mi!]#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#r#mi~P#6QO#r$QO~P#6QOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO(aVOa#mi!]#mi#x#mi#z#mi#{#mi'z#mi(r#mi(y#mi(z#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#v#mi~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO(aVO(z#}Oa#mi!]#mi#z#mi#{#mi'z#mi(r#mi(y#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#x$UO~P#;VO#x#mi~P#;VO#v$SO~P#8oOP$[OR#zO[$cOj$ROr$aO!Q#yO!S#{O!l#xO!p$[O#R$RO#n$OO#o$PO#p$PO#q$PO#r$QO#s$RO#t$RO#u$bO#v$SO#x$UO(aVO(y#|O(z#}Oa#mi!]#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~O#z#mi~P#={O#z$WO~P#={OP]XR]X[]Xj]Xr]X!Q]X!S]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X!]]X!^]X~O$O]X~P#@jOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO#z<gO#{<hO(aVO(r$YO(y#|O(z#}O~O$O.{O~P#BwO#S$dO#`<nO$Q<nO$O(gX!^(gX~P! uOa'da!]'da'z'da'w'da!k'da!Y'dav'da!_'da%i'da!g'da~P!:tO[#mia#mij#mir#mi!]#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi'z#mi(r#mi'w#mi!Y#mi!k#miv#mi!_#mi%i#mi!g#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n$OO#o$PO#p$PO#q$PO(aVO(y#mi(z#mi~P#EyOn>]O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P#EyO!]/POg(pX~P!1WOg/RO~Oa$Pi!]$Pi'z$Pi'w$Pi!Y$Pi!k$Piv$Pi!_$Pi%i$Pi!g$Pi~P!:tO$]/SO$_/SO~O$]/TO$_/TO~O!g)hO#`/UO!_$cX$Z$cX$]$cX$_$cX$f$cX~O![/VO~O!_)kO$Z/XO$])jO$_)jO$f/YO~O!]<iO!^(fX~P#BwO!^/ZO~O!g)hO$f({X~O$f/]O~Ov/^O~P!&zOx)yO(b)zO(c/aO~O!S/dO~O(y$}On%aa!Q%aa'y%aa(z%aa!]%aa#`%aa~Og%aa$O%aa~P#L{O(z%POn%ca!Q%ca'y%ca(y%ca!]%ca#`%ca~Og%ca$O%ca~P#MnO!]fX!gfX!kfX!k$zX(rfX~P!0SOp%WO![/mO!](^O(T/lO!Y(vP!Y)PP~P!1uOr*sO!b*qO!c*kO!d*kO!l*bO#[*rO%`*mO(U!lO(VTO(YUO~Os<}O!S/nO![+[O!^*pO(e<|O!^(xP~P$ [O!k/oO~P#/sO!]/pO!g#vO(r'pO!k)OX~O!k/uO~OnoX!QoX'yoX(yoX(zoX~O!g#vO!koX~P$#OOp/wO!S%hO![*^O!_%iO(T%gO!k)OP~O#k/xO~O!Y$zX!]$zX!g%RX~P!0SO!]/yO!Y)PX~P#/sO!g/{O~O!Y/}O~OpkO(T0OO~P.iOh%VOr0TO!g#vO!l%eO(r'pO~O!g+iO~Oa%nO!]0XO'z%nO~O!^0ZO~P!5iO!c0[O!d0[O(U!lO~P#$`Os!nO!S0]O(VTO(YUO(e!mO~O#[0_O~Og%aa!]%aa#`%aa$O%aa~P!1WOg%ca!]%ca#`%ca$O%ca~P!1WOj%dOk%dOl%dO(T&ZOg'mX!]'mX~O!]*yOg(^a~Og0hO~On0jO#`0iOg(_a!](_a~OR0kO!Q0kO!S0lO#S$dOn}a'y}a(y}a(z}a!]}a#`}a~Og}a$O}a~P$(cO!Q*OO'y*POn$sa(y$sa(z$sa!]$sa#`$sa~Og$sa$O$sa~P$)_O!Q*OO'y*POn$ua(y$ua(z$ua!]$ua#`$ua~Og$ua$O$ua~P$*QO#k0oO~Og%Ta!]%Ta#`%Ta$O%Ta~P!1WO!g#vO~O#k0rO~O!]+^Oa)Ta'z)Ta~OR#zO!Q#yO!S#{O!l#xO(aVOP!ri[!rij!rir!ri!]!ri!p!ri#R!ri#n!ri#o!ri#p!ri#q!ri#r!ri#s!ri#t!ri#u!ri#v!ri#x!ri#z!ri#{!ri(r!ri(y!ri(z!ri~Oa!ri'z!ri'w!ri!Y!ri!k!riv!ri!_!ri%i!ri!g!ri~P$+oOh%VOr%XOs$tOt$tOz%YO|%ZO!O<sO!S${O!_$|O!i>VO!l$xO#j<yO$W%`O$t<uO$v<wO$y%aO(VTO(YUO(a$uO(y$}O(z%PO~Op0{O%]0|O(T0zO~P$.VO!g+iOa(]a!_(]a'z(]a!](]a~O#k1SO~O[]X!]fX!^fX~O!]1TO!^)XX~O!^1VO~O[1WO~Ob1YO(T+qO(VTO(YUO~O!_&PO(T%gO`'uX!]'uX~O!]+vO`)Wa~O!k1]O~P!:tO[1`O~O`1aO~O#`1fO~On1iO!_$|O~O(e(|O!^)UP~Oh%VOn1rO!_1oO%i1qO~O[1|O!]1zO!^)VX~O!^1}O~O`2POa%nO'z%nO~O(T#nO(VTO(YUO~O#S$dO#`$eO$Q$eOP(gXR(gX[(gXr(gX!Q(gX!S(gX!](gX!l(gX!p(gX#R(gX#n(gX#o(gX#p(gX#q(gX#r(gX#s(gX#t(gX#u(gX#v(gX#x(gX#z(gX#{(gX(a(gX(r(gX(y(gX(z(gX~Oj2SO&[2TOa(gX~P$3pOj2SO#`$eO&[2TO~Oa2VO~P%[Oa2XO~O&e2[OP&ciQ&ciS&ciY&cia&cid&cie&cil&cip&cir&cis&cit&ciz&ci|&ci!O&ci!S&ci!W&ci!X&ci!_&ci!i&ci!l&ci!o&ci!p&ci!q&ci!s&ci!u&ci!x&ci!|&ci$W&ci$n&ci%h&ci%j&ci%l&ci%m&ci%n&ci%q&ci%s&ci%v&ci%w&ci%y&ci&W&ci&^&ci&`&ci&b&ci&d&ci&g&ci&m&ci&s&ci&u&ci&w&ci&y&ci&{&ci'w&ci(T&ci(V&ci(Y&ci(a&ci(o&ci!^&cib&ci&j&ci~Ob2bO!^2`O&j2aO~P`O!_XO!l2dO~O&q,{OP&liQ&liS&liY&lia&lid&lie&lil&lip&lir&lis&lit&liz&li|&li!O&li!S&li!W&li!X&li!_&li!i&li!l&li!o&li!p&li!q&li!s&li!u&li!x&li!|&li$W&li$n&li%h&li%j&li%l&li%m&li%n&li%q&li%s&li%v&li%w&li%y&li&W&li&^&li&`&li&b&li&d&li&g&li&m&li&s&li&u&li&w&li&y&li&{&li'w&li(T&li(V&li(Y&li(a&li(o&li!^&li&e&lib&li&j&li~O!Y2jO~O!]!aa!^!aa~P#BwOs!nO!S!oO![2pO(e!mO!]'XX!^'XX~P@nO!]-]O!^(ia~O!]'_X!^'_X~P!9|O!]-`O!^(xa~O!^2wO~P'_Oa%nO#`3QO'z%nO~Oa%nO!g#vO#`3QO'z%nO~Oa%nO!g#vO!p3UO#`3QO'z%nO(r'pO~Oa%nO'z%nO~P!:tO!]$_Ov$qa~O!Y'Wi!]'Wi~P!:tO!](VO!Y(hi~O!](^O!Y(vi~O!Y(wi!](wi~P!:tO!](ti!k(tia(ti'z(ti~P!:tO#`3WO!](ti!k(tia(ti'z(ti~O!](jO!k(si~O!S%hO!_%iO!|]O#i3]O#j3[O(T%gO~O!S%hO!_%iO#j3[O(T%gO~On3dO!_'`O%i3cO~Oh%VOn3dO!_'`O%i3cO~O#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aav%aa!_%aa%i%aa!g%aa~P#L{O#k%caP%caR%ca[%caa%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%cav%ca!_%ca%i%ca!g%ca~P#MnO#k%aaP%aaR%aa[%aaa%aaj%aar%aa!S%aa!]%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa'z%aa(a%aa(r%aa!k%aa!Y%aa'w%aa#`%aav%aa!_%aa%i%aa!g%aa~P#/sO#k%caP%caR%ca[%caa%caj%car%ca!S%ca!]%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca'z%ca(a%ca(r%ca!k%ca!Y%ca'w%ca#`%cav%ca!_%ca%i%ca!g%ca~P#/sO#k}aP}a[}aa}aj}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a'z}a(a}a(r}a!k}a!Y}a'w}av}a!_}a%i}a!g}a~P$(cO#k$saP$saR$sa[$saa$saj$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa'z$sa(a$sa(r$sa!k$sa!Y$sa'w$sav$sa!_$sa%i$sa!g$sa~P$)_O#k$uaP$uaR$ua[$uaa$uaj$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua'z$ua(a$ua(r$ua!k$ua!Y$ua'w$uav$ua!_$ua%i$ua!g$ua~P$*QO#k%TaP%TaR%Ta[%Taa%Taj%Tar%Ta!S%Ta!]%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta'z%Ta(a%Ta(r%Ta!k%Ta!Y%Ta'w%Ta#`%Tav%Ta!_%Ta%i%Ta!g%Ta~P#/sOa#cq!]#cq'z#cq'w#cq!Y#cq!k#cqv#cq!_#cq%i#cq!g#cq~P!:tO![3lO!]'YX!k'YX~P%[O!].tO!k(ka~O!].tO!k(ka~P!:tO!Y3oO~O$O!na!^!na~PKlO$O!ja!]!ja!^!ja~P#BwO$O!ra!^!ra~P!=[O$O!ta!^!ta~P!?rOg']X!]']X~P!,TO!]/POg(pa~OSfO!_4TO$d4UO~O!^4YO~Ov4ZO~P#/sOa$mq!]$mq'z$mq'w$mq!Y$mq!k$mqv$mq!_$mq%i$mq!g$mq~P!:tO!Y4]O~P!&zO!S4^O~O!Q*OO'y*PO(z%POn'ia(y'ia!]'ia#`'ia~Og'ia$O'ia~P%-fO!Q*OO'y*POn'ka(y'ka(z'ka!]'ka#`'ka~Og'ka$O'ka~P%.XO(r$YO~P#/sO!YfX!Y$zX!]fX!]$zX!g%RX#`fX~P!0SOp%WO(T=WO~P!1uOp4bO!S%hO![4aO!_%iO(T%gO!]'eX!k'eX~O!]/pO!k)Oa~O!]/pO!g#vO!k)Oa~O!]/pO!g#vO(r'pO!k)Oa~Og$|i!]$|i#`$|i$O$|i~P!1WO![4jO!Y'gX!]'gX~P!3tO!]/yO!Y)Pa~O!]/yO!Y)Pa~P#/sOP]XR]X[]Xj]Xr]X!Q]X!S]X!Y]X!]]X!l]X!p]X#R]X#S]X#`]X#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~Oj%YX!g%YX~P%2OOj4oO!g#vO~Oh%VO!g#vO!l%eO~Oh%VOr4tO!l%eO(r'pO~Or4yO!g#vO(r'pO~Os!nO!S4zO(VTO(YUO(e!mO~O(y$}On%ai!Q%ai'y%ai(z%ai!]%ai#`%ai~Og%ai$O%ai~P%5oO(z%POn%ci!Q%ci'y%ci(y%ci!]%ci#`%ci~Og%ci$O%ci~P%6bOg(_i!](_i~P!1WO#`5QOg(_i!](_i~P!1WO!k5VO~Oa$oq!]$oq'z$oq'w$oq!Y$oq!k$oqv$oq!_$oq%i$oq!g$oq~P!:tO!Y5ZO~O!]5[O!_)QX~P#/sOa$zX!_$zX%^]X'z$zX!]$zX~P!0SO%^5_OaoX!_oX'zoX!]oX~P$#OOp5`O(T#nO~O%^5_O~Ob5fO%j5gO(T+qO(VTO(YUO!]'tX!^'tX~O!]1TO!^)Xa~O[5kO~O`5lO~O[5pO~Oa%nO'z%nO~P#/sO!]5uO#`5wO!^)UX~O!^5xO~Or6OOs!nO!S*iO!b!yO!c!vO!d!vO!|<VO#T!pO#U!pO#V!pO#W!pO#X!pO#[5}O#]!zO(U!lO(VTO(YUO(e!mO(o!sO~O!^5|O~P%;eOn6TO!_1oO%i6SO~Oh%VOn6TO!_1oO%i6SO~Ob6[O(T#nO(VTO(YUO!]'sX!^'sX~O!]1zO!^)Va~O(VTO(YUO(e6^O~O`6bO~Oj6eO&[6fO~PNXO!k6gO~P%[Oa6iO~Oa6iO~P%[Ob2bO!^6nO&j2aO~P`O!g6pO~O!g6rOh(ji!](ji!^(ji!g(ji!l(jir(ji(r(ji~O!]#hi!^#hi~P#BwO#`6sO!]#hi!^#hi~O!]!ai!^!ai~P#BwOa%nO#`6|O'z%nO~Oa%nO!g#vO#`6|O'z%nO~O!](tq!k(tqa(tq'z(tq~P!:tO!](jO!k(sq~O!S%hO!_%iO#j7TO(T%gO~O!_'`O%i7WO~On7[O!_'`O%i7WO~O#k'iaP'iaR'ia['iaa'iaj'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia'z'ia(a'ia(r'ia!k'ia!Y'ia'w'iav'ia!_'ia%i'ia!g'ia~P%-fO#k'kaP'kaR'ka['kaa'kaj'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka'z'ka(a'ka(r'ka!k'ka!Y'ka'w'kav'ka!_'ka%i'ka!g'ka~P%.XO#k$|iP$|iR$|i[$|ia$|ij$|ir$|i!S$|i!]$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i'z$|i(a$|i(r$|i!k$|i!Y$|i'w$|i#`$|iv$|i!_$|i%i$|i!g$|i~P#/sO#k%aiP%aiR%ai[%aia%aij%air%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai'z%ai(a%ai(r%ai!k%ai!Y%ai'w%aiv%ai!_%ai%i%ai!g%ai~P%5oO#k%ciP%ciR%ci[%cia%cij%cir%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci'z%ci(a%ci(r%ci!k%ci!Y%ci'w%civ%ci!_%ci%i%ci!g%ci~P%6bO!]'Ya!k'Ya~P!:tO!].tO!k(ki~O$O#ci!]#ci!^#ci~P#BwOP$[OR#zO!Q#yO!S#{O!l#xO!p$[O(aVO[#mij#mir#mi#R#mi#o#mi#p#mi#q#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#n#mi~P%NdO#n<_O~P%NdOP$[OR#zOr<kO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO[#mij#mi#R#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#r#mi~P&!lO#r<aO~P&!lOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO(aVO#x#mi#z#mi#{#mi$O#mi(r#mi(y#mi(z#mi!]#mi!^#mi~O#v#mi~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO(aVO(z#}O#z#mi#{#mi$O#mi(r#mi(y#mi!]#mi!^#mi~O#x<eO~P&&uO#x#mi~P&&uO#v<cO~P&$tOP$[OR#zO[<mOj<bOr<kO!Q#yO!S#{O!l#xO!p$[O#R<bO#n<_O#o<`O#p<`O#q<`O#r<aO#s<bO#t<bO#u<lO#v<cO#x<eO(aVO(y#|O(z#}O#{#mi$O#mi(r#mi!]#mi!^#mi~O#z#mi~P&)UO#z<gO~P&)UOa#|y!]#|y'z#|y'w#|y!Y#|y!k#|yv#|y!_#|y%i#|y!g#|y~P!:tO[#mij#mir#mi#R#mi#r#mi#s#mi#t#mi#u#mi#v#mi#x#mi#z#mi#{#mi$O#mi(r#mi!]#mi!^#mi~OP$[OR#zO!Q#yO!S#{O!l#xO!p$[O#n<_O#o<`O#p<`O#q<`O(aVO(y#mi(z#mi~P&,QOn>^O!Q*OO'y*PO(y$}O(z%POP#miR#mi!S#mi!l#mi!p#mi#n#mi#o#mi#p#mi#q#mi(a#mi~P&,QO#S$dOP(`XR(`X[(`Xj(`Xn(`Xr(`X!Q(`X!S(`X!l(`X!p(`X#R(`X#n(`X#o(`X#p(`X#q(`X#r(`X#s(`X#t(`X#u(`X#v(`X#x(`X#z(`X#{(`X$O(`X'y(`X(a(`X(r(`X(y(`X(z(`X!](`X!^(`X~O$O$Pi!]$Pi!^$Pi~P#BwO$O!ri!^!ri~P$+oOg']a!]']a~P!1WO!^7nO~O!]'da!^'da~P#BwO!Y7oO~P#/sO!g#vO(r'pO!]'ea!k'ea~O!]/pO!k)Oi~O!]/pO!g#vO!k)Oi~Og$|q!]$|q#`$|q$O$|q~P!1WO!Y'ga!]'ga~P#/sO!g7vO~O!]/yO!Y)Pi~P#/sO!]/yO!Y)Pi~O!Y7yO~Oh%VOr8OO!l%eO(r'pO~Oj8QO!g#vO~Or8TO!g#vO(r'pO~O!Q*OO'y*PO(z%POn'ja(y'ja!]'ja#`'ja~Og'ja$O'ja~P&5RO!Q*OO'y*POn'la(y'la(z'la!]'la#`'la~Og'la$O'la~P&5tOg(_q!](_q~P!1WO#`8VOg(_q!](_q~P!1WO!Y8WO~Og%Oq!]%Oq#`%Oq$O%Oq~P!1WOa$oy!]$oy'z$oy'w$oy!Y$oy!k$oyv$oy!_$oy%i$oy!g$oy~P!:tO!g6rO~O!]5[O!_)Qa~O!_'`OP$TaR$Ta[$Taj$Tar$Ta!Q$Ta!S$Ta!]$Ta!l$Ta!p$Ta#R$Ta#n$Ta#o$Ta#p$Ta#q$Ta#r$Ta#s$Ta#t$Ta#u$Ta#v$Ta#x$Ta#z$Ta#{$Ta(a$Ta(r$Ta(y$Ta(z$Ta~O%i7WO~P&8fO%^8[Oa%[i!_%[i'z%[i!]%[i~Oa#cy!]#cy'z#cy'w#cy!Y#cy!k#cyv#cy!_#cy%i#cy!g#cy~P!:tO[8^O~Ob8`O(T+qO(VTO(YUO~O!]1TO!^)Xi~O`8dO~O(e(|O!]'pX!^'pX~O!]5uO!^)Ua~O!^8nO~P%;eO(o!sO~P$&YO#[8oO~O!_1oO~O!_1oO%i8qO~On8tO!_1oO%i8qO~O[8yO!]'sa!^'sa~O!]1zO!^)Vi~O!k8}O~O!k9OO~O!k9RO~O!k9RO~P%[Oa9TO~O!g9UO~O!k9VO~O!](wi!^(wi~P#BwOa%nO#`9_O'z%nO~O!](ty!k(tya(ty'z(ty~P!:tO!](jO!k(sy~O%i9bO~P&8fO!_'`O%i9bO~O#k$|qP$|qR$|q[$|qa$|qj$|qr$|q!S$|q!]$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q'z$|q(a$|q(r$|q!k$|q!Y$|q'w$|q#`$|qv$|q!_$|q%i$|q!g$|q~P#/sO#k'jaP'jaR'ja['jaa'jaj'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja'z'ja(a'ja(r'ja!k'ja!Y'ja'w'jav'ja!_'ja%i'ja!g'ja~P&5RO#k'laP'laR'la['laa'laj'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la'z'la(a'la(r'la!k'la!Y'la'w'lav'la!_'la%i'la!g'la~P&5tO#k%OqP%OqR%Oq[%Oqa%Oqj%Oqr%Oq!S%Oq!]%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq'z%Oq(a%Oq(r%Oq!k%Oq!Y%Oq'w%Oq#`%Oqv%Oq!_%Oq%i%Oq!g%Oq~P#/sO!]'Yi!k'Yi~P!:tO$O#cq!]#cq!^#cq~P#BwO(y$}OP%aaR%aa[%aaj%aar%aa!S%aa!l%aa!p%aa#R%aa#n%aa#o%aa#p%aa#q%aa#r%aa#s%aa#t%aa#u%aa#v%aa#x%aa#z%aa#{%aa$O%aa(a%aa(r%aa!]%aa!^%aa~On%aa!Q%aa'y%aa(z%aa~P&IyO(z%POP%caR%ca[%caj%car%ca!S%ca!l%ca!p%ca#R%ca#n%ca#o%ca#p%ca#q%ca#r%ca#s%ca#t%ca#u%ca#v%ca#x%ca#z%ca#{%ca$O%ca(a%ca(r%ca!]%ca!^%ca~On%ca!Q%ca'y%ca(y%ca~P&LQOn>^O!Q*OO'y*PO(z%PO~P&IyOn>^O!Q*OO'y*PO(y$}O~P&LQOR0kO!Q0kO!S0lO#S$dOP}a[}aj}an}ar}a!l}a!p}a#R}a#n}a#o}a#p}a#q}a#r}a#s}a#t}a#u}a#v}a#x}a#z}a#{}a$O}a'y}a(a}a(r}a(y}a(z}a!]}a!^}a~O!Q*OO'y*POP$saR$sa[$saj$san$sar$sa!S$sa!l$sa!p$sa#R$sa#n$sa#o$sa#p$sa#q$sa#r$sa#s$sa#t$sa#u$sa#v$sa#x$sa#z$sa#{$sa$O$sa(a$sa(r$sa(y$sa(z$sa!]$sa!^$sa~O!Q*OO'y*POP$uaR$ua[$uaj$uan$uar$ua!S$ua!l$ua!p$ua#R$ua#n$ua#o$ua#p$ua#q$ua#r$ua#s$ua#t$ua#u$ua#v$ua#x$ua#z$ua#{$ua$O$ua(a$ua(r$ua(y$ua(z$ua!]$ua!^$ua~On>^O!Q*OO'y*PO(y$}O(z%PO~OP%TaR%Ta[%Taj%Tar%Ta!S%Ta!l%Ta!p%Ta#R%Ta#n%Ta#o%Ta#p%Ta#q%Ta#r%Ta#s%Ta#t%Ta#u%Ta#v%Ta#x%Ta#z%Ta#{%Ta$O%Ta(a%Ta(r%Ta!]%Ta!^%Ta~P''VO$O$mq!]$mq!^$mq~P#BwO$O$oq!]$oq!^$oq~P#BwO!^9oO~O$O9pO~P!1WO!g#vO!]'ei!k'ei~O!g#vO(r'pO!]'ei!k'ei~O!]/pO!k)Oq~O!Y'gi!]'gi~P#/sO!]/yO!Y)Pq~Or9wO!g#vO(r'pO~O[9yO!Y9xO~P#/sO!Y9xO~Oj:PO!g#vO~Og(_y!](_y~P!1WO!]'na!_'na~P#/sOa%[q!_%[q'z%[q!]%[q~P#/sO[:UO~O!]1TO!^)Xq~O`:YO~O#`:ZO!]'pa!^'pa~O!]5uO!^)Ui~P#BwO!S:]O~O!_1oO%i:`O~O(VTO(YUO(e:eO~O!]1zO!^)Vq~O!k:hO~O!k:iO~O!k:jO~O!k:jO~P%[O#`:mO!]#hy!^#hy~O!]#hy!^#hy~P#BwO%i:rO~P&8fO!_'`O%i:rO~O$O#|y!]#|y!^#|y~P#BwOP$|iR$|i[$|ij$|ir$|i!S$|i!l$|i!p$|i#R$|i#n$|i#o$|i#p$|i#q$|i#r$|i#s$|i#t$|i#u$|i#v$|i#x$|i#z$|i#{$|i$O$|i(a$|i(r$|i!]$|i!^$|i~P''VO!Q*OO'y*PO(z%POP'iaR'ia['iaj'ian'iar'ia!S'ia!l'ia!p'ia#R'ia#n'ia#o'ia#p'ia#q'ia#r'ia#s'ia#t'ia#u'ia#v'ia#x'ia#z'ia#{'ia$O'ia(a'ia(r'ia(y'ia!]'ia!^'ia~O!Q*OO'y*POP'kaR'ka['kaj'kan'kar'ka!S'ka!l'ka!p'ka#R'ka#n'ka#o'ka#p'ka#q'ka#r'ka#s'ka#t'ka#u'ka#v'ka#x'ka#z'ka#{'ka$O'ka(a'ka(r'ka(y'ka(z'ka!]'ka!^'ka~O(y$}OP%aiR%ai[%aij%ain%air%ai!Q%ai!S%ai!l%ai!p%ai#R%ai#n%ai#o%ai#p%ai#q%ai#r%ai#s%ai#t%ai#u%ai#v%ai#x%ai#z%ai#{%ai$O%ai'y%ai(a%ai(r%ai(z%ai!]%ai!^%ai~O(z%POP%ciR%ci[%cij%cin%cir%ci!Q%ci!S%ci!l%ci!p%ci#R%ci#n%ci#o%ci#p%ci#q%ci#r%ci#s%ci#t%ci#u%ci#v%ci#x%ci#z%ci#{%ci$O%ci'y%ci(a%ci(r%ci(y%ci!]%ci!^%ci~O$O$oy!]$oy!^$oy~P#BwO$O#cy!]#cy!^#cy~P#BwO!g#vO!]'eq!k'eq~O!]/pO!k)Oy~O!Y'gq!]'gq~P#/sOr:|O!g#vO(r'pO~O[;QO!Y;PO~P#/sO!Y;PO~Og(_!R!](_!R~P!1WOa%[y!_%[y'z%[y!]%[y~P#/sO!]1TO!^)Xy~O!]5uO!^)Uq~O(T;XO~O!_1oO%i;[O~O!k;_O~O%i;dO~P&8fOP$|qR$|q[$|qj$|qr$|q!S$|q!l$|q!p$|q#R$|q#n$|q#o$|q#p$|q#q$|q#r$|q#s$|q#t$|q#u$|q#v$|q#x$|q#z$|q#{$|q$O$|q(a$|q(r$|q!]$|q!^$|q~P''VO!Q*OO'y*PO(z%POP'jaR'ja['jaj'jan'jar'ja!S'ja!l'ja!p'ja#R'ja#n'ja#o'ja#p'ja#q'ja#r'ja#s'ja#t'ja#u'ja#v'ja#x'ja#z'ja#{'ja$O'ja(a'ja(r'ja(y'ja!]'ja!^'ja~O!Q*OO'y*POP'laR'la['laj'lan'lar'la!S'la!l'la!p'la#R'la#n'la#o'la#p'la#q'la#r'la#s'la#t'la#u'la#v'la#x'la#z'la#{'la$O'la(a'la(r'la(y'la(z'la!]'la!^'la~OP%OqR%Oq[%Oqj%Oqr%Oq!S%Oq!l%Oq!p%Oq#R%Oq#n%Oq#o%Oq#p%Oq#q%Oq#r%Oq#s%Oq#t%Oq#u%Oq#v%Oq#x%Oq#z%Oq#{%Oq$O%Oq(a%Oq(r%Oq!]%Oq!^%Oq~P''VOg%e!Z!]%e!Z#`%e!Z$O%e!Z~P!1WO!Y;hO~P#/sOr;iO!g#vO(r'pO~O[;kO!Y;hO~P#/sO!]'pq!^'pq~P#BwO!]#h!Z!^#h!Z~P#BwO#k%e!ZP%e!ZR%e!Z[%e!Za%e!Zj%e!Zr%e!Z!S%e!Z!]%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z'z%e!Z(a%e!Z(r%e!Z!k%e!Z!Y%e!Z'w%e!Z#`%e!Zv%e!Z!_%e!Z%i%e!Z!g%e!Z~P#/sOr;tO!g#vO(r'pO~O!Y;uO~P#/sOr;|O!g#vO(r'pO~O!Y;}O~P#/sOP%e!ZR%e!Z[%e!Zj%e!Zr%e!Z!S%e!Z!l%e!Z!p%e!Z#R%e!Z#n%e!Z#o%e!Z#p%e!Z#q%e!Z#r%e!Z#s%e!Z#t%e!Z#u%e!Z#v%e!Z#x%e!Z#z%e!Z#{%e!Z$O%e!Z(a%e!Z(r%e!Z!]%e!Z!^%e!Z~P''VOr<QO!g#vO(r'pO~Ov(fX~P1qO!Q%rO~P!)[O(U!lO~P!)[O!YfX!]fX#`fX~P%2OOP]XR]X[]Xj]Xr]X!Q]X!S]X!]]X!]fX!l]X!p]X#R]X#S]X#`]X#`fX#kfX#n]X#o]X#p]X#q]X#r]X#s]X#t]X#u]X#v]X#x]X#z]X#{]X$Q]X(a]X(r]X(y]X(z]X~O!gfX!k]X!kfX(rfX~P'LTOP<UOQ<UOSfOd>ROe!iOpkOr<UOskOtkOzkO|<UO!O<UO!SWO!WkO!XkO!_XO!i<XO!lZO!o<UO!p<UO!q<UO!s<YO!u<]O!x!hO$W!kO$n>PO(T)]O(VTO(YUO(aVO(o[O~O!]<iO!^$qa~Oh%VOp%WOr%XOs$tOt$tOz%YO|%ZO!O<tO!S${O!_$|O!i>WO!l$xO#j<zO$W%`O$t<vO$v<xO$y%aO(T(vO(VTO(YUO(a$uO(y$}O(z%PO~Ol)dO~P(!yOr!eX(r!eX~P#!iOr(jX(r(jX~P##[O!^]X!^fX~P'LTO!YfX!Y$zX!]fX!]$zX#`fX~P!0SO#k<^O~O!g#vO#k<^O~O#`<nO~Oj<bO~O#`=OO!](wX!^(wX~O#`<nO!](uX!^(uX~O#k=PO~Og=RO~P!1WO#k=XO~O#k=YO~Og=RO(T&ZO~O!g#vO#k=ZO~O!g#vO#k=PO~O$O=[O~P#BwO#k=]O~O#k=^O~O#k=cO~O#k=dO~O#k=eO~O#k=fO~O$O=gO~P!1WO$O=hO~P!1WOl=sO~P7eOk#S#T#U#W#X#[#i#j#u$n$t$v$y%]%^%h%i%j%q%s%v%w%y%{~(OT#o!X'|(U#ps#n#qr!Q'}$]'}(T$_(e~",goto:"$9Y)]PPPPPP)^PP)aP)rP+W/]PPPP6mPP7TPP=QPPP@tPA^PA^PPPA^PCfPA^PA^PA^PCjPCoPD^PIWPPPI[PPPPI[L_PPPLeMVPI[PI[PP! eI[PPPI[PI[P!#lI[P!'S!(X!(bP!)U!)Y!)U!,gPPPPPPP!-W!(XPP!-h!/YP!2iI[I[!2n!5z!:h!:h!>gPPP!>oI[PPPPPPPPP!BOP!C]PPI[!DnPI[PI[I[I[I[I[PI[!FQP!I[P!LbP!Lf!Lp!Lt!LtP!IXP!Lx!LxP#!OP#!SI[PI[#!Y#%_CjA^PA^PA^A^P#&lA^A^#)OA^#+vA^#.SA^A^#.r#1W#1W#1]#1f#1W#1qPP#1WPA^#2ZA^#6YA^A^6mPPP#:_PPP#:x#:xP#:xP#;`#:xPP#;fP#;]P#;]#;y#;]#<e#<k#<n)aP#<q)aP#<z#<z#<zP)aP)aP)aP)aPP)aP#=Q#=TP#=T)aP#=XP#=[P)aP)aP)aP)aP)aP)a)aPP#=b#=h#=s#=y#>P#>V#>]#>k#>q#>{#?R#?]#?c#?s#?y#@k#@}#AT#AZ#Ai#BO#Cs#DR#DY#Et#FS#Gt#HS#HY#H`#Hf#Hp#Hv#H|#IW#Ij#IpPPPPPPPPPPP#IvPPPPPPP#Jk#Mx$ b$ i$ qPPP$']P$'f$*_$0x$0{$1O$1}$2Q$2X$2aP$2g$2jP$3W$3[$4S$5b$5g$5}PP$6S$6Y$6^$6a$6e$6i$7e$7|$8e$8i$8l$8o$8y$8|$9Q$9UR!|RoqOXst!Z#d%m&r&t&u&w,s,x2[2_Y!vQ'`-e1o5{Q%tvQ%|yQ&T|Q&j!VS'W!e-]Q'f!iS'l!r!yU*k$|*Z*oQ+o%}S+|&V&WQ,d&dQ-c'_Q-m'gQ-u'mQ0[*qQ1b,OQ1y,eR<{<Y%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_S#q]<V!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU+P%]<s<tQ+t&PQ,f&gQ,m&oQ0x+gQ0}+iQ1Y+uQ2R,kQ3`.gQ5`0|Q5f1TQ6[1zQ7Y3dQ8`5gR9e7['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S!S!nQ!r!v!y!z$|'W'_'`'l'm'n*k*o*q*r-]-c-e-u0[0_1o5{5}%[$ti#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q&X|Q'U!eS'[%i-`Q+t&PQ,P&WQ,f&gQ0n+SQ1Y+uQ1_+{Q2Q,jQ2R,kQ5f1TQ5o1aQ6[1zQ6_1|Q6`2PQ8`5gQ8c5lQ8|6bQ:X8dQ:f8yQ;V:YR<}*ZrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R,h&k&z^OPXYstuvwz!Z!`!g!j!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'b'r(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>R>S[#]WZ#W#Z'X(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ%wxQ%{yW&Q|&V&W,OQ&_!TQ'c!hQ'e!iQ(q#sS+n%|%}Q+r&PQ,_&bQ,c&dS-l'f'gQ.i(rQ1R+oQ1X+uQ1Z+vQ1^+zQ1t,`S1x,d,eQ2|-mQ5e1TQ5i1WQ5n1`Q6Z1yQ8_5gQ8b5kQ8f5pQ:T8^R;T:U!U$zi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y!^%yy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{Q+h%wQ,T&[Q,W&]Q,b&dQ.h(qQ1s,_U1w,c,d,eQ3e.iQ6U1tS6Y1x1yQ8x6Z#f>T#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o>U<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hW%Ti%V*y>PS&[!Q&iQ&]!RQ&^!SU*}%[%d=sR,R&Y%]%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^T)z$u){V+P%]<s<tW'[!e%i*Z-`S(}#y#zQ+c%rQ+y&SS.b(m(nQ1j,XQ5T0kR8i5u'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S$i$^c#Y#e%q%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.|.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vT#TV#U'RkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ'Y!eR2q-]!W!nQ!e!r!v!y!z$|'W'_'`'l'm'n*Z*k*o*q*r-]-c-e-u0[0_1o5{5}R1l,ZnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&y!^Q'v!xS(s#u<^Q+l%zQ,]&_Q,^&aQ-j'dQ-w'oS.r(x=PS0q+X=ZQ1P+mQ1n,[Q2c,zQ2e,{Q2m-WQ2z-kQ2}-oS5Y0r=eQ5a1QS5d1S=fQ6t2oQ6x2{Q6}3SQ8]5bQ9Y6vQ9Z6yQ9^7OR:l9V$d$]c#Y#e%s%u(S(Y(t(y)R)S)T)U)V)W)X)Y)Z)[)^)`)b)g)q+d+x-Z-x-}.S.U.s.v.z.}/O/b0p2k2n3O3V3k3p3q3r3s3t3u3v3w3x3y3z3{3|4P4Q4X5X5c6u6{7Q7a7b7k7l8k9X9]9g9m9n:o;W;`<W=vS(o#p'iQ)P#zS+b%q.|S.c(n(pR3^.d'QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS#q]<VQ&t!XQ&u!YQ&w![Q&x!]R2Z,vQ'a!hQ+e%wQ-h'cS.e(q+hQ2x-gW3b.h.i0w0yQ6w2yW7U3_3a3e5^U9a7V7X7ZU:q9c9d9fS;b:p:sQ;p;cR;x;qU!wQ'`-eT5y1o5{!Q_OXZ`st!V!Z#d#h%e%m&i&k&r&t&u&w(j,s,x.[2[2_]!pQ!r'`-e1o5{T#q]<V%^{OPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S(}#y#zS.b(m(n!s=l$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SU$fd)_,mS(p#p'iU*v%R(w4OU0m+O.n7gQ5^0xQ7V3`Q9d7YR:s9em!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}Q't!uS(f#g2US-s'k'wQ/s*]Q0R*jQ3U-vQ4f/tQ4r0TQ4s0UQ4x0^Q7r4`S7}4t4vS8R4y4{Q9r7sQ9v7yQ9{8OQ:Q8TS:{9w9xS;g:|;PS;s;h;iS;{;t;uS<P;|;}R<S<QQ#wbQ's!uS(e#g2US(g#m+WQ+Y%fQ+j%xQ+p&OU-r'k't'wQ.W(fU/r*]*`/wQ0S*jQ0V*lQ1O+kQ1u,aS3R-s-vQ3Z.`S4e/s/tQ4n0PS4q0R0^Q4u0WQ6W1vQ7P3US7q4`4bQ7u4fU7|4r4x4{Q8P4wQ8v6XS9q7r7sQ9u7yQ9}8RQ:O8SQ:c8wQ:y9rS:z9v9xQ;S:QQ;^:dS;f:{;PS;r;g;hS;z;s;uS<O;{;}Q<R<PQ<T<SQ=o=jQ={=tR=|=uV!wQ'`-e%^aOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_S#wz!j!r=i$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=o>R%^bOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Q%fj!^%xy!i!u%{%|%}'V'e'f'g'k'u*j+n+o-Y-l-m-t0R0U1R2u2|3T4r4s4v7}9{S&Oz!jQ+k%yQ,a&dW1v,b,c,d,eU6X1w1x1yS8w6Y6ZQ:d8x!r=j$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ=t>QR=u>R%QeOPXYstuvw!Z!`!g!o#S#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_Y#bWZ#W#Z(T!b%jm#h#i#l$x%e%h(^(h(i(j*Y*^*b+Z+[+^,o-V.T.Z.[.]._/m/p2d3[3]4a6r7TQ,n&o!p=k$Z$n)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SR=n'XU']!e%i*ZR2s-`%SdOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+],p,s,x-i-q.P.V.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3l4z6T6e6f6i6|8t9T9_!r)_$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SQ,m&oQ0x+gQ3`.gQ7Y3dR9e7[!b$Tc#Y%q(S(Y(t(y)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!P<d)^)q-Z.|2k2n3p3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!f$Vc#Y%q(S(Y(t(y)W)X)Z)[)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<W!T<f)^)q-Z.|2k2n3p3v3w3y3z4P4X6u7b7k7l8k9X9g9m9n;W;`=v!^$Zc#Y%q(S(Y(t(y)`)g+x-x-}.S.U.s.v/b0p3O3V3k3{5X5c6{7Q7a9]:o<WQ4_/kz>S)^)q-Z.|2k2n3p4P4X6u7b7k7l8k9X9g9m9n;W;`=vQ>X>ZR>Y>['QkOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>SS$oh$pR4U/U'XgOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$kf$qQ$ifS)j$l)nR)v$qT$jf$qT)l$l)n'XhOPWXYZhstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$Z$_$a$e$n$p%m%t&R&k&n&o&r&t&u&w&{'T'X'b'r(T(V(](d(x(z)O)s)}*i+X+]+g,p,s,x-U-X-i-q.P.V.g.t.{/U/V/n0]0l0r1S1r2S2T2V2X2[2_2a2p3Q3W3d3l4T4z5w6T6e6f6i6s6|7[8t9T9_:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>ST$oh$pQ$rhR)u$p%^jOPWXYZstuvw!Z!`!g!o#S#W#Z#d#o#u#x#{$O$P$Q$R$S$T$U$V$W$X$_$a$e%m%t&R&k&n&o&r&t&u&w&{'T'b'r(T(V(](d(x(z)O)}*i+X+]+g,p,s,x-i-q.P.V.g.t.{/n0]0l0r1S1r2S2T2V2X2[2_2a3Q3W3d3l4z6T6e6f6i6|7[8t9T9_!s>Q$Z$n'X)s-U-X/V2p4T5w6s:Z:m<U<X<Y<]<^<_<`<a<b<c<d<e<f<g<h<i<k<n<{=O=P=R=Z=[=e=f>S#glOPXZst!Z!`!o#S#d#o#{$n%m&k&n&o&r&t&u&w&{'T'b)O)s*i+]+g,p,s,x-i.g/V/n0]0l1r2S2T2V2X2[2_2a3d4T4z6T6e6f6i7[8t9T!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^Q+T%aQ/c*Oo4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!U$yi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>YQ*c$zU*l$|*Z*oQ+U%bQ0W*m#f=q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n=r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hQ=w>TQ=x>UQ=y>VR=z>W!U%Ri$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y#f(w#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^o4O<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=hnoOXst!Z#d%m&r&t&u&w,s,x2[2_S*f${*YQ-R'OQ-S'QR4i/y%[%Si#v$b$c$d$x${%O%Q%^%_%c)y*R*T*V*Y*a*g*w*x+f+i,S,V.f/P/d/m/x/y/{0`0b0i0j0o1f1i1q3c4^4_4j4o5Q5[5_6S7W7v8Q8V8[8q9b9p9y:P:`:r;Q;[;d;k<l<m<o<p<q<r<u<v<w<x<y<z=S=T=U=V=X=Y=]=^=_=`=a=b=c=d=g=h>P>X>Y>]>^Q,U&]Q1h,WQ5s1gR8h5tV*n$|*Z*oU*n$|*Z*oT5z1o5{S0P*i/nQ4w0]T8S4z:]Q+j%xQ0V*lQ1O+kQ1u,aQ6W1vQ8v6XQ:c8wR;^:d!U%Oi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Yx*R$v)e*S*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>OS0`*t0a#f<o#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<p<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!d=S(u)c*[*e.j.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[`=T3}7c7f7j9h:t:w;yS=_.l3iT=`7e9k!U%Qi$d%O%Q%^%_%c*R*T*a*w*x/P/x0`0b0i0j0o4_5Q8V9p>P>X>Y|*T$v)e*U*t+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>OS0b*u0c#f<q#v$b$c$x${)y*V*Y*g+f+i,S,V.f/d/m/y/{1f1i1q3c4^4j4o5[5_6S7W7v8Q8[8q9b9y:P:`:r;Q;[;d;k<o<q<u<w<y=S=U=X=]=_=a=c=g>]>^n<r<l<m<p<r<v<x<z=T=V=Y=^=`=b=d=h!h=U(u)c*[*e.k.l.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[d=V3}7d7e7j9h9i:t:u:w;yS=a.m3jT=b7f9lrnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q&f!UR,p&ornOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_R&f!UQ,Y&^R1d,RsnOXst!V!Z#d%m&i&r&t&u&w,s,x2[2_Q1p,_S6R1s1tU8p6P6Q6US:_8r8sS;Y:^:aQ;m;ZR;w;nQ&m!VR,i&iR6_1|R:f8yW&Q|&V&W,OR1Z+vQ&r!WR,s&sR,y&xT2],x2_R,}&yQ,|&yR2f,}Q'y!{R-y'ySsOtQ#dXT%ps#dQ#OTR'{#OQ#RUR'}#RQ){$uR/`){Q#UVR(Q#UQ#XWU(W#X(X.QQ(X#YR.Q(YQ-^'YR2r-^Q.u(yS3m.u3nR3n.vQ-e'`R2v-eY!rQ'`-e1o5{R'j!rQ/Q)eR4S/QU#_W%h*YU(_#_(`.RQ(`#`R.R(ZQ-a']R2t-at`OXst!V!Z#d%m&i&k&r&t&u&w,s,x2[2_S#hZ%eU#r`#h.[R.[(jQ(k#jQ.X(gW.a(k.X3X7RQ3X.YR7R3YQ)n$lR/W)nQ$phR)t$pQ$`cU)a$`-|<jQ-|<WR<j)qQ/q*]W4c/q4d7t9sU4d/r/s/tS7t4e4fR9s7u$e*Q$v(u)c)e*[*e*t*u+Q+R+V.l.m.o.p.q/_/g/i/k/v/|0d0e0v1e3f3g3h3}4R4[4g4h4l4|5O5R5S5W5r7]7^7_7`7e7f7h7i7j7p7w7z8U8X8Z9h9i9j9t9|:R:S:t:u:v:w:x:};R;e;j;v;y=p=}>O>Z>[Q/z*eU4k/z4m7xQ4m/|R7x4lS*o$|*ZR0Y*ox*S$v)e*t*u+V/v0d0e4R4g5R5S5W7p8U:R:x=p=}>O!d.j(u)c*[*e.l.m.q/_/k/|0v1e3h4[4h4l5r7]7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/h*S.j7ca7c3}7e7f7j9h:t:w;yQ0a*tQ3i.lU4}0a3i9kR9k7e|*U$v)e*t*u+V/g/v0d0e4R4g4|5R5S5W7p8U:R:x=p=}>O!h.k(u)c*[*e.l.m.q/_/k/|0v1e3f3h4[4h4l5r7]7^7`7w7z8X8Z9t9|:S:};R;e;j;v>Z>[U/j*U.k7de7d3}7e7f7j9h9i:t:u:w;yQ0c*uQ3j.mU5P0c3j9lR9l7fQ*z%UR0g*zQ5]0vR8Y5]Q+_%kR0u+_Q5v1jS8j5v:[R:[8kQ,[&_R1m,[Q5{1oR8m5{Q1{,fS6]1{8zR8z6_Q1U+rW5h1U5j8a:VQ5j1XQ8a5iR:V8bQ+w&QR1[+wQ2_,xR6m2_YrOXst#dQ&v!ZQ+a%mQ,r&rQ,t&tQ,u&uQ,w&wQ2Y,sS2],x2_R6l2[Q%opQ&z!_Q&}!aQ'P!bQ'R!cQ'q!uQ+`%lQ+l%zQ,Q&XQ,h&mQ-P&|W-p'k's't'wQ-w'oQ0X*nQ1P+mQ1c,PS2O,i,lQ2g-OQ2h-RQ2i-SQ2}-oW3P-r-s-v-xQ5a1QQ5m1_Q5q1eQ6V1uQ6a2QQ6k2ZU6z3O3R3UQ6}3SQ8]5bQ8e5oQ8g5rQ8l5zQ8u6WQ8{6`S9[6{7PQ9^7OQ:W8cQ:b8vQ:g8|Q:n9]Q;U:XQ;]:cQ;a:oQ;l;VR;o;^Q%zyQ'd!iQ'o!uU+m%{%|%}Q-W'VU-k'e'f'gS-o'k'uQ0Q*jS1Q+n+oQ2o-YS2{-l-mQ3S-tS4p0R0UQ5b1RQ6v2uQ6y2|Q7O3TU7{4r4s4vQ9z7}R;O9{S$wi>PR*{%VU%Ui%V>PR0f*yQ$viS(u#v+iS)c$b$cQ)e$dQ*[$xS*e${*YQ*t%OQ*u%QQ+Q%^Q+R%_Q+V%cQ.l<oQ.m<qQ.o<uQ.p<wQ.q<yQ/_)yQ/g*RQ/i*TQ/k*VQ/v*aS/|*g/mQ0d*wQ0e*xl0v+f,V.f1i1q3c6S7W8q9b:`:r;[;dQ1e,SQ3f=SQ3g=UQ3h=XS3}<l<mQ4R/PS4[/d4^Q4g/xQ4h/yQ4l/{Q4|0`Q5O0bQ5R0iQ5S0jQ5W0oQ5r1fQ7]=]Q7^=_Q7_=aQ7`=cQ7e<pQ7f<rQ7h<vQ7i<xQ7j<zQ7p4_Q7w4jQ7z4oQ8U5QQ8X5[Q8Z5_Q9h=YQ9i=TQ9j=VQ9t7vQ9|8QQ:R8VQ:S8[Q:t=^Q:u=`Q:v=bQ:w=dQ:x9pQ:}9yQ;R:PQ;e=gQ;j;QQ;v;kQ;y=hQ=p>PQ=}>XQ>O>YQ>Z>]R>[>^Q+O%]Q.n<sR7g<tnpOXst!Z#d%m&r&t&u&w,s,x2[2_Q!fPS#fZ#oQ&|!`W'h!o*i0]4zQ(P#SQ)Q#{Q)r$nS,l&k&nQ,q&oQ-O&{S-T'T/nQ-g'bQ.x)OQ/[)sQ0s+]Q0y+gQ2W,pQ2y-iQ3a.gQ4W/VQ5U0lQ6Q1rQ6c2SQ6d2TQ6h2VQ6j2XQ6o2aQ7Z3dQ7m4TQ8s6TQ9P6eQ9Q6fQ9S6iQ9f7[Q:a8tR:k9T#[cOPXZst!Z!`!o#d#o#{%m&k&n&o&r&t&u&w&{'T'b)O*i+]+g,p,s,x-i.g/n0]0l1r2S2T2V2X2[2_2a3d4z6T6e6f6i7[8t9TQ#YWQ#eYQ%quQ%svS%uw!gS(S#W(VQ(Y#ZQ(t#uQ(y#xQ)R$OQ)S$PQ)T$QQ)U$RQ)V$SQ)W$TQ)X$UQ)Y$VQ)Z$WQ)[$XQ)^$ZQ)`$_Q)b$aQ)g$eW)q$n)s/V4TQ+d%tQ+x&RS-Z'X2pQ-x'rS-}(T.PQ.S(]Q.U(dQ.s(xQ.v(zQ.z<UQ.|<XQ.}<YQ/O<]Q/b)}Q0p+XQ2k-UQ2n-XQ3O-qQ3V.VQ3k.tQ3p<^Q3q<_Q3r<`Q3s<aQ3t<bQ3u<cQ3v<dQ3w<eQ3x<fQ3y<gQ3z<hQ3{.{Q3|<kQ4P<nQ4Q<{Q4X<iQ5X0rQ5c1SQ6u=OQ6{3QQ7Q3WQ7a3lQ7b=PQ7k=RQ7l=ZQ8k5wQ9X6sQ9]6|Q9g=[Q9m=eQ9n=fQ:o9_Q;W:ZQ;`:mQ<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:ete,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:[ote],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#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z07[+rq$i&j(Wp(Z!b'|0/lOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z07[.ST(X#S$i&j'}0/lO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c07[.n_$i&j(Wp(Z!b'}0/lOY%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)3p/x`$i&j!p),Q(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW1V`#v(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW2d_#v(Ch$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'At3l_(V':f$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k(^4r_$i&j(Z!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k&z5vX$i&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q&z6jT$d`$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c`6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y`7bO$d``7eP;=`<%l6y&z7kP;=`<%l5q(^7w]$d`$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!r8uZ(Z!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p!r9oU$d`(Z!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!r:UP;=`<%l8p(^:[P;=`<%l4k%9[:hh$i&j(Wp(Z!bOY%ZYZ&cZq%Zqr<Srs&}st%ZtuCruw%Zwx(rx!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr(r<__WS$i&j(Wp(Z!bOY<SYZ&cZr<Srs=^sw<Swx@nx!^<S!^!_Bm!_#O<S#O#P>`#P#o<S#o#pBm#p;'S<S;'S;=`Cl<%lO<S(Q=g]WS$i&j(Z!bOY=^YZ&cZw=^wx>`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXWS$i&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSWSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWWS(Z!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]WS$i&j(WpOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWWS(WpOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYWS(Wp(Z!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%l<S%9[C}i$i&j(o%1l(Wp(Z!bOY%ZYZ&cZr%Zrs&}st%ZtuCruw%Zwx(rx!Q%Z!Q![Cr![!^%Z!^!_*g!_!c%Z!c!}Cr!}#O%Z#O#P&c#P#R%Z#R#SCr#S#T%Z#T#oCr#o#p*g#p$g%Z$g;'SCr;'S;=`El<%lOCr%9[EoP;=`<%lCr07[FRk$i&j(Wp(Z!b$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr+dHRk$i&j(Wp(Z!b$]#tOY%ZYZ&cZr%Zrs&}st%ZtuGvuw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Gv![!^%Z!^!_*g!_!c%Z!c!}Gv!}#O%Z#O#P&c#P#R%Z#R#SGv#S#T%Z#T#oGv#o#p*g#p$g%Z$g;'SGv;'S;=`Iv<%lOGv+dIyP;=`<%lGv07[JPP;=`<%lEr(KWJ_`$i&j(Wp(Z!b#p(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWKl_$i&j$Q(Ch(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,#xLva(z+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sv%ZvwM{wx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KWNW`$i&j#z(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'At! c_(Y';W$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b'l!!i_$i&j(WpOY!!bYZ!#hZr!!brs!#hsw!!bwx!$xx!^!!b!^!_!%z!_#O!!b#O#P!#h#P#o!!b#o#p!%z#p;'S!!b;'S;=`!'c<%lO!!b&z!#mX$i&jOw!#hwx6cx!^!#h!^!_!$Y!_#o!#h#o#p!$Y#p;'S!#h;'S;=`!$r<%lO!#h`!$]TOw!$Ywx7]x;'S!$Y;'S;=`!$l<%lO!$Y`!$oP;=`<%l!$Y&z!$uP;=`<%l!#h'l!%R]$d`$i&j(WpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r!Q!&PZ(WpOY!%zYZ!$YZr!%zrs!$Ysw!%zwx!&rx#O!%z#O#P!$Y#P;'S!%z;'S;=`!']<%lO!%z!Q!&yU$d`(WpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)r!Q!'`P;=`<%l!%z'l!'fP;=`<%l!!b/5|!'t_!l/.^$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#&U!)O_!k!Lf$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-!n!*[b$i&j(Wp(Z!b(U%&f#q(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rxz%Zz{!+d{!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW!+o`$i&j(Wp(Z!b#n(ChOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;x!,|`$i&j(Wp(Z!br+4YOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z,$U!.Z_!]+Jf$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%Z07[!/ec$i&j(Wp(Z!b!Q.2^OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!0p!P!Q%Z!Q![!3Y![!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!0ya$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!2O!P!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z#%|!2Z_![!L^$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'Ad!3eg$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!3Y![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S!3Y#S#X%Z#X#Y!4|#Y#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!5Vg$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx{%Z{|!6n|}%Z}!O!6n!O!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!6wc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad!8_c$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![!8S![!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S!8S#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z07[!9uf$i&j(Wp(Z!b#o(ChOY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcxz!;Zz{#-}{!P!;Z!P!Q#/d!Q!^!;Z!^!_#(i!_!`#7S!`!a#8i!a!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z?O!;fb$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z>^!<w`$i&j(Z!b!X7`OY!<nYZ&cZw!<nwx!=yx!P!<n!P!Q!Eq!Q!^!<n!^!_!Gr!_!}!<n!}#O!KS#O#P!Dy#P#o!<n#o#p!Gr#p;'S!<n;'S;=`!L]<%lO!<n<z!>Q^$i&j!X7`OY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@c!_!}!=y!}#O!CW#O#P!Dy#P#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!?Td$i&j!X7`O!^&c!_#W&c#W#X!>|#X#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#k!>|#k#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&c7`!@hX!X7`OY!@cZ!P!@c!P!Q!AT!Q!}!@c!}#O!Ar#O#P!Bq#P;'S!@c;'S;=`!CQ<%lO!@c7`!AYW!X7`#W#X!AT#Z#[!AT#]#^!AT#a#b!AT#g#h!AT#i#j!AT#j#k!AT#m#n!AT7`!AuVOY!ArZ#O!Ar#O#P!B[#P#Q!@c#Q;'S!Ar;'S;=`!Bk<%lO!Ar7`!B_SOY!ArZ;'S!Ar;'S;=`!Bk<%lO!Ar7`!BnP;=`<%l!Ar7`!BtSOY!@cZ;'S!@c;'S;=`!CQ<%lO!@c7`!CTP;=`<%l!@c<z!C][$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#O!CW#O#P!DR#P#Q!=y#Q#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DWX$i&jOY!CWYZ&cZ!^!CW!^!_!Ar!_#o!CW#o#p!Ar#p;'S!CW;'S;=`!Ds<%lO!CW<z!DvP;=`<%l!CW<z!EOX$i&jOY!=yYZ&cZ!^!=y!^!_!@c!_#o!=y#o#p!@c#p;'S!=y;'S;=`!Ek<%lO!=y<z!EnP;=`<%l!=y>^!Ezl$i&j(Z!b!X7`OY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#W&}#W#X!Eq#X#Z&}#Z#[!Eq#[#]&}#]#^!Eq#^#a&}#a#b!Eq#b#g&}#g#h!Eq#h#i&}#i#j!Eq#j#k!Eq#k#m&}#m#n!Eq#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}8r!GyZ(Z!b!X7`OY!GrZw!Grwx!@cx!P!Gr!P!Q!Hl!Q!}!Gr!}#O!JU#O#P!Bq#P;'S!Gr;'S;=`!J|<%lO!Gr8r!Hse(Z!b!X7`OY'}Zw'}x#O'}#P#W'}#W#X!Hl#X#Z'}#Z#[!Hl#[#]'}#]#^!Hl#^#a'}#a#b!Hl#b#g'}#g#h!Hl#h#i'}#i#j!Hl#j#k!Hl#k#m'}#m#n!Hl#n;'S'};'S;=`(f<%lO'}8r!JZX(Z!bOY!JUZw!JUwx!Arx#O!JU#O#P!B[#P#Q!Gr#Q;'S!JU;'S;=`!Jv<%lO!JU8r!JyP;=`<%l!JU8r!KPP;=`<%l!Gr>^!KZ^$i&j(Z!bOY!KSYZ&cZw!KSwx!CWx!^!KS!^!_!JU!_#O!KS#O#P!DR#P#Q!<n#Q#o!KS#o#p!JU#p;'S!KS;'S;=`!LV<%lO!KS>^!LYP;=`<%l!KS>^!L`P;=`<%l!<n=l!Ll`$i&j(Wp!X7`OY!LcYZ&cZr!Lcrs!=ys!P!Lc!P!Q!Mn!Q!^!Lc!^!_# o!_!}!Lc!}#O#%P#O#P!Dy#P#o!Lc#o#p# o#p;'S!Lc;'S;=`#&Y<%lO!Lc=l!Mwl$i&j(Wp!X7`OY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#W(r#W#X!Mn#X#Z(r#Z#[!Mn#[#](r#]#^!Mn#^#a(r#a#b!Mn#b#g(r#g#h!Mn#h#i(r#i#j!Mn#j#k!Mn#k#m(r#m#n!Mn#n#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(r8Q# vZ(Wp!X7`OY# oZr# ors!@cs!P# o!P!Q#!i!Q!}# o!}#O#$R#O#P!Bq#P;'S# o;'S;=`#$y<%lO# o8Q#!pe(Wp!X7`OY)rZr)rs#O)r#P#W)r#W#X#!i#X#Z)r#Z#[#!i#[#])r#]#^#!i#^#a)r#a#b#!i#b#g)r#g#h#!i#h#i)r#i#j#!i#j#k#!i#k#m)r#m#n#!i#n;'S)r;'S;=`*Z<%lO)r8Q#$WX(WpOY#$RZr#$Rrs!Ars#O#$R#O#P!B[#P#Q# o#Q;'S#$R;'S;=`#$s<%lO#$R8Q#$vP;=`<%l#$R8Q#$|P;=`<%l# o=l#%W^$i&j(WpOY#%PYZ&cZr#%Prs!CWs!^#%P!^!_#$R!_#O#%P#O#P!DR#P#Q!Lc#Q#o#%P#o#p#$R#p;'S#%P;'S;=`#&S<%lO#%P=l#&VP;=`<%l#%P=l#&]P;=`<%l!Lc?O#&kn$i&j(Wp(Z!b!X7`OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#W%Z#W#X#&`#X#Z%Z#Z#[#&`#[#]%Z#]#^#&`#^#a%Z#a#b#&`#b#g%Z#g#h#&`#h#i%Z#i#j#&`#j#k#&`#k#m%Z#m#n#&`#n#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z9d#(r](Wp(Z!b!X7`OY#(iZr#(irs!Grsw#(iwx# ox!P#(i!P!Q#)k!Q!}#(i!}#O#+`#O#P!Bq#P;'S#(i;'S;=`#,`<%lO#(i9d#)th(Wp(Z!b!X7`OY*gZr*grs'}sw*gwx)rx#O*g#P#W*g#W#X#)k#X#Z*g#Z#[#)k#[#]*g#]#^#)k#^#a*g#a#b#)k#b#g*g#g#h#)k#h#i*g#i#j#)k#j#k#)k#k#m*g#m#n#)k#n;'S*g;'S;=`+Z<%lO*g9d#+gZ(Wp(Z!bOY#+`Zr#+`rs!JUsw#+`wx#$Rx#O#+`#O#P!B[#P#Q#(i#Q;'S#+`;'S;=`#,Y<%lO#+`9d#,]P;=`<%l#+`9d#,cP;=`<%l#(i?O#,o`$i&j(Wp(Z!bOY#,fYZ&cZr#,frs!KSsw#,fwx#%Px!^#,f!^!_#+`!_#O#,f#O#P!DR#P#Q!;Z#Q#o#,f#o#p#+`#p;'S#,f;'S;=`#-q<%lO#,f?O#-tP;=`<%l#,f?O#-zP;=`<%l!;Z07[#.[b$i&j(Wp(Z!b(O0/l!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z07[#/o_$i&j(Wp(Z!bT0/lOY#/dYZ&cZr#/drs#0nsw#/dwx#4Ox!^#/d!^!_#5}!_#O#/d#O#P#1p#P#o#/d#o#p#5}#p;'S#/d;'S;=`#6|<%lO#/d06j#0w]$i&j(Z!bT0/lOY#0nYZ&cZw#0nwx#1px!^#0n!^!_#3R!_#O#0n#O#P#1p#P#o#0n#o#p#3R#p;'S#0n;'S;=`#3x<%lO#0n05W#1wX$i&jT0/lOY#1pYZ&cZ!^#1p!^!_#2d!_#o#1p#o#p#2d#p;'S#1p;'S;=`#2{<%lO#1p0/l#2iST0/lOY#2dZ;'S#2d;'S;=`#2u<%lO#2d0/l#2xP;=`<%l#2d05W#3OP;=`<%l#1p01O#3YW(Z!bT0/lOY#3RZw#3Rwx#2dx#O#3R#O#P#2d#P;'S#3R;'S;=`#3r<%lO#3R01O#3uP;=`<%l#3R06j#3{P;=`<%l#0n05x#4X]$i&j(WpT0/lOY#4OYZ&cZr#4Ors#1ps!^#4O!^!_#5Q!_#O#4O#O#P#1p#P#o#4O#o#p#5Q#p;'S#4O;'S;=`#5w<%lO#4O00^#5XW(WpT0/lOY#5QZr#5Qrs#2ds#O#5Q#O#P#2d#P;'S#5Q;'S;=`#5q<%lO#5Q00^#5tP;=`<%l#5Q05x#5zP;=`<%l#4O01p#6WY(Wp(Z!bT0/lOY#5}Zr#5}rs#3Rsw#5}wx#5Qx#O#5}#O#P#2d#P;'S#5};'S;=`#6v<%lO#5}01p#6yP;=`<%l#5}07[#7PP;=`<%l#/d)3h#7ab$i&j$Q(Ch(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;ZAt#8vb$Z#t$i&j(Wp(Z!b!X7`OY!;ZYZ&cZr!;Zrs!<nsw!;Zwx!Lcx!P!;Z!P!Q#&`!Q!^!;Z!^!_#(i!_!}!;Z!}#O#,f#O#P!Dy#P#o!;Z#o#p#(i#p;'S!;Z;'S;=`#-w<%lO!;Z'Ad#:Zp$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#U%Z#U#V#?i#V#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#d#Bq#d#l%Z#l#m#Es#m#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#<jk$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!O%Z!O!P!3Y!P!Q%Z!Q![#<_![!^%Z!^!_*g!_!g%Z!g!h!4|!h#O%Z#O#P&c#P#R%Z#R#S#<_#S#X%Z#X#Y!4|#Y#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#>j_$i&j(Wp(Z!bs'9tOY%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'Ad#?rd$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#A]f$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#AQ!R!S#AQ!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#AQ#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Bzc$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Dbe$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!Y#DV!Y!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#DV#S#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#E|g$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z'Ad#Gpi$i&j(Wp(Z!bs'9tOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#Ge![!^%Z!^!_*g!_!c%Z!c!i#Ge!i#O%Z#O#P&c#P#R%Z#R#S#Ge#S#T%Z#T#Z#Ge#Z#b%Z#b#c#>_#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z*)x#Il_!g$b$i&j$O)Lv(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)[#Jv_al$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%Z04f#LS^h#)`#R-<U(Wp(Z!b$n7`OY*gZr*grs'}sw*gwx)rx!P*g!P!Q#MO!Q!^*g!^!_#Mt!_!`$ f!`#O*g#P;'S*g;'S;=`+Z<%lO*g(n#MXX$k&j(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El#M}Z#r(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx!_*g!_!`#Np!`#O*g#P;'S*g;'S;=`+Z<%lO*g(El#NyX$Q(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g(El$ oX#s(Ch(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g*)x$!ga#`*!Y$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`!a$#l!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(K[$#w_#k(Cl$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*)x$%Vag!*r#s(Ch$f#|$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`$&[!`!a$'f!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$&g_#s(Ch$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(KW$'qa#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`!a$(v!a#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$)R`#r(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(Kd$*`a(r(Ct$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!a%Z!a!b$+e!b#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z(KW$+p`$i&j#{(Ch(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`$,}_!|$Ip$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%Z04f$.X_!S0,v$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(n$/]Z$i&jO!^$0O!^!_$0f!_#i$0O#i#j$0k#j#l$0O#l#m$2^#m#o$0O#o#p$0f#p;'S$0O;'S;=`$4i<%lO$0O(n$0VT_#S$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#S$0kO_#S(n$0p[$i&jO!Q&c!Q![$1f![!^&c!_!c&c!c!i$1f!i#T&c#T#Z$1f#Z#o&c#o#p$3|#p;'S&c;'S;=`&w<%lO&c(n$1kZ$i&jO!Q&c!Q![$2^![!^&c!_!c&c!c!i$2^!i#T&c#T#Z$2^#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$2cZ$i&jO!Q&c!Q![$3U![!^&c!_!c&c!c!i$3U!i#T&c#T#Z$3U#Z#o&c#p;'S&c;'S;=`&w<%lO&c(n$3ZZ$i&jO!Q&c!Q![$0O![!^&c!_!c&c!c!i$0O!i#T&c#T#Z$0O#Z#o&c#p;'S&c;'S;=`&w<%lO&c#S$4PR!Q![$4Y!c!i$4Y#T#Z$4Y#S$4]S!Q![$4Y!c!i$4Y#T#Z$4Y#q#r$0f(n$4lP;=`<%l$0O#1[$4z_!Y#)l$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(KW$6U`#x(Ch$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z+;p$7c_$i&j(Wp(Z!b(a+4QOY%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%Z07[$8qk$i&j(Wp(Z!b(T,2j$_#t(e$I[OY%ZYZ&cZr%Zrs&}st%Ztu$8buw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$8b![!^%Z!^!_*g!_!c%Z!c!}$8b!}#O%Z#O#P&c#P#R%Z#R#S$8b#S#T%Z#T#o$8b#o#p*g#p$g%Z$g;'S$8b;'S;=`$<l<%lO$8b+d$:qk$i&j(Wp(Z!b$_#tOY%ZYZ&cZr%Zrs&}st%Ztu$:fuw%Zwx(rx}%Z}!O$:f!O!Q%Z!Q![$:f![!^%Z!^!_*g!_!c%Z!c!}$:f!}#O%Z#O#P&c#P#R%Z#R#S$:f#S#T%Z#T#o$:f#o#p*g#p$g%Z$g;'S$:f;'S;=`$<f<%lO$:f+d$<iP;=`<%l$:f07[$<oP;=`<%l$8b#Jf$<{X!_#Hb(Wp(Z!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g,#x$=sa(y+JY$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Ka!`#O%Z#O#P&c#P#o%Z#o#p*g#p#q$+e#q;'S%Z;'S;=`+a<%lO%Z)>v$?V_!^(CdvBr$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?O$@a_!q7`$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%Z07[$Aq|$i&j(Wp(Z!b'|0/l$]#t(T,2j(e$I[OX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr07[$D|k$i&j(Wp(Z!b'}0/l$]#t(T,2j(e$I[OY%ZYZ&cZr%Zrs&}st%ZtuEruw%Zwx(rx}%Z}!OGv!O!Q%Z!Q![Er![!^%Z!^!_*g!_!c%Z!c!}Er!}#O%Z#O#P&c#P#R%Z#R#SEr#S#T%Z#T#oEr#o#p*g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[ite,nte,ste,rte,2,3,4,5,6,7,8,9,10,11,12,13,14,tte,new Yg("$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 Yg("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=>ate[t]||-1},{term:343,get:t=>lte[t]||-1},{term:95,get:t=>cte[t]||-1}],tokenPrec:15201}),H4=[Qn("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Qn("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Qn("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Qn("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Qn("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Qn(`try {
75
+ \${}
76
+ } catch (\${error}) {
77
+ \${}
78
+ }`,{label:"try",detail:"/ catch block",type:"keyword"}),Qn("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Qn(`if (\${}) {
79
+ \${}
80
+ } else {
81
+ \${}
82
+ }`,{label:"if",detail:"/ else block",type:"keyword"}),Qn(`class \${name} {
83
+ constructor(\${params}) {
84
+ \${}
85
+ }
86
+ }`,{label:"class",detail:"definition",type:"keyword"}),Qn('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Qn('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],ute=H4.concat([Qn("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Qn("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Qn("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),rP=new BB,F4=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ru(t){return(e,i)=>{let n=e.node.getChild("VariableDefinition");return n&&i(n,t),!0}}const fte=["FunctionDeclaration"],dte={FunctionDeclaration:Ru("function"),ClassDeclaration:Ru("class"),ClassExpression:()=>!0,EnumDeclaration:Ru("constant"),TypeAliasDeclaration:Ru("type"),NamespaceDeclaration:Ru("namespace"),VariableDefinition(t,e){t.matchContext(fte)||e(t,"variable")},TypeDefinition(t,e){e(t,"type")},__proto__:null};function G4(t,e){let i=rP.get(e);if(i)return i;let n=[],s=!0;function r(o,l){let c=t.sliceString(o.from,o.to);n.push({label:c,type:l})}return e.cursor(ut.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let l=dte[o.name];if(l&&l(o,r)||F4.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of G4(t,o.node))n.push(l);return!1}}),rP.set(e,n),n}const oP=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,K4=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function pte(t){let e=xt(t.state).resolveInner(t.pos,-1);if(K4.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&oP.test(t.state.sliceDoc(e.from,e.to));if(!i&&!t.explicit)return null;let n=[];for(let s=e;s;s=s.parent)F4.has(s.name)&&(n=n.concat(G4(t.state.doc,s)));return{options:n,from:i?e.from:t.pos,validFor:oP}}const kr=lh.define({name:"javascript",parser:hte.configure({props:[md.add({IfStatement:Ym({except:/^\s*({|else\b)/}),TryStatement:Ym({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:jY,SwitchBody:t=>{let e=t.textAfter,i=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:n?1:2)*t.unit},Block:NY({closing:"}"}),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ym({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}}),bh.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":ZB,BlockComment(t){return{from:t.from+2,to:t.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),J4={test:t=>/^JSX/.test(t.name),facet:Gx({commentTokens:{block:{open:"{/*",close:"*/}"}}})},e6=kr.configure({dialect:"ts"},"typescript"),t6=kr.configure({dialect:"jsx",props:[Kx.add(t=>t.isTop?[J4]:void 0)]}),i6=kr.configure({dialect:"jsx ts",props:[Kx.add(t=>t.isTop?[J4]:void 0)]},"typescript");let n6=t=>({label:t,type:"keyword"});const s6="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(n6),mte=s6.concat(["declare","implements","private","protected","public"].map(n6));function gte(t={}){let e=t.jsx?t.typescript?i6:t6:t.typescript?e6:kr,i=t.typescript?ute.concat(mte):H4.concat(s6);return new Vf(e,[kr.data.of({autocomplete:oG(K4,W$(i))}),kr.data.of({autocomplete:pte}),t.jsx?_te:[]])}function Ote(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 aP(t,e,i=t.length){for(let n=e==null?void 0:e.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return t.sliceString(n.from,Math.min(n.to,i));return""}const vte=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),_te=ve.inputHandler.of((t,e,i,n,s)=>{if((vte?t.composing:t.compositionStarted)||t.state.readOnly||e!=i||n!=">"&&n!="/"||!kr.isActiveAt(t.state,e,-1))return!1;let r=s(),{state:o}=r,l=o.changeByRange(c=>{var u;let{head:d}=c,p=xt(o).resolveInner(d-1,-1),g;if(p.name=="JSXStartTag"&&(p=p.parent),!(o.doc.sliceString(d-1,d)!=n||p.name=="JSXAttributeValue"&&p.to>d)){if(n==">"&&p.name=="JSXFragmentTag")return{range:c,changes:{from:d,insert:"</>"}};if(n=="/"&&p.name=="JSXStartCloseTag"){let O=p.parent,_=O.parent;if(_&&O.from==d-2&&((g=aP(o.doc,_.firstChild,d))||((u=_.firstChild)===null||u===void 0?void 0:u.name)=="JSXFragmentTag")){let b=`${g}>`;return{range:re.cursor(d+b.length,-1),changes:{from:d,insert:b}}}}else if(n==">"){let O=Ote(p);if(O&&O.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(d,d+2))&&(g=aP(o.doc,O,d)))return{range:c,changes:{from:d,insert:`</${g}>`}}}}return{range:c}});return l.changes.empty?!1:(t.dispatch([r,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Qu=["_blank","_self","_top","_parent"],sy=["ascii","utf-8","utf-16","latin1","latin1"],ry=["get","post","put","delete"],oy=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],Gn=["true","false"],Me={},yte={a:{attrs:{href:null,ping:null,type:null,media:null,target:Qu,hreflang:null}},abbr:Me,address:Me,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Me,aside:Me,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Me,base:{attrs:{href:null,target:Qu}},bdi:Me,bdo:Me,blockquote:{attrs:{cite:null}},body:Me,br:Me,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:oy,formmethod:ry,formnovalidate:["novalidate"],formtarget:Qu,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Me,center:Me,cite:Me,code:Me,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:Me,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Me,div:Me,dl:Me,dt:Me,em:Me,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Me,figure:Me,footer:Me,form:{attrs:{action:null,name:null,"accept-charset":sy,autocomplete:["on","off"],enctype:oy,method:ry,novalidate:["novalidate"],target:Qu}},h1:Me,h2:Me,h3:Me,h4:Me,h5:Me,h6:Me,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Me,hgroup:Me,hr:Me,html:{attrs:{manifest:null}},i:Me,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:oy,formmethod:ry,formnovalidate:["novalidate"],formtarget:Qu,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:Me,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Me,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:Me,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:sy,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:Me,noscript:Me,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:Me,param:{attrs:{name:null,value:null}},pre:Me,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Me,rt:Me,ruby:Me,samp:Me,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:sy}},section:Me,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Me,source:{attrs:{src:null,type:null,media:null}},span:Me,strong:Me,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Me,summary:Me,sup:Me,table:Me,tbody:Me,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Me,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:Me,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Me,time:{attrs:{datetime:null}},title:Me,tr:Me,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Me,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:Me},r6={accesskey:null,class:null,contenteditable:Gn,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:Gn,autocorrect:Gn,autocapitalize:Gn,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":Gn,"aria-autocomplete":["inline","list","both","none"],"aria-busy":Gn,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":Gn,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":Gn,"aria-hidden":Gn,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":Gn,"aria-multiselectable":Gn,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":Gn,"aria-relevant":null,"aria-required":Gn,"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},o6="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 o6)r6[t]=null;let Jf=class{constructor(e,i){this.tags={...yte,...e},this.globalAttrs={...r6,...i},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};Jf.default=new Jf;function dh(t,e,i=t.length){if(!e)return"";let n=e.firstChild,s=n&&n.getChild("TagName");return s?t.sliceString(s.from,Math.min(s.to,i)):""}function ph(t,e=!1){for(;t;t=t.parent)if(t.name=="Element")if(e)e=!1;else return t;return null}function a6(t,e,i){let n=i.tags[dh(t,ph(e))];return(n==null?void 0:n.children)||i.allTags}function Cw(t,e){let i=[];for(let n=ph(e);n&&!n.type.isTop;n=ph(n.parent)){let s=dh(t,n);if(s&&n.lastChild.name=="CloseTag")break;s&&i.indexOf(s)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&i.push(s)}return i}const l6=/^[:\-\.\w\u00b7-\uffff]*$/;function lP(t,e,i,n,s){let r=/\s*>/.test(t.sliceDoc(s,s+5))?"":">",o=ph(i,i.name=="StartTag"||i.name=="TagName");return{from:n,to:s,options:a6(t.doc,o,e).map(l=>({label:l,type:"type"})).concat(Cw(t.doc,i).map((l,c)=>({label:"/"+l,apply:"/"+l+r,type:"type",boost:99-c}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function cP(t,e,i,n){let s=/\s*>/.test(t.sliceDoc(n,n+5))?"":">";return{from:i,to:n,options:Cw(t.doc,e).map((r,o)=>({label:r,apply:r+s,type:"type",boost:99-o})),validFor:l6}}function bte(t,e,i,n){let s=[],r=0;for(let o of a6(t.doc,i,e))s.push({label:"<"+o,type:"type"});for(let o of Cw(t.doc,i))s.push({label:"</"+o+">",type:"type",boost:99-r++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Ste(t,e,i,n,s){let r=ph(i),o=r?e.tags[dh(t.doc,r)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],c=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:s,options:c.map(u=>({label:u,type:"property"})),validFor:l6}}function xte(t,e,i,n,s){var r;let o=(r=i.parent)===null||r===void 0?void 0:r.getChild("AttributeName"),l=[],c;if(o){let u=t.sliceDoc(o.from,o.to),d=e.globalAttrs[u];if(!d){let p=ph(i),g=p?e.tags[dh(t.doc,p)]:null;d=(g==null?void 0:g.attrs)&&g.attrs[u]}if(d){let p=t.sliceDoc(n,s).toLowerCase(),g='"',O='"';/^['"]/.test(p)?(c=p[0]=='"'?/^[^"]*$/:/^[^']*$/,g="",O=t.sliceDoc(s,s+1)==p[0]?"":p[0],p=p.slice(1),n++):c=/^[^\s<>='"]*$/;for(let _ of d)l.push({label:_,apply:g+_+O,type:"constant"})}}return{from:n,to:s,options:l,validFor:c}}function c6(t,e){let{state:i,pos:n}=e,s=xt(i).resolveInner(n,-1),r=s.resolve(n);for(let o=n,l;r==s&&(l=s.childBefore(o));){let c=l.lastChild;if(!c||!c.type.isError||c.from<c.to)break;r=s=l,o=c.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?cP(i,s,s.from,n):lP(i,t,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?lP(i,t,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?cP(i,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?Ste(i,t,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?xte(i,t,s,s.name=="Is"?n:s.from,n):e.explicit&&(r.name=="Element"||r.name=="Text"||r.name=="Document")?bte(i,t,s,n):null}function wte(t){return c6(Jf.default,t)}function Cte(t){let{extraTags:e,extraGlobalAttributes:i}=t,n=i||e?new Jf(e,i):Jf.default;return s=>c6(n,s)}const kte=kr.parser.configure({top:"SingleExpression"}),h6=[{tag:"script",attrs:t=>t.type=="text/typescript"||t.lang=="ts",parser:e6.parser},{tag:"script",attrs:t=>t.type=="text/babel"||t.type=="text/jsx",parser:t6.parser},{tag:"script",attrs:t=>t.type=="text/typescript-jsx",parser:i6.parser},{tag:"script",attrs(t){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(t.type)},parser:kte},{tag:"script",attrs(t){return!t.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(t.type)},parser:kr.parser},{tag:"style",attrs(t){return(!t.lang||t.lang=="css")&&(!t.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(t.type))},parser:Fg.parser}],u6=[{name:"style",parser:Fg.parser.configure({top:"Styles"})}].concat(o6.map(t=>({name:t,parser:kr.parser}))),f6=lh.define({name:"html",parser:GJ.configure({props:[md.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,i;for(let n=t.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;e=n=s}return e&&!((i=e.lastChild)&&(i.name=="CloseTag"||i.name=="SelfClosingTag"))?t.lineIndent(e.from)+t.unit:null}}),bh.add({Element(t){let e=t.firstChild,i=t.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:i.name=="CloseTag"?i.from:t.to}}}),n$.add({"OpenTag CloseTag":t=>t.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Km=f6.configure({wrap:V4(h6,u6)});function Tte(t={}){let e="",i;t.matchClosingTags===!1&&(e="noMatch"),t.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(t.nestedLanguages&&t.nestedLanguages.length||t.nestedAttributes&&t.nestedAttributes.length)&&(i=V4((t.nestedLanguages||[]).concat(h6),(t.nestedAttributes||[]).concat(u6)));let n=i?f6.configure({wrap:i,dialect:e}):e?Km.configure({dialect:e}):Km;return new Vf(n,[Km.data.of({autocomplete:Cte(t)}),t.autoCloseTags!==!1?Ate:[],gte().support,Qee().support])}const hP=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),Ate=ve.inputHandler.of((t,e,i,n,s)=>{if(t.composing||t.state.readOnly||e!=i||n!=">"&&n!="/"||!Km.isActiveAt(t.state,e,-1))return!1;let r=s(),{state:o}=r,l=o.changeByRange(c=>{var u,d,p;let g=o.doc.sliceString(c.from-1,c.to)==n,{head:O}=c,_=xt(o).resolveInner(O,-1),b;if(g&&n==">"&&_.name=="EndTag"){let x=_.parent;if(((d=(u=x.parent)===null||u===void 0?void 0:u.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(b=dh(o.doc,x.parent,O))&&!hP.has(b)){let w=O+(o.doc.sliceString(O,O+1)===">"?1:0),k=`</${b}>`;return{range:c,changes:{from:O,to:w,insert:k}}}}else if(g&&n=="/"&&_.name=="IncompleteCloseTag"){let x=_.parent;if(_.from==O-2&&((p=x.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(b=dh(o.doc,x,O))&&!hP.has(b)){let w=O+(o.doc.sliceString(O,O+1)===">"?1:0),k=`${b}>`;return{range:re.cursor(O+k.length,-1),changes:{from:O,to:w,insert:k}}}}return{range:c}});return l.changes.empty?!1:(t.dispatch([r,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),d6=Gx({commentTokens:{block:{open:"<!--",close:"-->"}}}),p6=new Ne,m6=qK.configure({props:[bh.add(t=>!t.is("Block")||t.is("Document")||qb(t)!=null||Ete(t)?void 0:(e,i)=>({from:i.doc.lineAt(e.from).to,to:e.to})),p6.add(qb),md.add({Document:()=>null}),Ol.add({Document:d6})]});function qb(t){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(t.name);return e?+e[1]:void 0}function Ete(t){return t.name=="OrderedList"||t.name=="BulletList"}function Mte(t,e){let i=t;for(;;){let n=i.nextSibling,s;if(!n||(s=qb(n.type))!=null&&s<=e)break;i=n}return i.to}const Pte=XB.of((t,e,i)=>{for(let n=xt(t).resolveInner(i,-1);n&&!(n.from<e);n=n.parent){let s=n.type.prop(p6);if(s==null)continue;let r=Mte(n,s);if(r>i)return{from:i,to:r}}return null});function kw(t){return new As(d6,t,[],"markdown")}const Rte=kw(m6),Qte=m6.configure([iJ,sJ,nJ,rJ,{props:[bh.add({Table:(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})})]}]),ed=kw(Qte);function Lte(t,e){return i=>{if(i&&t){let n=null;if(i=/\S*/.exec(i)[0],typeof t=="function"?n=t(i):n=Rg.matchLanguageName(t,i,!0),n instanceof Rg)return n.support?n.support.language.parser:If.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class ay{constructor(e,i,n,s,r,o,l){this.node=e,this.from=i,this.to=n,this.spaceBefore=s,this.spaceAfter=r,this.type=o,this.item=l}blank(e,i=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length<e;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(i?this.spaceAfter:"")}}marker(e,i){let n=this.node.name=="OrderedList"?String(+O6(this.item,e)[2]+i):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function g6(t,e){let i=[],n=[];for(let s=t;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&i.push(s)}for(let s=i.length-1;s>=0;s--){let r=i[s],o,l=e.lineAt(r.from),c=r.from-l.from;if(r.name=="Blockquote"&&(o=/^ *>( ?)/.exec(l.text.slice(c))))n.push(new ay(r,c,c+o[0].length,"",o[1],">",null));else if(r.name=="ListItem"&&r.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(l.text.slice(c)))){let u=o[3],d=o[0].length;u.length>=4&&(u=u.slice(0,u.length-4),d-=4),n.push(new ay(r.parent,c,c+d,o[1],u,o[2],r))}else if(r.name=="ListItem"&&r.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(c)))){let u=o[4],d=o[0].length;u.length>4&&(u=u.slice(0,u.length-4),d-=4);let p=o[2];o[3]&&(p+=o[3].replace(/[xX]/," ")),n.push(new ay(r.parent,c,c+d,o[1],u,p,r))}}return n}function O6(t,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(t.from,t.from+10))}function ly(t,e,i,n=0){for(let s=-1,r=t;;){if(r.name=="ListItem"){let l=O6(r,e),c=+l[2];if(s>=0){if(c!=s+1)return;i.push({from:r.from+l[1].length,to:r.from+l[0].length,insert:String(s+2+n)})}s=c}let o=r.nextSibling;if(!o)break;r=o}}function Tw(t,e){let i=/^[ \t]*/.exec(t)[0].length;if(!i||e.facet(yh)!=" ")return t;let n=Ys(t,4,i),s="";for(let r=n;r>0;)r>=4?(s+=" ",r-=4):(s+=" ",r--);return s+t.slice(i)}const Dte=(t={})=>({state:e,dispatch:i})=>{let n=xt(e),{doc:s}=e,r=null,o=e.changeByRange(l=>{if(!l.empty||!ed.isActiveAt(e,l.from,-1)&&!ed.isActiveAt(e,l.from,1))return r={range:l};let c=l.from,u=s.lineAt(c),d=g6(n.resolveInner(c,-1),s);for(;d.length&&d[d.length-1].from>c-u.from;)d.pop();if(!d.length)return r={range:l};let p=d[d.length-1];if(p.to-p.spaceAfter.length>c-u.from)return r={range:l};let g=c>=p.to-p.spaceAfter.length&&!/\S/.test(u.text.slice(p.to));if(p.item&&g){let w=p.node.firstChild,k=p.node.getChild("ListItem","ListItem");if(w.to>=c||k&&k.to<c||u.from>0&&!/[^\s>]/.test(s.lineAt(u.from-1).text)||t.nonTightLists===!1){let T=d.length>1?d[d.length-2]:null,A,L="";T&&T.item?(A=u.from+T.from,L=T.marker(s,1)):A=u.from+(T?T.to:0);let E=[{from:A,to:c,insert:L}];return p.node.name=="OrderedList"&&ly(p.item,s,E,-2),T&&T.node.name=="OrderedList"&&ly(T.item,s,E),{range:re.cursor(A+L.length),changes:E}}else{let T=fP(d,e,u);return{range:re.cursor(c+T.length+1),changes:{from:u.from,insert:T+e.lineBreak}}}}if(p.node.name=="Blockquote"&&g&&u.from){let w=s.lineAt(u.from-1),k=/>\s*$/.exec(w.text);if(k&&k.index==p.from){let T=e.changes([{from:w.from+k.index,to:w.to},{from:u.from+p.from,to:u.to}]);return{range:l.map(T),changes:T}}}let O=[];p.node.name=="OrderedList"&&ly(p.item,s,O);let _=p.item&&p.item.from<u.from,b="";if(!_||/^[\s\d.)\-+*>]*/.exec(u.text)[0].length>=p.to)for(let w=0,k=d.length-1;w<=k;w++)b+=w==k&&!_?d[w].marker(s,1):d[w].blank(w<k?Ys(u.text,4,d[w+1].from)-b.length:null);let x=c;for(;x>u.from&&/\s/.test(u.text.charAt(x-u.from-1));)x--;return b=Tw(b,e),$te(p.node,e.doc)&&(b=fP(d,e,u)+e.lineBreak+b),O.push({from:x,to:c,insert:e.lineBreak+b}),{range:re.cursor(x+b.length+1),changes:O}});return r?!1:(i(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},Bte=Dte();function uP(t){return t.name=="QuoteMark"||t.name=="ListMark"}function $te(t,e){if(t.name!="OrderedList"&&t.name!="BulletList")return!1;let i=t.firstChild,n=t.getChild("ListItem","ListItem");if(!n)return!1;let s=e.lineAt(i.to),r=e.lineAt(n.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<r.number}function fP(t,e,i){let n="";for(let s=0,r=t.length-2;s<=r;s++)n+=t[s].blank(s<r?Ys(i.text,4,t[s+1].from)-n.length:null,s<r);return Tw(n,e)}function zte(t,e){let i=t.resolveInner(e,-1),n=e;uP(i)&&(n=i.from,i=i.parent);for(let s;s=i.childBefore(n);)if(uP(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")i=s.lastChild,n=i.to;else break;return i}const Nte=({state:t,dispatch:e})=>{let i=xt(t),n=null,s=t.changeByRange(r=>{let o=r.from,{doc:l}=t;if(r.empty&&ed.isActiveAt(t,r.from)){let c=l.lineAt(o),u=g6(zte(i,o),l);if(u.length){let d=u[u.length-1],p=d.to-d.spaceAfter.length+(d.spaceAfter?1:0);if(o-c.from>p&&!/\S/.test(c.text.slice(p,o-c.from)))return{range:re.cursor(c.from+p),changes:{from:c.from+p,to:o}};if(o-c.from==p&&(!d.item||c.from<=d.item.from||!/\S/.test(c.text.slice(0,d.to)))){let g=c.from+d.from;if(d.item&&d.node.from<d.item.from&&/\S/.test(c.text.slice(d.from,d.to))){let O=d.blank(Ys(c.text,4,d.to)-Ys(c.text,4,d.from));return g==c.from&&(O=Tw(O,t)),{range:re.cursor(g+O.length),changes:{from:g,to:c.from+d.to,insert:O}}}if(g<o)return{range:re.cursor(g),changes:{from:g,to:o}}}}}return n={range:r}});return n?!1:(e(t.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},jte=[{key:"Enter",run:Bte},{key:"Backspace",run:Nte}],v6=Tte({matchClosingTags:!1});function Ite(t={}){let{codeLanguages:e,defaultCodeLanguage:i,addKeymap:n=!0,base:{parser:s}=Rte,completeHTMLTags:r=!0,pasteURLAsLink:o=!0,htmlTagLanguage:l=v6}=t;if(!(s instanceof CO))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let c=t.extensions?[t.extensions]:[],u=[l.support,Pte],d;o&&u.push(qte),i instanceof Vf?(u.push(i.support),d=i.language):i&&(d=i);let p=e||d?Lte(e,d):void 0;c.push(UK({codeParser:p,htmlParser:l.language.parser})),n&&u.push(So.high(Ll.of(jte)));let g=kw(s.configure(c));return r&&u.push(g.data.of({autocomplete:Vte})),new Vf(g,u)}function Vte(t){let{state:e,pos:i}=t,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(i-25,i));if(!n)return null;let s=xt(e).resolveInner(i,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:i-n[0].length,to:i,options:Xte(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let cy=null;function Xte(){if(cy)return cy;let t=wte(new lw(et.create({extensions:v6}),0,!0));return cy=t?t.options:[]}const Zte=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,qte=ve.domEventHandlers({paste:(t,e)=>{var i;let{main:n}=e.state.selection;if(n.empty)return!1;let s=(i=t.clipboardData)===null||i===void 0?void 0:i.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!ed.isActiveAt(e.state,n.from,1)))return!1;let r=xt(e.state),o=!1;return r.iterate({from:n.from,to:n.to,enter:l=>{(l.from>n.from||Zte.test(l.name))&&(o=!0)},leave:l=>{l.to<n.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}});function Wte({initialContent:t,filePath:e,onSave:i,onClose:n}){const[s,r]=Z.useState(t),[o,l]=Z.useState(!1),[c,u]=Z.useState(!1),d=Z.useRef(s);Z.useEffect(()=>{d.current=s},[s]);const p=Z.useCallback(b=>{r(b),u(b!==t)},[t]),g=Z.useCallback(async()=>{if(!o){l(!0);try{await i(d.current),u(!1)}catch(b){console.error("[plan-editor] Save failed:",b)}finally{l(!1)}}},[i,o]),O=Z.useCallback(()=>{c&&!window.confirm("Unsaved changes -- discard?")||n()},[c,n]),_=Ll.of([{key:"Mod-s",run:()=>(g(),!0)}]);return Z.useEffect(()=>{const b=x=>{(x.ctrlKey||x.metaKey)&&x.key==="s"&&x.preventDefault()};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[]),S.jsxs("div",{className:"fixed inset-0 z-50 bg-background/95 flex flex-col",children:[S.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-card",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:e}),c&&S.jsx("span",{className:"text-xs px-1.5 py-0.5 rounded-sm bg-warning/20 text-warning font-mono",children:"unsaved"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[c&&S.jsx("button",{type:"button",onClick:g,disabled:o,className:Fe("text-xs px-3 py-1.5 rounded-md font-mono","bg-accent text-foreground","hover:bg-accent-glow","disabled:opacity-50 disabled:cursor-not-allowed","transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50"),children:o?"Saving...":"Save"}),S.jsx("button",{type:"button",onClick:O,className:Fe("text-xs px-3 py-1.5 rounded-md font-mono","bg-muted text-muted-foreground","hover:bg-danger/20 hover:text-danger","transition-colors focus:outline-none focus:ring-2 focus:ring-accent/50"),children:"Close"})]})]}),S.jsx("div",{className:"flex-1 overflow-auto",children:S.jsx(l4,{value:s,onChange:p,theme:a4,extensions:[Ite({base:ed}),_],height:"calc(100vh - 56px)",basicSetup:{lineNumbers:!0,foldGutter:!0,highlightActiveLine:!0,bracketMatching:!0,indentOnInput:!0}})})]})}function Ute({phaseId:t,onBack:e}){const{plans:i,context:n,research:s,loading:r,error:o,refetch:l}=UZ(t),[c,u]=Z.useState(null),[d,p]=Z.useState(""),g=i.length>0?i[0].frontmatter.phase??t:t,O=Z.useCallback(async x=>{try{const k=x.replace(/^\.planning[\\/]/,"").split(/[\\/]/),T=await fetch(`/api/plan/${k.join("/")}`);if(!T.ok)return;const A=await T.json();p(A.content),u(x)}catch(w){console.error("[phase-detail]",w)}},[]),_=Z.useCallback(async x=>{if(!c)return;const k=c.replace(/^\.planning[\\/]/,"").split(/[\\/]/);if(!(await fetch(`/api/plan/${k.join("/")}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:x})})).ok)throw new Error("Failed to save plan")},[c]),b=Z.useCallback(()=>{u(null),p(""),l()},[l]);return S.jsxs("div",{className:"space-y-6",children:[S.jsxs("button",{type:"button",onClick:e,className:Fe("flex items-center gap-2 font-mono text-[10px] uppercase tracking-widest text-muted-foreground","hover:text-foreground transition-colors"),children:[S.jsx("svg",{className:"w-3 h-3",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M10 3L5 8l5 5"})}),"Overview"]}),S.jsxs("div",{className:"border-b border-border pb-4",children:[S.jsxs("div",{className:"flex items-baseline gap-3 mb-2",children:[S.jsxs("span",{className:"font-mono text-xs font-bold text-accent uppercase tracking-widest",children:["Phase ",t]}),S.jsx("h2",{className:"text-lg font-semibold tracking-tight text-foreground",children:g})]}),S.jsxs("div",{className:"flex gap-2",children:[n&&S.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 border border-success/30 text-success",children:"Context"}),s&&S.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 border border-success/30 text-success",children:"Research"}),!n&&!s&&!r&&S.jsx("span",{className:"font-mono text-[9px] uppercase tracking-widest px-2 py-0.5 border border-border text-muted-foreground",children:"No context"})]})]}),o&&S.jsx("div",{className:"border border-danger/30 p-4 text-danger text-sm font-mono text-xs",children:o}),r&&i.length===0&&S.jsx("div",{className:"space-y-3",children:[1,2,3].map(x=>S.jsxs("div",{className:"border border-border p-4 animate-pulse",children:[S.jsx("div",{className:"h-4 w-24 bg-muted mb-3"}),S.jsx("div",{className:"h-3 w-3/4 bg-muted mb-2"}),S.jsx("div",{className:"h-3 w-1/2 bg-muted"})]},x))}),!r&&!o&&i.length===0&&S.jsx("div",{className:"border border-border p-8 text-center",children:S.jsxs("p",{className:"font-mono text-xs text-muted-foreground",children:["No plans yet — run"," ",S.jsx("code",{className:"text-accent",children:"/maxsim:plan-phase"})]})}),i.length>0&&S.jsx("div",{className:"space-y-3",children:i.map(x=>S.jsx(HZ,{plan:x,onEdit:O},x.path))}),c&&S.jsx(Wte,{initialContent:d,filePath:c,onSave:_,onClose:b})]})}function Yte(){const{lastChange:t}=Ea(),[e,i]=Z.useState([]),[n,s]=Z.useState([]),[r,o]=Z.useState(!0),[l,c]=Z.useState(null),[u,d]=Z.useState(""),[p,g]=Z.useState(!1),[O,_]=Z.useState(!1),b=Z.useCallback(async()=>{try{c(null);const k=await fetch("/api/todos");if(!k.ok)throw new Error(`Failed to fetch todos: ${k.status}`);const T=await k.json();i(T.pending),s(T.completed)}catch(k){c(k instanceof Error?k.message:"Failed to fetch todos")}finally{o(!1)}},[]);Z.useEffect(()=>{b()},[b]),Z.useEffect(()=>{t>0&&b()},[t,b]);const x=Z.useCallback(async()=>{const k=u.trim();if(k){g(!0);try{if(!(await fetch("/api/todos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:k})})).ok)throw new Error("Failed to create todo");d(""),await b()}catch(T){c(T instanceof Error?T.message:"Failed to create todo")}finally{g(!1)}}},[u,b]),w=Z.useCallback(async(k,T)=>{try{if(!(await fetch("/api/todos",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:k,completed:T})})).ok)throw new Error("Failed to update todo");await b()}catch(A){c(A instanceof Error?A.message:"Failed to update todo")}},[b]);return S.jsxs("div",{className:"space-y-6",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("h2",{className:"font-mono text-xs uppercase tracking-widest text-foreground",children:"Todos"}),S.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:[e.length," pending"]})]}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("input",{type:"text",value:u,onChange:k=>d(k.target.value),onKeyDown:k=>{k.key==="Enter"&&!p&&x()},placeholder:"Add a new todo...",className:"flex-1 border border-border bg-card px-3 py-2 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:border-accent focus:outline-none"}),S.jsx("button",{type:"button",onClick:x,disabled:p||!u.trim(),className:Fe("bg-accent px-4 py-2 font-mono text-[10px] uppercase tracking-widest text-foreground transition-colors","hover:opacity-80 disabled:opacity-30 disabled:cursor-not-allowed"),children:"Add"})]}),l&&S.jsx("div",{className:"border border-danger/30 px-3 py-2 font-mono text-xs text-danger",children:l}),r&&S.jsx("div",{className:"space-y-px",children:[1,2,3].map(k=>S.jsxs("div",{className:"flex items-center gap-3 bg-card px-4 py-3",children:[S.jsx("div",{className:"h-3 w-3 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-48 animate-pulse bg-muted"})]},k))}),!r&&S.jsx("div",{className:"space-y-1",children:e.length===0?S.jsx("p",{className:"px-4 py-6 text-center text-sm text-muted-foreground",children:"No pending todos"}):e.map(k=>S.jsxs("button",{type:"button",onClick:()=>w(k.file,!0),className:"group flex w-full items-center gap-3 px-4 py-2.5 text-left transition-colors hover:bg-card-hover border-b border-border",children:[S.jsx("span",{className:"inline-flex h-3 w-3 shrink-0 items-center justify-center border border-muted-foreground transition-colors group-hover:border-accent"}),S.jsx("span",{className:"text-sm text-foreground",children:k.text})]},k.file))}),!r&&n.length>0&&S.jsxs("div",{className:"border-t border-border pt-4",children:[S.jsxs("button",{type:"button",onClick:()=>_(!O),className:"flex w-full items-center gap-2 text-left",children:[S.jsx("svg",{className:Fe("h-3 w-3 text-muted-foreground transition-transform",O&&"rotate-90"),viewBox:"0 0 12 12",fill:"currentColor",children:S.jsx("path",{d:"M4 2l5 4-5 4z"})}),S.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Completed (",n.length,")"]})]}),O&&S.jsx("div",{className:"mt-2 space-y-1",children:n.map(k=>S.jsxs("button",{type:"button",onClick:()=>w(k.file,!1),className:"group flex w-full items-center gap-3 rounded-sm px-4 py-2 text-left transition-colors hover:bg-card-hover",children:[S.jsx("span",{className:"inline-flex h-4 w-4 shrink-0 items-center justify-center rounded-sm border border-success bg-success/20",children:S.jsx("svg",{className:"h-3 w-3 text-success",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M2 6l3 3 5-5"})})}),S.jsx("span",{className:"text-sm text-muted-foreground line-through",children:k.text})]},k.file))})]})]})}function Hte({onEntryAdded:t}){const[e,i]=Z.useState(!1),[n,s]=Z.useState("decision"),[r,o]=Z.useState(""),[l,c]=Z.useState(""),[u,d]=Z.useState(!1),[p,g]=Z.useState(null),[O,_]=Z.useState(null),b=Z.useCallback(async()=>{const x=l.trim();if(x){d(!0),g(null),_(null);try{if(n==="decision"){const w=await fetch("/api/state/decision",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({phase:r.trim()||void 0,text:x})});if(!w.ok){const k=await w.json().catch(()=>({}));throw new Error(k.error||"Could not add decision")}_("Decision added")}else{const w=await fetch("/api/state/blocker",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:x})});if(!w.ok){const k=await w.json().catch(()=>({}));throw new Error(k.error||"Could not add blocker")}_("Blocker added")}c(""),o(""),t==null||t(),setTimeout(()=>_(null),2e3)}catch(w){g(w instanceof Error?w.message:"Failed to update STATE.md")}finally{d(!1)}}},[n,r,l,t]);return S.jsxs("div",{className:"border-t border-border pt-4",children:[S.jsxs("button",{type:"button",onClick:()=>i(!e),className:"flex w-full items-center gap-2 text-left",children:[S.jsx("svg",{className:Fe("h-3 w-3 text-muted-foreground transition-transform",e&&"rotate-90"),viewBox:"0 0 12 12",fill:"currentColor",children:S.jsx("path",{d:"M4 2l5 4-5 4z"})}),S.jsx("span",{className:"font-mono text-xs uppercase tracking-wide text-muted-foreground",children:"Add to STATE.md"})]}),e&&S.jsxs("div",{className:"mt-3 space-y-3",children:[S.jsxs("div",{className:"flex gap-1",children:[S.jsx("button",{type:"button",onClick:()=>s("decision"),className:Fe("rounded-sm px-3 py-1 font-mono text-xs transition-colors",n==="decision"?"bg-accent/20 text-accent":"text-muted-foreground hover:text-foreground"),children:"Decision"}),S.jsx("button",{type:"button",onClick:()=>s("blocker"),className:Fe("rounded-sm px-3 py-1 font-mono text-xs transition-colors",n==="blocker"?"bg-danger/20 text-danger":"text-muted-foreground hover:text-foreground"),children:"Blocker"})]}),n==="decision"&&S.jsx("input",{type:"text",value:r,onChange:x=>o(x.target.value),placeholder:"Phase (e.g. 13-06)",className:"w-full rounded-sm border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:border-accent focus:outline-none"}),S.jsx("input",{type:"text",value:l,onChange:x=>c(x.target.value),onKeyDown:x=>{x.key==="Enter"&&!u&&b()},placeholder:n==="decision"?"Decision text...":"Blocker description...",className:"w-full rounded-sm border border-border bg-card px-3 py-1.5 font-mono text-xs text-foreground placeholder:text-muted-foreground focus:border-accent focus:outline-none"}),S.jsx("button",{type:"button",onClick:b,disabled:u||!l.trim(),className:Fe("rounded-sm px-3 py-1.5 font-mono text-xs font-semibold transition-colors","disabled:opacity-40 disabled:cursor-not-allowed",n==="decision"?"bg-accent/20 text-accent hover:bg-accent/30":"bg-danger/20 text-danger hover:bg-danger/30"),children:u?"Saving...":`Add ${n==="decision"?"Decision":"Blocker"}`}),p&&S.jsx("p",{className:"text-xs text-danger",children:p}),O&&S.jsx("p",{className:"text-xs text-success",children:O})]})]})}function Fte(t){return t.map(e=>({text:e.replace(/~~(.+)~~/,"$1").replace(/\s*RESOLVED.*$/i,"").trim(),resolved:e.includes("RESOLVED")||e.startsWith("~~")&&e.endsWith("~~")}))}function Gte(){const{state:t}=Rl(),[e,i]=Z.useState(!1),[n,s]=Z.useState(null),[r,o]=Z.useState(null),[l,c]=Z.useState(0),u=Fte((t==null?void 0:t.blockers)??[]),d=u.filter(_=>!_.resolved),p=u.filter(_=>_.resolved),g=Z.useCallback(async _=>{s(_),o(null);try{if(!(await fetch("/api/state",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({field:"blockers",value:`~~${_}~~ RESOLVED`})})).ok)throw new Error("Failed to resolve blocker");c(x=>x+1)}catch(b){o(b instanceof Error?b.message:"Failed to resolve blocker")}finally{s(null)}},[]),O=Z.useCallback(()=>{c(_=>_+1)},[]);return S.jsxs("div",{className:"space-y-6",children:[S.jsxs("div",{className:"flex items-center justify-between",children:[S.jsx("h2",{className:"font-mono text-xs uppercase tracking-widest text-foreground",children:"Blockers"}),S.jsx("span",{className:Fe("font-mono text-xs",d.length>0?"text-danger":"text-success"),children:d.length>0?`${d.length} active`:"No active blockers"})]}),r&&S.jsx("div",{className:"border border-danger/30 px-3 py-2 font-mono text-xs text-danger",children:r}),d.length===0?S.jsx("div",{className:"border border-success/20 px-4 py-6 text-center",children:S.jsx("p",{className:"font-mono text-xs text-success",children:"No active blockers"})}):S.jsx("div",{className:"border border-border divide-y divide-border",children:d.map(_=>S.jsxs("div",{className:"flex items-start gap-3 bg-card px-4 py-3",children:[S.jsx("span",{className:"mt-1.5 inline-block h-1.5 w-1.5 shrink-0 bg-danger"}),S.jsx("div",{className:"flex-1",children:S.jsx("p",{className:"text-sm text-foreground",children:_.text})}),S.jsx("button",{type:"button",onClick:()=>g(_.text),disabled:n===_.text,className:Fe("shrink-0 border border-success/30 px-3 py-1 font-mono text-[10px] uppercase tracking-widest transition-colors","text-success hover:bg-success/10","disabled:opacity-30 disabled:cursor-not-allowed"),children:n===_.text?"...":"Resolve"})]},_.text))}),p.length>0&&S.jsxs("div",{className:"border-t border-border pt-4",children:[S.jsxs("button",{type:"button",onClick:()=>i(!e),className:"flex w-full items-center gap-2 text-left",children:[S.jsx("svg",{className:Fe("h-3 w-3 text-muted-foreground transition-transform",e&&"rotate-90"),viewBox:"0 0 12 12",fill:"currentColor",children:S.jsx("path",{d:"M4 2l5 4-5 4z"})}),S.jsxs("span",{className:"font-mono text-xs text-muted-foreground",children:["Resolved (",p.length,")"]})]}),e&&S.jsx("div",{className:"mt-2 space-y-1",children:p.map(_=>S.jsxs("div",{className:"flex items-center gap-3 rounded-sm px-4 py-2",children:[S.jsx("span",{className:"inline-block h-1.5 w-1.5 shrink-0 bg-muted"}),S.jsx("p",{className:"text-sm text-muted-foreground line-through",children:_.text})]},_.text))})]}),S.jsx(Hte,{onEntryAdded:O})]},l)}function Kte({sidebar:t,children:e,mobileMenuOpen:i=!1,onMobileMenuToggle:n,onMobileMenuClose:s,headerRight:r,simpleMode:o=!1}){return S.jsxs("div",{className:"flex h-screen flex-col overflow-hidden md:flex-row",children:[S.jsxs("div",{className:Fe("flex shrink-0 items-center justify-between border-b bg-card px-4 py-3 md:hidden",o?"border-simple-accent/30 bg-simple-accent/5":"border-border"),children:[S.jsxs("span",{className:"text-sm font-bold tracking-tight text-foreground",children:["MAXSIM",S.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground",children:"Dashboard"})]}),S.jsxs("div",{className:"flex items-center gap-2",children:[r,S.jsx("button",{type:"button",onClick:n,className:"flex h-8 w-8 items-center justify-center text-muted-foreground transition-colors hover:text-foreground","aria-label":"Toggle menu",children:i?S.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M3 3l10 10M13 3L3 13"})}):S.jsx("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M2 4h12M2 8h12M2 12h12"})})})]})]}),i&&S.jsxs("div",{className:"fixed inset-0 z-50 md:hidden",children:[S.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:s}),S.jsx("div",{className:"absolute left-0 top-0 h-full w-64",children:t})]}),S.jsx("div",{className:"hidden shrink-0 md:flex",children:t}),S.jsxs("main",{className:"flex min-h-0 flex-1 flex-col overflow-hidden",children:[o&&S.jsxs("div",{className:"hidden md:flex shrink-0 items-center justify-between border-b border-simple-accent/30 bg-simple-accent/5 px-6 py-3",children:[S.jsxs("span",{className:"text-sm font-bold tracking-tight text-foreground",children:["MAXSIM ",S.jsx("span",{className:"ml-1.5 text-xs font-normal text-muted-foreground",children:"Simple Mode"})]}),r]}),e]})]})}var xc={},hy,dP;function Jte(){return dP||(dP=1,hy=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),hy}var uy={},ia={},pP;function Dl(){if(pP)return ia;pP=1;let t;const e=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return ia.getSymbolSize=function(n){if(!n)throw new Error('"version" cannot be null or undefined');if(n<1||n>40)throw new Error('"version" should be in range from 1 to 40');return n*4+17},ia.getSymbolTotalCodewords=function(n){return e[n]},ia.getBCHDigit=function(i){let n=0;for(;i!==0;)n++,i>>>=1;return n},ia.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');t=n},ia.isKanjiModeEnabled=function(){return typeof t<"u"},ia.toSJIS=function(n){return t(n)},ia}var fy={},mP;function Aw(){return mP||(mP=1,(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+i)}}t.isValid=function(n){return n&&typeof n.bit<"u"&&n.bit>=0&&n.bit<4},t.from=function(n,s){if(t.isValid(n))return n;try{return e(n)}catch{return s}}})(fy)),fy}var dy,gP;function eie(){if(gP)return dy;gP=1;function t(){this.buffer=[],this.length=0}return t.prototype={get:function(e){const i=Math.floor(e/8);return(this.buffer[i]>>>7-e%8&1)===1},put:function(e,i){for(let n=0;n<i;n++)this.putBit((e>>>i-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const i=Math.floor(this.length/8);this.buffer.length<=i&&this.buffer.push(0),e&&(this.buffer[i]|=128>>>this.length%8),this.length++}},dy=t,dy}var py,OP;function tie(){if(OP)return py;OP=1;function t(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}return t.prototype.set=function(e,i,n,s){const r=e*this.size+i;this.data[r]=n,s&&(this.reservedBit[r]=!0)},t.prototype.get=function(e,i){return this.data[e*this.size+i]},t.prototype.xor=function(e,i,n){this.data[e*this.size+i]^=n},t.prototype.isReserved=function(e,i){return this.reservedBit[e*this.size+i]},py=t,py}var my={},vP;function iie(){return vP||(vP=1,(function(t){const e=Dl().getSymbolSize;t.getRowColCoords=function(n){if(n===1)return[];const s=Math.floor(n/7)+2,r=e(n),o=r===145?26:Math.ceil((r-13)/(2*s-2))*2,l=[r-7];for(let c=1;c<s-1;c++)l[c]=l[c-1]-o;return l.push(6),l.reverse()},t.getPositions=function(n){const s=[],r=t.getRowColCoords(n),o=r.length;for(let l=0;l<o;l++)for(let c=0;c<o;c++)l===0&&c===0||l===0&&c===o-1||l===o-1&&c===0||s.push([r[l],r[c]]);return s}})(my)),my}var gy={},_P;function nie(){if(_P)return gy;_P=1;const t=Dl().getSymbolSize,e=7;return gy.getPositions=function(n){const s=t(n);return[[0,0],[s-e,0],[0,s-e]]},gy}var Oy={},yP;function sie(){return yP||(yP=1,(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(s){return s!=null&&s!==""&&!isNaN(s)&&s>=0&&s<=7},t.from=function(s){return t.isValid(s)?parseInt(s,10):void 0},t.getPenaltyN1=function(s){const r=s.size;let o=0,l=0,c=0,u=null,d=null;for(let p=0;p<r;p++){l=c=0,u=d=null;for(let g=0;g<r;g++){let O=s.get(p,g);O===u?l++:(l>=5&&(o+=e.N1+(l-5)),u=O,l=1),O=s.get(g,p),O===d?c++:(c>=5&&(o+=e.N1+(c-5)),d=O,c=1)}l>=5&&(o+=e.N1+(l-5)),c>=5&&(o+=e.N1+(c-5))}return o},t.getPenaltyN2=function(s){const r=s.size;let o=0;for(let l=0;l<r-1;l++)for(let c=0;c<r-1;c++){const u=s.get(l,c)+s.get(l,c+1)+s.get(l+1,c)+s.get(l+1,c+1);(u===4||u===0)&&o++}return o*e.N2},t.getPenaltyN3=function(s){const r=s.size;let o=0,l=0,c=0;for(let u=0;u<r;u++){l=c=0;for(let d=0;d<r;d++)l=l<<1&2047|s.get(u,d),d>=10&&(l===1488||l===93)&&o++,c=c<<1&2047|s.get(d,u),d>=10&&(c===1488||c===93)&&o++}return o*e.N3},t.getPenaltyN4=function(s){let r=0;const o=s.data.length;for(let c=0;c<o;c++)r+=s.data[c];return Math.abs(Math.ceil(r*100/o/5)-10)*e.N4};function i(n,s,r){switch(n){case t.Patterns.PATTERN000:return(s+r)%2===0;case t.Patterns.PATTERN001:return s%2===0;case t.Patterns.PATTERN010:return r%3===0;case t.Patterns.PATTERN011:return(s+r)%3===0;case t.Patterns.PATTERN100:return(Math.floor(s/2)+Math.floor(r/3))%2===0;case t.Patterns.PATTERN101:return s*r%2+s*r%3===0;case t.Patterns.PATTERN110:return(s*r%2+s*r%3)%2===0;case t.Patterns.PATTERN111:return(s*r%3+(s+r)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}t.applyMask=function(s,r){const o=r.size;for(let l=0;l<o;l++)for(let c=0;c<o;c++)r.isReserved(c,l)||r.xor(c,l,i(s,c,l))},t.getBestMask=function(s,r){const o=Object.keys(t.Patterns).length;let l=0,c=1/0;for(let u=0;u<o;u++){r(u),t.applyMask(u,s);const d=t.getPenaltyN1(s)+t.getPenaltyN2(s)+t.getPenaltyN3(s)+t.getPenaltyN4(s);t.applyMask(u,s),d<c&&(c=d,l=u)}return l}})(Oy)),Oy}var bm={},bP;function _6(){if(bP)return bm;bP=1;const t=Aw(),e=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],i=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return bm.getBlocksCount=function(s,r){switch(r){case t.L:return e[(s-1)*4+0];case t.M:return e[(s-1)*4+1];case t.Q:return e[(s-1)*4+2];case t.H:return e[(s-1)*4+3];default:return}},bm.getTotalCodewordsCount=function(s,r){switch(r){case t.L:return i[(s-1)*4+0];case t.M:return i[(s-1)*4+1];case t.Q:return i[(s-1)*4+2];case t.H:return i[(s-1)*4+3];default:return}},bm}var vy={},Lu={},SP;function rie(){if(SP)return Lu;SP=1;const t=new Uint8Array(512),e=new Uint8Array(256);return(function(){let n=1;for(let s=0;s<255;s++)t[s]=n,e[n]=s,n<<=1,n&256&&(n^=285);for(let s=255;s<512;s++)t[s]=t[s-255]})(),Lu.log=function(n){if(n<1)throw new Error("log("+n+")");return e[n]},Lu.exp=function(n){return t[n]},Lu.mul=function(n,s){return n===0||s===0?0:t[e[n]+e[s]]},Lu}var xP;function oie(){return xP||(xP=1,(function(t){const e=rie();t.mul=function(n,s){const r=new Uint8Array(n.length+s.length-1);for(let o=0;o<n.length;o++)for(let l=0;l<s.length;l++)r[o+l]^=e.mul(n[o],s[l]);return r},t.mod=function(n,s){let r=new Uint8Array(n);for(;r.length-s.length>=0;){const o=r[0];for(let c=0;c<s.length;c++)r[c]^=e.mul(s[c],o);let l=0;for(;l<r.length&&r[l]===0;)l++;r=r.slice(l)}return r},t.generateECPolynomial=function(n){let s=new Uint8Array([1]);for(let r=0;r<n;r++)s=t.mul(s,new Uint8Array([1,e.exp(r)]));return s}})(vy)),vy}var _y,wP;function aie(){if(wP)return _y;wP=1;const t=oie();function e(i){this.genPoly=void 0,this.degree=i,this.degree&&this.initialize(this.degree)}return e.prototype.initialize=function(n){this.degree=n,this.genPoly=t.generateECPolynomial(this.degree)},e.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const s=new Uint8Array(n.length+this.degree);s.set(n);const r=t.mod(s,this.genPoly),o=this.degree-r.length;if(o>0){const l=new Uint8Array(this.degree);return l.set(r,o),l}return r},_y=e,_y}var yy={},by={},Sy={},CP;function y6(){return CP||(CP=1,Sy.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}),Sy}var ar={},kP;function b6(){if(kP)return ar;kP=1;const t="[0-9]+",e="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r
87
+ ]))+`;ar.KANJI=new RegExp(i,"g"),ar.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),ar.BYTE=new RegExp(n,"g"),ar.NUMERIC=new RegExp(t,"g"),ar.ALPHANUMERIC=new RegExp(e,"g");const s=new RegExp("^"+i+"$"),r=new RegExp("^"+t+"$"),o=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return ar.testKanji=function(c){return s.test(c)},ar.testNumeric=function(c){return r.test(c)},ar.testAlphanumeric=function(c){return o.test(c)},ar}var TP;function Bl(){return TP||(TP=1,(function(t){const e=y6(),i=b6();t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(r,o){if(!r.ccBits)throw new Error("Invalid mode: "+r);if(!e.isValid(o))throw new Error("Invalid version: "+o);return o>=1&&o<10?r.ccBits[0]:o<27?r.ccBits[1]:r.ccBits[2]},t.getBestModeForData=function(r){return i.testNumeric(r)?t.NUMERIC:i.testAlphanumeric(r)?t.ALPHANUMERIC:i.testKanji(r)?t.KANJI:t.BYTE},t.toString=function(r){if(r&&r.id)return r.id;throw new Error("Invalid mode")},t.isValid=function(r){return r&&r.bit&&r.ccBits};function n(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+s)}}t.from=function(r,o){if(t.isValid(r))return r;try{return n(r)}catch{return o}}})(by)),by}var AP;function lie(){return AP||(AP=1,(function(t){const e=Dl(),i=_6(),n=Aw(),s=Bl(),r=y6(),o=7973,l=e.getBCHDigit(o);function c(g,O,_){for(let b=1;b<=40;b++)if(O<=t.getCapacity(b,_,g))return b}function u(g,O){return s.getCharCountIndicator(g,O)+4}function d(g,O){let _=0;return g.forEach(function(b){const x=u(b.mode,O);_+=x+b.getBitsLength()}),_}function p(g,O){for(let _=1;_<=40;_++)if(d(g,_)<=t.getCapacity(_,O,s.MIXED))return _}t.from=function(O,_){return r.isValid(O)?parseInt(O,10):_},t.getCapacity=function(O,_,b){if(!r.isValid(O))throw new Error("Invalid QR Code version");typeof b>"u"&&(b=s.BYTE);const x=e.getSymbolTotalCodewords(O),w=i.getTotalCodewordsCount(O,_),k=(x-w)*8;if(b===s.MIXED)return k;const T=k-u(b,O);switch(b){case s.NUMERIC:return Math.floor(T/10*3);case s.ALPHANUMERIC:return Math.floor(T/11*2);case s.KANJI:return Math.floor(T/13);case s.BYTE:default:return Math.floor(T/8)}},t.getBestVersionForData=function(O,_){let b;const x=n.from(_,n.M);if(Array.isArray(O)){if(O.length>1)return p(O,x);if(O.length===0)return 1;b=O[0]}else b=O;return c(b.mode,b.getLength(),x)},t.getEncodedBits=function(O){if(!r.isValid(O)||O<7)throw new Error("Invalid QR Code version");let _=O<<12;for(;e.getBCHDigit(_)-l>=0;)_^=o<<e.getBCHDigit(_)-l;return O<<12|_}})(yy)),yy}var xy={},EP;function cie(){if(EP)return xy;EP=1;const t=Dl(),e=1335,i=21522,n=t.getBCHDigit(e);return xy.getEncodedBits=function(r,o){const l=r.bit<<3|o;let c=l<<10;for(;t.getBCHDigit(c)-n>=0;)c^=e<<t.getBCHDigit(c)-n;return(l<<10|c)^i},xy}var wy={},Cy,MP;function hie(){if(MP)return Cy;MP=1;const t=Bl();function e(i){this.mode=t.NUMERIC,this.data=i.toString()}return e.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(n){let s,r,o;for(s=0;s+3<=this.data.length;s+=3)r=this.data.substr(s,3),o=parseInt(r,10),n.put(o,10);const l=this.data.length-s;l>0&&(r=this.data.substr(s),o=parseInt(r,10),n.put(o,l*3+1))},Cy=e,Cy}var ky,PP;function uie(){if(PP)return ky;PP=1;const t=Bl(),e=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function i(n){this.mode=t.ALPHANUMERIC,this.data=n}return i.getBitsLength=function(s){return 11*Math.floor(s/2)+6*(s%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(s){let r;for(r=0;r+2<=this.data.length;r+=2){let o=e.indexOf(this.data[r])*45;o+=e.indexOf(this.data[r+1]),s.put(o,11)}this.data.length%2&&s.put(e.indexOf(this.data[r]),6)},ky=i,ky}var Ty,RP;function fie(){if(RP)return Ty;RP=1;const t=Bl();function e(i){this.mode=t.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}return e.getBitsLength=function(n){return n*8},e.prototype.getLength=function(){return this.data.length},e.prototype.getBitsLength=function(){return e.getBitsLength(this.data.length)},e.prototype.write=function(i){for(let n=0,s=this.data.length;n<s;n++)i.put(this.data[n],8)},Ty=e,Ty}var Ay,QP;function die(){if(QP)return Ay;QP=1;const t=Bl(),e=Dl();function i(n){this.mode=t.KANJI,this.data=n}return i.getBitsLength=function(s){return s*13},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(n){let s;for(s=0;s<this.data.length;s++){let r=e.toSJIS(this.data[s]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw new Error("Invalid SJIS character: "+this.data[s]+`
88
+ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),n.put(r,13)}},Ay=i,Ay}var Ey={exports:{}},LP;function pie(){return LP||(LP=1,(function(t){var e={single_source_shortest_paths:function(i,n,s){var r={},o={};o[n]=0;var l=e.PriorityQueue.make();l.push(n,0);for(var c,u,d,p,g,O,_,b,x;!l.empty();){c=l.pop(),u=c.value,p=c.cost,g=i[u]||{};for(d in g)g.hasOwnProperty(d)&&(O=g[d],_=p+O,b=o[d],x=typeof o[d]>"u",(x||b>_)&&(o[d]=_,l.push(d,_),r[d]=u))}if(typeof s<"u"&&typeof o[s]>"u"){var w=["Could not find a path from ",n," to ",s,"."].join("");throw new Error(w)}return r},extract_shortest_path_from_predecessor_list:function(i,n){for(var s=[],r=n;r;)s.push(r),i[r],r=i[r];return s.reverse(),s},find_path:function(i,n,s){var r=e.single_source_shortest_paths(i,n,s);return e.extract_shortest_path_from_predecessor_list(r,s)},PriorityQueue:{make:function(i){var n=e.PriorityQueue,s={},r;i=i||{};for(r in n)n.hasOwnProperty(r)&&(s[r]=n[r]);return s.queue=[],s.sorter=i.sorter||n.default_sorter,s},default_sorter:function(i,n){return i.cost-n.cost},push:function(i,n){var s={value:i,cost:n};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(Ey)),Ey.exports}var DP;function mie(){return DP||(DP=1,(function(t){const e=Bl(),i=hie(),n=uie(),s=fie(),r=die(),o=b6(),l=Dl(),c=pie();function u(w){return unescape(encodeURIComponent(w)).length}function d(w,k,T){const A=[];let L;for(;(L=w.exec(T))!==null;)A.push({data:L[0],index:L.index,mode:k,length:L[0].length});return A}function p(w){const k=d(o.NUMERIC,e.NUMERIC,w),T=d(o.ALPHANUMERIC,e.ALPHANUMERIC,w);let A,L;return l.isKanjiModeEnabled()?(A=d(o.BYTE,e.BYTE,w),L=d(o.KANJI,e.KANJI,w)):(A=d(o.BYTE_KANJI,e.BYTE,w),L=[]),k.concat(T,A,L).sort(function(z,N){return z.index-N.index}).map(function(z){return{data:z.data,mode:z.mode,length:z.length}})}function g(w,k){switch(k){case e.NUMERIC:return i.getBitsLength(w);case e.ALPHANUMERIC:return n.getBitsLength(w);case e.KANJI:return r.getBitsLength(w);case e.BYTE:return s.getBitsLength(w)}}function O(w){return w.reduce(function(k,T){const A=k.length-1>=0?k[k.length-1]:null;return A&&A.mode===T.mode?(k[k.length-1].data+=T.data,k):(k.push(T),k)},[])}function _(w){const k=[];for(let T=0;T<w.length;T++){const A=w[T];switch(A.mode){case e.NUMERIC:k.push([A,{data:A.data,mode:e.ALPHANUMERIC,length:A.length},{data:A.data,mode:e.BYTE,length:A.length}]);break;case e.ALPHANUMERIC:k.push([A,{data:A.data,mode:e.BYTE,length:A.length}]);break;case e.KANJI:k.push([A,{data:A.data,mode:e.BYTE,length:u(A.data)}]);break;case e.BYTE:k.push([{data:A.data,mode:e.BYTE,length:u(A.data)}])}}return k}function b(w,k){const T={},A={start:{}};let L=["start"];for(let E=0;E<w.length;E++){const z=w[E],N=[];for(let q=0;q<z.length;q++){const J=z[q],U=""+E+q;N.push(U),T[U]={node:J,lastCount:0},A[U]={};for(let R=0;R<L.length;R++){const B=L[R];T[B]&&T[B].node.mode===J.mode?(A[B][U]=g(T[B].lastCount+J.length,J.mode)-g(T[B].lastCount,J.mode),T[B].lastCount+=J.length):(T[B]&&(T[B].lastCount=J.length),A[B][U]=g(J.length,J.mode)+4+e.getCharCountIndicator(J.mode,k))}}L=N}for(let E=0;E<L.length;E++)A[L[E]].end=0;return{map:A,table:T}}function x(w,k){let T;const A=e.getBestModeForData(w);if(T=e.from(k,A),T!==e.BYTE&&T.bit<A.bit)throw new Error('"'+w+'" cannot be encoded with mode '+e.toString(T)+`.
89
+ Suggested mode is: `+e.toString(A));switch(T===e.KANJI&&!l.isKanjiModeEnabled()&&(T=e.BYTE),T){case e.NUMERIC:return new i(w);case e.ALPHANUMERIC:return new n(w);case e.KANJI:return new r(w);case e.BYTE:return new s(w)}}t.fromArray=function(k){return k.reduce(function(T,A){return typeof A=="string"?T.push(x(A,null)):A.data&&T.push(x(A.data,A.mode)),T},[])},t.fromString=function(k,T){const A=p(k,l.isKanjiModeEnabled()),L=_(A),E=b(L,T),z=c.find_path(E.map,"start","end"),N=[];for(let q=1;q<z.length-1;q++)N.push(E.table[z[q]].node);return t.fromArray(O(N))},t.rawSplit=function(k){return t.fromArray(p(k,l.isKanjiModeEnabled()))}})(wy)),wy}var BP;function gie(){if(BP)return uy;BP=1;const t=Dl(),e=Aw(),i=eie(),n=tie(),s=iie(),r=nie(),o=sie(),l=_6(),c=aie(),u=lie(),d=cie(),p=Bl(),g=mie();function O(E,z){const N=E.size,q=r.getPositions(z);for(let J=0;J<q.length;J++){const U=q[J][0],R=q[J][1];for(let B=-1;B<=7;B++)if(!(U+B<=-1||N<=U+B))for(let D=-1;D<=7;D++)R+D<=-1||N<=R+D||(B>=0&&B<=6&&(D===0||D===6)||D>=0&&D<=6&&(B===0||B===6)||B>=2&&B<=4&&D>=2&&D<=4?E.set(U+B,R+D,!0,!0):E.set(U+B,R+D,!1,!0))}}function _(E){const z=E.size;for(let N=8;N<z-8;N++){const q=N%2===0;E.set(N,6,q,!0),E.set(6,N,q,!0)}}function b(E,z){const N=s.getPositions(z);for(let q=0;q<N.length;q++){const J=N[q][0],U=N[q][1];for(let R=-2;R<=2;R++)for(let B=-2;B<=2;B++)R===-2||R===2||B===-2||B===2||R===0&&B===0?E.set(J+R,U+B,!0,!0):E.set(J+R,U+B,!1,!0)}}function x(E,z){const N=E.size,q=u.getEncodedBits(z);let J,U,R;for(let B=0;B<18;B++)J=Math.floor(B/3),U=B%3+N-8-3,R=(q>>B&1)===1,E.set(J,U,R,!0),E.set(U,J,R,!0)}function w(E,z,N){const q=E.size,J=d.getEncodedBits(z,N);let U,R;for(U=0;U<15;U++)R=(J>>U&1)===1,U<6?E.set(U,8,R,!0):U<8?E.set(U+1,8,R,!0):E.set(q-15+U,8,R,!0),U<8?E.set(8,q-U-1,R,!0):U<9?E.set(8,15-U-1+1,R,!0):E.set(8,15-U-1,R,!0);E.set(q-8,8,1,!0)}function k(E,z){const N=E.size;let q=-1,J=N-1,U=7,R=0;for(let B=N-1;B>0;B-=2)for(B===6&&B--;;){for(let D=0;D<2;D++)if(!E.isReserved(J,B-D)){let j=!1;R<z.length&&(j=(z[R]>>>U&1)===1),E.set(J,B-D,j),U--,U===-1&&(R++,U=7)}if(J+=q,J<0||N<=J){J-=q,q=-q;break}}}function T(E,z,N){const q=new i;N.forEach(function(D){q.put(D.mode.bit,4),q.put(D.getLength(),p.getCharCountIndicator(D.mode,E)),D.write(q)});const J=t.getSymbolTotalCodewords(E),U=l.getTotalCodewordsCount(E,z),R=(J-U)*8;for(q.getLengthInBits()+4<=R&&q.put(0,4);q.getLengthInBits()%8!==0;)q.putBit(0);const B=(R-q.getLengthInBits())/8;for(let D=0;D<B;D++)q.put(D%2?17:236,8);return A(q,E,z)}function A(E,z,N){const q=t.getSymbolTotalCodewords(z),J=l.getTotalCodewordsCount(z,N),U=q-J,R=l.getBlocksCount(z,N),B=q%R,D=R-B,j=Math.floor(q/R),$=Math.floor(U/R),X=$+1,H=j-$,F=new c(H);let M=0;const I=new Array(R),K=new Array(R);let Q=0;const ue=new Uint8Array(E.buffer);for(let ye=0;ye<R;ye++){const nt=ye<D?$:X;I[ye]=ue.slice(M,M+nt),K[ye]=F.encode(I[ye]),M+=nt,Q=Math.max(Q,nt)}const he=new Uint8Array(q);let fe=0,Oe,Ce;for(Oe=0;Oe<Q;Oe++)for(Ce=0;Ce<R;Ce++)Oe<I[Ce].length&&(he[fe++]=I[Ce][Oe]);for(Oe=0;Oe<H;Oe++)for(Ce=0;Ce<R;Ce++)he[fe++]=K[Ce][Oe];return he}function L(E,z,N,q){let J;if(Array.isArray(E))J=g.fromArray(E);else if(typeof E=="string"){let j=z;if(!j){const $=g.rawSplit(E);j=u.getBestVersionForData($,N)}J=g.fromString(E,j||40)}else throw new Error("Invalid data");const U=u.getBestVersionForData(J,N);if(!U)throw new Error("The amount of data is too big to be stored in a QR Code");if(!z)z=U;else if(z<U)throw new Error(`
90
+ The chosen QR Code version cannot contain this amount of data.
91
+ Minimum version required to store current data is: `+U+`.
92
+ `);const R=T(z,N,J),B=t.getSymbolSize(z),D=new n(B);return O(D,z),_(D),b(D,z),w(D,N,0),z>=7&&x(D,z),k(D,R),isNaN(q)&&(q=o.getBestMask(D,w.bind(null,D,N))),o.applyMask(q,D),w(D,N,q),{modules:D,version:z,errorCorrectionLevel:N,maskPattern:q,segments:J}}return uy.create=function(z,N){if(typeof z>"u"||z==="")throw new Error("No input text");let q=e.M,J,U;return typeof N<"u"&&(q=e.from(N.errorCorrectionLevel,e.M),J=u.from(N.version),U=o.from(N.maskPattern),N.toSJISFunc&&t.setToSJISFunction(N.toSJISFunc)),L(z,J,q,U)},uy}var My={},Py={},$P;function S6(){return $P||($P=1,(function(t){function e(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let n=i.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+i);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(r){return[r,r]}))),n.length===6&&n.push("F","F");const s=parseInt(n.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+n.slice(0,6).join("")}}t.getOptions=function(n){n||(n={}),n.color||(n.color={});const s=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,r=n.width&&n.width>=21?n.width:void 0,o=n.scale||4;return{width:r,scale:r?4:o,margin:s,color:{dark:e(n.color.dark||"#000000ff"),light:e(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},t.getScale=function(n,s){return s.width&&s.width>=n+s.margin*2?s.width/(n+s.margin*2):s.scale},t.getImageWidth=function(n,s){const r=t.getScale(n,s);return Math.floor((n+s.margin*2)*r)},t.qrToImageData=function(n,s,r){const o=s.modules.size,l=s.modules.data,c=t.getScale(o,r),u=Math.floor((o+r.margin*2)*c),d=r.margin*c,p=[r.color.light,r.color.dark];for(let g=0;g<u;g++)for(let O=0;O<u;O++){let _=(g*u+O)*4,b=r.color.light;if(g>=d&&O>=d&&g<u-d&&O<u-d){const x=Math.floor((g-d)/c),w=Math.floor((O-d)/c);b=p[l[x*o+w]?1:0]}n[_++]=b.r,n[_++]=b.g,n[_++]=b.b,n[_]=b.a}}})(Py)),Py}var zP;function Oie(){return zP||(zP=1,(function(t){const e=S6();function i(s,r,o){s.clearRect(0,0,r.width,r.height),r.style||(r.style={}),r.height=o,r.width=o,r.style.height=o+"px",r.style.width=o+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}t.render=function(r,o,l){let c=l,u=o;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),o||(u=n()),c=e.getOptions(c);const d=e.getImageWidth(r.modules.size,c),p=u.getContext("2d"),g=p.createImageData(d,d);return e.qrToImageData(g.data,r,c),i(p,u,d),p.putImageData(g,0,0),u},t.renderToDataURL=function(r,o,l){let c=l;typeof c>"u"&&(!o||!o.getContext)&&(c=o,o=void 0),c||(c={});const u=t.render(r,o,c),d=c.type||"image/png",p=c.rendererOpts||{};return u.toDataURL(d,p.quality)}})(My)),My}var Ry={},NP;function vie(){if(NP)return Ry;NP=1;const t=S6();function e(s,r){const o=s.a/255,l=r+'="'+s.hex+'"';return o<1?l+" "+r+'-opacity="'+o.toFixed(2).slice(1)+'"':l}function i(s,r,o){let l=s+r;return typeof o<"u"&&(l+=" "+o),l}function n(s,r,o){let l="",c=0,u=!1,d=0;for(let p=0;p<s.length;p++){const g=Math.floor(p%r),O=Math.floor(p/r);!g&&!u&&(u=!0),s[p]?(d++,p>0&&g>0&&s[p-1]||(l+=u?i("M",g+o,.5+O+o):i("m",c,0),c=0,u=!1),g+1<r&&s[p+1]||(l+=i("h",d),d=0)):c++}return l}return Ry.render=function(r,o,l){const c=t.getOptions(o),u=r.modules.size,d=r.modules.data,p=u+c.margin*2,g=c.color.light.a?"<path "+e(c.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",O="<path "+e(c.color.dark,"stroke")+' d="'+n(d,u,c.margin)+'"/>',_='viewBox="0 0 '+p+" "+p+'"',x='<svg xmlns="http://www.w3.org/2000/svg" '+(c.width?'width="'+c.width+'" height="'+c.width+'" ':"")+_+' shape-rendering="crispEdges">'+g+O+`</svg>
93
+ `;return typeof l=="function"&&l(null,x),x},Ry}var jP;function _ie(){if(jP)return xc;jP=1;const t=Jte(),e=gie(),i=Oie(),n=vie();function s(r,o,l,c,u){const d=[].slice.call(arguments,1),p=d.length,g=typeof d[p-1]=="function";if(!g&&!t())throw new Error("Callback required as last argument");if(g){if(p<2)throw new Error("Too few arguments provided");p===2?(u=l,l=o,o=c=void 0):p===3&&(o.getContext&&typeof u>"u"?(u=c,c=void 0):(u=c,c=l,l=o,o=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(l=o,o=c=void 0):p===2&&!o.getContext&&(c=l,l=o,o=void 0),new Promise(function(O,_){try{const b=e.create(l,c);O(r(b,o,c))}catch(b){_(b)}})}try{const O=e.create(l,c);u(null,r(O,o,c))}catch(O){u(O)}}return xc.create=e.create,xc.toCanvas=s.bind(null,i.render),xc.toDataURL=s.bind(null,i.renderToDataURL),xc.toString=s.bind(null,function(r,o,l){return n.render(r,l)}),xc}var yie=_ie();const IP=WS(yie);function bie(){const[t,e]=Z.useState(null),[i,n]=Z.useState(!1),[s,r]=Z.useState(null),[o,l]=Z.useState(null);Z.useEffect(()=>{fetch("/api/server-info").then(p=>p.json()).then(p=>e(p)).catch(()=>{})},[]),Z.useEffect(()=>{t!=null&&t.tailscaleUrl&&IP.toDataURL(t.tailscaleUrl,{width:192,margin:2}).then(r).catch(()=>{}),t!=null&&t.networkUrl&&IP.toDataURL(t.networkUrl,{width:192,margin:2}).then(l).catch(()=>{})},[t==null?void 0:t.tailscaleUrl,t==null?void 0:t.networkUrl]);const c=!!(t!=null&&t.tailscaleUrl),u=!!(t!=null&&t.networkUrl),d=c||u;return S.jsxs("div",{className:"relative border-t border-border px-1 py-2",children:[i&&S.jsxs("div",{className:"absolute bottom-full left-2 right-2 mb-2 border border-border bg-card shadow-xl",children:[c&&S.jsxs("div",{className:"p-3",children:[S.jsxs("div",{className:"mb-2 flex items-center gap-1.5",children:[S.jsx("span",{className:"inline-block h-1.5 w-1.5 bg-success"}),S.jsx("p",{className:"font-mono text-[9px] uppercase tracking-widest text-success",children:"Tailscale — Secure"})]}),S.jsx("p",{className:"mb-3 break-all font-mono text-[11px] text-foreground",children:t.tailscaleUrl}),s&&S.jsx("img",{src:s,alt:"QR code for Tailscale access",width:192,height:192,className:"w-full"}),S.jsx("p",{className:"mt-2 font-mono text-[9px] text-muted-foreground",children:"Only visible to your Tailscale devices"})]}),u&&S.jsxs("div",{className:`p-3 ${c?"border-t border-border":""}`,children:[S.jsx("p",{className:"mb-0.5 font-mono text-[9px] uppercase tracking-widest text-muted-foreground",children:"Local Network"}),S.jsx("p",{className:"mb-3 break-all font-mono text-[11px] text-foreground",children:t.networkUrl}),o&&S.jsx("img",{src:o,alt:"QR code for local network access",width:192,height:192,className:"w-full"}),S.jsx("p",{className:"mt-2 font-mono text-[9px] text-muted-foreground",children:"Anyone on your local network can access this"})]}),!d&&S.jsxs("div",{className:"p-3",children:[S.jsxs("div",{className:"mb-2 flex items-center gap-1.5",children:[S.jsx("span",{className:"inline-block h-1.5 w-1.5 bg-muted-foreground"}),S.jsx("p",{className:"font-mono text-[9px] uppercase tracking-widest text-muted-foreground",children:"Remote Access"})]}),S.jsx("p",{className:"mb-3 font-mono text-[11px] leading-relaxed text-muted-foreground",children:"Install Tailscale on this device and your phone to securely access the dashboard from anywhere — no port forwarding, no public URLs."}),S.jsx("a",{href:"https://tailscale.com/download",target:"_blank",rel:"noopener noreferrer",className:"block w-full border border-border px-3 py-1.5 text-center font-mono text-[10px] uppercase tracking-widest text-muted-foreground transition-colors hover:border-accent hover:text-accent",children:"Get Tailscale →"}),S.jsx("p",{className:"mt-2 font-mono text-[9px] text-muted-foreground",children:"Free · E2E encrypted · No account sharing"})]})]}),S.jsxs("button",{type:"button",onClick:()=>n(p=>!p),title:c?"Open on another device via Tailscale":u?"Open on another device via local network":"Set up remote access",className:"flex w-full items-center gap-2.5 rounded-sm px-3 py-2 text-left text-sm transition-colors hover:bg-card-hover text-muted-foreground",children:[S.jsx(Sie,{active:c}),S.jsx("span",{className:"font-mono text-xs uppercase tracking-wide",children:"Share"}),c&&S.jsx("span",{className:"ml-auto inline-block h-1.5 w-1.5 bg-success"})]})]})}function Sie({active:t}){return S.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[S.jsx("circle",{cx:"18",cy:"5",r:"3"}),S.jsx("circle",{cx:"6",cy:"12",r:"3"}),S.jsx("circle",{cx:"18",cy:"19",r:"3"}),S.jsx("line",{x1:"8.59",y1:"13.51",x2:"15.42",y2:"17.49"}),S.jsx("line",{x1:"15.41",y1:"6.51",x2:"8.59",y2:"10.49"})]})}function xie(t){switch(t){case"complete":return"bg-success";case"partial":return"bg-accent";case"planned":case"researched":case"discussed":return"bg-muted-foreground/50";default:return"bg-muted"}}function wie({activeView:t,activePhaseId:e,onNavigate:i,logoAction:n}){const{roadmap:s,state:r,todos:o}=Rl(),{connected:l}=Ea(),[c,u]=Z.useState(!1);Z.useEffect(()=>{if(!c)return;const b=setTimeout(()=>u(!1),3e3);return()=>clearTimeout(b)},[c]);async function d(){if(!c){u(!0);return}try{await fetch("/api/shutdown",{method:"POST"})}catch{}}const p=((s==null?void 0:s.phases)??[]).map(b=>({number:b.number,name:b.name,goal:b.goal??"",dependsOn:b.depends_on?[b.depends_on]:[],planCount:b.plan_count,summaryCount:b.summary_count,diskStatus:b.disk_status,roadmapComplete:b.roadmap_complete,hasContext:b.has_context,hasResearch:b.has_research})),g=(s==null?void 0:s.current_phase)??null,O=(r==null?void 0:r.blockers.filter(b=>!b.includes("RESOLVED")).length)??0,_=(o==null?void 0:o.pending.length)??0;return S.jsxs("aside",{className:"flex h-full w-56 shrink-0 flex-col border-r border-border bg-card",children:[S.jsxs("div",{className:"border-b border-border px-5 py-4 flex items-center justify-between",children:[S.jsxs("button",{type:"button",onClick:()=>i("overview"),className:"flex flex-col gap-0.5 text-left",children:[S.jsx("span",{className:"text-sm font-bold tracking-tight text-foreground",children:"MAXSIM"}),S.jsx("span",{className:"text-xs text-muted-foreground",children:"Dashboard"})]}),n]}),S.jsxs("div",{className:"flex-1 overflow-y-auto",children:[S.jsxs("div",{className:"flex items-center gap-2 px-5 py-3",children:[S.jsx("span",{className:"block w-4 h-px bg-border"}),S.jsx("span",{className:"text-xs uppercase tracking-widest text-muted-foreground",children:"Phases"})]}),S.jsx("nav",{className:"flex flex-col",children:p.map(b=>{const x=t==="phase"&&e===b.number,w=b.number===g;return S.jsxs("button",{type:"button",onClick:()=>i("phase",b.number),className:Fe("flex w-full items-center gap-2.5 px-5 py-2 text-left transition-colors duration-200",x?"bg-card-hover border-l-2 border-l-accent text-foreground":"border-l-2 border-l-transparent text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[S.jsx("span",{className:Fe("inline-block h-1.5 w-1.5 shrink-0",xie(b.diskStatus))}),S.jsx("span",{className:Fe("font-mono text-xs tabular-nums shrink-0",w||x?"text-accent":""),children:b.number}),S.jsx("span",{className:"truncate text-xs",children:b.name})]},b.number)})})]}),S.jsxs("div",{className:"border-t border-border",children:[S.jsxs("button",{type:"button",onClick:()=>i("todos"),className:Fe("flex w-full items-center justify-between px-5 py-2.5 text-left transition-colors duration-200",t==="todos"?"text-foreground bg-card-hover":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[S.jsx("span",{className:"text-sm",children:"Todos"}),_>0&&S.jsx("span",{className:"font-mono text-xs text-warning tabular-nums",children:_})]}),S.jsxs("button",{type:"button",onClick:()=>i("blockers"),className:Fe("flex w-full items-center justify-between border-t border-border px-5 py-2.5 text-left transition-colors duration-200",t==="blockers"?"text-foreground bg-card-hover":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[S.jsx("span",{className:"text-sm",children:"Blockers"}),O>0&&S.jsx("span",{className:"font-mono text-xs text-danger tabular-nums",children:O})]})]}),S.jsx("div",{className:"border-t border-border",children:S.jsxs("button",{type:"button",onClick:()=>i("terminal"),className:Fe("flex w-full items-center gap-2 px-5 py-2.5 text-left transition-colors duration-200",t==="terminal"?"text-foreground bg-card-hover":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[S.jsxs("span",{className:"font-mono text-xs",children:[">","_"]}),S.jsx("span",{className:"text-sm",children:"Terminal"})]})}),S.jsx(bie,{}),S.jsx("div",{className:"border-t border-border px-5 py-3",children:S.jsxs("div",{className:"flex items-center justify-between gap-2",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:Fe("inline-block h-1.5 w-1.5",l?"bg-success":"bg-danger")}),S.jsx("span",{className:"text-xs text-muted-foreground",children:l?"Connected":"Disconnected"})]}),S.jsxs("button",{type:"button",onClick:d,title:c?"Click again to confirm shutdown":"Shut down dashboard server",className:Fe("flex items-center gap-1 rounded px-1.5 py-0.5 text-xs transition-colors duration-150",c?"bg-danger/15 text-danger hover:bg-danger/25":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:[S.jsxs("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"h-3 w-3 shrink-0","aria-hidden":"true",children:[S.jsx("path",{d:"M6 2.5A5.5 5.5 0 1 0 10 3",strokeLinecap:"round"}),S.jsx("path",{d:"M8 1v5",strokeLinecap:"round"})]}),c&&S.jsx("span",{children:"Confirm"})]})]})})]})}/**
94
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
95
+ * @license MIT
96
+ *
97
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
98
+ * @license MIT
99
+ *
100
+ * Originally forked from (with the author's permission):
101
+ * Fabrice Bellard's javascript vt100 for jslinux:
102
+ * http://bellard.org/jslinux/
103
+ * Copyright (c) 2011 Fabrice Bellard
104
+ */var x6=Object.defineProperty,Cie=Object.getOwnPropertyDescriptor,kie=(t,e)=>{for(var i in e)x6(t,i,{get:e[i],enumerable:!0})},Ut=(t,e,i,n)=>{for(var s=n>1?void 0:n?Cie(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(s=(n?o(e,i,s):o(s))||s);return n&&s&&x6(e,i,s),s},be=(t,e)=>(i,n)=>e(i,n,t),VP="Terminal input",Wb={get:()=>VP,set:t=>VP=t},XP="Too much output to announce, navigate to rows manually to read",Ub={get:()=>XP,set:t=>XP=t};function Tie(t){return t.replace(/\r?\n/g,"\r")}function Aie(t,e){return e?"\x1B[200~"+t+"\x1B[201~":t}function Eie(t,e){t.clipboardData&&t.clipboardData.setData("text/plain",e.selectionText),t.preventDefault()}function Mie(t,e,i,n){if(t.stopPropagation(),t.clipboardData){let s=t.clipboardData.getData("text/plain");w6(s,e,i,n)}}function w6(t,e,i,n){t=Tie(t),t=Aie(t,i.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(t,!0),e.value=""}function C6(t,e,i){let n=i.getBoundingClientRect(),s=t.clientX-n.left-10,r=t.clientY-n.top-10;e.style.width="20px",e.style.height="20px",e.style.left=`${s}px`,e.style.top=`${r}px`,e.style.zIndex="1000",e.focus()}function ZP(t,e,i,n,s){C6(t,e,i),s&&n.rightClickSelect(t),e.value=n.selectionText,e.select()}function pa(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}function kO(t,e=0,i=t.length){let n="";for(let s=e;s<i;++s){let r=t[s];r>65535?(r-=65536,n+=String.fromCharCode((r>>10)+55296)+String.fromCharCode(r%1024+56320)):n+=String.fromCharCode(r)}return n}var Pie=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,i){let n=e.length;if(!n)return 0;let s=0,r=0;if(this._interim){let o=e.charCodeAt(r++);56320<=o&&o<=57343?i[s++]=(this._interim-55296)*1024+o-56320+65536:(i[s++]=this._interim,i[s++]=o),this._interim=0}for(let o=r;o<n;++o){let l=e.charCodeAt(o);if(55296<=l&&l<=56319){if(++o>=n)return this._interim=l,s;let c=e.charCodeAt(o);56320<=c&&c<=57343?i[s++]=(l-55296)*1024+c-56320+65536:(i[s++]=l,i[s++]=c);continue}l!==65279&&(i[s++]=l)}return s}},Rie=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,i){let n=e.length;if(!n)return 0;let s=0,r,o,l,c,u=0,d=0;if(this.interim[0]){let O=!1,_=this.interim[0];_&=(_&224)===192?31:(_&240)===224?15:7;let b=0,x;for(;(x=this.interim[++b]&63)&&b<4;)_<<=6,_|=x;let w=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,k=w-b;for(;d<k;){if(d>=n)return 0;if(x=e[d++],(x&192)!==128){d--,O=!0;break}else this.interim[b++]=x,_<<=6,_|=x&63}O||(w===2?_<128?d--:i[s++]=_:w===3?_<2048||_>=55296&&_<=57343||_===65279||(i[s++]=_):_<65536||_>1114111||(i[s++]=_)),this.interim.fill(0)}let p=n-4,g=d;for(;g<n;){for(;g<p&&!((r=e[g])&128)&&!((o=e[g+1])&128)&&!((l=e[g+2])&128)&&!((c=e[g+3])&128);)i[s++]=r,i[s++]=o,i[s++]=l,i[s++]=c,g+=4;if(r=e[g++],r<128)i[s++]=r;else if((r&224)===192){if(g>=n)return this.interim[0]=r,s;if(o=e[g++],(o&192)!==128){g--;continue}if(u=(r&31)<<6|o&63,u<128){g--;continue}i[s++]=u}else if((r&240)===224){if(g>=n)return this.interim[0]=r,s;if(o=e[g++],(o&192)!==128){g--;continue}if(g>=n)return this.interim[0]=r,this.interim[1]=o,s;if(l=e[g++],(l&192)!==128){g--;continue}if(u=(r&15)<<12|(o&63)<<6|l&63,u<2048||u>=55296&&u<=57343||u===65279)continue;i[s++]=u}else if((r&248)===240){if(g>=n)return this.interim[0]=r,s;if(o=e[g++],(o&192)!==128){g--;continue}if(g>=n)return this.interim[0]=r,this.interim[1]=o,s;if(l=e[g++],(l&192)!==128){g--;continue}if(g>=n)return this.interim[0]=r,this.interim[1]=o,this.interim[2]=l,s;if(c=e[g++],(c&192)!==128){g--;continue}if(u=(r&7)<<18|(o&63)<<12|(l&63)<<6|c&63,u<65536||u>1114111)continue;i[s++]=u}}return s}},k6="",va=" ",bd=class T6{constructor(){this.fg=0,this.bg=0,this.extended=new Gg}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new T6;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Gg=class A6{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new A6(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Rs=class E6 extends bd{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Gg,this.combinedData=""}static fromCharData(e){let i=new E6;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?pa(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let s=e[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(n-55296)*1024+s-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},qP="di$target",Yb="di$dependencies",Qy=new Map;function Qie(t){return t[Yb]||[]}function $i(t){if(Qy.has(t))return Qy.get(t);let e=function(i,n,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Lie(e,i,s)};return e._id=t,Qy.set(t,e),e}function Lie(t,e,i){e[qP]===e?e[Yb].push({id:t,index:i}):(e[Yb]=[{id:t,index:i}],e[qP]=e)}var yn=$i("BufferService"),M6=$i("CoreMouseService"),$l=$i("CoreService"),Die=$i("CharsetService"),Ew=$i("InstantiationService"),P6=$i("LogService"),bn=$i("OptionsService"),R6=$i("OscLinkService"),Bie=$i("UnicodeService"),Sd=$i("DecorationService"),Hb=class{constructor(e,i,n){this._bufferService=e,this._optionsService=i,this._oscLinkService=n}provideLinks(e,i){var p;let n=this._bufferService.buffer.lines.get(e-1);if(!n){i(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,o=new Rs,l=n.getTrimmedLength(),c=-1,u=-1,d=!1;for(let g=0;g<l;g++)if(!(u===-1&&!n.hasContent(g))){if(n.loadCell(g,o),o.hasExtendedAttrs()&&o.extended.urlId)if(u===-1){u=g,c=o.extended.urlId;continue}else d=o.extended.urlId!==c;else u!==-1&&(d=!0);if(d||u!==-1&&g===l-1){let O=(p=this._oscLinkService.getLinkData(c))==null?void 0:p.uri;if(O){let _={start:{x:u+1,y:e},end:{x:g+(!d&&g===l-1?1:0),y:e}},b=!1;if(!(r!=null&&r.allowNonHttpProtocols))try{let x=new URL(O);["http:","https:"].includes(x.protocol)||(b=!0)}catch{b=!0}b||s.push({text:O,range:_,activate:(x,w)=>r?r.activate(x,w,_):$ie(x,w),hover:(x,w)=>{var k;return(k=r==null?void 0:r.hover)==null?void 0:k.call(r,x,w,_)},leave:(x,w)=>{var k;return(k=r==null?void 0:r.leave)==null?void 0:k.call(r,x,w,_)}})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(u=g,c=o.extended.urlId):(u=-1,c=-1)}}i(s)}};Hb=Ut([be(0,yn),be(1,bn),be(2,R6)],Hb);function $ie(t,e){if(confirm(`Do you want to navigate to ${e}?
105
+
106
+ WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=e}else console.warn("Opening link blocked as opener could not be cleared")}}var TO=$i("CharSizeService"),xo=$i("CoreBrowserService"),Mw=$i("MouseService"),wo=$i("RenderService"),zie=$i("SelectionService"),Q6=$i("CharacterJoinerService"),Ch=$i("ThemeService"),L6=$i("LinkProviderService"),Nie=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?WP.isErrorNoTelemetry(e)?new WP(e.message+`
107
+
108
+ `+e.stack):new Error(e.message+`
109
+
110
+ `+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},jie=new Nie;function Jm(t){Iie(t)||jie.onUnexpectedError(t)}var Fb="Canceled";function Iie(t){return t instanceof Vie?!0:t instanceof Error&&t.name===Fb&&t.message===Fb}var Vie=class extends Error{constructor(){super(Fb),this.name=this.message}};function Xie(t){return new Error(`Illegal argument: ${t}`)}var WP=class Gb extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof Gb)return e;let i=new Gb;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Kb=class D6 extends Error{constructor(e){super(e||"An unexpected bug occurred."),Object.setPrototypeOf(this,D6.prototype)}};function Kn(t,e=0){return t[t.length-(1+e)]}var Zie;(t=>{function e(r){return r<0}t.isLessThan=e;function i(r){return r<=0}t.isLessThanOrEqual=i;function n(r){return r>0}t.isGreaterThan=n;function s(r){return r===0}t.isNeitherLessOrGreaterThan=s,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(Zie||(Zie={}));function qie(t,e){let i=this,n=!1,s;return function(){return n||(n=!0,e||(s=t.apply(i,arguments))),s}}var B6;(t=>{function e(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function n(){return i}t.empty=n;function*s(A){yield A}t.single=s;function r(A){return e(A)?A:s(A)}t.wrap=r;function o(A){return A||i}t.from=o;function*l(A){for(let L=A.length-1;L>=0;L--)yield A[L]}t.reverse=l;function c(A){return!A||A[Symbol.iterator]().next().done===!0}t.isEmpty=c;function u(A){return A[Symbol.iterator]().next().value}t.first=u;function d(A,L){let E=0;for(let z of A)if(L(z,E++))return!0;return!1}t.some=d;function p(A,L){for(let E of A)if(L(E))return E}t.find=p;function*g(A,L){for(let E of A)L(E)&&(yield E)}t.filter=g;function*O(A,L){let E=0;for(let z of A)yield L(z,E++)}t.map=O;function*_(A,L){let E=0;for(let z of A)yield*L(z,E++)}t.flatMap=_;function*b(...A){for(let L of A)yield*L}t.concat=b;function x(A,L,E){let z=E;for(let N of A)z=L(z,N);return z}t.reduce=x;function*w(A,L,E=A.length){for(L<0&&(L+=A.length),E<0?E+=A.length:E>A.length&&(E=A.length);L<E;L++)yield A[L]}t.slice=w;function k(A,L=Number.POSITIVE_INFINITY){let E=[];if(L===0)return[E,A];let z=A[Symbol.iterator]();for(let N=0;N<L;N++){let q=z.next();if(q.done)return[E,t.empty()];E.push(q.value)}return[E,{[Symbol.iterator](){return z}}]}t.consume=k;async function T(A){let L=[];for await(let E of A)L.push(E);return Promise.resolve(L)}t.asyncToArray=T})(B6||(B6={}));function Ml(t){if(B6.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function Wie(...t){return Bt(()=>Ml(t))}function Bt(t){return{dispose:qie(()=>{t()})}}var $6=class z6{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Ml(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?z6.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};$6.DISABLE_DISPOSED_WARNING=!1;var ya=$6,We=class{constructor(){this._store=new ya,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};We.None=Object.freeze({dispose(){}});var mh=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var i;this._isDisposed||e===this._value||((i=this._value)==null||i.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},fo=typeof window=="object"?window:globalThis,Jb=class eS{constructor(e){this.element=e,this.next=eS.Undefined,this.prev=eS.Undefined}};Jb.Undefined=new Jb(void 0);var $t=Jb,UP=class{constructor(){this._first=$t.Undefined,this._last=$t.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===$t.Undefined}clear(){let e=this._first;for(;e!==$t.Undefined;){let i=e.next;e.prev=$t.Undefined,e.next=$t.Undefined,e=i}this._first=$t.Undefined,this._last=$t.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,i){let n=new $t(e);if(this._first===$t.Undefined)this._first=n,this._last=n;else if(i){let r=this._last;this._last=n,n.prev=r,r.next=n}else{let r=this._first;this._first=n,n.next=r,r.prev=n}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(n))}}shift(){if(this._first!==$t.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==$t.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==$t.Undefined&&e.next!==$t.Undefined){let i=e.prev;i.next=e.next,e.next.prev=i}else e.prev===$t.Undefined&&e.next===$t.Undefined?(this._first=$t.Undefined,this._last=$t.Undefined):e.next===$t.Undefined?(this._last=this._last.prev,this._last.next=$t.Undefined):e.prev===$t.Undefined&&(this._first=this._first.next,this._first.prev=$t.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==$t.Undefined;)yield e.element,e=e.next}},Uie=globalThis.performance&&typeof globalThis.performance.now=="function",Yie=class N6{static create(e){return new N6(e)}constructor(e){this._now=Uie&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},Gi;(t=>{t.None=()=>We.None;function e(R,B){return p(R,()=>{},0,void 0,!0,void 0,B)}t.defer=e;function i(R){return(B,D=null,j)=>{let $=!1,X;return X=R(H=>{if(!$)return X?X.dispose():$=!0,B.call(D,H)},null,j),$&&X.dispose(),X}}t.once=i;function n(R,B,D){return u((j,$=null,X)=>R(H=>j.call($,B(H)),null,X),D)}t.map=n;function s(R,B,D){return u((j,$=null,X)=>R(H=>{B(H),j.call($,H)},null,X),D)}t.forEach=s;function r(R,B,D){return u((j,$=null,X)=>R(H=>B(H)&&j.call($,H),null,X),D)}t.filter=r;function o(R){return R}t.signal=o;function l(...R){return(B,D=null,j)=>{let $=Wie(...R.map(X=>X(H=>B.call(D,H))));return d($,j)}}t.any=l;function c(R,B,D,j){let $=D;return n(R,X=>($=B($,X),$),j)}t.reduce=c;function u(R,B){let D,j={onWillAddFirstListener(){D=R($.fire,$)},onDidRemoveLastListener(){D==null||D.dispose()}},$=new me(j);return B==null||B.add($),$.event}function d(R,B){return B instanceof Array?B.push(R):B&&B.add(R),R}function p(R,B,D=100,j=!1,$=!1,X,H){let F,M,I,K=0,Q,ue={leakWarningThreshold:X,onWillAddFirstListener(){F=R(fe=>{K++,M=B(M,fe),j&&!I&&(he.fire(M),M=void 0),Q=()=>{let Oe=M;M=void 0,I=void 0,(!j||K>1)&&he.fire(Oe),K=0},typeof D=="number"?(clearTimeout(I),I=setTimeout(Q,D)):I===void 0&&(I=0,queueMicrotask(Q))})},onWillRemoveListener(){$&&K>0&&(Q==null||Q())},onDidRemoveLastListener(){Q=void 0,F.dispose()}},he=new me(ue);return H==null||H.add(he),he.event}t.debounce=p;function g(R,B=0,D){return t.debounce(R,(j,$)=>j?(j.push($),j):[$],B,void 0,!0,void 0,D)}t.accumulate=g;function O(R,B=(j,$)=>j===$,D){let j=!0,$;return r(R,X=>{let H=j||!B(X,$);return j=!1,$=X,H},D)}t.latch=O;function _(R,B,D){return[t.filter(R,B,D),t.filter(R,j=>!B(j),D)]}t.split=_;function b(R,B=!1,D=[],j){let $=D.slice(),X=R(M=>{$?$.push(M):F.fire(M)});j&&j.add(X);let H=()=>{$==null||$.forEach(M=>F.fire(M)),$=null},F=new me({onWillAddFirstListener(){X||(X=R(M=>F.fire(M)),j&&j.add(X))},onDidAddFirstListener(){$&&(B?setTimeout(H):H())},onDidRemoveLastListener(){X&&X.dispose(),X=null}});return j&&j.add(F),F.event}t.buffer=b;function x(R,B){return(D,j,$)=>{let X=B(new k);return R(function(H){let F=X.evaluate(H);F!==w&&D.call(j,F)},void 0,$)}}t.chain=x;let w=Symbol("HaltChainable");class k{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(D=>(B(D),D)),this}filter(B){return this.steps.push(D=>B(D)?D:w),this}reduce(B,D){let j=D;return this.steps.push($=>(j=B(j,$),j)),this}latch(B=(D,j)=>D===j){let D=!0,j;return this.steps.push($=>{let X=D||!B($,j);return D=!1,j=$,X?$:w}),this}evaluate(B){for(let D of this.steps)if(B=D(B),B===w)break;return B}}function T(R,B,D=j=>j){let j=(...F)=>H.fire(D(...F)),$=()=>R.on(B,j),X=()=>R.removeListener(B,j),H=new me({onWillAddFirstListener:$,onDidRemoveLastListener:X});return H.event}t.fromNodeEventEmitter=T;function A(R,B,D=j=>j){let j=(...F)=>H.fire(D(...F)),$=()=>R.addEventListener(B,j),X=()=>R.removeEventListener(B,j),H=new me({onWillAddFirstListener:$,onDidRemoveLastListener:X});return H.event}t.fromDOMEventEmitter=A;function L(R){return new Promise(B=>i(R)(B))}t.toPromise=L;function E(R){let B=new me;return R.then(D=>{B.fire(D)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}t.fromPromise=E;function z(R,B){return R(D=>B.fire(D))}t.forward=z;function N(R,B,D){return B(D),R(j=>B(j))}t.runAndSubscribe=N;class q{constructor(B,D){this._observable=B,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new me(j),D&&D.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,D){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function J(R,B){return new q(R,B).emitter.event}t.fromObservable=J;function U(R){return(B,D,j)=>{let $=0,X=!1,H={beginUpdate(){$++},endUpdate(){$--,$===0&&(R.reportChanges(),X&&(X=!1,B.call(D)))},handlePossibleChange(){},handleChange(){X=!0}};R.addObserver(H),R.reportChanges();let F={dispose(){R.removeObserver(H)}};return j instanceof ya?j.add(F):Array.isArray(j)&&j.push(F),F}}t.fromObservableLight=U})(Gi||(Gi={}));var tS=class iS{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${iS._idPool++}`,iS.all.add(this)}start(e){this._stopWatch=new Yie,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};tS.all=new Set,tS._idPool=0;var Hie=tS,Fie=-1,j6=class I6{constructor(e,i,n=(I6._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[r,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(r);let c=new Jie(l,r);this._errorHandler(c)}return()=>{let r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[n,s]of this._stacks)(!e||i<s)&&(e=[n,s],i=s);return e}};j6._idPool=1;var Gie=j6,Kie=class V6{constructor(e){this.value=e}static create(){let e=new Error;return new V6(e.stack??"")}print(){console.warn(this.value.split(`
111
+ `).slice(2).join(`
112
+ `))}},Jie=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},ene=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},tne=0,Ly=class{constructor(e){this.value=e,this.id=tne++}},ine=2,nne,me=class{constructor(e){var i,n,s,r;this._size=0,this._options=e,this._leakageMon=(i=this._options)!=null&&i.leakWarningThreshold?new Gie((e==null?void 0:e.onListenerError)??Jm,((n=this._options)==null?void 0:n.leakWarningThreshold)??Fie):void 0,this._perfMon=(s=this._options)!=null&&s._profName?new Hie(this._options._profName):void 0,this._deliveryQueue=(r=this._options)==null?void 0:r.deliveryQueue}dispose(){var e,i,n,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(i=this._options)==null?void 0:i.onDidRemoveLastListener)==null||n.call(i),(s=this._leakageMon)==null||s.dispose())}get event(){return this._event??(this._event=(e,i,n)=>{var l,c,u,d,p;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);let O=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],_=new ene(`${g}. HINT: Stack shows most frequent listener (${O[1]}-times)`,O[0]);return(((l=this._options)==null?void 0:l.onListenerError)||Jm)(_),We.None}if(this._disposed)return We.None;i&&(e=e.bind(i));let s=new Ly(e),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=Kie.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Ly?(this._deliveryQueue??(this._deliveryQueue=new sne),this._listeners=[this._listeners,s]):this._listeners.push(s):((u=(c=this._options)==null?void 0:c.onWillAddFirstListener)==null||u.call(c,this),this._listeners=s,(p=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||p.call(d,this)),this._size++;let o=Bt(()=>{r==null||r(),this._removeListener(s)});return n instanceof ya?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var r,o,l,c;if((o=(r=this._options)==null?void 0:r.onWillRemoveListener)==null||o.call(r,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(c=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||c.call(l,this),this._size=0;return}let i=this._listeners,n=i.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let s=this._deliveryQueue.current===this;if(this._size*ine<=i.length){let u=0;for(let d=0;d<i.length;d++)i[d]?i[u++]=i[d]:s&&(this._deliveryQueue.end--,u<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=u}}_deliver(e,i){var s;if(!e)return;let n=((s=this._options)==null?void 0:s.onListenerError)||Jm;if(!n){e.value(i);return}try{e.value(i)}catch(r){n(r)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){var i,n,s,r;if((i=this._deliveryQueue)!=null&&i.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(s=this._perfMon)==null||s.start(this._size),this._listeners)if(this._listeners instanceof Ly)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(r=this._perfMon)==null||r.stop()}hasListeners(){return this._size>0}},sne=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,n){this.i=0,this.end=n,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},nS=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new me,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new me,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};nS.INSTANCE=new nS;var Pw=nS;function rne(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}Pw.INSTANCE.onDidChangeZoomLevel;function one(t){return Pw.INSTANCE.getZoomFactor(t)}Pw.INSTANCE.onDidChangeFullscreen;var kh=typeof navigator=="object"?navigator.userAgent:"",sS=kh.indexOf("Firefox")>=0,ane=kh.indexOf("AppleWebKit")>=0,Rw=kh.indexOf("Chrome")>=0,lne=!Rw&&kh.indexOf("Safari")>=0;kh.indexOf("Electron/")>=0;kh.indexOf("Android")>=0;var Dy=!1;if(typeof fo.matchMedia=="function"){let t=fo.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=fo.matchMedia("(display-mode: fullscreen)");Dy=t.matches,rne(fo,t,({matches:i})=>{Dy&&e.matches||(Dy=i)})}var Vc="en",rS=!1,oS=!1,eg=!1,X6=!1,Sm,tg=Vc,YP=Vc,cne,Is,xl=globalThis,Ui,FQ;typeof xl.vscode<"u"&&typeof xl.vscode.process<"u"?Ui=xl.vscode.process:typeof process<"u"&&typeof((FQ=process==null?void 0:process.versions)==null?void 0:FQ.node)=="string"&&(Ui=process);var GQ,hne=typeof((GQ=Ui==null?void 0:Ui.versions)==null?void 0:GQ.electron)=="string",une=hne&&(Ui==null?void 0:Ui.type)==="renderer",KQ;if(typeof Ui=="object"){rS=Ui.platform==="win32",oS=Ui.platform==="darwin",eg=Ui.platform==="linux",eg&&Ui.env.SNAP&&Ui.env.SNAP_REVISION,Ui.env.CI||Ui.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Sm=Vc,tg=Vc;let t=Ui.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);Sm=e.userLocale,YP=e.osLocale,tg=e.resolvedLanguage||Vc,cne=(KQ=e.languagePack)==null?void 0:KQ.translationsConfigFile}catch{}X6=!0}else typeof navigator=="object"&&!une?(Is=navigator.userAgent,rS=Is.indexOf("Windows")>=0,oS=Is.indexOf("Macintosh")>=0,(Is.indexOf("Macintosh")>=0||Is.indexOf("iPad")>=0||Is.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,eg=Is.indexOf("Linux")>=0,(Is==null?void 0:Is.indexOf("Mobi"))>=0,tg=globalThis._VSCODE_NLS_LANGUAGE||Vc,Sm=navigator.language.toLowerCase(),YP=Sm):console.error("Unable to resolve platform.");var Z6=rS,Tr=oS,fne=eg,HP=X6,Er=Is,na=tg,dne;(t=>{function e(){return na}t.value=e;function i(){return na.length===2?na==="en":na.length>=3?na[0]==="e"&&na[1]==="n"&&na[2]==="-":!1}t.isDefaultVariant=i;function n(){return na==="en"}t.isDefault=n})(dne||(dne={}));var pne=typeof xl.postMessage=="function"&&!xl.importScripts;(()=>{if(pne){let t=[];xl.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,s=t.length;n<s;n++){let r=t[n];if(r.id===i.data.vscodeScheduleAsyncWork){t.splice(n,1),r.callback();return}}});let e=0;return i=>{let n=++e;t.push({id:n,callback:i}),xl.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var mne=!!(Er&&Er.indexOf("Chrome")>=0);Er&&Er.indexOf("Firefox")>=0;!mne&&Er&&Er.indexOf("Safari")>=0;Er&&Er.indexOf("Edg/")>=0;Er&&Er.indexOf("Android")>=0;var wc=typeof navigator=="object"?navigator:{};HP||document.queryCommandSupported&&document.queryCommandSupported("copy")||wc&&wc.clipboard&&wc.clipboard.writeText,HP||wc&&wc.clipboard&&wc.clipboard.readText;var Qw=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},By=new Qw,FP=new Qw,GP=new Qw,gne=new Array(230),q6;(t=>{function e(l){return By.keyCodeToStr(l)}t.toString=e;function i(l){return By.strToKeyCode(l)}t.fromString=i;function n(l){return FP.keyCodeToStr(l)}t.toUserSettingsUS=n;function s(l){return GP.keyCodeToStr(l)}t.toUserSettingsGeneral=s;function r(l){return FP.strToKeyCode(l)||GP.strToKeyCode(l)}t.fromUserSettings=r;function o(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return By.keyCodeToStr(l)}t.toElectronAccelerator=o})(q6||(q6={}));var One=class W6{constructor(e,i,n,s,r){this.ctrlKey=e,this.shiftKey=i,this.altKey=n,this.metaKey=s,this.keyCode=r}equals(e){return e instanceof W6&&this.ctrlKey===e.ctrlKey&&this.shiftKey===e.shiftKey&&this.altKey===e.altKey&&this.metaKey===e.metaKey&&this.keyCode===e.keyCode}getHashCode(){let e=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",n=this.altKey?"1":"0",s=this.metaKey?"1":"0";return`K${e}${i}${n}${s}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new vne([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},vne=class{constructor(t){if(t.length===0)throw Xie("chords");this.chords=t}getHashCode(){let t="";for(let e=0,i=this.chords.length;e<i;e++)e!==0&&(t+=";"),t+=this.chords[e].getHashCode();return t}equals(t){if(t===null||this.chords.length!==t.chords.length)return!1;for(let e=0;e<this.chords.length;e++)if(!this.chords[e].equals(t.chords[e]))return!1;return!0}};function _ne(t){if(t.charCode){let i=String.fromCharCode(t.charCode).toUpperCase();return q6.fromString(i)}let e=t.keyCode;if(e===3)return 7;if(sS)switch(e){case 59:return 85;case 60:if(fne)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(Tr)return 57;break}else if(ane&&(Tr&&e===93||!Tr&&e===92))return 57;return gne[e]||0}var yne=Tr?256:2048,bne=512,Sne=1024,xne=Tr?2048:256,KP=class{constructor(t){var i;this._standardKeyboardEventBrand=!0;let e=t;this.browserEvent=e,this.target=e.target,this.ctrlKey=e.ctrlKey,this.shiftKey=e.shiftKey,this.altKey=e.altKey,this.metaKey=e.metaKey,this.altGraphKey=(i=e.getModifierState)==null?void 0:i.call(e,"AltGraph"),this.keyCode=_ne(e),this.code=e.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(t){return this._asKeybinding===t}_computeKeybinding(){let t=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode);let e=0;return this.ctrlKey&&(e|=yne),this.altKey&&(e|=bne),this.shiftKey&&(e|=Sne),this.metaKey&&(e|=xne),e|=t,e}_computeKeyCodeChord(){let t=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(t=this.keyCode),new One(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,t)}},JP=new WeakMap;function wne(t){if(!t.parent||t.parent===t)return null;try{let e=t.location,i=t.parent.location;if(e.origin!=="null"&&i.origin!=="null"&&e.origin!==i.origin)return null}catch{return null}return t.parent}var Cne=class{static getSameOriginWindowChain(t){let e=JP.get(t);if(!e){e=[],JP.set(t,e);let i=t,n;do n=wne(i),n?e.push({window:new WeakRef(i),iframeElement:i.frameElement||null}):e.push({window:new WeakRef(i),iframeElement:null}),i=n;while(i)}return e.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(t,e){if(!e||t===e)return{top:0,left:0};let i=0,n=0,s=this.getSameOriginWindowChain(t);for(let r of s){let o=r.window.deref();if(i+=(o==null?void 0:o.scrollY)??0,n+=(o==null?void 0:o.scrollX)??0,o===e||!r.iframeElement)break;let l=r.iframeElement.getBoundingClientRect();i+=l.top,n+=l.left}return{top:i,left:n}}},xm=class{constructor(e,i){this.timestamp=Date.now(),this.browserEvent=i,this.leftButton=i.button===0,this.middleButton=i.button===1,this.rightButton=i.button===2,this.buttons=i.buttons,this.target=i.target,this.detail=i.detail||1,i.type==="dblclick"&&(this.detail=2),this.ctrlKey=i.ctrlKey,this.shiftKey=i.shiftKey,this.altKey=i.altKey,this.metaKey=i.metaKey,typeof i.pageX=="number"?(this.posx=i.pageX,this.posy=i.pageY):(this.posx=i.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=i.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=Cne.getPositionOfChildWindowRelativeToAncestorWindow(e,i.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},eR=class{constructor(e,i=0,n=0){var r;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=i;let s=!1;if(Rw){let o=navigator.userAgent.match(/Chrome\/(\d+)/);s=(o?parseInt(o[1]):123)<=122}if(e){let o=e,l=e,c=((r=e.view)==null?void 0:r.devicePixelRatio)||1;if(typeof o.wheelDeltaY<"u")s?this.deltaY=o.wheelDeltaY/(120*c):this.deltaY=o.wheelDeltaY/120;else if(typeof l.VERTICAL_AXIS<"u"&&l.axis===l.VERTICAL_AXIS)this.deltaY=-l.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?sS&&!Tr?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof o.wheelDeltaX<"u")lne&&Z6?this.deltaX=-(o.wheelDeltaX/120):s?this.deltaX=o.wheelDeltaX/(120*c):this.deltaX=o.wheelDeltaX/120;else if(typeof l.HORIZONTAL_AXIS<"u"&&l.axis===l.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let u=e;u.deltaMode===u.DOM_DELTA_LINE?sS&&!Tr?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(s?this.deltaY=e.wheelDelta/(120*c):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},U6=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),kne;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof Tne?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Gi.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:U6})})(kne||(kne={}));var Tne=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?U6:(this._emitter||(this._emitter=new me),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Lw=class{constructor(e,i){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof i=="number"&&this.setIfNotSet(e,i)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,i){if(this._isDisposed)throw new Kb("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},i)}setIfNotSet(e,i){if(this._isDisposed)throw new Kb("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},i))}},Ane=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,i,n=globalThis){if(this.isDisposed)throw new Kb("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=n.setInterval(()=>{e()},i);this.disposable=Bt(()=>{n.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Ene;(t=>{async function e(n){let s,r=await Promise.all(n.map(o=>o.then(l=>l,l=>{s||(s=l)})));if(typeof s<"u")throw s;return r}t.settled=e;function i(n){return new Promise(async(s,r)=>{try{await n(s,r)}catch(o){r(o)}})}t.withAsyncBody=i})(Ene||(Ene={}));var tR=class _s{static fromArray(e){return new _s(i=>{i.emitMany(e)})}static fromPromise(e){return new _s(async i=>{i.emitMany(await e)})}static fromPromises(e){return new _s(async i=>{await Promise.all(e.map(async n=>i.emitOne(await n)))})}static merge(e){return new _s(async i=>{await Promise.all(e.map(async n=>{for await(let s of n)i.emitOne(s)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new me,queueMicrotask(async()=>{let n={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(e(n)),this.resolve()}catch(s){this.reject(s)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await Gi.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var i;return(i=this._onReturn)==null||i.call(this),{done:!0,value:void 0}}}}static map(e,i){return new _s(async n=>{for await(let s of e)n.emitOne(i(s))})}map(e){return _s.map(this,e)}static filter(e,i){return new _s(async n=>{for await(let s of e)i(s)&&n.emitOne(s)})}filter(e){return _s.filter(this,e)}static coalesce(e){return _s.filter(e,i=>!!i)}coalesce(){return _s.coalesce(this)}static async toPromise(e){let i=[];for await(let n of e)i.push(n);return i}toPromise(){return _s.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};tR.EMPTY=tR.fromArray([]);var{getWindow:xr,getWindowId:Mne,onDidRegisterWindow:Pne}=(function(){let t=new Map,e={window:fo,disposables:new ya};t.set(fo.vscodeWindowId,e);let i=new me,n=new me,s=new me;function r(o,l){return(typeof o=="number"?t.get(o):void 0)??(l?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:n.event,registerWindow(o){if(t.has(o.vscodeWindowId))return We.None;let l=new ya,c={window:o,disposables:l.add(new ya)};return t.set(o.vscodeWindowId,c),l.add(Bt(()=>{t.delete(o.vscodeWindowId),n.fire(o)})),l.add(Be(o,wi.BEFORE_UNLOAD,()=>{s.fire(o)})),i.fire(c),l},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return t.has(o)},getWindowById:r,getWindow(o){var u;let l=o;if((u=l==null?void 0:l.ownerDocument)!=null&&u.defaultView)return l.ownerDocument.defaultView.window;let c=o;return c!=null&&c.view?c.view.window:fo},getDocument(o){return xr(o).document}}})(),Rne=class{constructor(e,i,n,s){this._node=e,this._type=i,this._handler=n,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function Be(t,e,i,n){return new Rne(t,e,i,n)}var iR=function(t,e,i,n){return Be(t,e,i,n)},Dw,Qne=class extends Ane{constructor(t){super(),this.defaultTarget=t&&xr(t)}cancelAndSet(t,e,i){return super.cancelAndSet(t,e,i??this.defaultTarget)}},nR=class{constructor(e,i=0){this._runner=e,this.priority=i,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Jm(e)}}static sort(e,i){return i.priority-e.priority}};(function(){let t=new Map,e=new Map,i=new Map,n=new Map,s=r=>{i.set(r,!1);let o=t.get(r)??[];for(e.set(r,o),t.set(r,[]),n.set(r,!0);o.length>0;)o.sort(nR.sort),o.shift().execute();n.set(r,!1)};Dw=(r,o,l=0)=>{let c=Mne(r),u=new nR(o,l),d=t.get(c);return d||(d=[],t.set(c,d)),d.push(u),i.get(c)||(i.set(c,!0),r.requestAnimationFrame(()=>s(c))),u}})();function Lne(t){let e=t.getBoundingClientRect(),i=xr(t);return{left:e.left+i.scrollX,top:e.top+i.scrollY,width:e.width,height:e.height}}var wi={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Dne=class{constructor(t){this.domNode=t,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(t){let e=Mn(t);this._maxWidth!==e&&(this._maxWidth=e,this.domNode.style.maxWidth=this._maxWidth)}setWidth(t){let e=Mn(t);this._width!==e&&(this._width=e,this.domNode.style.width=this._width)}setHeight(t){let e=Mn(t);this._height!==e&&(this._height=e,this.domNode.style.height=this._height)}setTop(t){let e=Mn(t);this._top!==e&&(this._top=e,this.domNode.style.top=this._top)}setLeft(t){let e=Mn(t);this._left!==e&&(this._left=e,this.domNode.style.left=this._left)}setBottom(t){let e=Mn(t);this._bottom!==e&&(this._bottom=e,this.domNode.style.bottom=this._bottom)}setRight(t){let e=Mn(t);this._right!==e&&(this._right=e,this.domNode.style.right=this._right)}setPaddingTop(t){let e=Mn(t);this._paddingTop!==e&&(this._paddingTop=e,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(t){let e=Mn(t);this._paddingLeft!==e&&(this._paddingLeft=e,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(t){let e=Mn(t);this._paddingBottom!==e&&(this._paddingBottom=e,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(t){let e=Mn(t);this._paddingRight!==e&&(this._paddingRight=e,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(t){let e=Mn(t);this._fontSize!==e&&(this._fontSize=e,this.domNode.style.fontSize=this._fontSize)}setFontStyle(t){this._fontStyle!==t&&(this._fontStyle=t,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(t){this._fontFeatureSettings!==t&&(this._fontFeatureSettings=t,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(t){this._fontVariationSettings!==t&&(this._fontVariationSettings=t,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(t){this._textDecoration!==t&&(this._textDecoration=t,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(t){let e=Mn(t);this._lineHeight!==e&&(this._lineHeight=e,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(t){let e=Mn(t);this._letterSpacing!==e&&(this._letterSpacing=e,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(t){this._className!==t&&(this._className=t,this.domNode.className=this._className)}toggleClassName(t,e){this.domNode.classList.toggle(t,e),this._className=this.domNode.className}setDisplay(t){this._display!==t&&(this._display=t,this.domNode.style.display=this._display)}setPosition(t){this._position!==t&&(this._position=t,this.domNode.style.position=this._position)}setVisibility(t){this._visibility!==t&&(this._visibility=t,this.domNode.style.visibility=this._visibility)}setColor(t){this._color!==t&&(this._color=t,this.domNode.style.color=this._color)}setBackgroundColor(t){this._backgroundColor!==t&&(this._backgroundColor=t,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(t){this._layerHint!==t&&(this._layerHint=t,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(t){this._boxShadow!==t&&(this._boxShadow=t,this.domNode.style.boxShadow=t)}setContain(t){this._contain!==t&&(this._contain=t,this.domNode.style.contain=this._contain)}setAttribute(t,e){this.domNode.setAttribute(t,e)}removeAttribute(t){this.domNode.removeAttribute(t)}appendChild(t){this.domNode.appendChild(t.domNode)}removeChild(t){this.domNode.removeChild(t.domNode)}};function Mn(t){return typeof t=="number"?`${t}px`:t}function bf(t){return new Dne(t)}var Y6=class{constructor(){this._hooks=new ya,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,i){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(i)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,i,n,s,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=r;let o=e;try{e.setPointerCapture(i),this._hooks.add(Bt(()=>{try{e.releasePointerCapture(i)}catch{}}))}catch{o=xr(e)}this._hooks.add(Be(o,wi.POINTER_MOVE,l=>{if(l.buttons!==n){this.stopMonitoring(!0);return}l.preventDefault(),this._pointerMoveCallback(l)})),this._hooks.add(Be(o,wi.POINTER_UP,l=>this.stopMonitoring(!0)))}};function Bne(t,e,i){let n=null,s=null;if(typeof i.value=="function"?(n="value",s=i.value,s.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(n="get",s=i.get),!s)throw new Error("not supported");let r=`$memoize$${e}`;i[n]=function(...o){return this.hasOwnProperty(r)||Object.defineProperty(this,r,{configurable:!1,enumerable:!1,writable:!1,value:s.apply(this,o)}),this[r]}}var fr;(t=>(t.Tap="-xterm-gesturetap",t.Change="-xterm-gesturechange",t.Start="-xterm-gesturestart",t.End="-xterm-gesturesend",t.Contextmenu="-xterm-gesturecontextmenu"))(fr||(fr={}));var tf=class en extends We{constructor(){super(),this.dispatched=!1,this.targets=new UP,this.ignoreTargets=new UP,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Gi.runAndSubscribe(Pne,({window:e,disposables:i})=>{i.add(Be(e.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),i.add(Be(e.document,"touchend",n=>this.onTouchEnd(e,n))),i.add(Be(e.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:fo,disposables:this._store}))}static addTarget(e){if(!en.isTouchDevice())return We.None;en.INSTANCE||(en.INSTANCE=new en);let i=en.INSTANCE.targets.push(e);return Bt(i)}static ignoreTarget(e){if(!en.isTouchDevice())return We.None;en.INSTANCE||(en.INSTANCE=new en);let i=en.INSTANCE.ignoreTargets.push(e);return Bt(i)}static isTouchDevice(){return"ontouchstart"in fo||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(e){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,s=e.targetTouches.length;n<s;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:i,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[i],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let o=this.newGestureEvent(fr.Start,r.target);o.pageX=r.pageX,o.pageY=r.pageY,this.dispatchEvent(o)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}onTouchEnd(e,i){let n=Date.now(),s=Object.keys(this.activeTouches).length;for(let r=0,o=i.changedTouches.length;r<o;r++){let l=i.changedTouches.item(r);if(!this.activeTouches.hasOwnProperty(String(l.identifier))){console.warn("move of an UNKNOWN touch",l);continue}let c=this.activeTouches[l.identifier],u=Date.now()-c.initialTimeStamp;if(u<en.HOLD_DELAY&&Math.abs(c.initialPageX-Kn(c.rollingPageX))<30&&Math.abs(c.initialPageY-Kn(c.rollingPageY))<30){let d=this.newGestureEvent(fr.Tap,c.initialTarget);d.pageX=Kn(c.rollingPageX),d.pageY=Kn(c.rollingPageY),this.dispatchEvent(d)}else if(u>=en.HOLD_DELAY&&Math.abs(c.initialPageX-Kn(c.rollingPageX))<30&&Math.abs(c.initialPageY-Kn(c.rollingPageY))<30){let d=this.newGestureEvent(fr.Contextmenu,c.initialTarget);d.pageX=Kn(c.rollingPageX),d.pageY=Kn(c.rollingPageY),this.dispatchEvent(d)}else if(s===1){let d=Kn(c.rollingPageX),p=Kn(c.rollingPageY),g=Kn(c.rollingTimestamps)-c.rollingTimestamps[0],O=d-c.rollingPageX[0],_=p-c.rollingPageY[0],b=[...this.targets].filter(x=>c.initialTarget instanceof Node&&x.contains(c.initialTarget));this.inertia(e,b,n,Math.abs(O)/g,O>0?1:-1,d,Math.abs(_)/g,_>0?1:-1,p)}this.dispatchEvent(this.newGestureEvent(fr.End,c.initialTarget)),delete this.activeTouches[l.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(e,i){let n=document.createEvent("CustomEvent");return n.initEvent(e,!1,!0),n.initialTarget=i,n.tapCount=0,n}dispatchEvent(e){if(e.type===fr.Tap){let i=new Date().getTime(),n=0;i-this._lastSetTapCountTime>en.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=i,e.tapCount=n}else(e.type===fr.Change||e.type===fr.Contextmenu)&&(this._lastSetTapCountTime=0);if(e.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(e.initialTarget))return;let i=[];for(let n of this.targets)if(n.contains(e.initialTarget)){let s=0,r=e.initialTarget;for(;r&&r!==n;)s++,r=r.parentElement;i.push([s,n])}i.sort((n,s)=>n[0]-s[0]);for(let[n,s]of i)s.dispatchEvent(e),this.dispatched=!0}}inertia(e,i,n,s,r,o,l,c,u){this.handle=Dw(e,()=>{let d=Date.now(),p=d-n,g=0,O=0,_=!0;s+=en.SCROLL_FRICTION*p,l+=en.SCROLL_FRICTION*p,s>0&&(_=!1,g=r*s*p),l>0&&(_=!1,O=c*l*p);let b=this.newGestureEvent(fr.Change);b.translationX=g,b.translationY=O,i.forEach(x=>x.dispatchEvent(b)),_||this.inertia(e,i,d,s,r,o+g,l,c,u+O)})}onTouchMove(e){let i=Date.now();for(let n=0,s=e.changedTouches.length;n<s;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn("end of an UNKNOWN touch",r);continue}let o=this.activeTouches[r.identifier],l=this.newGestureEvent(fr.Change,o.initialTarget);l.translationX=r.pageX-Kn(o.rollingPageX),l.translationY=r.pageY-Kn(o.rollingPageY),l.pageX=r.pageX,l.pageY=r.pageY,this.dispatchEvent(l),o.rollingPageX.length>3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(r.pageX),o.rollingPageY.push(r.pageY),o.rollingTimestamps.push(i)}this.dispatched&&(e.preventDefault(),e.stopPropagation(),this.dispatched=!1)}};tf.SCROLL_FRICTION=-.005,tf.HOLD_DELAY=700,tf.CLEAR_TAP_COUNT_TIME=400,Ut([Bne],tf,"isTouchDevice",1);var $ne=tf,Bw=class extends We{onclick(e,i){this._register(Be(e,wi.CLICK,n=>i(new xm(xr(e),n))))}onmousedown(e,i){this._register(Be(e,wi.MOUSE_DOWN,n=>i(new xm(xr(e),n))))}onmouseover(e,i){this._register(Be(e,wi.MOUSE_OVER,n=>i(new xm(xr(e),n))))}onmouseleave(e,i){this._register(Be(e,wi.MOUSE_LEAVE,n=>i(new xm(xr(e),n))))}onkeydown(e,i){this._register(Be(e,wi.KEY_DOWN,n=>i(new KP(n))))}onkeyup(e,i){this._register(Be(e,wi.KEY_UP,n=>i(new KP(n))))}oninput(e,i){this._register(Be(e,wi.INPUT,i))}onblur(e,i){this._register(Be(e,wi.BLUR,i))}onfocus(e,i){this._register(Be(e,wi.FOCUS,i))}onchange(e,i){this._register(Be(e,wi.CHANGE,i))}ignoreGesture(e){return $ne.ignoreTarget(e)}},sR=11,zne=class extends Bw{constructor(t){super(),this._onActivate=t.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=t.bgWidth+"px",this.bgDomNode.style.height=t.bgHeight+"px",typeof t.top<"u"&&(this.bgDomNode.style.top="0px"),typeof t.left<"u"&&(this.bgDomNode.style.left="0px"),typeof t.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof t.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=t.className,this.domNode.style.position="absolute",this.domNode.style.width=sR+"px",this.domNode.style.height=sR+"px",typeof t.top<"u"&&(this.domNode.style.top=t.top+"px"),typeof t.left<"u"&&(this.domNode.style.left=t.left+"px"),typeof t.bottom<"u"&&(this.domNode.style.bottom=t.bottom+"px"),typeof t.right<"u"&&(this.domNode.style.right=t.right+"px"),this._pointerMoveMonitor=this._register(new Y6),this._register(iR(this.bgDomNode,wi.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(iR(this.domNode,wi.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new Qne),this._pointerdownScheduleRepeatTimer=this._register(new Lw)}_arrowPointerDown(t){if(!t.target||!(t.target instanceof Element))return;let e=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,xr(t))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(e,200),this._pointerMoveMonitor.startMonitoring(t.target,t.pointerId,t.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),t.preventDefault()}},Nne=class aS{constructor(e,i,n,s,r,o,l){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,n=n|0,s=s|0,r=r|0,o=o|0,l=l|0),this.rawScrollLeft=s,this.rawScrollTop=l,i<0&&(i=0),s+i>n&&(s=n-i),s<0&&(s=0),r<0&&(r=0),l+r>o&&(l=o-r),l<0&&(l=0),this.width=i,this.scrollWidth=n,this.scrollLeft=s,this.height=r,this.scrollHeight=o,this.scrollTop=l}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(e,i){return new aS(this._forceIntegerValues,typeof e.width<"u"?e.width:this.width,typeof e.scrollWidth<"u"?e.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof e.height<"u"?e.height:this.height,typeof e.scrollHeight<"u"?e.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(e){return new aS(this._forceIntegerValues,this.width,this.scrollWidth,typeof e.scrollLeft<"u"?e.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof e.scrollTop<"u"?e.scrollTop:this.rawScrollTop)}createScrollEvent(e,i){let n=this.width!==e.width,s=this.scrollWidth!==e.scrollWidth,r=this.scrollLeft!==e.scrollLeft,o=this.height!==e.height,l=this.scrollHeight!==e.scrollHeight,c=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:i,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:s,scrollLeftChanged:r,heightChanged:o,scrollHeightChanged:l,scrollTopChanged:c}}},jne=class extends We{constructor(t){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._smoothScrollDuration=t.smoothScrollDuration,this._scheduleAtNextAnimationFrame=t.scheduleAtNextAnimationFrame,this._state=new Nne(t.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(t){this._smoothScrollDuration=t}validateScrollPosition(t){return this._state.withScrollPosition(t)}getScrollDimensions(){return this._state}setScrollDimensions(t,e){var n;let i=this._state.withScrollDimensions(t,e);this._setState(i,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(t){let e=this._state.withScrollPosition(t);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(e,!1)}setScrollPositionSmooth(t,e){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(t);if(this._smoothScrolling){t={scrollLeft:typeof t.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:t.scrollLeft,scrollTop:typeof t.scrollTop>"u"?this._smoothScrolling.to.scrollTop:t.scrollTop};let i=this._state.withScrollPosition(t);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let n;e?n=new oR(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let i=this._state.withScrollPosition(t);this._smoothScrolling=oR.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let t=this._smoothScrolling.tick(),e=this._state.withScrollPosition(t);if(this._setState(e,!0),!!this._smoothScrolling){if(t.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(t,e){let i=this._state;i.equals(t)||(this._state=t,this._onScroll.fire(this._state.createScrollEvent(i,e)))}},rR=class{constructor(e,i,n){this.scrollLeft=e,this.scrollTop=i,this.isDone=n}};function $y(t,e){let i=e-t;return function(n){return t+i*Xne(n)}}function Ine(t,e,i){return function(n){return n<i?t(n/i):e((n-i)/(1-i))}}var oR=class lS{constructor(e,i,n,s){this.from=e,this.to=i,this.duration=s,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,i,n){if(Math.abs(e-i)>2.5*n){let s,r;return e<i?(s=e+.75*n,r=i-.75*n):(s=e-.75*n,r=i+.75*n),Ine($y(e,s),$y(r,i),.33)}return $y(e,i)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let i=(e-this.startTime)/this.duration;if(i<1){let n=this.scrollLeft(i),s=this.scrollTop(i);return new rR(n,s,!1)}return new rR(this.to.scrollLeft,this.to.scrollTop,!0)}combine(e,i,n){return lS.start(e,i,n)}static start(e,i,n){n=n+10;let s=Date.now()-10;return new lS(e,i,s,n)}};function Vne(t){return Math.pow(t,3)}function Xne(t){return 1-Vne(1-t)}var Zne=class extends We{constructor(e,i,n){super(),this._visibility=e,this._visibleClassName=i,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new Lw)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3?!0:this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){if(!this._isNeeded){this._hide(!1);return}this._shouldBeVisible?this._reveal():this._hide(!0)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{var e;(e=this._domNode)==null||e.setClassName(this._visibleClassName)},0))}_hide(e){var i;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(i=this._domNode)==null||i.setClassName(this._invisibleClassName+(e?" fade":"")))}},qne=140,H6=class extends Bw{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Zne(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Y6),this._shouldRender=!0,this.domNode=bf(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(Be(this.domNode.domNode,wi.POINTER_DOWN,i=>this._domNodePointerDown(i)))}_createArrow(e){let i=this._register(new zne(e));this.domNode.domNode.appendChild(i.bgDomNode),this.domNode.domNode.appendChild(i.domNode)}_createSlider(e,i,n,s){this.slider=bf(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(i),typeof n=="number"&&this.slider.setWidth(n),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Be(this.slider.domNode,wi.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let i=this.domNode.domNode.getClientRects()[0].top,n=i+this._scrollbarState.getSliderPosition(),s=i+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);n<=r&&r<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let i,n;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")i=e.offsetX,n=e.offsetY;else{let r=Lne(this.domNode.domNode);i=e.pageX-r.left,n=e.pageY-r.top}let s=this._pointerDownRelativePosition(i,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let i=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let o=this._sliderOrthogonalPointerPosition(r),l=Math.abs(o-n);if(Z6&&l>qne){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let c=this._sliderPointerPosition(r)-i;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(c))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let i={};this.writeScrollPosition(i,e),this._scrollable.setScrollPositionNow(i)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},F6=class cS{constructor(e,i,n,s,r,o){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=s,this._scrollSize=r,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new cS(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let i=Math.round(e);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(e){let i=Math.round(e);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(e){let i=Math.round(e);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,i,n,s,r){let o=Math.max(0,n-e),l=Math.max(0,o-2*i),c=s>0&&s>n;if(!c)return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(l),computedSliderRatio:0,computedSliderPosition:0};let u=Math.round(Math.max(20,Math.floor(n*l/s))),d=(l-u)/(s-n),p=r*d;return{computedAvailableSize:Math.round(o),computedIsNeeded:c,computedSliderSize:Math.round(u),computedSliderRatio:d,computedSliderPosition:Math.round(p)}}_refreshComputedValues(){let e=cS._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=e.computedAvailableSize,this._computedIsNeeded=e.computedIsNeeded,this._computedSliderSize=e.computedSliderSize,this._computedSliderRatio=e.computedSliderRatio,this._computedSliderPosition=e.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let i=e-this._arrowSize,n=this._scrollPosition;return i<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let i=this._computedSliderPosition+e;return Math.round(i/this._computedSliderRatio)}},Wne=class extends H6{constructor(e,i,n){let s=e.getScrollDimensions(),r=e.getCurrentScrollPosition();if(super({lazyRender:i.lazyRender,host:n,scrollbarState:new F6(i.horizontalHasArrows?i.arrowSize:0,i.horizontal===2?0:i.horizontalScrollbarSize,i.vertical===2?0:i.verticalScrollbarSize,s.width,s.scrollWidth,r.scrollLeft),visibility:i.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:i.scrollByPage}),i.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((i.horizontalScrollbarSize-i.horizontalSliderSize)/2),0,void 0,i.horizontalSliderSize)}_updateSlider(e,i){this.slider.setWidth(e),this.slider.setLeft(i)}_renderDomNode(e,i){this.domNode.setWidth(e),this.domNode.setHeight(i),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,i){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,i){e.scrollLeft=i}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},Une=class extends H6{constructor(t,e,i){let n=t.getScrollDimensions(),s=t.getCurrentScrollPosition();if(super({lazyRender:e.lazyRender,host:i,scrollbarState:new F6(e.verticalHasArrows?e.arrowSize:0,e.vertical===2?0:e.verticalScrollbarSize,0,n.height,n.scrollHeight,s.scrollTop),visibility:e.vertical,extraScrollbarClassName:"vertical",scrollable:t,scrollByPage:e.scrollByPage}),e.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((e.verticalScrollbarSize-e.verticalSliderSize)/2),e.verticalSliderSize,void 0)}_updateSlider(t,e){this.slider.setHeight(t),this.slider.setTop(e)}_renderDomNode(t,e){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(t){return this._shouldRender=this._onElementScrollSize(t.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(t.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(t.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(t,e){return e}_sliderPointerPosition(t){return t.pageY}_sliderOrthogonalPointerPosition(t){return t.pageX}_updateScrollbarSize(t){this.slider.setWidth(t)}writeScrollPosition(t,e){t.scrollTop=e}updateOptions(t){this.updateScrollbarSize(t.vertical===2?0:t.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(t.vertical),this._scrollByPage=t.scrollByPage}},Yne=500,aR=50,Hne=class{constructor(e,i,n){this.timestamp=e,this.deltaX=i,this.deltaY=n,this.score=0}},hS=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,i=0,n=1,s=this._rear;do{let r=s===this._front?e:Math.pow(2,-n);if(e-=r,i+=this._memory[s].score*r,s===this._front)break;s=(this._capacity+s-1)%this._capacity,n++}while(!0);return i<=.5}acceptStandardWheelEvent(e){if(Rw){let i=xr(e.browserEvent),n=one(i);this.accept(Date.now(),e.deltaX*n,e.deltaY*n)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,i,n){let s=null,r=new Hne(e,i,n);this._front===-1&&this._rear===-1?(this._memory[0]=r,this._front=0,this._rear=0):(s=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=r),r.score=this._computeScore(r,s)}_computeScore(e,i){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),i){let s=Math.abs(e.deltaX),r=Math.abs(e.deltaY),o=Math.abs(i.deltaX),l=Math.abs(i.deltaY),c=Math.max(Math.min(s,o),1),u=Math.max(Math.min(r,l),1),d=Math.max(s,o),p=Math.max(r,l);d%c===0&&p%u===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};hS.INSTANCE=new hS;var Fne=hS,Gne=class extends Bw{constructor(t,e,i){super(),this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new me),this.onWillScroll=this._onWillScroll.event,this._options=Jne(e),this._scrollable=i,this._register(this._scrollable.onScroll(s=>{this._onWillScroll.fire(s),this._onDidScroll(s),this._onScroll.fire(s)}));let n={onMouseWheel:s=>this._onMouseWheel(s),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Une(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new Wne(this._scrollable,this._options,n)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(t),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=bf(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=bf(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=bf(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,s=>this._onMouseOver(s)),this.onmouseleave(this._listenOnDomNode,s=>this._onMouseLeave(s)),this._hideTimeout=this._register(new Lw),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Ml(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(t){this._verticalScrollbar.delegatePointerDown(t)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(t){this._scrollable.setScrollDimensions(t,!1)}updateClassName(t){this._options.className=t,Tr&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(t){typeof t.handleMouseWheel<"u"&&(this._options.handleMouseWheel=t.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof t.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=t.mouseWheelScrollSensitivity),typeof t.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=t.fastScrollSensitivity),typeof t.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=t.scrollPredominantAxis),typeof t.horizontal<"u"&&(this._options.horizontal=t.horizontal),typeof t.vertical<"u"&&(this._options.vertical=t.vertical),typeof t.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=t.horizontalScrollbarSize),typeof t.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=t.verticalScrollbarSize),typeof t.scrollByPage<"u"&&(this._options.scrollByPage=t.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(t){this._revealOnScroll=t}delegateScrollFromMouseWheelEvent(t){this._onMouseWheel(new eR(t))}_setListeningToMouseWheel(t){if(this._mouseWheelToDispose.length>0!==t&&(this._mouseWheelToDispose=Ml(this._mouseWheelToDispose),t)){let e=i=>{this._onMouseWheel(new eR(i))};this._mouseWheelToDispose.push(Be(this._listenOnDomNode,wi.MOUSE_WHEEL,e,{passive:!1}))}}_onMouseWheel(t){var s;if((s=t.browserEvent)!=null&&s.defaultPrevented)return;let e=Fne.INSTANCE;e.acceptStandardWheelEvent(t);let i=!1;if(t.deltaY||t.deltaX){let r=t.deltaY*this._options.mouseWheelScrollSensitivity,o=t.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&o+r===0?o=r=0:Math.abs(r)>=Math.abs(o)?o=0:r=0),this._options.flipAxes&&([r,o]=[o,r]);let l=!Tr&&t.browserEvent&&t.browserEvent.shiftKey;(this._options.scrollYToX||l)&&!o&&(o=r,r=0),t.browserEvent&&t.browserEvent.altKey&&(o=o*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let c=this._scrollable.getFutureScrollPosition(),u={};if(r){let d=aR*r,p=c.scrollTop-(d<0?Math.floor(d):Math.ceil(d));this._verticalScrollbar.writeScrollPosition(u,p)}if(o){let d=aR*o,p=c.scrollLeft-(d<0?Math.floor(d):Math.ceil(d));this._horizontalScrollbar.writeScrollPosition(u,p)}u=this._scrollable.validateScrollPosition(u),(c.scrollLeft!==u.scrollLeft||c.scrollTop!==u.scrollTop)&&(this._options.mouseWheelSmoothScroll&&e.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(u):this._scrollable.setScrollPositionNow(u),i=!0)}let n=i;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(t.preventDefault(),t.stopPropagation())}_onDidScroll(t){this._shouldRender=this._horizontalScrollbar.onDidScroll(t)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(t)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let t=this._scrollable.getCurrentScrollPosition(),e=t.scrollTop>0,i=t.scrollLeft>0,n=i?" left":"",s=e?" top":"",r=i||e?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${s}`),this._topLeftShadowDomNode.setClassName(`shadow${r}${s}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(t){this._mouseIsOver=!1,this._hide()}_onMouseOver(t){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Yne)}},Kne=class extends Gne{constructor(e,i,n){super(e,i,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Jne(t){let e={lazyRender:typeof t.lazyRender<"u"?t.lazyRender:!1,className:typeof t.className<"u"?t.className:"",useShadows:typeof t.useShadows<"u"?t.useShadows:!0,handleMouseWheel:typeof t.handleMouseWheel<"u"?t.handleMouseWheel:!0,flipAxes:typeof t.flipAxes<"u"?t.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof t.consumeMouseWheelIfScrollbarIsNeeded<"u"?t.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof t.alwaysConsumeMouseWheel<"u"?t.alwaysConsumeMouseWheel:!1,scrollYToX:typeof t.scrollYToX<"u"?t.scrollYToX:!1,mouseWheelScrollSensitivity:typeof t.mouseWheelScrollSensitivity<"u"?t.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof t.fastScrollSensitivity<"u"?t.fastScrollSensitivity:5,scrollPredominantAxis:typeof t.scrollPredominantAxis<"u"?t.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof t.mouseWheelSmoothScroll<"u"?t.mouseWheelSmoothScroll:!0,arrowSize:typeof t.arrowSize<"u"?t.arrowSize:11,listenOnDomNode:typeof t.listenOnDomNode<"u"?t.listenOnDomNode:null,horizontal:typeof t.horizontal<"u"?t.horizontal:1,horizontalScrollbarSize:typeof t.horizontalScrollbarSize<"u"?t.horizontalScrollbarSize:10,horizontalSliderSize:typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:0,horizontalHasArrows:typeof t.horizontalHasArrows<"u"?t.horizontalHasArrows:!1,vertical:typeof t.vertical<"u"?t.vertical:1,verticalScrollbarSize:typeof t.verticalScrollbarSize<"u"?t.verticalScrollbarSize:10,verticalHasArrows:typeof t.verticalHasArrows<"u"?t.verticalHasArrows:!1,verticalSliderSize:typeof t.verticalSliderSize<"u"?t.verticalSliderSize:0,scrollByPage:typeof t.scrollByPage<"u"?t.scrollByPage:!1};return e.horizontalSliderSize=typeof t.horizontalSliderSize<"u"?t.horizontalSliderSize:e.horizontalScrollbarSize,e.verticalSliderSize=typeof t.verticalSliderSize<"u"?t.verticalSliderSize:e.verticalScrollbarSize,Tr&&(e.className+=" mac"),e}var uS=class extends We{constructor(e,i,n,s,r,o,l,c){super(),this._bufferService=n,this._optionsService=l,this._renderService=c,this._onRequestScrollLines=this._register(new me),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let u=this._register(new jne({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:d=>Dw(s.window,d)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{u.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new Kne(i,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},u)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(r.onProtocolChange(d=>{this._scrollableElement.updateOptions({handleMouseWheel:!(d&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Gi.runAndSubscribe(o.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=o.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(Bt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),i.appendChild(this._styleElement),this._register(Bt(()=>this._styleElement.remove())),this._register(Gi.runAndSubscribe(o.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${o.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${o.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${o.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
113
+ `)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(d=>this._handleScroll(d)))}scrollLines(e){let i=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:i.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,i){i&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!i,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){var e;return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:((e=this._optionsService.rawOptions.overviewRuler)==null?void 0:e.width)||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let i=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=i-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=i,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};uS=Ut([be(2,yn),be(3,xo),be(4,M6),be(5,Ch),be(6,bn),be(7,wo)],uS);var fS=class extends We{constructor(e,i,n,s,r){super(),this._screenElement=e,this._bufferService=i,this._coreBrowserService=n,this._decorationService=s,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(o=>this._removeDecoration(o))),this._register(Bt(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){var s;let i=this._coreBrowserService.mainDocument.createElement("div");i.classList.add("xterm-decoration"),i.classList.toggle("xterm-decoration-top-layer",((s=e==null?void 0:e.options)==null?void 0:s.layer)==="top"),i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(i.style.display="none"),this._refreshXPosition(e,i),i}_refreshStyle(e){let i=e.marker.line-this._bufferService.buffers.active.ydisp;if(i<0||i>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${i*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,i=e.element){if(!i)return;let n=e.options.x??0;(e.options.anchor||"left")==="right"?i.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:"":i.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var i;(i=this._decorationElements.get(e))==null||i.remove(),this._decorationElements.delete(e),e.dispose()}};fS=Ut([be(1,yn),be(2,xo),be(3,Sd),be(4,wo)],fS);var ese=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let i of this._zones)if(i.color===e.options.overviewRulerOptions.color&&i.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(i,e.marker.line))return;if(this._lineAdjacentToZone(i,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(i,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,i){return i>=e.startBufferLine&&i<=e.endBufferLine}_lineAdjacentToZone(e,i,n){return i>=e.startBufferLine-this._linePadding[n||"full"]&&i<=e.endBufferLine+this._linePadding[n||"full"]}_addLineToZone(e,i){e.startBufferLine=Math.min(e.startBufferLine,i),e.endBufferLine=Math.max(e.endBufferLine,i)}},lr={full:0,left:0,center:0,right:0},sa={full:0,left:0,center:0,right:0},Du={full:0,left:0,center:0,right:0},Kg=class extends We{constructor(e,i,n,s,r,o,l,c){var d;super(),this._viewportElement=e,this._screenElement=i,this._bufferService=n,this._decorationService=s,this._renderService=r,this._optionsService=o,this._themeService=l,this._coreBrowserService=c,this._colorZoneStore=new ese,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(d=this._viewportElement.parentElement)==null||d.insertBefore(this._canvas,this._viewportElement),this._register(Bt(()=>{var p;return(p=this._canvas)==null?void 0:p.remove()}));let u=this._canvas.getContext("2d");if(u)this._ctx=u;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){var e;return((e=this._optionsService.options.overviewRuler)==null?void 0:e.width)||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),i=Math.ceil((this._canvas.width-1)/3);sa.full=this._canvas.width,sa.left=e,sa.center=i,sa.right=e,this._refreshDrawHeightConstants(),Du.full=1,Du.left=1,Du.center=1+sa.left,Du.right=1+sa.left+sa.center}_refreshDrawHeightConstants(){lr.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,i=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);lr.left=i,lr.center=i,lr.right=i}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*lr.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*lr.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*lr.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*lr.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let i of this._decorationService.decorations)this._colorZoneStore.addDecoration(i);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let i of e)i.position!=="full"&&this._renderColorZone(i);for(let i of e)i.position==="full"&&this._renderColorZone(i);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Du[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-lr[e.position||"full"]/2),sa[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+lr[e.position||"full"]))}_queueRefresh(e,i){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=i||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Kg=Ut([be(2,yn),be(3,Sd),be(4,wo),be(5,bn),be(6,Ch),be(7,xo)],Kg);var ce;(t=>(t.NUL="\0",t.SOH="",t.STX="",t.ETX="",t.EOT="",t.ENQ="",t.ACK="",t.BEL="\x07",t.BS="\b",t.HT=" ",t.LF=`
114
+ `,t.VT="\v",t.FF="\f",t.CR="\r",t.SO="",t.SI="",t.DLE="",t.DC1="",t.DC2="",t.DC3="",t.DC4="",t.NAK="",t.SYN="",t.ETB="",t.CAN="",t.EM="",t.SUB="",t.ESC="\x1B",t.FS="",t.GS="",t.RS="",t.US="",t.SP=" ",t.DEL=""))(ce||(ce={}));var ig;(t=>(t.PAD="€",t.HOP="",t.BPH="‚",t.NBH="ƒ",t.IND="„",t.NEL="…",t.SSA="†",t.ESA="‡",t.HTS="ˆ",t.HTJ="‰",t.VTS="Š",t.PLD="‹",t.PLU="Œ",t.RI="",t.SS2="Ž",t.SS3="",t.DCS="",t.PU1="‘",t.PU2="’",t.STS="“",t.CCH="”",t.MW="•",t.SPA="–",t.EPA="—",t.SOS="˜",t.SGCI="™",t.SCI="š",t.CSI="›",t.ST="œ",t.OSC="",t.PM="ž",t.APC="Ÿ"))(ig||(ig={}));var G6;(t=>t.ST=`${ce.ESC}\\`)(G6||(G6={}));var dS=class{constructor(e,i,n,s,r,o){this._textarea=e,this._compositionView=i,this._bufferService=n,this._optionsService=s,this._coreService=r,this._renderService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let n;i.start+=this._dataAlreadySent.length,this._isComposing?n=this._textarea.value.substring(i.start,this._compositionPosition.start):n=this._textarea.value.substring(i.start),n.length>0&&this._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;let i=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(i,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let i=this._textarea.value,n=i.replace(e,"");this._dataAlreadySent=n,i.length>e.length?this._coreService.triggerDataEvent(n,!0):i.length<e.length?this._coreService.triggerDataEvent(`${ce.DEL}`,!0):i.length===e.length&&i!==e&&this._coreService.triggerDataEvent(i,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let i=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),n=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=i*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=n+"px",this._compositionView.style.lineHeight=n+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let o=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(o.width,1)+"px",this._textarea.style.height=Math.max(o.height,1)+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};dS=Ut([be(2,yn),be(3,bn),be(4,$l),be(5,wo)],dS);var Ci=0,ki=0,Ti=0,Zt=0,lR={css:"#00000000",rgba:0},ci;(t=>{function e(s,r,o,l){return l!==void 0?`#${il(s)}${il(r)}${il(o)}${il(l)}`:`#${il(s)}${il(r)}${il(o)}`}t.toCss=e;function i(s,r,o,l=255){return(s<<24|r<<16|o<<8|l)>>>0}t.toRgba=i;function n(s,r,o,l){return{css:t.toCss(s,r,o,l),rgba:t.toRgba(s,r,o,l)}}t.toColor=n})(ci||(ci={}));var Pt;(t=>{function e(c,u){if(Zt=(u.rgba&255)/255,Zt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,g=u.rgba>>8&255,O=c.rgba>>24&255,_=c.rgba>>16&255,b=c.rgba>>8&255;Ci=O+Math.round((d-O)*Zt),ki=_+Math.round((p-_)*Zt),Ti=b+Math.round((g-b)*Zt);let x=ci.toCss(Ci,ki,Ti),w=ci.toRgba(Ci,ki,Ti);return{css:x,rgba:w}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function n(c,u,d){let p=ng.ensureContrastRatio(c.rgba,u.rgba,d);if(p)return ci.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=n;function s(c){let u=(c.rgba|255)>>>0;return[Ci,ki,Ti]=ng.toChannels(u),{css:ci.toCss(Ci,ki,Ti),rgba:u}}t.opaque=s;function r(c,u){return Zt=Math.round(u*255),[Ci,ki,Ti]=ng.toChannels(c.rgba),{css:ci.toCss(Ci,ki,Ti,Zt),rgba:ci.toRgba(Ci,ki,Ti,Zt)}}t.opacity=r;function o(c,u){return Zt=c.rgba&255,r(c,Zt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(Pt||(Pt={}));var zt;(t=>{let e,i;try{let s=document.createElement("canvas");s.width=1,s.height=1;let r=s.getContext("2d",{willReadFrequently:!0});r&&(e=r,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Ci=parseInt(s.slice(1,2).repeat(2),16),ki=parseInt(s.slice(2,3).repeat(2),16),Ti=parseInt(s.slice(3,4).repeat(2),16),ci.toColor(Ci,ki,Ti);case 5:return Ci=parseInt(s.slice(1,2).repeat(2),16),ki=parseInt(s.slice(2,3).repeat(2),16),Ti=parseInt(s.slice(3,4).repeat(2),16),Zt=parseInt(s.slice(4,5).repeat(2),16),ci.toColor(Ci,ki,Ti,Zt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let r=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return Ci=parseInt(r[1]),ki=parseInt(r[2]),Ti=parseInt(r[3]),Zt=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),ci.toColor(Ci,ki,Ti,Zt);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=s,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Ci,ki,Ti,Zt]=e.getImageData(0,0,1,1).data,Zt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:ci.toRgba(Ci,ki,Ti,Zt),css:s}}t.toColor=n})(zt||(zt={}));var fn;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,s,r){let o=n/255,l=s/255,c=r/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+p*.0722}t.relativeLuminance2=i})(fn||(fn={}));var ng;(t=>{function e(o,l){if(Zt=(l&255)/255,Zt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,p=o>>24&255,g=o>>16&255,O=o>>8&255;return Ci=p+Math.round((c-p)*Zt),ki=g+Math.round((u-g)*Zt),Ti=O+Math.round((d-O)*Zt),ci.toRgba(Ci,ki,Ti)}t.blend=e;function i(o,l,c){let u=fn.relativeLuminance(o>>8),d=fn.relativeLuminance(l>>8);if(no(u,d)<c){if(d<u){let O=n(o,l,c),_=no(u,fn.relativeLuminance(O>>8));if(_<c){let b=s(o,l,c),x=no(u,fn.relativeLuminance(b>>8));return _>x?O:b}return O}let p=s(o,l,c),g=no(u,fn.relativeLuminance(p>>8));if(g<c){let O=n(o,l,c),_=no(u,fn.relativeLuminance(O>>8));return g>_?p:O}return p}}t.ensureContrastRatio=i;function n(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=no(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));for(;b<c&&(g>0||O>0||_>0);)g-=Math.max(0,Math.ceil(g*.1)),O-=Math.max(0,Math.ceil(O*.1)),_-=Math.max(0,Math.ceil(_*.1)),b=no(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.reduceLuminance=n;function s(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=no(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));for(;b<c&&(g<255||O<255||_<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),O=Math.min(255,O+Math.ceil((255-O)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),b=no(fn.relativeLuminance2(g,O,_),fn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.increaseLuminance=s;function r(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=r})(ng||(ng={}));function il(t){let e=t.toString(16);return e.length<2?"0"+e:e}function no(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var tse=class extends bd{constructor(e,i,n){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Jg=class{constructor(t){this._bufferService=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new Rs}register(t){let e={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(e),e.id}deregister(t){for(let e=0;e<this._characterJoiners.length;e++)if(this._characterJoiners[e].id===t)return this._characterJoiners.splice(e,1),!0;return!1}getJoinedCharacters(t){if(this._characterJoiners.length===0)return[];let e=this._bufferService.buffer.lines.get(t);if(!e||e.length===0)return[];let i=[],n=e.translateToString(!0),s=0,r=0,o=0,l=e.getFg(0),c=e.getBg(0);for(let u=0;u<e.getTrimmedLength();u++)if(e.loadCell(u,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==l||this._workCell.bg!==c){if(u-s>1){let d=this._getJoinedRanges(n,o,r,e,s);for(let p=0;p<d.length;p++)i.push(d[p])}s=u,o=r,l=this._workCell.fg,c=this._workCell.bg}r+=this._workCell.getChars().length||va.length}if(this._bufferService.cols-s>1){let u=this._getJoinedRanges(n,o,r,e,s);for(let d=0;d<u.length;d++)i.push(u[d])}return i}_getJoinedRanges(t,e,i,n,s){let r=t.substring(e,i),o=[];try{o=this._characterJoiners[0].handler(r)}catch(l){console.error(l)}for(let l=1;l<this._characterJoiners.length;l++)try{let c=this._characterJoiners[l].handler(r);for(let u=0;u<c.length;u++)Jg._mergeRanges(o,c[u])}catch(c){console.error(c)}return this._stringRangesToCellRanges(o,n,s),o}_stringRangesToCellRanges(t,e,i){let n=0,s=!1,r=0,o=t[n];if(o){for(let l=i;l<this._bufferService.cols;l++){let c=e.getWidth(l),u=e.getString(l).length||va.length;if(c!==0){if(!s&&o[0]<=r&&(o[0]=l,s=!0),o[1]<=r){if(o[1]=l,o=t[++n],!o)break;o[0]<=r?(o[0]=l,s=!0):s=!1}r+=u}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(t,e){let i=!1;for(let n=0;n<t.length;n++){let s=t[n];if(i){if(e[1]<=s[0])return t[n-1][1]=e[1],t;if(e[1]<=s[1])return t[n-1][1]=Math.max(e[1],s[1]),t.splice(n,1),t;t.splice(n,1),n--}else{if(e[1]<=s[0])return t.splice(n,0,e),t;if(e[1]<=s[1])return s[0]=Math.min(e[0],s[0]),t;e[0]<s[1]&&(s[0]=Math.min(e[0],s[0]),i=!0);continue}}return i?t[t.length-1][1]=e[1]:t.push(e),t}};Jg=Ut([be(0,yn)],Jg);function ise(t){return 57508<=t&&t<=57558}function nse(t){return 9472<=t&&t<=9631}function sse(t){return ise(t)||nse(t)}function rse(){return{css:{canvas:wm(),cell:wm()},device:{canvas:wm(),cell:wm(),char:{width:0,height:0,left:0,top:0}}}}function wm(){return{width:0,height:0}}var pS=class{constructor(e,i,n,s,r,o,l){this._document=e,this._characterJoinerService=i,this._optionsService=n,this._coreBrowserService=s,this._coreService=r,this._decorationService=o,this._themeService=l,this._workCell=new Rs,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,i,n){this._selectionStart=e,this._selectionEnd=i,this._columnSelectMode=n}createRow(e,i,n,s,r,o,l,c,u,d,p){let g=[],O=this._characterJoinerService.getJoinedCharacters(i),_=this._themeService.colors,b=e.getNoBgTrimmedLength();n&&b<o+1&&(b=o+1);let x,w=0,k="",T=0,A=0,L=0,E=0,z=!1,N=0,q=!1,J=0,U=0,R=[],B=d!==-1&&p!==-1;for(let D=0;D<b;D++){e.loadCell(D,this._workCell);let j=this._workCell.getWidth();if(j===0)continue;let $=!1,X=D>=U,H=D,F=this._workCell;if(O.length>0&&D===O[0][0]&&X){let Le=O.shift(),as=this._isCellInSelection(Le[0],i);for(T=Le[0]+1;T<Le[1];T++)X&&(X=as===this._isCellInSelection(T,i));X&&(X=!n||o<Le[0]||o>=Le[1]),X?($=!0,F=new tse(this._workCell,e.translateToString(!0,Le[0],Le[1]),Le[1]-Le[0]),H=Le[1]-1,j=F.getWidth()):U=Le[1]}let M=this._isCellInSelection(D,i),I=n&&D===o,K=B&&D>=d&&D<=p,Q=!1;this._decorationService.forEachDecorationAtCell(D,i,void 0,Le=>{Q=!0});let ue=F.getChars()||va;if(ue===" "&&(F.isUnderline()||F.isOverline())&&(ue=" "),J=j*c-u.get(ue,F.isBold(),F.isItalic()),!x)x=this._document.createElement("span");else if(w&&(M&&q||!M&&!q&&F.bg===A)&&(M&&q&&_.selectionForeground||F.fg===L)&&F.extended.ext===E&&K===z&&J===N&&!I&&!$&&!Q&&X){F.isInvisible()?k+=va:k+=ue,w++;continue}else w&&(x.textContent=k),x=this._document.createElement("span"),w=0,k="";if(A=F.bg,L=F.fg,E=F.extended.ext,z=K,N=J,q=M,$&&o>=D&&o<=H&&(o=D),!this._coreService.isCursorHidden&&I&&this._coreService.isCursorInitialized){if(R.push("xterm-cursor"),this._coreBrowserService.isFocused)l&&R.push("xterm-cursor-blink"),R.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":R.push("xterm-cursor-outline");break;case"block":R.push("xterm-cursor-block");break;case"bar":R.push("xterm-cursor-bar");break;case"underline":R.push("xterm-cursor-underline");break}}if(F.isBold()&&R.push("xterm-bold"),F.isItalic()&&R.push("xterm-italic"),F.isDim()&&R.push("xterm-dim"),F.isInvisible()?k=va:k=F.getChars()||va,F.isUnderline()&&(R.push(`xterm-underline-${F.extended.underlineStyle}`),k===" "&&(k=" "),!F.isUnderlineColorDefault()))if(F.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${bd.toColorRGB(F.getUnderlineColor()).join(",")})`;else{let Le=F.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&F.isBold()&&Le<8&&(Le+=8),x.style.textDecorationColor=_.ansi[Le].css}F.isOverline()&&(R.push("xterm-overline"),k===" "&&(k=" ")),F.isStrikethrough()&&R.push("xterm-strikethrough"),K&&(x.style.textDecoration="underline");let he=F.getFgColor(),fe=F.getFgColorMode(),Oe=F.getBgColor(),Ce=F.getBgColorMode(),ye=!!F.isInverse();if(ye){let Le=he;he=Oe,Oe=Le;let as=fe;fe=Ce,Ce=as}let nt,Qt,Yt=!1;this._decorationService.forEachDecorationAtCell(D,i,void 0,Le=>{Le.options.layer!=="top"&&Yt||(Le.backgroundColorRGB&&(Ce=50331648,Oe=Le.backgroundColorRGB.rgba>>8&16777215,nt=Le.backgroundColorRGB),Le.foregroundColorRGB&&(fe=50331648,he=Le.foregroundColorRGB.rgba>>8&16777215,Qt=Le.foregroundColorRGB),Yt=Le.options.layer==="top")}),!Yt&&M&&(nt=this._coreBrowserService.isFocused?_.selectionBackgroundOpaque:_.selectionInactiveBackgroundOpaque,Oe=nt.rgba>>8&16777215,Ce=50331648,Yt=!0,_.selectionForeground&&(fe=50331648,he=_.selectionForeground.rgba>>8&16777215,Qt=_.selectionForeground)),Yt&&R.push("xterm-decoration-top");let ei;switch(Ce){case 16777216:case 33554432:ei=_.ansi[Oe],R.push(`xterm-bg-${Oe}`);break;case 50331648:ei=ci.toColor(Oe>>16,Oe>>8&255,Oe&255),this._addStyle(x,`background-color:#${cR((Oe>>>0).toString(16),"0",6)}`);break;case 0:default:ye?(ei=_.foreground,R.push("xterm-bg-257")):ei=_.background}switch(nt||F.isDim()&&(nt=Pt.multiplyOpacity(ei,.5)),fe){case 16777216:case 33554432:F.isBold()&&he<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(he+=8),this._applyMinimumContrast(x,ei,_.ansi[he],F,nt,void 0)||R.push(`xterm-fg-${he}`);break;case 50331648:let Le=ci.toColor(he>>16&255,he>>8&255,he&255);this._applyMinimumContrast(x,ei,Le,F,nt,Qt)||this._addStyle(x,`color:#${cR(he.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(x,ei,_.foreground,F,nt,Qt)||ye&&R.push("xterm-fg-257")}R.length&&(x.className=R.join(" "),R.length=0),!I&&!$&&!Q&&X?w++:x.textContent=k,J!==this.defaultSpacing&&(x.style.letterSpacing=`${J}px`),g.push(x),D=H}return x&&w&&(x.textContent=k),g}_applyMinimumContrast(e,i,n,s,r,o){if(this._optionsService.rawOptions.minimumContrastRatio===1||sse(s.getCode()))return!1;let l=this._getContrastCache(s),c;if(!r&&!o&&(c=l.getColor(i.rgba,n.rgba)),c===void 0){let u=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);c=Pt.ensureContrastRatio(r||i,o||n,u),l.setColor((r||i).rgba,(o||n).rgba,c??null)}return c?(this._addStyle(e,`color:${c.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,i){e.setAttribute("style",`${e.getAttribute("style")||""}${i};`)}_isCellInSelection(e,i){let n=this._selectionStart,s=this._selectionEnd;return!n||!s?!1:this._columnSelectMode?n[0]<=s[0]?e>=n[0]&&i>=n[1]&&e<s[0]&&i<=s[1]:e<n[0]&&i>=n[1]&&e>=s[0]&&i<=s[1]:i>n[1]&&i<s[1]||n[1]===s[1]&&i===n[1]&&e>=n[0]&&e<s[0]||n[1]<s[1]&&i===s[1]&&e<s[0]||n[1]<s[1]&&i===n[1]&&e>=n[0]}};pS=Ut([be(1,Q6),be(2,bn),be(3,xo),be(4,$l),be(5,Sd),be(6,Ch)],pS);function cR(t,e,i){for(;t.length<i;)t=e+t;return t}var ose=class{constructor(e,i){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";let n=e.createElement("span");n.classList.add("xterm-char-measure-element");let s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";let r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontStyle="italic";let o=e.createElement("span");o.classList.add("xterm-char-measure-element"),o.style.fontWeight="bold",o.style.fontStyle="italic",this._measureElements=[n,s,r,o],this._container.appendChild(n),this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(o),i.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,i,n,s){e===this._font&&i===this._fontSize&&n===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=i,this._weight=n,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,i,n){let s=0;if(!i&&!n&&e.length===1&&(s=e.charCodeAt(0))<256){if(this._flat[s]!==-9999)return this._flat[s];let l=this._measure(e,0);return l>0&&(this._flat[s]=l),l}let r=e;i&&(r+="B"),n&&(r+="I");let o=this._holey.get(r);if(o===void 0){let l=0;i&&(l|=1),n&&(l|=2),o=this._measure(e,l),o>0&&this._holey.set(r,o)}return o}_measure(e,i){let n=this._measureElements[i];return n.textContent=e.repeat(32),n.offsetWidth/32}},ase=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,i,n,s=!1){if(this.selectionStart=i,this.selectionEnd=n,!i||!n||i[0]===n[0]&&i[1]===n[1]){this.clear();return}let r=e.buffers.active.ydisp,o=i[1]-r,l=n[1]-r,c=Math.max(o,0),u=Math.min(l,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=o,this.viewportEndRow=l,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=i[0],this.endCol=n[0]}isCellSelected(e,i,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&n>=this.viewportCappedStartRow&&i<this.endCol&&n<=this.viewportCappedEndRow:i<this.startCol&&n>=this.viewportCappedStartRow&&i>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&i>=this.startCol):!1}};function lse(){return new ase}var zy="xterm-dom-renderer-owner-",vs="xterm-rows",Cm="xterm-fg-",hR="xterm-bg-",Bu="xterm-focus",km="xterm-selection",cse=1,mS=class extends We{constructor(e,i,n,s,r,o,l,c,u,d,p,g,O,_){super(),this._terminal=e,this._document=i,this._element=n,this._screenElement=s,this._viewportElement=r,this._helperContainer=o,this._linkifier2=l,this._charSizeService=u,this._optionsService=d,this._bufferService=p,this._coreService=g,this._coreBrowserService=O,this._themeService=_,this._terminalClass=cse++,this._rowElements=[],this._selectionRenderModel=lse(),this.onRequestRedraw=this._register(new me).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(vs),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(km),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=rse(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(b=>this._injectCss(b))),this._injectCss(this._themeService.colors),this._rowFactory=c.createInstance(pS,document),this._element.classList.add(zy+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(b=>this._handleLinkHover(b))),this._register(this._linkifier2.onHideLinkUnderline(b=>this._handleLinkLeave(b))),this._register(Bt(()=>{this._element.classList.remove(zy+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new ose(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let n of this._rowElements)n.style.width=`${this.dimensions.css.canvas.width}px`,n.style.height=`${this.dimensions.css.cell.height}px`,n.style.lineHeight=`${this.dimensions.css.cell.height}px`,n.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let i=`${this._terminalSelector} .${vs} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=i,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let i=`${this._terminalSelector} .${vs} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;i+=`${this._terminalSelector} .${vs} .xterm-dim { color: ${Pt.multiplyOpacity(e.foreground,.5).css};}`,i+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;i+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,i+=`@keyframes ${s} { 50% { box-shadow: none; }}`,i+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,i+=`${this._terminalSelector} .${vs}.${Bu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${vs}.${Bu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${vs}.${Bu} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${vs} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${vs} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${vs} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${vs} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${vs} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,i+=`${this._terminalSelector} .${km} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${km} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${km} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[o,l]of e.ansi.entries())i+=`${this._terminalSelector} .${Cm}${o} { color: ${l.css}; }${this._terminalSelector} .${Cm}${o}.xterm-dim { color: ${Pt.multiplyOpacity(l,.5).css}; }${this._terminalSelector} .${hR}${o} { background-color: ${l.css}; }`;i+=`${this._terminalSelector} .${Cm}257 { color: ${Pt.opaque(e.background).css}; }${this._terminalSelector} .${Cm}257.xterm-dim { color: ${Pt.multiplyOpacity(Pt.opaque(e.background),.5).css}; }${this._terminalSelector} .${hR}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=i}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,i){for(let n=this._rowElements.length;n<=i;n++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>i;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,i){this._refreshRowElements(e,i),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Bu),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Bu),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,i,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,i,n),this.renderRows(0,this._bufferService.rows-1),!e||!i||(this._selectionRenderModel.update(this._terminal,e,i,n),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,o=this._selectionRenderModel.viewportCappedStartRow,l=this._selectionRenderModel.viewportCappedEndRow,c=this._document.createDocumentFragment();if(n){let u=e[0]>i[0];c.appendChild(this._createSelectionElement(o,u?i[0]:e[0],u?e[0]:i[0],l-o+1))}else{let u=s===o?e[0]:0,d=o===r?i[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(o,u,d));let p=l-o-1;if(c.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,p)),o!==l){let g=r===l?i[0]:this._bufferService.cols;c.appendChild(this._createSelectionElement(l,0,g))}}this._selectionContainer.appendChild(c)}_createSelectionElement(e,i,n,s=1){let r=this._document.createElement("div"),o=i*this.dimensions.css.cell.width,l=this.dimensions.css.cell.width*(n-i);return o+l>this.dimensions.css.canvas.width&&(l=this.dimensions.css.canvas.width-o),r.style.height=`${s*this.dimensions.css.cell.height}px`,r.style.top=`${e*this.dimensions.css.cell.height}px`,r.style.left=`${o}px`,r.style.width=`${l}px`,r}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,i){let n=this._bufferService.buffer,s=n.ybase+n.y,r=Math.min(n.x,this._bufferService.cols-1),o=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,l=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,c=this._optionsService.rawOptions.cursorInactiveStyle;for(let u=e;u<=i;u++){let d=u+n.ydisp,p=this._rowElements[u],g=n.lines.get(d);if(!p||!g)break;p.replaceChildren(...this._rowFactory.createRow(g,d,d===s,l,c,r,o,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${zy}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,i,n,s,r,o){n<0&&(e=0),s<0&&(i=0);let l=this._bufferService.rows-1;n=Math.max(Math.min(n,l),0),s=Math.max(Math.min(s,l),0),r=Math.min(r,this._bufferService.cols);let c=this._bufferService.buffer,u=c.ybase+c.y,d=Math.min(c.x,r-1),p=this._optionsService.rawOptions.cursorBlink,g=this._optionsService.rawOptions.cursorStyle,O=this._optionsService.rawOptions.cursorInactiveStyle;for(let _=n;_<=s;++_){let b=_+c.ydisp,x=this._rowElements[_],w=c.lines.get(b);if(!x||!w)break;x.replaceChildren(...this._rowFactory.createRow(w,b,b===u,g,O,d,p,this.dimensions.css.cell.width,this._widthCache,o?_===n?e:0:-1,o?(_===s?i:r)-1:-1))}}};mS=Ut([be(7,Ew),be(8,TO),be(9,bn),be(10,yn),be(11,$l),be(12,xo),be(13,Ch)],mS);var gS=class extends We{constructor(e,i,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new me),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new use(this._optionsService))}catch{this._measureStrategy=this._register(new hse(e,i,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};gS=Ut([be(2,bn)],gS);var K6=class extends We{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(t,e){t!==void 0&&t>0&&e!==void 0&&e>0&&(this._result.width=t,this._result.height=e)}},hse=class extends K6{constructor(t,e,i){super(),this._document=t,this._parentElement=e,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},use=class extends K6{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let i=this._ctx.measureText("W");if(!("width"in i&&"fontBoundingBoxAscent"in i&&"fontBoundingBoxDescent"in i))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},fse=class extends We{constructor(e,i,n){super(),this._textarea=e,this._window=i,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new dse(this._window)),this._onDprChange=this._register(new me),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new me),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(Gi.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Be(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Be(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},dse=class extends We{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new mh),this._onDprChange=this._register(new me),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(Bt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Be(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var e;this._outerListener&&((e=this._resolutionMediaMatchList)==null||e.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},pse=class extends We{constructor(){super(),this.linkProviders=[],this._register(Bt(()=>this.linkProviders.length=0))}registerLinkProvider(t){return this.linkProviders.push(t),{dispose:()=>{let e=this.linkProviders.indexOf(t);e!==-1&&this.linkProviders.splice(e,1)}}}};function $w(t,e,i){let n=i.getBoundingClientRect(),s=t.getComputedStyle(i),r=parseInt(s.getPropertyValue("padding-left")),o=parseInt(s.getPropertyValue("padding-top"));return[e.clientX-n.left-r,e.clientY-n.top-o]}function mse(t,e,i,n,s,r,o,l,c){if(!r)return;let u=$w(t,e,i);if(u)return u[0]=Math.ceil((u[0]+(c?o/2:0))/o),u[1]=Math.ceil(u[1]/l),u[0]=Math.min(Math.max(u[0],1),n+(c?1:0)),u[1]=Math.min(Math.max(u[1],1),s),u}var OS=class{constructor(e,i){this._renderService=e,this._charSizeService=i}getCoords(e,i,n,s,r){return mse(window,e,i,n,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,i){let n=$w(window,e,i);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};OS=Ut([be(0,wo),be(1,TO)],OS);var gse=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},J6={};kie(J6,{getSafariVersion:()=>vse,isChromeOS:()=>nz,isFirefox:()=>ez,isIpad:()=>_se,isIphone:()=>yse,isLegacyEdge:()=>Ose,isLinux:()=>zw,isMac:()=>eO,isNode:()=>AO,isSafari:()=>tz,isWindows:()=>iz});var AO=typeof process<"u"&&"title"in process,xd=AO?"node":navigator.userAgent,wd=AO?"node":navigator.platform,ez=xd.includes("Firefox"),Ose=xd.includes("Edge"),tz=/^((?!chrome|android).)*safari/i.test(xd);function vse(){if(!tz)return 0;let t=xd.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}var eO=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(wd),_se=wd==="iPad",yse=wd==="iPhone",iz=["Windows","Win16","Win32","WinCE"].includes(wd),zw=wd.indexOf("Linux")>=0,nz=/\bCrOS\b/.test(xd),sz=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(t){this._idleCallback=void 0;let e=0,i=0,n=t.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i=Math.max(e,i),s=t.timeRemaining(),i*1.5>s){n-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-e))}ms`),this._start();return}n=s}this.clear()}},bse=class extends sz{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},Sse=class extends sz{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},tO=!AO&&"requestIdleCallback"in window?Sse:bse,xse=class{constructor(){this._queue=new tO}set(t){this._queue.clear(),this._queue.enqueue(t)}flush(){this._queue.flush()}},vS=class extends We{constructor(e,i,n,s,r,o,l,c,u){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=s,this._coreService=r,this._coreBrowserService=c,this._renderer=this._register(new mh),this._pausedResizeTask=new xse,this._observerDisposable=this._register(new mh),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new me),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new me),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new me),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new me),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new gse((d,p)=>this._renderRows(d,p),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new wse(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(Bt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(l.onResize(()=>this._fullRefresh())),this._register(l.buffers.onBufferActivate(()=>{var d;return(d=this._renderer.value)==null?void 0:d.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(o.onDecorationRegistered(()=>this._fullRefresh())),this._register(o.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(l.cols,l.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(l.buffer.y,l.buffer.y,!0))),this._register(u.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,i),this._register(this._coreBrowserService.onWindowChange(d=>this._registerIntersectionObserver(d,i)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,i){if("IntersectionObserver"in e){let n=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});n.observe(i),this._observerDisposable.value=Bt(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,i,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),i=Math.max(i,s.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,i,this._rowCount)}_renderRows(e,i){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,i);return}e=Math.min(e,this._rowCount-1),i=Math.min(i,this._rowCount-1),this._renderer.value.renderRows(e,i),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:i}),this._onRender.fire({start:e,end:i}),this._isNextRenderRedrawOnly=!0}}resize(e,i){this._rowCount=i,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(i=>this.refreshRows(i.start,i.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var e,i;this._renderer.value&&((i=(e=this._renderer.value).clearTextureAtlas)==null||i.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,i){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var n;return(n=this._renderer.value)==null?void 0:n.handleResize(e,i)}):this._renderer.value.handleResize(e,i),this._fullRefresh())}handleCharSizeChanged(){var e;(e=this._renderer.value)==null||e.handleCharSizeChanged()}handleBlur(){var e;(e=this._renderer.value)==null||e.handleBlur()}handleFocus(){var e;(e=this._renderer.value)==null||e.handleFocus()}handleSelectionChanged(e,i,n){var s;this._selectionState.start=e,this._selectionState.end=i,this._selectionState.columnSelectMode=n,(s=this._renderer.value)==null||s.handleSelectionChanged(e,i,n)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};vS=Ut([be(2,bn),be(3,TO),be(4,$l),be(5,Sd),be(6,yn),be(7,xo),be(8,Ch)],vS);var wse=class{constructor(t,e,i){this._coreBrowserService=t,this._coreService=e,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(t,e){this._isBuffering?(this._start=Math.min(this._start,t),this._end=Math.max(this._end,e)):(this._start=t,this._end=e,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let t={start:this._start,end:this._end};return this._isBuffering=!1,t}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function Cse(t,e,i,n){let s=i.buffer.x,r=i.buffer.y;if(!i.buffer.hasScrollback)return Ase(s,r,t,e,i,n)+EO(r,e,i,n)+Ese(s,r,t,e,i,n);let o;if(r===e)return o=s>t?"D":"C",id(Math.abs(s-t),td(o,n));o=r>e?"D":"C";let l=Math.abs(r-e),c=Tse(r>e?t:s,i)+(l-1)*i.cols+1+kse(r>e?s:t);return id(c,td(o,n))}function kse(t,e){return t-1}function Tse(t,e){return e.cols-t}function Ase(t,e,i,n,s,r){return EO(e,n,s,r).length===0?"":id(oz(t,e,t,e-Pl(e,s),!1,s).length,td("D",r))}function EO(t,e,i,n){let s=t-Pl(t,i),r=e-Pl(e,i),o=Math.abs(s-r)-Mse(t,e,i);return id(o,td(rz(t,e),n))}function Ese(t,e,i,n,s,r){let o;EO(e,n,s,r).length>0?o=n-Pl(n,s):o=e;let l=n,c=Pse(t,e,i,n,s,r);return id(oz(t,o,i,l,c==="C",s).length,td(c,r))}function Mse(t,e,i){var o;let n=0,s=t-Pl(t,i),r=e-Pl(e,i);for(let l=0;l<Math.abs(s-r);l++){let c=rz(t,e)==="A"?-1:1;(o=i.buffer.lines.get(s+c*l))!=null&&o.isWrapped&&n++}return n}function Pl(t,e){let i=0,n=e.buffer.lines.get(t),s=n==null?void 0:n.isWrapped;for(;s&&t>=0&&t<e.rows;)i++,n=e.buffer.lines.get(--t),s=n==null?void 0:n.isWrapped;return i}function Pse(t,e,i,n,s,r){let o;return EO(i,n,s,r).length>0?o=n-Pl(n,s):o=e,t<i&&o<=n||t>=i&&o<n?"C":"D"}function rz(t,e){return t>e?"A":"B"}function oz(t,e,i,n,s,r){let o=t,l=e,c="";for(;(o!==i||l!==n)&&l>=0&&l<r.buffer.lines.length;)o+=s?1:-1,s&&o>r.cols-1?(c+=r.buffer.translateBufferLineToString(l,!1,t,o),o=0,t=0,l++):!s&&o<0&&(c+=r.buffer.translateBufferLineToString(l,!1,0,t+1),o=r.cols-1,t=o,l--);return c+r.buffer.translateBufferLineToString(l,!1,t,o)}function td(t,e){let i=e?"O":"[";return ce.ESC+i+t}function id(t,e){t=Math.floor(t);let i="";for(let n=0;n<t;n++)i+=e;return i}var Rse=class{constructor(t){this._bufferService=t,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?t%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)-1]:[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[t,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let t=this.selectionStart[0]+this.selectionStartLength;return t>this._bufferService.cols?[t%this._bufferService.cols,this.selectionStart[1]+Math.floor(t/this._bufferService.cols)]:[Math.max(t,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let t=this.selectionStart,e=this.selectionEnd;return!t||!e?!1:t[1]>e[1]||t[1]===e[1]&&t[0]>e[0]}handleTrim(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function uR(t,e){if(t.start.y>t.end.y)throw new Error(`Buffer range end (${t.end.x}, ${t.end.y}) cannot be before start (${t.start.x}, ${t.start.y})`);return e*(t.end.y-t.start.y)+(t.end.x-t.start.x+1)}var Ny=50,Qse=15,Lse=50,Dse=500,Bse=" ",$se=new RegExp(Bse,"g"),_S=class extends We{constructor(e,i,n,s,r,o,l,c,u){super(),this._element=e,this._screenElement=i,this._linkifier=n,this._bufferService=s,this._coreService=r,this._mouseService=o,this._optionsService=l,this._renderService=c,this._coreBrowserService=u,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Rs,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new me),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new me),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new me),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new me),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=d=>this._handleMouseMove(d),this._mouseUpListener=d=>this._handleMouseUp(d),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(d=>this._handleTrim(d)),this._register(this._bufferService.buffers.onBufferActivate(d=>this._handleBufferActivate(d))),this.enable(),this._model=new Rse(this._bufferService),this._activeSelectionMode=0,this._register(Bt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(d=>{d.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;return!e||!i?!1:e[0]!==i[0]||e[1]!==i[1]}get selectionText(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd;if(!e||!i)return"";let n=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===i[0])return"";let r=e[0]<i[0]?e[0]:i[0],o=e[0]<i[0]?i[0]:e[0];for(let l=e[1];l<=i[1];l++){let c=n.translateBufferLineToString(l,!0,r,o);s.push(c)}}else{let r=e[1]===i[1]?i[0]:void 0;s.push(n.translateBufferLineToString(e[1],!0,e[0],r));for(let o=e[1]+1;o<=i[1]-1;o++){let l=n.lines.get(o),c=n.translateBufferLineToString(o,!0);l!=null&&l.isWrapped?s[s.length-1]+=c:s.push(c)}if(e[1]!==i[1]){let o=n.lines.get(i[1]),l=n.translateBufferLineToString(i[1],!0,0,i[0]);o&&o.isWrapped?s[s.length-1]+=l:s.push(l)}}return s.map(r=>r.replace($se," ")).join(iz?`\r
115
+ `:`
116
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),zw&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let i=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!n||!s||!i?!1:this._areCoordsInSelection(i,n,s)}isCellInSelection(e,i){let n=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!n||!s?!1:this._areCoordsInSelection([e,i],n,s)}_areCoordsInSelection(e,i,n){return e[1]>i[1]&&e[1]<n[1]||i[1]===n[1]&&e[1]===i[1]&&e[0]>=i[0]&&e[0]<n[0]||i[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||i[1]<n[1]&&e[1]===i[1]&&e[0]>=i[0]}_selectWordAtCursor(e,i){var r,o;let n=(o=(r=this._linkifier.currentLink)==null?void 0:r.link)==null?void 0:o.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=uR(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,i),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,i){this._model.clearSelection(),e=Math.max(e,0),i=Math.min(i,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,i],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let i=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(i)return i[0]--,i[1]--,i[1]+=this._bufferService.buffer.ydisp,i}_getMouseEventScrollAmount(e){let i=$w(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return i>=0&&i<=n?0:(i>n&&(i-=n),i=Math.min(Math.max(i,-Ny),Ny),i/=Ny,i/Math.abs(i)+Math.round(i*(Qse-1)))}shouldForceSelection(e){return eO?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),Lse)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let i=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);i&&i.length!==this._model.selectionStart[0]&&i.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let i=this._getMouseBufferCoords(e);i&&(this._activeSelectionMode=2,this._selectLineAt(i[1]))}shouldColumnSelect(e){return e.altKey&&!(eO&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let i=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let s=n.lines.get(this._model.selectionEnd[1]);s&&s.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!i||i[0]!==this._model.selectionEnd[0]||i[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(!(!this._model.selectionEnd||!this._model.selectionStart)&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let i=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&i<Dse&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let n=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(n&&n[0]!==void 0&&n[1]!==void 0){let s=Cse(n[0]-1,n[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(s,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,i=this._model.finalSelectionEnd,n=!!e&&!!i&&(e[0]!==i[0]||e[1]!==i[1]);if(!n){this._oldHasSelection&&this._fireOnSelectionChange(e,i,n);return}!e||!i||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||i[0]!==this._oldSelectionEnd[0]||i[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,i,n)}_fireOnSelectionChange(e,i,n){this._oldSelectionStart=e,this._oldSelectionEnd=i,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(i=>this._handleTrim(i))}_convertViewportColToCharacterIndex(e,i){let n=i;for(let s=0;i>=s;s++){let r=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:r>1&&i!==s&&(n+=r-1)}return n}setSelection(e,i,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,i],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,i,n=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,o=r.lines.get(e[1]);if(!o)return;let l=r.translateBufferLineToString(e[1],!1),c=this._convertViewportColToCharacterIndex(o,e[0]),u=c,d=e[0]-c,p=0,g=0,O=0,_=0;if(l.charAt(c)===" "){for(;c>0&&l.charAt(c-1)===" ";)c--;for(;u<l.length&&l.charAt(u+1)===" ";)u++}else{let w=e[0],k=e[0];o.getWidth(w)===0&&(p++,w--),o.getWidth(k)===2&&(g++,k++);let T=o.getString(k).length;for(T>1&&(_+=T-1,u+=T-1);w>0&&c>0&&!this._isCharWordSeparator(o.loadCell(w-1,this._workCell));){o.loadCell(w-1,this._workCell);let A=this._workCell.getChars().length;this._workCell.getWidth()===0?(p++,w--):A>1&&(O+=A-1,c-=A-1),c--,w--}for(;k<o.length&&u+1<l.length&&!this._isCharWordSeparator(o.loadCell(k+1,this._workCell));){o.loadCell(k+1,this._workCell);let A=this._workCell.getChars().length;this._workCell.getWidth()===2?(g++,k++):A>1&&(_+=A-1,u+=A-1),u++,k++}}u++;let b=c+d-p+O,x=Math.min(this._bufferService.cols,u-c+p+g-O-_);if(!(!i&&l.slice(c,u).trim()==="")){if(n&&b===0&&o.getCodePoint(0)!==32){let w=r.lines.get(e[1]-1);if(w&&o.isWrapped&&w.getCodePoint(this._bufferService.cols-1)!==32){let k=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(k){let T=this._bufferService.cols-k.start;b-=T,x+=T}}}if(s&&b+x===this._bufferService.cols&&o.getCodePoint(this._bufferService.cols-1)!==32){let w=r.lines.get(e[1]+1);if(w!=null&&w.isWrapped&&w.getCodePoint(0)!==32){let k=this._getWordAt([0,e[1]+1],!1,!1,!0);k&&(x+=k.length)}}return{start:b,length:x}}}_selectWordAt(e,i){let n=this._getWordAt(e,i);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let i=this._getWordAt(e,!0);if(i){let n=e[1];for(;i.start<0;)i.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;i.start+i.length>this._bufferService.cols;)i.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?i.start:i.start+i.length,n]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let i=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:i.first},end:{x:this._bufferService.cols-1,y:i.last}};this._model.selectionStart=[0,i.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=uR(n,this._bufferService.cols)}};_S=Ut([be(3,yn),be(4,$l),be(5,Mw),be(6,bn),be(7,wo),be(8,xo)],_S);var fR=class{constructor(){this._data={}}set(e,i,n){this._data[e]||(this._data[e]={}),this._data[e][i]=n}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},dR=class{constructor(){this._color=new fR,this._css=new fR}setCss(e,i,n){this._css.set(e,i,n)}getCss(e,i){return this._css.get(e,i)}setColor(e,i,n){this._color.set(e,i,n)}getColor(e,i){return this._color.get(e,i)}clear(){this._color.clear(),this._css.clear()}},mi=Object.freeze((()=>{let t=[zt.toColor("#2e3436"),zt.toColor("#cc0000"),zt.toColor("#4e9a06"),zt.toColor("#c4a000"),zt.toColor("#3465a4"),zt.toColor("#75507b"),zt.toColor("#06989a"),zt.toColor("#d3d7cf"),zt.toColor("#555753"),zt.toColor("#ef2929"),zt.toColor("#8ae234"),zt.toColor("#fce94f"),zt.toColor("#729fcf"),zt.toColor("#ad7fa8"),zt.toColor("#34e2e2"),zt.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=e[i/36%6|0],s=e[i/6%6|0],r=e[i%6];t.push({css:ci.toCss(n,s,r),rgba:ci.toRgba(n,s,r)})}for(let i=0;i<24;i++){let n=8+i*10;t.push({css:ci.toCss(n,n,n),rgba:ci.toRgba(n,n,n)})}return t})()),ll=zt.toColor("#ffffff"),nf=zt.toColor("#000000"),pR=zt.toColor("#ffffff"),mR=nf,$u={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},zse=ll,yS=class extends We{constructor(e){super(),this._optionsService=e,this._contrastCache=new dR,this._halfContrastCache=new dR,this._onChangeColors=this._register(new me),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:ll,background:nf,cursor:pR,cursorAccent:mR,selectionForeground:void 0,selectionBackgroundTransparent:$u,selectionBackgroundOpaque:Pt.blend(nf,$u),selectionInactiveBackgroundTransparent:$u,selectionInactiveBackgroundOpaque:Pt.blend(nf,$u),scrollbarSliderBackground:Pt.opacity(ll,.2),scrollbarSliderHoverBackground:Pt.opacity(ll,.4),scrollbarSliderActiveBackground:Pt.opacity(ll,.5),overviewRulerBorder:ll,ansi:mi.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let i=this._colors;if(i.foreground=Ot(e.foreground,ll),i.background=Ot(e.background,nf),i.cursor=Pt.blend(i.background,Ot(e.cursor,pR)),i.cursorAccent=Pt.blend(i.background,Ot(e.cursorAccent,mR)),i.selectionBackgroundTransparent=Ot(e.selectionBackground,$u),i.selectionBackgroundOpaque=Pt.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=Ot(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=Pt.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?Ot(e.selectionForeground,lR):void 0,i.selectionForeground===lR&&(i.selectionForeground=void 0),Pt.isOpaque(i.selectionBackgroundTransparent)&&(i.selectionBackgroundTransparent=Pt.opacity(i.selectionBackgroundTransparent,.3)),Pt.isOpaque(i.selectionInactiveBackgroundTransparent)&&(i.selectionInactiveBackgroundTransparent=Pt.opacity(i.selectionInactiveBackgroundTransparent,.3)),i.scrollbarSliderBackground=Ot(e.scrollbarSliderBackground,Pt.opacity(i.foreground,.2)),i.scrollbarSliderHoverBackground=Ot(e.scrollbarSliderHoverBackground,Pt.opacity(i.foreground,.4)),i.scrollbarSliderActiveBackground=Ot(e.scrollbarSliderActiveBackground,Pt.opacity(i.foreground,.5)),i.overviewRulerBorder=Ot(e.overviewRulerBorder,zse),i.ansi=mi.slice(),i.ansi[0]=Ot(e.black,mi[0]),i.ansi[1]=Ot(e.red,mi[1]),i.ansi[2]=Ot(e.green,mi[2]),i.ansi[3]=Ot(e.yellow,mi[3]),i.ansi[4]=Ot(e.blue,mi[4]),i.ansi[5]=Ot(e.magenta,mi[5]),i.ansi[6]=Ot(e.cyan,mi[6]),i.ansi[7]=Ot(e.white,mi[7]),i.ansi[8]=Ot(e.brightBlack,mi[8]),i.ansi[9]=Ot(e.brightRed,mi[9]),i.ansi[10]=Ot(e.brightGreen,mi[10]),i.ansi[11]=Ot(e.brightYellow,mi[11]),i.ansi[12]=Ot(e.brightBlue,mi[12]),i.ansi[13]=Ot(e.brightMagenta,mi[13]),i.ansi[14]=Ot(e.brightCyan,mi[14]),i.ansi[15]=Ot(e.brightWhite,mi[15]),e.extendedAnsi){let n=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let s=0;s<n;s++)i.ansi[s+16]=Ot(e.extendedAnsi[s],mi[s+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0){for(let i=0;i<this._restoreColors.ansi.length;++i)this._colors.ansi[i]=this._restoreColors.ansi[i];return}switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};yS=Ut([be(0,bn)],yS);function Ot(t,e){if(t!==void 0)try{return zt.toColor(t)}catch{}return e}var Nse=class{constructor(...e){this._entries=new Map;for(let[i,n]of e)this.set(i,n)}set(e,i){let n=this._entries.get(e);return this._entries.set(e,i),n}forEach(e){for(let[i,n]of this._entries.entries())e(i,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},jse=class{constructor(){this._services=new Nse,this._services.set(Ew,this)}setService(t,e){this._services.set(t,e)}getService(t){return this._services.get(t)}createInstance(t,...e){let i=Qie(t).sort((r,o)=>r.index-o.index),n=[];for(let r of i){let o=this._services.get(r.id);if(!o)throw new Error(`[createInstance] ${t.name} depends on UNKNOWN service ${r.id._id}.`);n.push(o)}let s=i.length>0?i[0].index:e.length;if(e.length!==s)throw new Error(`[createInstance] First service dependency of ${t.name} at position ${s+1} conflicts with ${e.length} static arguments`);return new t(...e,...n)}},Ise={trace:0,debug:1,info:2,warn:3,error:4,off:5},Vse="xterm.js: ",bS=class extends We{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Ise[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?"":Vse)+i,...n)}trace(e,...i){var n;this._logLevel<=0&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,e,i)}debug(e,...i){var n;this._logLevel<=1&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,e,i)}info(e,...i){var n;this._logLevel<=2&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,e,i)}warn(e,...i){var n;this._logLevel<=3&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,e,i)}error(e,...i){var n;this._logLevel<=4&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,e,i)}};bS=Ut([be(0,bn)],bS);var gR=class extends We{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new me),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new me),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new me),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let i=new Array(e);for(let n=0;n<Math.min(e,this.length);n++)i[n]=this._array[this._getCyclicIndex(n)];this._array=i,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let i=this._length;i<e;i++)this._array[i]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,i){this._array[this._getCyclicIndex(e)]=i}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,i,...n){if(i){for(let s=e;s<this._length-i;s++)this._array[this._getCyclicIndex(s)]=this._array[this._getCyclicIndex(s+i)];this._length-=i,this.onDeleteEmitter.fire({index:e,amount:i})}for(let s=this._length-1;s>=e;s--)this._array[this._getCyclicIndex(s+n.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;s<n.length;s++)this._array[this._getCyclicIndex(e+s)]=n[s];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let s=this._length+n.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,i,n){if(!(i<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+n<0)throw new Error("Cannot shift elements in list beyond index 0");if(n>0){for(let r=i-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let s=e+i+n-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s<i;s++)this.set(e+s+n,this.get(e+s))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Ze=3,oi=Object.freeze(new bd),Tm=0,jy=2,sf=class az{constructor(e,i,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*Ze);let s=i||Rs.fromCharData([0,k6,1,0]);for(let r=0;r<e;++r)this.setCell(r,s);this.length=e}get(e){let i=this._data[e*Ze+0],n=i&2097151;return[this._data[e*Ze+1],i&2097152?this._combined[e]:n?pa(n):"",i>>22,i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,i){this._data[e*Ze+1]=i[0],i[1].length>1?(this._combined[e]=i[1],this._data[e*Ze+0]=e|2097152|i[2]<<22):this._data[e*Ze+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(e){return this._data[e*Ze+0]>>22}hasWidth(e){return this._data[e*Ze+0]&12582912}getFg(e){return this._data[e*Ze+1]}getBg(e){return this._data[e*Ze+2]}hasContent(e){return this._data[e*Ze+0]&4194303}getCodePoint(e){let i=this._data[e*Ze+0];return i&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):i&2097151}isCombined(e){return this._data[e*Ze+0]&2097152}getString(e){let i=this._data[e*Ze+0];return i&2097152?this._combined[e]:i&2097151?pa(i&2097151):""}isProtected(e){return this._data[e*Ze+2]&536870912}loadCell(e,i){return Tm=e*Ze,i.content=this._data[Tm+0],i.fg=this._data[Tm+1],i.bg=this._data[Tm+2],i.content&2097152&&(i.combinedData=this._combined[e]),i.bg&268435456&&(i.extended=this._extendedAttrs[e]),i}setCell(e,i){i.content&2097152&&(this._combined[e]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[e]=i.extended),this._data[e*Ze+0]=i.content,this._data[e*Ze+1]=i.fg,this._data[e*Ze+2]=i.bg}setCellFromCodepoint(e,i,n,s){s.bg&268435456&&(this._extendedAttrs[e]=s.extended),this._data[e*Ze+0]=i|n<<22,this._data[e*Ze+1]=s.fg,this._data[e*Ze+2]=s.bg}addCodepointToCell(e,i,n){let s=this._data[e*Ze+0];s&2097152?this._combined[e]+=pa(i):s&2097151?(this._combined[e]=pa(s&2097151)+pa(i),s&=-2097152,s|=2097152):s=i|1<<22,n&&(s&=-12582913,s|=n<<22),this._data[e*Ze+0]=s}insertCells(e,i,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length-e){let s=new Rs;for(let r=this.length-e-i-1;r>=0;--r)this.setCell(e+i+r,this.loadCell(e+r,s));for(let r=0;r<i;++r)this.setCell(e+r,n)}else for(let s=e;s<this.length;++s)this.setCell(s,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,i,n){if(e%=this.length,i<this.length-e){let s=new Rs;for(let r=0;r<this.length-e-i;++r)this.setCell(e+r,this.loadCell(e+i+r,s));for(let r=this.length-i;r<this.length;++r)this.setCell(r,n)}else for(let s=e;s<this.length;++s)this.setCell(s,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,i,n,s=!1){if(s){for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&!this.isProtected(i)&&this.setCellFromCodepoint(i,0,1,n);e<i&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;return}for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),i<this.length&&this.getWidth(i-1)===2&&this.setCellFromCodepoint(i,0,1,n);e<i&&e<this.length;)this.setCell(e++,n)}resize(e,i){if(e===this.length)return this._data.length*4*jy<this._data.buffer.byteLength;let n=e*Ze;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let s=new Uint32Array(n);s.set(this._data),this._data=s}for(let s=this.length;s<e;++s)this.setCell(s,i)}else{this._data=this._data.subarray(0,n);let s=Object.keys(this._combined);for(let o=0;o<s.length;o++){let l=parseInt(s[o],10);l>=e&&delete this._combined[l]}let r=Object.keys(this._extendedAttrs);for(let o=0;o<r.length;o++){let l=parseInt(r[o],10);l>=e&&delete this._extendedAttrs[l]}}return this.length=e,n*4*jy<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*jy<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,i=!1){if(i){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,e);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,e)}copyFrom(e){this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={};for(let i in e._combined)this._combined[i]=e._combined[i];this._extendedAttrs={};for(let i in e._extendedAttrs)this._extendedAttrs[i]=e._extendedAttrs[i];this.isWrapped=e.isWrapped}clone(){let e=new az(0);e._data=new Uint32Array(this._data),e.length=this.length;for(let i in this._combined)e._combined[i]=this._combined[i];for(let i in this._extendedAttrs)e._extendedAttrs[i]=this._extendedAttrs[i];return e.isWrapped=this.isWrapped,e}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*Ze+0]&4194303)return e+(this._data[e*Ze+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*Ze+0]&4194303||this._data[e*Ze+2]&50331648)return e+(this._data[e*Ze+0]>>22);return 0}copyCellsFrom(e,i,n,s,r){let o=e._data;if(r)for(let c=s-1;c>=0;c--){for(let u=0;u<Ze;u++)this._data[(n+c)*Ze+u]=o[(i+c)*Ze+u];o[(i+c)*Ze+2]&268435456&&(this._extendedAttrs[n+c]=e._extendedAttrs[i+c])}else for(let c=0;c<s;c++){for(let u=0;u<Ze;u++)this._data[(n+c)*Ze+u]=o[(i+c)*Ze+u];o[(i+c)*Ze+2]&268435456&&(this._extendedAttrs[n+c]=e._extendedAttrs[i+c])}let l=Object.keys(e._combined);for(let c=0;c<l.length;c++){let u=parseInt(l[c],10);u>=i&&(this._combined[u-i+n]=e._combined[u])}}translateToString(e,i,n,s){i=i??0,n=n??this.length,e&&(n=Math.min(n,this.getTrimmedLength())),s&&(s.length=0);let r="";for(;i<n;){let o=this._data[i*Ze+0],l=o&2097151,c=o&2097152?this._combined[i]:l?pa(l):va;if(r+=c,s)for(let u=0;u<c.length;++u)s.push(i);i+=o>>22||1}return s&&s.push(i),r}};function Xse(t,e,i,n,s,r){let o=[];for(let l=0;l<t.length-1;l++){let c=l,u=t.get(++c);if(!u.isWrapped)continue;let d=[t.get(l)];for(;c<t.length&&u.isWrapped;)d.push(u),u=t.get(++c);if(!r&&n>=l&&n<c){l+=d.length-1;continue}let p=0,g=nd(d,p,e),O=1,_=0;for(;O<d.length;){let x=nd(d,O,e),w=x-_,k=i-g,T=Math.min(w,k);d[p].copyCellsFrom(d[O],_,g,T,!1),g+=T,g===i&&(p++,g=0),_+=T,_===x&&(O++,_=0),g===0&&p!==0&&d[p-1].getWidth(i-1)===2&&(d[p].copyCellsFrom(d[p-1],i-1,g++,1,!1),d[p-1].setCell(i-1,s))}d[p].replaceCells(g,i,s);let b=0;for(let x=d.length-1;x>0&&(x>p||d[x].getTrimmedLength()===0);x--)b++;b>0&&(o.push(l+d.length-b),o.push(b)),l+=d.length-1}return o}function Zse(t,e){let i=[],n=0,s=e[n],r=0;for(let o=0;o<t.length;o++)if(s===o){let l=e[++n];t.onDeleteEmitter.fire({index:o-r,amount:l}),o+=l-1,r+=l,s=e[++n]}else i.push(o);return{layout:i,countRemoved:r}}function qse(t,e){let i=[];for(let n=0;n<e.length;n++)i.push(t.get(e[n]));for(let n=0;n<i.length;n++)t.set(n,i[n]);t.length=e.length}function Wse(t,e,i){let n=[],s=t.map((c,u)=>nd(t,u,e)).reduce((c,u)=>c+u),r=0,o=0,l=0;for(;l<s;){if(s-l<i){n.push(s-l);break}r+=i;let c=nd(t,o,e);r>c&&(r-=c,o++);let u=t[o].getWidth(r-1)===2;u&&r--;let d=u?i-1:i;n.push(d),l+=d}return n}function nd(t,e,i){if(e===t.length-1)return t[e].getTrimmedLength();let n=!t[e].hasContent(i-1)&&t[e].getWidth(i-1)===1,s=t[e+1].getWidth(0)===2;return n&&s?i-1:i}var lz=class cz{constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=cz._nextId++,this._onDispose=this.register(new me),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Ml(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};lz._nextId=1;var Use=lz,yi={},cl=yi.B;yi[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};yi.A={"#":"£"};yi.B=void 0;yi[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};yi.C=yi[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};yi.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};yi.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};yi.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};yi.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};yi.E=yi[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};yi.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};yi.H=yi[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};yi["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var OR=4294967295,vR=class{constructor(t,e,i){this._hasScrollback=t,this._optionsService=e,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=oi.clone(),this.savedCharset=cl,this.markers=[],this._nullCell=Rs.fromCharData([0,k6,1,0]),this._whitespaceCell=Rs.fromCharData([0,va,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new tO,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new gR(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Gg),this._nullCell}getWhitespaceCell(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Gg),this._whitespaceCell}getBlankLine(t,e){return new sf(this._bufferService.cols,this.getNullCell(t),e)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows}_getCorrectBufferLength(t){if(!this._hasScrollback)return t;let e=t+this._optionsService.rawOptions.scrollback;return e>OR?OR:e}fillViewportRows(t){if(this.lines.length===0){t===void 0&&(t=oi);let e=this._rows;for(;e--;)this.lines.push(this.getBlankLine(t))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new gR(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(t,e){let i=this.getNullCell(oi),n=0,s=this._getCorrectBufferLength(e);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols<t)for(let o=0;o<this.lines.length;o++)n+=+this.lines.get(o).resize(t,i);let r=0;if(this._rows<e)for(let o=this._rows;o<e;o++)this.lines.length<e+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new sf(t,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+r+1?(this.ybase--,r++,this.ydisp>0&&this.ydisp--):this.lines.push(new sf(t,i)));else for(let o=this._rows;o>e;o--)this.lines.length>e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s<this.lines.maxLength){let o=this.lines.length-s;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=s}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,e-1),r&&(this.y+=r),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=e-1,this._isReflowEnabled&&(this._reflow(t,e),this._cols>t))for(let r=0;r<this.lines.length;r++)n+=+this.lines.get(r).resize(t,i);this._cols=t,this._rows=e,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let t=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,t=!1);let e=0;for(;this._memoryCleanupPosition<this.lines.length;)if(e+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),e>100)return!0;return t}get _isReflowEnabled(){let t=this._optionsService.rawOptions.windowsPty;return t&&t.buildNumber?this._hasScrollback&&t.backend==="conpty"&&t.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(t,e){this._cols!==t&&(t>this._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))}_reflowLarger(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,n=Xse(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(oi),i);if(n.length>0){let s=Zse(this.lines,n);qse(this.lines,s.layout),this._reflowLargerAdjustViewport(t,e,s.countRemoved)}}_reflowLargerAdjustViewport(t,e,i){let n=this.getNullCell(oi),s=i;for(;s-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<e&&this.lines.push(new sf(t,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)}_reflowSmaller(t,e){let i=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(oi),s=[],r=0;for(let o=this.lines.length-1;o>=0;o--){let l=this.lines.get(o);if(!l||!l.isWrapped&&l.getTrimmedLength()<=t)continue;let c=[l];for(;l.isWrapped&&o>0;)l=this.lines.get(--o),c.unshift(l);if(!i){let T=this.ybase+this.y;if(T>=o&&T<o+c.length)continue}let u=c[c.length-1].getTrimmedLength(),d=Wse(c,this._cols,t),p=d.length-c.length,g;this.ybase===0&&this.y!==this.lines.length-1?g=Math.max(0,this.y-this.lines.maxLength+p):g=Math.max(0,this.lines.length-this.lines.maxLength+p);let O=[];for(let T=0;T<p;T++){let A=this.getBlankLine(oi,!0);O.push(A)}O.length>0&&(s.push({start:o+c.length+r,newLines:O}),r+=O.length),c.push(...O);let _=d.length-1,b=d[_];b===0&&(_--,b=d[_]);let x=c.length-p-1,w=u;for(;x>=0;){let T=Math.min(w,b);if(c[_]===void 0)break;if(c[_].copyCellsFrom(c[x],w-T,b-T,T,!0),b-=T,b===0&&(_--,b=d[_]),w-=T,w===0){x--;let A=Math.max(x,0);w=nd(c,A,this._cols)}}for(let T=0;T<c.length;T++)d[T]<t&&c[T].setCell(d[T],n);let k=p-g;for(;k-- >0;)this.ybase===0?this.y<e-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+r)-e&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+p,this.ybase+e-1)}if(s.length>0){let o=[],l=[];for(let b=0;b<this.lines.length;b++)l.push(this.lines.get(b));let c=this.lines.length,u=c-1,d=0,p=s[d];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+r);let g=0;for(let b=Math.min(this.lines.maxLength-1,c+r-1);b>=0;b--)if(p&&p.start>u+g){for(let x=p.newLines.length-1;x>=0;x--)this.lines.set(b--,p.newLines[x]);b++,o.push({index:u+1,amount:p.newLines.length}),g+=p.newLines.length,p=s[++d]}else this.lines.set(b,l[u--]);let O=0;for(let b=o.length-1;b>=0;b--)o[b].index+=O,this.lines.onInsertEmitter.fire(o[b]),O+=o[b].amount;let _=Math.max(0,c+r-this.lines.maxLength);_>0&&this.lines.onTrimEmitter.fire(_)}}translateBufferLineToString(t,e,i=0,n){let s=this.lines.get(t);return s?s.translateToString(e,i,n):""}getWrappedRangeForLine(t){let e=t,i=t;for(;e>0&&this.lines.get(e).isWrapped;)e--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:e,last:i}}setupTabStops(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.rawOptions.tabStopWidth)this.tabs[t]=!0}prevStop(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t}nextStop(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t}clearMarkers(t){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].line===t&&(this.markers[e].dispose(),this.markers.splice(e--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].dispose();this.markers.length=0,this._isClearing=!1}addMarker(t){let e=new Use(t);return this.markers.push(e),e.register(this.lines.onTrim(i=>{e.line-=i,e.line<0&&e.dispose()})),e.register(this.lines.onInsert(i=>{e.line>=i.index&&(e.line+=i.amount)})),e.register(this.lines.onDelete(i=>{e.line>=i.index&&e.line<i.index+i.amount&&e.dispose(),e.line>i.index&&(e.line-=i.amount)})),e.register(e.onDispose(()=>this._removeMarker(e))),e}_removeMarker(t){this._isClearing||this.markers.splice(this.markers.indexOf(t),1)}},Yse=class extends We{constructor(e,i){super(),this._optionsService=e,this._bufferService=i,this._onBufferActivate=this._register(new me),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new vR(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new vR(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,i){this._normal.resize(e,i),this._alt.resize(e,i),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},hz=2,uz=1,SS=class extends We{constructor(t){super(),this.isUserScrolling=!1,this._onResize=this._register(new me),this.onResize=this._onResize.event,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this.cols=Math.max(t.rawOptions.cols||0,hz),this.rows=Math.max(t.rawOptions.rows||0,uz),this.buffers=this._register(new Yse(t,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(t,e){let i=this.cols!==t,n=this.rows!==e;this.cols=t,this.rows=e,this.buffers.resize(t,e),this._onResize.fire({cols:t,rows:e,colsChanged:i,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,e=!1){let i=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==t.fg||n.getBg(0)!==t.bg)&&(n=i.getBlankLine(t,e),this._cachedBlankLine=n),n.isWrapped=e;let s=i.ybase+i.scrollTop,r=i.ybase+i.scrollBottom;if(i.scrollTop===0){let o=i.lines.isFull;r===i.lines.length-1?o?i.lines.recycle().copyFrom(n):i.lines.push(n.clone()):i.lines.splice(r+1,0,n.clone()),o?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let o=r-s+1;i.lines.shiftElements(s+1,o-1,-1),i.lines.set(r,n.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(t,e){let i=this.buffer;if(t<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else t+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let n=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+t,i.ybase),0),n!==i.ydisp&&(e||this._onScroll.fire(i.ydisp))}};SS=Ut([be(0,bn)],SS);var Cc={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:eO,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Hse=["normal","bold","100","200","300","400","500","600","700","800","900"],Fse=class extends We{constructor(e){super(),this._onOptionChange=this._register(new me),this.onOptionChange=this._onOptionChange.event;let i={...Cc};for(let n in e)if(n in i)try{let s=e[n];i[n]=this._sanitizeAndValidateOption(n,s)}catch(s){console.error(s)}this.rawOptions=i,this.options={...i},this._setupOptions(),this._register(Bt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,i){return this.onOptionChange(n=>{n===e&&i(this.rawOptions[e])})}onMultipleOptionChange(e,i){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&i()})}_setupOptions(){let e=n=>{if(!(n in Cc))throw new Error(`No option with key "${n}"`);return this.rawOptions[n]},i=(n,s)=>{if(!(n in Cc))throw new Error(`No option with key "${n}"`);s=this._sanitizeAndValidateOption(n,s),this.rawOptions[n]!==s&&(this.rawOptions[n]=s,this._onOptionChange.fire(n))};for(let n in this.rawOptions){let s={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this.options,n,s)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=Cc[e]),!Gse(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=Cc[e]);break;case"fontWeight":case"fontWeightBold":if(typeof i=="number"&&1<=i&&i<=1e3)break;i=Hse.includes(i)?i:Cc[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(i*10)/10));break;case"scrollback":if(i=Math.min(i,4294967295),i<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&i!==0)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{};break}return i}};function Gse(t){return t==="block"||t==="underline"||t==="bar"}function rf(t,e=5){if(typeof t!="object")return t;let i=Array.isArray(t)?[]:{};for(let n in t)i[n]=e<=1?t[n]:t[n]&&rf(t[n],e-1);return i}var _R=Object.freeze({insertMode:!1}),yR=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),xS=class extends We{constructor(e,i,n){super(),this._bufferService=e,this._logService=i,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new me),this.onData=this._onData.event,this._onUserInput=this._register(new me),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new me),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new me),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=rf(_R),this.decPrivateModes=rf(yR)}reset(){this.modes=rf(_R),this.decPrivateModes=rf(yR)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;i&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};xS=Ut([be(0,yn),be(1,P6),be(2,bn)],xS);var bR={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:t=>t.button===4||t.action!==1?!1:(t.ctrl=!1,t.alt=!1,t.shift=!1,!0)},VT200:{events:19,restrict:t=>t.action!==32},DRAG:{events:23,restrict:t=>!(t.action===32&&t.button===3)},ANY:{events:31,restrict:t=>!0}};function Iy(t,e){let i=(t.ctrl?16:0)|(t.shift?4:0)|(t.alt?8:0);return t.button===4?(i|=64,i|=t.action):(i|=t.button&3,t.button&4&&(i|=64),t.button&8&&(i|=128),t.action===32?i|=32:t.action===0&&!e&&(i|=3)),i}var Vy=String.fromCharCode,SR={DEFAULT:t=>{let e=[Iy(t,!1)+32,t.col+32,t.row+32];return e[0]>255||e[1]>255||e[2]>255?"":`\x1B[M${Vy(e[0])}${Vy(e[1])}${Vy(e[2])}`},SGR:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${Iy(t,!0)};${t.col};${t.row}${e}`},SGR_PIXELS:t=>{let e=t.action===0&&t.button!==4?"m":"M";return`\x1B[<${Iy(t,!0)};${t.x};${t.y}${e}`}},wS=class extends We{constructor(t,e,i){super(),this._bufferService=t,this._coreService=e,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new me),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(bR))this.addProtocol(n,bR[n]);for(let n of Object.keys(SR))this.addEncoding(n,SR[n]);this.reset()}addProtocol(t,e){this._protocols[t]=e}addEncoding(t,e){this._encodings[t]=e}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(t){if(!this._protocols[t])throw new Error(`unknown protocol "${t}"`);this._activeProtocol=t,this._onProtocolChange.fire(this._protocols[t].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(t){if(!this._encodings[t])throw new Error(`unknown encoding "${t}"`);this._activeEncoding=t}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(t,e,i){if(t.deltaY===0||t.shiftKey||e===void 0||i===void 0)return 0;let n=e/i,s=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=n+0,Math.abs(t.deltaY)<50&&(s*=.3),this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(t,e){return e.altKey||e.ctrlKey||e.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(t){if(t.col<0||t.col>=this._bufferService.cols||t.row<0||t.row>=this._bufferService.rows||t.button===4&&t.action===32||t.button===3&&t.action!==32||t.button!==4&&(t.action===2||t.action===3)||(t.col++,t.row++,t.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,t,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(t))return!1;let e=this._encodings[this._activeEncoding](t);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=t,!0}explainEvents(t){return{down:!!(t&1),up:!!(t&2),drag:!!(t&4),move:!!(t&8),wheel:!!(t&16)}}_equalEvents(t,e,i){if(i){if(t.x!==e.x||t.y!==e.y)return!1}else if(t.col!==e.col||t.row!==e.row)return!1;return!(t.button!==e.button||t.action!==e.action||t.ctrl!==e.ctrl||t.alt!==e.alt||t.shift!==e.shift)}};wS=Ut([be(0,yn),be(1,$l),be(2,bn)],wS);var Xy=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],Kse=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],gi;function Jse(t,e){let i=0,n=e.length-1,s;if(t<e[0][0]||t>e[n][1])return!1;for(;n>=i;)if(s=i+n>>1,t>e[s][1])i=s+1;else if(t<e[s][0])n=s-1;else return!0;return!1}var ere=class{constructor(){if(this.version="6",!gi){gi=new Uint8Array(65536),gi.fill(1),gi[0]=0,gi.fill(0,1,32),gi.fill(0,127,160),gi.fill(2,4352,4448),gi[9001]=2,gi[9002]=2,gi.fill(2,11904,42192),gi[12351]=1,gi.fill(2,44032,55204),gi.fill(2,63744,64256),gi.fill(2,65040,65050),gi.fill(2,65072,65136),gi.fill(2,65280,65377),gi.fill(2,65504,65511);for(let e=0;e<Xy.length;++e)gi.fill(0,Xy[e][0],Xy[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?gi[e]:Jse(e,Kse)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,i){let n=this.wcwidth(e),s=n===0&&i!==0;if(s){let r=_l.extractWidth(i);r===0?s=!1:r>n&&(n=r)}return _l.createPropertyValue(0,n,s)}},_l=class sg{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new me,this.onChange=this._onChange.event;let e=new ere;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return(e&1)!==0}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,i,n=!1){return(e&16777215)<<3|(i&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let i=0,n=0,s=e.length;for(let r=0;r<s;++r){let o=e.charCodeAt(r);if(55296<=o&&o<=56319){if(++r>=s)return i+this.wcwidth(o);let u=e.charCodeAt(r);56320<=u&&u<=57343?o=(o-55296)*1024+u-56320+65536:i+=this.wcwidth(u)}let l=this.charProperties(o,n),c=sg.extractWidth(l);sg.extractShouldJoin(l)&&(c-=sg.extractWidth(n)),i+=c,n=l}return i}charProperties(e,i){return this._activeProvider.charProperties(e,i)}},tre=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,i){this._charsets[e]=i,this.glevel===e&&(this.charset=i)}};function xR(t){var n;let e=(n=t.buffer.lines.get(t.buffer.ybase+t.buffer.y-1))==null?void 0:n.get(t.cols-1),i=t.buffer.lines.get(t.buffer.ybase+t.buffer.y);i&&e&&(i.isWrapped=e[3]!==0&&e[3]!==32)}var zu=2147483647,ire=256,fz=class CS{constructor(e=32,i=32){if(this.maxLength=e,this.maxSubParamsLength=i,i>ire)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(e){let i=new CS;if(!e.length)return i;for(let n=Array.isArray(e[0])?1:0;n<e.length;++n){let s=e[n];if(Array.isArray(s))for(let r=0;r<s.length;++r)i.addSubParam(s[r]);else i.addParam(s)}return i}clone(){let e=new CS(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){let e=[];for(let i=0;i<this.length;++i){e.push(this.params[i]);let n=this._subParamsIdx[i]>>8,s=this._subParamsIdx[i]&255;s-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,s))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>zu?zu:e}addSubParam(e){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>zu?zu:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let i=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-i>0?this._subParams.subarray(i,n):null}getSubParamsAll(){let e={};for(let i=0;i<this.length;++i){let n=this._subParamsIdx[i]>>8,s=this._subParamsIdx[i]&255;s-n>0&&(e[i]=this._subParams.slice(n,s))}return e}addDigit(e){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,s=n[i-1];n[i-1]=~s?Math.min(s*10+e,zu):e}},Nu=[],nre=class{constructor(){this._state=0,this._active=Nu,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let s=n.indexOf(i);s!==-1&&n.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Nu}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Nu,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Nu,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,i,n){if(!this._active.length)this._handlerFb(this._id,"PUT",kO(e,i,n));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,i,n)}start(){this.reset(),this._state=1}put(e,i,n){if(this._state!==3){if(this._state===1)for(;i<n;){let s=e[i++];if(s===59){this._state=2,this._start();break}if(s<48||57<s){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+s-48}this._state===2&&n-i>0&&this._put(e,i,n)}}end(e,i=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let n=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,n=i,r=this._stack.fallThrough,this._stack.paused=!1),!r&&n===!1){for(;s>=0&&(n=this._active[s].end(e),n!==!0);s--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,n;s--}for(;s>=0;s--)if(n=this._active[s].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,n}this._active=Nu,this._id=-1,this._state=0}}},Jn=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,i,n){this._hitLimit||(this._data+=kO(e,i,n),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let i=!1;if(this._hitLimit)i=!1;else if(e&&(i=this._handler(this._data),i instanceof Promise))return i.then(n=>(this._data="",this._hitLimit=!1,n));return this._data="",this._hitLimit=!1,i}},ju=[],sre=class{constructor(){this._handlers=Object.create(null),this._active=ju,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=ju}registerHandler(e,i){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(i),{dispose:()=>{let s=n.indexOf(i);s!==-1&&n.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=ju,this._ident=0}hook(e,i){if(this.reset(),this._ident=e,this._active=this._handlers[e]||ju,!this._active.length)this._handlerFb(this._ident,"HOOK",i);else for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(i)}put(e,i,n){if(!this._active.length)this._handlerFb(this._ident,"PUT",kO(e,i,n));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,i,n)}unhook(e,i=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let n=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,n=i,r=this._stack.fallThrough,this._stack.paused=!1),!r&&n===!1){for(;s>=0&&(n=this._active[s].unhook(e),n!==!0);s--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,n;s--}for(;s>=0;s--)if(n=this._active[s].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,n}this._active=ju,this._ident=0}},of=new fz;of.addParam(0);var wR=class{constructor(t){this._handler=t,this._data="",this._params=of,this._hitLimit=!1}hook(t){this._params=t.length>1||t.params[0]?t.clone():of,this._data="",this._hitLimit=!1}put(t,e,i){this._hitLimit||(this._data+=kO(t,e,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(t){let e=!1;if(this._hitLimit)e=!1;else if(t&&(e=this._handler(this._data,this._params),e instanceof Promise))return e.then(i=>(this._params=of,this._data="",this._hitLimit=!1,i));return this._params=of,this._data="",this._hitLimit=!1,e}},rre=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){this.table.fill(e<<4|i)}add(e,i,n,s){this.table[i<<8|e]=n<<4|s}addMany(e,i,n,s){for(let r=0;r<e.length;r++)this.table[i<<8|e[r]]=n<<4|s}},Ss=160,ore=(function(){let t=new rre(4095),e=Array.apply(null,Array(256)).map((l,c)=>c),i=(l,c)=>e.slice(l,c),n=i(32,127),s=i(0,24);s.push(25),s.push.apply(s,i(28,32));let r=i(0,14),o;t.setDefault(1,0),t.addMany(n,0,2,0);for(o in r)t.addMany([24,26,153,154],o,3,0),t.addMany(i(128,144),o,3,0),t.addMany(i(144,152),o,3,0),t.add(156,o,0,0),t.add(27,o,11,1),t.add(157,o,4,8),t.addMany([152,158,159],o,0,7),t.add(155,o,11,3),t.add(144,o,11,9);return t.addMany(s,0,3,0),t.addMany(s,1,3,1),t.add(127,1,0,1),t.addMany(s,8,0,8),t.addMany(s,3,3,3),t.add(127,3,0,3),t.addMany(s,4,3,4),t.add(127,4,0,4),t.addMany(s,6,3,6),t.addMany(s,5,3,5),t.add(127,5,0,5),t.addMany(s,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(n,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(i(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(n,7,0,7),t.addMany(s,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(i(64,127),3,7,0),t.addMany(i(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(i(48,60),4,8,4),t.addMany(i(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(i(32,64),6,0,6),t.add(127,6,0,6),t.addMany(i(64,127),6,0,0),t.addMany(i(32,48),3,9,5),t.addMany(i(32,48),5,9,5),t.addMany(i(48,64),5,0,6),t.addMany(i(64,127),5,7,0),t.addMany(i(32,48),4,9,5),t.addMany(i(32,48),1,9,2),t.addMany(i(32,48),2,9,2),t.addMany(i(48,127),2,10,0),t.addMany(i(48,80),1,10,0),t.addMany(i(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(i(96,127),1,10,0),t.add(80,1,11,9),t.addMany(s,9,0,9),t.add(127,9,0,9),t.addMany(i(28,32),9,0,9),t.addMany(i(32,48),9,9,12),t.addMany(i(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(s,11,0,11),t.addMany(i(32,128),11,0,11),t.addMany(i(28,32),11,0,11),t.addMany(s,10,0,10),t.add(127,10,0,10),t.addMany(i(28,32),10,0,10),t.addMany(i(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(i(32,48),10,9,12),t.addMany(s,12,0,12),t.add(127,12,0,12),t.addMany(i(28,32),12,0,12),t.addMany(i(32,48),12,9,12),t.addMany(i(48,64),12,0,11),t.addMany(i(64,127),12,12,13),t.addMany(i(64,127),10,12,13),t.addMany(i(64,127),9,12,13),t.addMany(s,13,13,13),t.addMany(n,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(Ss,0,2,0),t.add(Ss,8,5,8),t.add(Ss,6,0,6),t.add(Ss,11,0,11),t.add(Ss,13,13,13),t})(),are=class extends We{constructor(e=ore){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new fz,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(i,n,s)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,n)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(Bt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new nre),this._dcsParser=this._register(new sre),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;r<e.intermediates.length;++r){let o=e.intermediates.charCodeAt(r);if(32>o||o>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");n<<=8,n|=o}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(i[0]>s||s>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return n<<=8,n|=s,n}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(e&255)),e>>=8;return i.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let s=this._escHandlers[n];return s.push(i),{dispose:()=>{let r=s.indexOf(i);r!==-1&&s.splice(r,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let s=this._csiHandlers[n];return s.push(i),{dispose:()=>{let r=s.indexOf(i);r!==-1&&s.splice(r,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,i,n,s,r){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=n,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,i,n){let s=0,r=0,o=0,l;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let c=this._parseStack.handlers,u=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&u>-1){for(;u>=0&&(l=c[u](this._params),l!==!0);u--)if(l instanceof Promise)return this._parseStack.handlerPos=u,l}this._parseStack.handlers=[];break;case 4:if(n===!1&&u>-1){for(;u>=0&&(l=c[u](),l!==!0);u--)if(l instanceof Promise)return this._parseStack.handlerPos=u,l}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],l=this._dcsParser.unhook(s!==24&&s!==26,n),l)return l;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],l=this._oscParser.end(s!==24&&s!==26,n),l)return l;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let c=o;c<i;++c){switch(s=e[c],r=this._transitions.table[this.currentState<<8|(s<160?s:Ss)],r>>4){case 2:for(let O=c+1;;++O){if(O>=i||(s=e[O])<32||s>126&&s<Ss){this._printHandler(e,c,O),c=O-1;break}if(++O>=i||(s=e[O])<32||s>126&&s<Ss){this._printHandler(e,c,O),c=O-1;break}if(++O>=i||(s=e[O])<32||s>126&&s<Ss){this._printHandler(e,c,O),c=O-1;break}if(++O>=i||(s=e[O])<32||s>126&&s<Ss){this._printHandler(e,c,O),c=O-1;break}}break;case 3:this._executeHandlers[s]?this._executeHandlers[s]():this._executeHandlerFb(s),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:c,code:s,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let u=this._csiHandlers[this._collect<<8|s],d=u?u.length-1:-1;for(;d>=0&&(l=u[d](this._params),l!==!0);d--)if(l instanceof Promise)return this._preserveStack(3,u,d,r,c),l;d<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++c<i&&(s=e[c])>47&&s<60);c--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let p=this._escHandlers[this._collect<<8|s],g=p?p.length-1:-1;for(;g>=0&&(l=p[g](),l!==!0);g--)if(l instanceof Promise)return this._preserveStack(4,p,g,r,c),l;g<0&&this._escHandlerFb(this._collect<<8|s),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|s,this._params);break;case 13:for(let O=c+1;;++O)if(O>=i||(s=e[O])===24||s===26||s===27||s>127&&s<Ss){this._dcsParser.put(e,c,O),c=O-1;break}break;case 14:if(l=this._dcsParser.unhook(s!==24&&s!==26),l)return this._preserveStack(6,[],0,r,c),l;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let O=c+1;;O++)if(O>=i||(s=e[O])<32||s>127&&s<Ss){this._oscParser.put(e,c,O),c=O-1;break}break;case 6:if(l=this._oscParser.end(s!==24&&s!==26),l)return this._preserveStack(5,[],0,r,c),l;s===27&&(r|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=r&15}}},lre=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,cre=/^[\da-f]+$/;function CR(t){if(!t)return;let e=t.toLowerCase();if(e.indexOf("rgb:")===0){e=e.slice(4);let i=lre.exec(e);if(i){let n=i[1]?15:i[4]?255:i[7]?4095:65535;return[Math.round(parseInt(i[1]||i[4]||i[7]||i[10],16)/n*255),Math.round(parseInt(i[2]||i[5]||i[8]||i[11],16)/n*255),Math.round(parseInt(i[3]||i[6]||i[9]||i[12],16)/n*255)]}}else if(e.indexOf("#")===0&&(e=e.slice(1),cre.exec(e)&&[3,6,9,12].includes(e.length))){let i=e.length/3,n=[0,0,0];for(let s=0;s<3;++s){let r=parseInt(e.slice(i*s,i*s+i),16);n[s]=i===1?r<<4:i===2?r:i===3?r>>4:r>>8}return n}}function Zy(t,e){let i=t.toString(16),n=i.length<2?"0"+i:i;switch(e){case 4:return i[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function hre(t,e=16){let[i,n,s]=t;return`rgb:${Zy(i,e)}/${Zy(n,e)}/${Zy(s,e)}`}var ure={"(":0,")":1,"*":2,"+":3,"-":1,".":2},ra=131072,kR=10;function TR(t,e){if(t>24)return e.setWinLines||!1;switch(t){case 1:return!!e.restoreWin;case 2:return!!e.minimizeWin;case 3:return!!e.setWinPosition;case 4:return!!e.setWinSizePixels;case 5:return!!e.raiseWin;case 6:return!!e.lowerWin;case 7:return!!e.refreshWin;case 8:return!!e.setWinSizeChars;case 9:return!!e.maximizeWin;case 10:return!!e.fullscreenWin;case 11:return!!e.getWinState;case 13:return!!e.getWinPosition;case 14:return!!e.getWinSizePixels;case 15:return!!e.getScreenSizePixels;case 16:return!!e.getCellSizePixels;case 18:return!!e.getWinSizeChars;case 19:return!!e.getScreenSizeChars;case 20:return!!e.getIconTitle;case 21:return!!e.getWinTitle;case 22:return!!e.pushTitle;case 23:return!!e.popTitle;case 24:return!!e.setWinLines}return!1}var AR=5e3,ER=0,fre=class extends We{constructor(t,e,i,n,s,r,o,l,c=new are){super(),this._bufferService=t,this._charsetService=e,this._coreService=i,this._logService=n,this._optionsService=s,this._oscLinkService=r,this._coreMouseService=o,this._unicodeService=l,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new Pie,this._utf8Decoder=new Rie,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=oi.clone(),this._eraseAttrDataInternal=oi.clone(),this._onRequestBell=this._register(new me),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new me),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new me),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new me),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new me),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new me),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new me),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new me),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new me),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new me),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new me),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new me),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new me),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new kS(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(u=>this._activeBuffer=u.activeBuffer)),this._parser.setCsiHandlerFallback((u,d)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(u),params:d.toArray()})}),this._parser.setEscHandlerFallback(u=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(u)})}),this._parser.setExecuteHandlerFallback(u=>{this._logService.debug("Unknown EXECUTE code: ",{code:u})}),this._parser.setOscHandlerFallback((u,d,p)=>{this._logService.debug("Unknown OSC code: ",{identifier:u,action:d,data:p})}),this._parser.setDcsHandlerFallback((u,d,p)=>{d==="HOOK"&&(p=p.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(u),action:d,payload:p})}),this._parser.setPrintHandler((u,d,p)=>this.print(u,d,p)),this._parser.registerCsiHandler({final:"@"},u=>this.insertChars(u)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},u=>this.scrollLeft(u)),this._parser.registerCsiHandler({final:"A"},u=>this.cursorUp(u)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},u=>this.scrollRight(u)),this._parser.registerCsiHandler({final:"B"},u=>this.cursorDown(u)),this._parser.registerCsiHandler({final:"C"},u=>this.cursorForward(u)),this._parser.registerCsiHandler({final:"D"},u=>this.cursorBackward(u)),this._parser.registerCsiHandler({final:"E"},u=>this.cursorNextLine(u)),this._parser.registerCsiHandler({final:"F"},u=>this.cursorPrecedingLine(u)),this._parser.registerCsiHandler({final:"G"},u=>this.cursorCharAbsolute(u)),this._parser.registerCsiHandler({final:"H"},u=>this.cursorPosition(u)),this._parser.registerCsiHandler({final:"I"},u=>this.cursorForwardTab(u)),this._parser.registerCsiHandler({final:"J"},u=>this.eraseInDisplay(u,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},u=>this.eraseInDisplay(u,!0)),this._parser.registerCsiHandler({final:"K"},u=>this.eraseInLine(u,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},u=>this.eraseInLine(u,!0)),this._parser.registerCsiHandler({final:"L"},u=>this.insertLines(u)),this._parser.registerCsiHandler({final:"M"},u=>this.deleteLines(u)),this._parser.registerCsiHandler({final:"P"},u=>this.deleteChars(u)),this._parser.registerCsiHandler({final:"S"},u=>this.scrollUp(u)),this._parser.registerCsiHandler({final:"T"},u=>this.scrollDown(u)),this._parser.registerCsiHandler({final:"X"},u=>this.eraseChars(u)),this._parser.registerCsiHandler({final:"Z"},u=>this.cursorBackwardTab(u)),this._parser.registerCsiHandler({final:"`"},u=>this.charPosAbsolute(u)),this._parser.registerCsiHandler({final:"a"},u=>this.hPositionRelative(u)),this._parser.registerCsiHandler({final:"b"},u=>this.repeatPrecedingCharacter(u)),this._parser.registerCsiHandler({final:"c"},u=>this.sendDeviceAttributesPrimary(u)),this._parser.registerCsiHandler({prefix:">",final:"c"},u=>this.sendDeviceAttributesSecondary(u)),this._parser.registerCsiHandler({final:"d"},u=>this.linePosAbsolute(u)),this._parser.registerCsiHandler({final:"e"},u=>this.vPositionRelative(u)),this._parser.registerCsiHandler({final:"f"},u=>this.hVPosition(u)),this._parser.registerCsiHandler({final:"g"},u=>this.tabClear(u)),this._parser.registerCsiHandler({final:"h"},u=>this.setMode(u)),this._parser.registerCsiHandler({prefix:"?",final:"h"},u=>this.setModePrivate(u)),this._parser.registerCsiHandler({final:"l"},u=>this.resetMode(u)),this._parser.registerCsiHandler({prefix:"?",final:"l"},u=>this.resetModePrivate(u)),this._parser.registerCsiHandler({final:"m"},u=>this.charAttributes(u)),this._parser.registerCsiHandler({final:"n"},u=>this.deviceStatus(u)),this._parser.registerCsiHandler({prefix:"?",final:"n"},u=>this.deviceStatusPrivate(u)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},u=>this.softReset(u)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},u=>this.setCursorStyle(u)),this._parser.registerCsiHandler({final:"r"},u=>this.setScrollRegion(u)),this._parser.registerCsiHandler({final:"s"},u=>this.saveCursor(u)),this._parser.registerCsiHandler({final:"t"},u=>this.windowOptions(u)),this._parser.registerCsiHandler({final:"u"},u=>this.restoreCursor(u)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},u=>this.insertColumns(u)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},u=>this.deleteColumns(u)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},u=>this.selectProtected(u)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},u=>this.requestMode(u,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},u=>this.requestMode(u,!1)),this._parser.setExecuteHandler(ce.BEL,()=>this.bell()),this._parser.setExecuteHandler(ce.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(ce.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(ce.BS,()=>this.backspace()),this._parser.setExecuteHandler(ce.HT,()=>this.tab()),this._parser.setExecuteHandler(ce.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(ce.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(ig.IND,()=>this.index()),this._parser.setExecuteHandler(ig.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(ig.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Jn(u=>(this.setTitle(u),this.setIconName(u),!0))),this._parser.registerOscHandler(1,new Jn(u=>this.setIconName(u))),this._parser.registerOscHandler(2,new Jn(u=>this.setTitle(u))),this._parser.registerOscHandler(4,new Jn(u=>this.setOrReportIndexedColor(u))),this._parser.registerOscHandler(8,new Jn(u=>this.setHyperlink(u))),this._parser.registerOscHandler(10,new Jn(u=>this.setOrReportFgColor(u))),this._parser.registerOscHandler(11,new Jn(u=>this.setOrReportBgColor(u))),this._parser.registerOscHandler(12,new Jn(u=>this.setOrReportCursorColor(u))),this._parser.registerOscHandler(104,new Jn(u=>this.restoreIndexedColor(u))),this._parser.registerOscHandler(110,new Jn(u=>this.restoreFgColor(u))),this._parser.registerOscHandler(111,new Jn(u=>this.restoreBgColor(u))),this._parser.registerOscHandler(112,new Jn(u=>this.restoreCursorColor(u))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let u in yi)this._parser.registerEscHandler({intermediates:"(",final:u},()=>this.selectCharset("("+u)),this._parser.registerEscHandler({intermediates:")",final:u},()=>this.selectCharset(")"+u)),this._parser.registerEscHandler({intermediates:"*",final:u},()=>this.selectCharset("*"+u)),this._parser.registerEscHandler({intermediates:"+",final:u},()=>this.selectCharset("+"+u)),this._parser.registerEscHandler({intermediates:"-",final:u},()=>this.selectCharset("-"+u)),this._parser.registerEscHandler({intermediates:".",final:u},()=>this.selectCharset("."+u)),this._parser.registerEscHandler({intermediates:"/",final:u},()=>this.selectCharset("/"+u));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(u=>(this._logService.error("Parsing error: ",u),u)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new wR((u,d)=>this.requestStatusString(u,d)))}getAttrData(){return this._curAttrData}_preserveStack(t,e,i,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=t,this._parseStack.cursorStartY=e,this._parseStack.decodedLength=i,this._parseStack.position=n}_logSlowResolvingAsync(t){this._logService.logLevel<=3&&Promise.race([t,new Promise((e,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),AR))]).catch(e=>{if(e!=="#SLOW_TIMEOUT")throw e;console.warn(`async parser handler taking longer than ${AR} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(t,e){let i,n=this._activeBuffer.x,s=this._activeBuffer.y,r=0,o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,e))return this._logSlowResolvingAsync(i),i;n=this._parseStack.cursorStartX,s=this._parseStack.cursorStartY,this._parseStack.paused=!1,t.length>ra&&(r=this._parseStack.position+ra)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof t=="string"?` "${t}"`:` "${Array.prototype.map.call(t,u=>String.fromCharCode(u)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof t=="string"?t.split("").map(u=>u.charCodeAt(0)):t),this._parseBuffer.length<t.length&&this._parseBuffer.length<ra&&(this._parseBuffer=new Uint32Array(Math.min(t.length,ra))),o||this._dirtyRowTracker.clearRange(),t.length>ra)for(let u=r;u<t.length;u+=ra){let d=u+ra<t.length?u+ra:t.length,p=typeof t=="string"?this._stringDecoder.decode(t.substring(u,d),this._parseBuffer):this._utf8Decoder.decode(t.subarray(u,d),this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,p))return this._preserveStack(n,s,p,u),this._logSlowResolvingAsync(i),i}else if(!o){let u=typeof t=="string"?this._stringDecoder.decode(t,this._parseBuffer):this._utf8Decoder.decode(t,this._parseBuffer);if(i=this._parser.parse(this._parseBuffer,u))return this._preserveStack(n,s,u,0),this._logSlowResolvingAsync(i),i}(this._activeBuffer.x!==n||this._activeBuffer.y!==s)&&this._onCursorMove.fire();let l=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(l,this._bufferService.rows-1)})}print(t,e,i){let n,s,r=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,l=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,u=this._coreService.modes.insertMode,d=this._curAttrData,p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&i-e>0&&p.getWidth(this._activeBuffer.x-1)===2&&p.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let g=this._parser.precedingJoinState;for(let O=e;O<i;++O){if(n=t[O],n<127&&r){let w=r[String.fromCharCode(n)];w&&(n=w.charCodeAt(0))}let _=this._unicodeService.charProperties(n,g);s=_l.extractWidth(_);let b=_l.extractShouldJoin(_),x=b?_l.extractWidth(g):0;if(g=_,o&&this._onA11yChar.fire(pa(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+s-x>l){if(c){let w=p,k=this._activeBuffer.x-x;for(this._activeBuffer.x=x,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),p=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),x>0&&p instanceof sf&&p.copyCellsFrom(w,k,0,x,!1);k<l;)w.setCellFromCodepoint(k++,0,1,d)}else if(this._activeBuffer.x=l-1,s===2)continue}if(b&&this._activeBuffer.x){let w=p.getWidth(this._activeBuffer.x-1)?1:2;p.addCodepointToCell(this._activeBuffer.x-w,n,s);for(let k=s-x;--k>=0;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,d);continue}if(u&&(p.insertCells(this._activeBuffer.x,s-x,this._activeBuffer.getNullCell(d)),p.getWidth(l-1)===2&&p.setCellFromCodepoint(l-1,0,1,d)),p.setCellFromCodepoint(this._activeBuffer.x++,n,s,d),s>0)for(;--s;)p.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=g,this._activeBuffer.x<l&&i-e>0&&p.getWidth(this._activeBuffer.x)===0&&!p.hasContent(this._activeBuffer.x)&&p.setCellFromCodepoint(this._activeBuffer.x,0,1,d),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(t,e){return t.final==="t"&&!t.prefix&&!t.intermediates?this._parser.registerCsiHandler(t,i=>TR(i.params[0],this._optionsService.rawOptions.windowOptions)?e(i):!0):this._parser.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._parser.registerDcsHandler(t,new wR(e))}registerEscHandler(t,e){return this._parser.registerEscHandler(t,e)}registerOscHandler(t,e){return this._parser.registerOscHandler(t,new Jn(e))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var t;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&((t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&t.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-t),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(t=this._bufferService.cols-1){this._activeBuffer.x=Math.min(t,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(t,e){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=t,this._activeBuffer.y=this._activeBuffer.scrollTop+e):(this._activeBuffer.x=t,this._activeBuffer.y=e),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(t,e){this._restrictCursor(),this._setCursor(this._activeBuffer.x+t,this._activeBuffer.y+e)}cursorUp(t){let e=this._activeBuffer.y-this._activeBuffer.scrollTop;return e>=0?this._moveCursor(0,-Math.min(e,t.params[0]||1)):this._moveCursor(0,-(t.params[0]||1)),!0}cursorDown(t){let e=this._activeBuffer.scrollBottom-this._activeBuffer.y;return e>=0?this._moveCursor(0,Math.min(e,t.params[0]||1)):this._moveCursor(0,t.params[0]||1),!0}cursorForward(t){return this._moveCursor(t.params[0]||1,0),!0}cursorBackward(t){return this._moveCursor(-(t.params[0]||1),0),!0}cursorNextLine(t){return this.cursorDown(t),this._activeBuffer.x=0,!0}cursorPrecedingLine(t){return this.cursorUp(t),this._activeBuffer.x=0,!0}cursorCharAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(t){return this._setCursor(t.length>=2?(t.params[1]||1)-1:0,(t.params[0]||1)-1),!0}charPosAbsolute(t){return this._setCursor((t.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(t){return this._moveCursor(t.params[0]||1,0),!0}linePosAbsolute(t){return this._setCursor(this._activeBuffer.x,(t.params[0]||1)-1),!0}vPositionRelative(t){return this._moveCursor(0,t.params[0]||1),!0}hVPosition(t){return this.cursorPosition(t),!0}tabClear(t){let e=t.params[0];return e===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:e===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(t){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=t.params[0]||1;for(;e--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(t){let e=t.params[0];return e===1&&(this._curAttrData.bg|=536870912),(e===2||e===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(t,e,i,n=!1,s=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);r.replaceCells(e,i,this._activeBuffer.getNullCell(this._eraseAttrData()),s),n&&(r.isWrapped=!1)}_resetBufferLine(t,e=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+t);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),e),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+t),i.isWrapped=!1)}eraseInDisplay(t,e=!1){var n;this._restrictCursor(this._bufferService.cols);let i;switch(t.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);i<this._bufferService.rows;i++)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(i);break;case 1:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i,0,this._activeBuffer.x+1,!0,e),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i))!=null&&n.getTrimmedLength()););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,e);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(t,e=!1){switch(this._restrictCursor(this._bufferService.cols),t.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,e);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,e);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,e);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,s=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;e--;)this._activeBuffer.lines.splice(s-1,1),this._activeBuffer.lines.splice(i,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(t){this._restrictCursor();let e=t.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let i=this._activeBuffer.ybase+this._activeBuffer.y,n;for(n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,n=this._bufferService.rows-1+this._activeBuffer.ybase-n;e--;)this._activeBuffer.lines.splice(i,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.insertCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.deleteCells(this._activeBuffer.x,t.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(t){let e=t.params[0]||1;for(;e--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(t){let e=t.params[0]||1;for(;e--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(oi));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(0,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.insertCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(t){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let e=t.params[0]||1;for(let i=this._activeBuffer.scrollTop;i<=this._activeBuffer.scrollBottom;++i){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+i);n.deleteCells(this._activeBuffer.x,e,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(t){this._restrictCursor();let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return e&&(e.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(t.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(t){let e=this._parser.precedingJoinState;if(!e)return!0;let i=t.params[0]||1,n=_l.extractWidth(e),s=this._activeBuffer.x-n,r=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(s),o=new Uint32Array(r.length*i),l=0;for(let u=0;u<r.length;){let d=r.codePointAt(u)||0;o[l++]=d,u+=d>65535?2:1}let c=l;for(let u=1;u<i;++u)o.copyWithin(c,0,l),c+=l;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(t){return t.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(ce.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(ce.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(t){return t.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(ce.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(ce.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(t.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(ce.ESC+"[>83;40003;0c")),!0}_is(t){return(this._optionsService.rawOptions.termName+"").indexOf(t)===0}setMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,cl),this._charsetService.setgCharset(1,cl),this._charsetService.setgCharset(2,cl),this._charsetService.setgCharset(3,cl);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0;break}return!0}resetMode(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(t){for(let e=0;e<t.length;e++)switch(t.params[e]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),t.params[e]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0);break}return!0}requestMode(t,e){(b=>(b[b.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",b[b.SET=1]="SET",b[b.RESET=2]="RESET",b[b.PERMANENTLY_SET=3]="PERMANENTLY_SET",b[b.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(i={}));let n=this._coreService.decPrivateModes,{activeProtocol:s,activeEncoding:r}=this._coreMouseService,o=this._coreService,{buffers:l,cols:c}=this._bufferService,{active:u,alt:d}=l,p=this._optionsService.rawOptions,g=(b,x)=>(o.triggerDataEvent(`${ce.ESC}[${e?"":"?"}${b};${x}$y`),!0),O=b=>b?1:2,_=t.params[0];return e?_===2?g(_,4):_===4?g(_,O(o.modes.insertMode)):_===12?g(_,3):_===20?g(_,O(p.convertEol)):g(_,0):_===1?g(_,O(n.applicationCursorKeys)):_===3?g(_,p.windowOptions.setWinLines?c===80?2:c===132?1:0:0):_===6?g(_,O(n.origin)):_===7?g(_,O(n.wraparound)):_===8?g(_,3):_===9?g(_,O(s==="X10")):_===12?g(_,O(p.cursorBlink)):_===25?g(_,O(!o.isCursorHidden)):_===45?g(_,O(n.reverseWraparound)):_===66?g(_,O(n.applicationKeypad)):_===67?g(_,4):_===1e3?g(_,O(s==="VT200")):_===1002?g(_,O(s==="DRAG")):_===1003?g(_,O(s==="ANY")):_===1004?g(_,O(n.sendFocus)):_===1005?g(_,4):_===1006?g(_,O(r==="SGR")):_===1015?g(_,4):_===1016?g(_,O(r==="SGR_PIXELS")):_===1048?g(_,1):_===47||_===1047||_===1049?g(_,O(u===d)):_===2004?g(_,O(n.bracketedPasteMode)):_===2026?g(_,O(n.synchronizedOutput)):g(_,0)}_updateAttrColor(t,e,i,n,s){return e===2?(t|=50331648,t&=-16777216,t|=bd.fromColorRGB([i,n,s])):e===5&&(t&=-50331904,t|=33554432|i&255),t}_extractColor(t,e,i){let n=[0,0,-1,0,0,0],s=0,r=0;do{if(n[r+s]=t.params[e+r],t.hasSubParams(e+r)){let o=t.getSubParams(e+r),l=0;do n[1]===5&&(s=1),n[r+l+1+s]=o[l];while(++l<o.length&&l+r+1+s<n.length);break}if(n[1]===5&&r+s>=2||n[1]===2&&r+s>=5)break;n[1]&&(s=1)}while(++r+e<t.length&&r+s<n.length);for(let o=2;o<n.length;++o)n[o]===-1&&(n[o]=0);switch(n[0]){case 38:i.fg=this._updateAttrColor(i.fg,n[1],n[3],n[4],n[5]);break;case 48:i.bg=this._updateAttrColor(i.bg,n[1],n[3],n[4],n[5]);break;case 58:i.extended=i.extended.clone(),i.extended.underlineColor=this._updateAttrColor(i.extended.underlineColor,n[1],n[3],n[4],n[5])}return r}_processUnderline(t,e){e.extended=e.extended.clone(),(!~t||t>5)&&(t=1),e.extended.underlineStyle=t,e.fg|=268435456,t===0&&(e.fg&=-268435457),e.updateExtended()}_processSGR0(t){t.fg=oi.fg,t.bg=oi.bg,t.extended=t.extended.clone(),t.extended.underlineStyle=0,t.extended.underlineColor&=-67108864,t.updateExtended()}charAttributes(t){if(t.length===1&&t.params[0]===0)return this._processSGR0(this._curAttrData),!0;let e=t.length,i,n=this._curAttrData;for(let s=0;s<e;s++)i=t.params[s],i>=30&&i<=37?(n.fg&=-50331904,n.fg|=16777216|i-30):i>=40&&i<=47?(n.bg&=-50331904,n.bg|=16777216|i-40):i>=90&&i<=97?(n.fg&=-50331904,n.fg|=16777216|i-90|8):i>=100&&i<=107?(n.bg&=-50331904,n.bg|=16777216|i-100|8):i===0?this._processSGR0(n):i===1?n.fg|=134217728:i===3?n.bg|=67108864:i===4?(n.fg|=268435456,this._processUnderline(t.hasSubParams(s)?t.getSubParams(s)[0]:1,n)):i===5?n.fg|=536870912:i===7?n.fg|=67108864:i===8?n.fg|=1073741824:i===9?n.fg|=2147483648:i===2?n.bg|=134217728:i===21?this._processUnderline(2,n):i===22?(n.fg&=-134217729,n.bg&=-134217729):i===23?n.bg&=-67108865:i===24?(n.fg&=-268435457,this._processUnderline(0,n)):i===25?n.fg&=-536870913:i===27?n.fg&=-67108865:i===28?n.fg&=-1073741825:i===29?n.fg&=2147483647:i===39?(n.fg&=-67108864,n.fg|=oi.fg&16777215):i===49?(n.bg&=-67108864,n.bg|=oi.bg&16777215):i===38||i===48||i===58?s+=this._extractColor(t,s,n):i===53?n.bg|=1073741824:i===55?n.bg&=-1073741825:i===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):i===100?(n.fg&=-67108864,n.fg|=oi.fg&16777215,n.bg&=-67108864,n.bg|=oi.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(t){switch(t.params[0]){case 5:this._coreService.triggerDataEvent(`${ce.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[${e};${i}R`);break}return!0}deviceStatusPrivate(t){switch(t.params[0]){case 6:let e=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${ce.ESC}[?${e};${i}R`);break}return!0}softReset(t){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=oi.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(t){let e=t.length===0?1:t.params[0];if(e===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(e){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=e%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(t){let e=t.params[0]||1,i;return(t.length<2||(i=t.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>e&&(this._activeBuffer.scrollTop=e-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(t){if(!TR(t.params[0],this._optionsService.rawOptions.windowOptions))return!0;let e=t.length>1?t.params[1]:0;switch(t.params[0]){case 14:e!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${ce.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(e===0||e===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>kR&&this._windowTitleStack.shift()),(e===0||e===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>kR&&this._iconNameStack.shift());break;case 23:(e===0||e===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(e===0||e===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(t){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(t){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(t){return this._windowTitle=t,this._onTitleChange.fire(t),!0}setIconName(t){return this._iconName=t,!0}setOrReportIndexedColor(t){let e=[],i=t.split(";");for(;i.length>1;){let n=i.shift(),s=i.shift();if(/^\d+$/.exec(n)){let r=parseInt(n);if(MR(r))if(s==="?")e.push({type:0,index:r});else{let o=CR(s);o&&e.push({type:1,index:r,color:o})}}}return e.length&&this._onColor.fire(e),!0}setHyperlink(t){let e=t.indexOf(";");if(e===-1)return!0;let i=t.slice(0,e).trim(),n=t.slice(e+1);return n?this._createHyperlink(i,n):i.trim()?!1:this._finishHyperlink()}_createHyperlink(t,e){this._getCurrentLinkId()&&this._finishHyperlink();let i=t.split(":"),n,s=i.findIndex(r=>r.startsWith("id="));return s!==-1&&(n=i[s].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:e}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(t,e){let i=t.split(";");for(let n=0;n<i.length&&!(e>=this._specialColors.length);++n,++e)if(i[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[e]}]);else{let s=CR(i[n]);s&&this._onColor.fire([{type:1,index:this._specialColors[e],color:s}])}return!0}setOrReportFgColor(t){return this._setOrReportSpecialColor(t,0)}setOrReportBgColor(t){return this._setOrReportSpecialColor(t,1)}setOrReportCursorColor(t){return this._setOrReportSpecialColor(t,2)}restoreIndexedColor(t){if(!t)return this._onColor.fire([{type:2}]),!0;let e=[],i=t.split(";");for(let n=0;n<i.length;++n)if(/^\d+$/.exec(i[n])){let s=parseInt(i[n]);MR(s)&&e.push({type:2,index:s})}return e.length&&this._onColor.fire(e),!0}restoreFgColor(t){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(t){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(t){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,cl),!0}selectCharset(t){return t.length!==2?(this.selectDefaultCharset(),!0):(t[0]==="/"||this._charsetService.setgCharset(ure[t[0]],yi[t[1]]||cl),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let t=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,t,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=oi.clone(),this._eraseAttrDataInternal=oi.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(t){return this._charsetService.setgLevel(t),!0}screenAlignmentPattern(){let t=new Rs;t.content=1<<22|69,t.fg=this._curAttrData.fg,t.bg=this._curAttrData.bg,this._setCursor(0,0);for(let e=0;e<this._bufferService.rows;++e){let i=this._activeBuffer.ybase+this._activeBuffer.y+e,n=this._activeBuffer.lines.get(i);n&&(n.fill(t),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(t,e){let i=o=>(this._coreService.triggerDataEvent(`${ce.ESC}${o}${ce.ESC}\\`),!0),n=this._bufferService.buffer,s=this._optionsService.rawOptions;return i(t==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:t==='"p'?'P1$r61;1"p':t==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:t==="m"?"P1$r0m":t===" q"?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(t,e){this._dirtyRowTracker.markRangeDirty(t,e)}},kS=class{constructor(t){this._bufferService=t,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(t){t<this.start?this.start=t:t>this.end&&(this.end=t)}markRangeDirty(t,e){t>e&&(ER=t,t=e,e=ER),t<this.start&&(this.start=t),e>this.end&&(this.end=e)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};kS=Ut([be(0,yn)],kS);function MR(t){return 0<=t&&t<256}var dre=5e7,PR=12,pre=50,mre=class extends We{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new me),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,i){if(i!==void 0&&this._syncCalls>i){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,i){if(this._pendingData>dre)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(i)}_innerWrite(e=0,i=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],r=this._action(s,i);if(r){let l=c=>performance.now()-n>=PR?setTimeout(()=>this._innerWrite(0,c)):this._innerWrite(n,c);r.catch(c=>(queueMicrotask(()=>{throw c}),Promise.resolve(!1))).then(l);return}let o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-n>=PR)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>pre&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},TS=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let i=this._bufferService.buffer;if(e.id===void 0){let c=i.addMarker(i.ybase+i.y),u={data:e,id:this._nextId++,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(u,c)),this._dataByLinkId.set(u.id,u),u.id}let n=e,s=this._getEntryIdKey(n),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,i.ybase+i.y),r.id;let o=i.addMarker(i.ybase+i.y),l={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[o]};return o.onDispose(()=>this._removeMarkerFromLink(l,o)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(e,i){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(s=>s.line!==i)){let s=this._bufferService.buffer.addMarker(i);n.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(n,s))}}getLinkData(e){var i;return(i=this._dataByLinkId.get(e))==null?void 0:i.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,i){let n=e.lines.indexOf(i);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};TS=Ut([be(0,yn)],TS);var RR=!1,gre=class extends We{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new mh),this._onBinary=this._register(new me),this.onBinary=this._onBinary.event,this._onData=this._register(new me),this.onData=this._onData.event,this._onLineFeed=this._register(new me),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new me),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new me),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new me),this._instantiationService=new jse,this.optionsService=this._register(new Fse(e)),this._instantiationService.setService(bn,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(SS)),this._instantiationService.setService(yn,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(bS)),this._instantiationService.setService(P6,this._logService),this.coreService=this._register(this._instantiationService.createInstance(xS)),this._instantiationService.setService($l,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(wS)),this._instantiationService.setService(M6,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(_l)),this._instantiationService.setService(Bie,this.unicodeService),this._charsetService=this._instantiationService.createInstance(tre),this._instantiationService.setService(Die,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(TS),this._instantiationService.setService(R6,this._oscLinkService),this._inputHandler=this._register(new fre(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Gi.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Gi.forward(this._bufferService.onResize,this._onResize)),this._register(Gi.forward(this.coreService.onData,this._onData)),this._register(Gi.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new mre((i,n)=>this._inputHandler.parse(i,n))),this._register(Gi.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new me),this._onScroll.event(e=>{var i;(i=this._onScrollApi)==null||i.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let i in e)this.optionsService.options[i]=e[i]}write(e,i){this._writeBuffer.write(e,i)}writeSync(e,i){this._logService.logLevel<=3&&!RR&&(this._logService.warn("writeSync is unreliable and will be removed soon."),RR=!0),this._writeBuffer.writeSync(e,i)}input(e,i=!0){this.coreService.triggerDataEvent(e,i)}resize(e,i){isNaN(e)||isNaN(i)||(e=Math.max(e,hz),i=Math.max(i,uz),this._bufferService.resize(e,i))}scroll(e,i=!1){this._bufferService.scroll(e,i)}scrollLines(e,i){this._bufferService.scrollLines(e,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}registerEscHandler(e,i){return this._inputHandler.registerEscHandler(e,i)}registerDcsHandler(e,i){return this._inputHandler.registerDcsHandler(e,i)}registerCsiHandler(e,i){return this._inputHandler.registerCsiHandler(e,i)}registerOscHandler(e,i){return this._inputHandler.registerOscHandler(e,i)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,i=this.optionsService.rawOptions.windowsPty;i&&i.buildNumber!==void 0&&i.buildNumber!==void 0?e=i.backend==="conpty"&&i.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(xR.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(xR(this._bufferService),!1))),this._windowsWrappingHeuristics.value=Bt(()=>{for(let i of e)i.dispose()})}}},Ore={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function vre(t,e,i,n){var o;let s={type:0,cancel:!1,key:void 0},r=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:t.key==="UIKeyInputUpArrow"?e?s.key=ce.ESC+"OA":s.key=ce.ESC+"[A":t.key==="UIKeyInputLeftArrow"?e?s.key=ce.ESC+"OD":s.key=ce.ESC+"[D":t.key==="UIKeyInputRightArrow"?e?s.key=ce.ESC+"OC":s.key=ce.ESC+"[C":t.key==="UIKeyInputDownArrow"&&(e?s.key=ce.ESC+"OB":s.key=ce.ESC+"[B");break;case 8:s.key=t.ctrlKey?"\b":ce.DEL,t.altKey&&(s.key=ce.ESC+s.key);break;case 9:if(t.shiftKey){s.key=ce.ESC+"[Z";break}s.key=ce.HT,s.cancel=!0;break;case 13:s.key=t.altKey?ce.ESC+ce.CR:ce.CR,s.cancel=!0;break;case 27:s.key=ce.ESC,t.altKey&&(s.key=ce.ESC+ce.ESC),s.cancel=!0;break;case 37:if(t.metaKey)break;r?s.key=ce.ESC+"[1;"+(r+1)+"D":e?s.key=ce.ESC+"OD":s.key=ce.ESC+"[D";break;case 39:if(t.metaKey)break;r?s.key=ce.ESC+"[1;"+(r+1)+"C":e?s.key=ce.ESC+"OC":s.key=ce.ESC+"[C";break;case 38:if(t.metaKey)break;r?s.key=ce.ESC+"[1;"+(r+1)+"A":e?s.key=ce.ESC+"OA":s.key=ce.ESC+"[A";break;case 40:if(t.metaKey)break;r?s.key=ce.ESC+"[1;"+(r+1)+"B":e?s.key=ce.ESC+"OB":s.key=ce.ESC+"[B";break;case 45:!t.shiftKey&&!t.ctrlKey&&(s.key=ce.ESC+"[2~");break;case 46:r?s.key=ce.ESC+"[3;"+(r+1)+"~":s.key=ce.ESC+"[3~";break;case 36:r?s.key=ce.ESC+"[1;"+(r+1)+"H":e?s.key=ce.ESC+"OH":s.key=ce.ESC+"[H";break;case 35:r?s.key=ce.ESC+"[1;"+(r+1)+"F":e?s.key=ce.ESC+"OF":s.key=ce.ESC+"[F";break;case 33:t.shiftKey?s.type=2:t.ctrlKey?s.key=ce.ESC+"[5;"+(r+1)+"~":s.key=ce.ESC+"[5~";break;case 34:t.shiftKey?s.type=3:t.ctrlKey?s.key=ce.ESC+"[6;"+(r+1)+"~":s.key=ce.ESC+"[6~";break;case 112:r?s.key=ce.ESC+"[1;"+(r+1)+"P":s.key=ce.ESC+"OP";break;case 113:r?s.key=ce.ESC+"[1;"+(r+1)+"Q":s.key=ce.ESC+"OQ";break;case 114:r?s.key=ce.ESC+"[1;"+(r+1)+"R":s.key=ce.ESC+"OR";break;case 115:r?s.key=ce.ESC+"[1;"+(r+1)+"S":s.key=ce.ESC+"OS";break;case 116:r?s.key=ce.ESC+"[15;"+(r+1)+"~":s.key=ce.ESC+"[15~";break;case 117:r?s.key=ce.ESC+"[17;"+(r+1)+"~":s.key=ce.ESC+"[17~";break;case 118:r?s.key=ce.ESC+"[18;"+(r+1)+"~":s.key=ce.ESC+"[18~";break;case 119:r?s.key=ce.ESC+"[19;"+(r+1)+"~":s.key=ce.ESC+"[19~";break;case 120:r?s.key=ce.ESC+"[20;"+(r+1)+"~":s.key=ce.ESC+"[20~";break;case 121:r?s.key=ce.ESC+"[21;"+(r+1)+"~":s.key=ce.ESC+"[21~";break;case 122:r?s.key=ce.ESC+"[23;"+(r+1)+"~":s.key=ce.ESC+"[23~";break;case 123:r?s.key=ce.ESC+"[24;"+(r+1)+"~":s.key=ce.ESC+"[24~";break;default:if(t.ctrlKey&&!t.shiftKey&&!t.altKey&&!t.metaKey)t.keyCode>=65&&t.keyCode<=90?s.key=String.fromCharCode(t.keyCode-64):t.keyCode===32?s.key=ce.NUL:t.keyCode>=51&&t.keyCode<=55?s.key=String.fromCharCode(t.keyCode-51+27):t.keyCode===56?s.key=ce.DEL:t.keyCode===219?s.key=ce.ESC:t.keyCode===220?s.key=ce.FS:t.keyCode===221&&(s.key=ce.GS);else if((!i||n)&&t.altKey&&!t.metaKey){let l=(o=Ore[t.keyCode])==null?void 0:o[t.shiftKey?1:0];if(l)s.key=ce.ESC+l;else if(t.keyCode>=65&&t.keyCode<=90){let c=t.ctrlKey?t.keyCode-64:t.keyCode+32,u=String.fromCharCode(c);t.shiftKey&&(u=u.toUpperCase()),s.key=ce.ESC+u}else if(t.keyCode===32)s.key=ce.ESC+(t.ctrlKey?ce.NUL:" ");else if(t.key==="Dead"&&t.code.startsWith("Key")){let c=t.code.slice(3,4);t.shiftKey||(c=c.toLowerCase()),s.key=ce.ESC+c,s.cancel=!0}}else i&&!t.altKey&&!t.ctrlKey&&!t.shiftKey&&t.metaKey?t.keyCode===65&&(s.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&t.keyCode>=48&&t.key.length===1?s.key=t.key:t.key&&t.ctrlKey&&(t.key==="_"&&(s.key=ce.US),t.key==="@"&&(s.key=ce.NUL));break}return s}var Gt=0,_re=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new tO,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new tO,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((r,o)=>this._getKey(r)-this._getKey(o)),i=0,n=0,s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r<s.length;r++)n>=this._array.length||this._getKey(e[i])<=this._getKey(this._array[n])?(s[r]=e[i],i++):s[r]=this._array[n++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let i=this._getKey(e);if(i===void 0||(Gt=this._search(i),Gt===-1)||this._getKey(this._array[Gt])!==i)return!1;do if(this._array[Gt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(Gt),!0;while(++Gt<this._array.length&&this._getKey(this._array[Gt])===i);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((r,o)=>r-o),i=0,n=new Array(this._array.length-e.length),s=0;for(let r=0;r<this._array.length;r++)e[i]===r?i++:n[s++]=this._array[r];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Gt=this._search(e),!(Gt<0||Gt>=this._array.length)&&this._getKey(this._array[Gt])===e))do yield this._array[Gt];while(++Gt<this._array.length&&this._getKey(this._array[Gt])===e)}forEachByKey(e,i){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(Gt=this._search(e),!(Gt<0||Gt>=this._array.length)&&this._getKey(this._array[Gt])===e))do i(this._array[Gt]);while(++Gt<this._array.length&&this._getKey(this._array[Gt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let i=0,n=this._array.length-1;for(;n>=i;){let s=i+n>>1,r=this._getKey(this._array[s]);if(r>e)n=s-1;else if(r<e)i=s+1;else{for(;s>0&&this._getKey(this._array[s-1])===e;)s--;return s}}return i}},qy=0,QR=0,yre=class extends We{constructor(){super(),this._decorations=new _re(t=>t==null?void 0:t.marker.line),this._onDecorationRegistered=this._register(new me),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new me),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(Bt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(t){if(t.marker.isDisposed)return;let e=new bre(t);if(e){let i=e.marker.onDispose(()=>e.dispose()),n=e.onDispose(()=>{n.dispose(),e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),i.dispose())});this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(let t of this._decorations.values())t.dispose();this._decorations.clear()}*getDecorationsAtCell(t,e,i){let n=0,s=0;for(let r of this._decorations.getKeyIterator(e))n=r.options.x??0,s=n+(r.options.width??1),t>=n&&t<s&&(!i||(r.options.layer??"bottom")===i)&&(yield r)}forEachDecorationAtCell(t,e,i,n){this._decorations.forEachByKey(e,s=>{qy=s.options.x??0,QR=qy+(s.options.width??1),t>=qy&&t<QR&&(!i||(s.options.layer??"bottom")===i)&&n(s)})}},bre=class extends ya{constructor(t){super(),this.options=t,this.onRenderEmitter=this.add(new me),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new me),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=t.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=zt.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=zt.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},Sre=1e3,xre=class{constructor(e,i=Sre){this._renderCallback=e,this._debounceThresholdMS=i,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,i,n){this._rowCount=n,e=e!==void 0?e:0,i=i!==void 0?i:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,i):i;let s=performance.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=s-this._lastRefreshMs,o=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},o)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),i=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,i)}},LR=20,iO=class extends We{constructor(t,e,i,n){super(),this._terminal=t,this._coreBrowserService=i,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let s=this._coreBrowserService.mainDocument;this._accessibilityContainer=s.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=s.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let r=0;r<this._terminal.rows;r++)this._rowElements[r]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[r]);if(this._topBoundaryFocusListener=r=>this._handleBoundaryFocus(r,0),this._bottomBoundaryFocusListener=r=>this._handleBoundaryFocus(r,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=s.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new xre(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(r=>this._handleResize(r.rows))),this._register(this._terminal.onRender(r=>this._refreshRows(r.start,r.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(r=>this._handleChar(r))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
117
+ `))),this._register(this._terminal.onA11yTab(r=>this._handleTab(r))),this._register(this._terminal.onKey(r=>this._handleKey(r.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Be(s,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(Bt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(t){for(let e=0;e<t;e++)this._handleChar(" ")}_handleChar(t){this._liveRegionLineCount<LR+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===`
118
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===LR+1&&(this._liveRegion.textContent+=Ub.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(t){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(t)||this._charsToConsume.push(t)}_refreshRows(t,e){this._liveRegionDebouncer.refresh(t,e,this._terminal.rows)}_renderRows(t,e){let i=this._terminal.buffer,n=i.lines.length.toString();for(let s=t;s<=e;s++){let r=i.lines.get(i.ydisp+s),o=[],l=(r==null?void 0:r.translateToString(!0,void 0,void 0,o))||"",c=(i.ydisp+s+1).toString(),u=this._rowElements[s];u&&(l.length===0?(u.textContent=" ",this._rowColumns.set(u,[0,1])):(u.textContent=l,this._rowColumns.set(u,o)),u.setAttribute("aria-posinset",c),u.setAttribute("aria-setsize",n),this._alignRowWidth(u))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(t,e){let i=t.target,n=this._rowElements[e===0?1:this._rowElements.length-2],s=i.getAttribute("aria-posinset"),r=e===0?"1":`${this._terminal.buffer.lines.length}`;if(s===r||t.relatedTarget!==n)return;let o,l;if(e===0?(o=i,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(o=this._rowElements.shift(),l=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),e===0){let c=this._createAccessibilityTreeNode();this._rowElements.unshift(c),this._rowContainer.insertAdjacentElement("afterbegin",c)}else{let c=this._createAccessibilityTreeNode();this._rowElements.push(c),this._rowContainer.appendChild(c)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(e===0?-1:1),this._rowElements[e===0?1:this._rowElements.length-2].focus(),t.preventDefault(),t.stopImmediatePropagation()}_handleSelectionChange(){var l;if(this._rowElements.length===0)return;let t=this._coreBrowserService.mainDocument.getSelection();if(!t)return;if(t.isCollapsed){this._rowContainer.contains(t.anchorNode)&&this._terminal.clearSelection();return}if(!t.anchorNode||!t.focusNode){console.error("anchorNode and/or focusNode are null");return}let e={node:t.anchorNode,offset:t.anchorOffset},i={node:t.focusNode,offset:t.focusOffset};if((e.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||e.node===i.node&&e.offset>i.offset)&&([e,i]=[i,e]),e.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(e={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(e.node))return;let n=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:n,offset:((l=n.textContent)==null?void 0:l.length)??0}),!this._rowContainer.contains(i.node))return;let s=({node:c,offset:u})=>{let d=c instanceof Text?c.parentNode:c,p=parseInt(d==null?void 0:d.getAttribute("aria-posinset"),10)-1;if(isNaN(p))return console.warn("row is invalid. Race condition?"),null;let g=this._rowColumns.get(d);if(!g)return console.warn("columns is null. Race condition?"),null;let O=u<g.length?g[u]:g.slice(-1)[0]+1;return O>=this._terminal.cols&&(++p,O=0),{row:p,column:O}},r=s(e),o=s(i);if(!(!r||!o)){if(r.row>o.row||r.row===o.row&&r.column>=o.column)throw new Error("invalid range");this._terminal.select(r.column,r.row,(o.row-r.row)*this._terminal.cols-r.column+o.column)}}_handleResize(t){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let t=this._coreBrowserService.mainDocument.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let t=0;t<this._terminal.rows;t++)this._refreshRowDimensions(this._rowElements[t]),this._alignRowWidth(this._rowElements[t])}}_refreshRowDimensions(t){t.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(t){var s,r;t.style.transform="";let e=t.getBoundingClientRect().width,i=(r=(s=this._rowColumns.get(t))==null?void 0:s.slice(-1))==null?void 0:r[0];if(!i)return;let n=i*this._renderService.dimensions.css.cell.width;t.style.transform=`scaleX(${n/e})`}};iO=Ut([be(1,Ew),be(2,xo),be(3,wo)],iO);var AS=class extends We{constructor(t,e,i,n,s){super(),this._element=t,this._mouseService=e,this._renderService=i,this._bufferService=n,this._linkProviderService=s,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new me),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new me),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(Bt(()=>{var r;Ml(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(r=this._activeProviderReplies)==null||r.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Be(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Be(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Be(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Be(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(t){this._lastMouseEvent=t;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!e)return;this._isMouseOut=!1;let i=t.composedPath();for(let n=0;n<i.length;n++){let s=i[n];if(s.classList.contains("xterm"))break;if(s.classList.contains("xterm-hover"))return}(!this._lastBufferCell||e.x!==this._lastBufferCell.x||e.y!==this._lastBufferCell.y)&&(this._handleHover(e),this._lastBufferCell=e)}_handleHover(t){if(this._activeLine!==t.y||this._wasResized){this._clearCurrentLink(),this._askForLink(t,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))}_askForLink(t,e){var n,s;(!this._activeProviderReplies||!e)&&((n=this._activeProviderReplies)==null||n.forEach(r=>{r==null||r.forEach(o=>{o.link.dispose&&o.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let i=!1;for(let[r,o]of this._linkProviderService.linkProviders.entries())e?(s=this._activeProviderReplies)!=null&&s.get(r)&&(i=this._checkLinkProviderResult(r,t,i)):o.provideLinks(t.y,l=>{var u,d;if(this._isMouseOut)return;let c=l==null?void 0:l.map(p=>({link:p}));(u=this._activeProviderReplies)==null||u.set(r,c),i=this._checkLinkProviderResult(r,t,i),((d=this._activeProviderReplies)==null?void 0:d.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,e){let i=new Set;for(let n=0;n<e.size;n++){let s=e.get(n);if(s)for(let r=0;r<s.length;r++){let o=s[r],l=o.link.range.start.y<t?0:o.link.range.start.x,c=o.link.range.end.y>t?this._bufferService.cols:o.link.range.end.x;for(let u=l;u<=c;u++){if(i.has(u)){s.splice(r--,1);break}i.add(u)}}}}_checkLinkProviderResult(t,e,i){var r;if(!this._activeProviderReplies)return i;let n=this._activeProviderReplies.get(t),s=!1;for(let o=0;o<t;o++)(!this._activeProviderReplies.has(o)||this._activeProviderReplies.get(o))&&(s=!0);if(!s&&n){let o=n.find(l=>this._linkAtPosition(l.link,e));o&&(i=!0,this._handleNewLink(o))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let o=0;o<this._activeProviderReplies.size;o++){let l=(r=this._activeProviderReplies.get(o))==null?void 0:r.find(c=>this._linkAtPosition(c.link,e));if(l){i=!0,this._handleNewLink(l);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._currentLink)return;let e=this._positionFromMouseEvent(t,this._element,this._mouseService);e&&this._mouseDownLink&&wre(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,e)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,e){!this._currentLink||!this._lastMouseEvent||(!t||!e||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=e)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Ml(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(t){if(!this._lastMouseEvent)return;let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._linkAtPosition(t.link,e)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0?!0:t.link.decorations.underline,pointerCursor:t.link.decorations===void 0?!0:t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>{var i,n;return(n=(i=this._currentLink)==null?void 0:i.state)==null?void 0:n.decorations.pointerCursor},set:i=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>{var i,n;return(n=(i=this._currentLink)==null?void 0:i.state)==null?void 0:n.decorations.underline},set:i=>{var n,s,r;(n=this._currentLink)!=null&&n.state&&((r=(s=this._currentLink)==null?void 0:s.state)==null?void 0:r.decorations.underline)!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let n=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=s&&(this._clearCurrentLink(n,s),this._lastMouseEvent)){let r=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);r&&this._askForLink(r,!1)}})))}_linkHover(t,e,i){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),e.hover&&e.hover(i,e.text)}_fireUnderlineEvent(t,e){let i=t.range,n=this._bufferService.buffer.ydisp,s=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-n-1,i.end.x,i.end.y-n-1,void 0);(e?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(s)}_linkLeave(t,e,i){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(e,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),e.leave&&e.leave(i,e.text)}_linkAtPosition(t,e){let i=t.range.start.y*this._bufferService.cols+t.range.start.x,n=t.range.end.y*this._bufferService.cols+t.range.end.x,s=e.y*this._bufferService.cols+e.x;return i<=s&&s<=n}_positionFromMouseEvent(t,e,i){let n=i.getCoords(t,e,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,e,i,n,s){return{x1:t,y1:e,x2:i,y2:n,cols:this._bufferService.cols,fg:s}}};AS=Ut([be(1,Mw),be(2,wo),be(3,yn),be(4,L6)],AS);function wre(t,e){return t.text===e.text&&t.range.start.x===e.range.start.x&&t.range.start.y===e.range.start.y&&t.range.end.x===e.range.end.x&&t.range.end.y===e.range.end.y}var Cre=class extends gre{constructor(e={}){super(e),this._linkifier=this._register(new mh),this.browser=J6,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new mh),this._onCursorMove=this._register(new me),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new me),this.onKey=this._onKey.event,this._onRender=this._register(new me),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new me),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new me),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new me),this.onBell=this._onBell.event,this._onFocus=this._register(new me),this._onBlur=this._register(new me),this._onA11yCharEmitter=this._register(new me),this._onA11yTabEmitter=this._register(new me),this._onWillOpen=this._register(new me),this._setup(),this._decorationService=this._instantiationService.createInstance(yre),this._instantiationService.setService(Sd,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(pse),this._instantiationService.setService(L6,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Hb)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(i=>this.refresh((i==null?void 0:i.start)??0,(i==null?void 0:i.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(i=>this._reportWindowsOptions(i))),this._register(this._inputHandler.onColor(i=>this._handleColorEvent(i))),this._register(Gi.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Gi.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Gi.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Gi.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(i=>this._afterResize(i.cols,i.rows))),this._register(Bt(()=>{var i,n;this._customKeyEventHandler=void 0,(n=(i=this.element)==null?void 0:i.parentNode)==null||n.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let i of e){let n,s="";switch(i.index){case 256:n="foreground",s="10";break;case 257:n="background",s="11";break;case 258:n="cursor",s="12";break;default:n="ansi",s="4;"+i.index}switch(i.type){case 0:let r=Pt.toColorRGB(n==="ansi"?this._themeService.colors.ansi[i.index]:this._themeService.colors[n]);this.coreService.triggerDataEvent(`${ce.ESC}]${s};${hre(r)}${G6.ST}`);break;case 1:if(n==="ansi")this._themeService.modifyColors(o=>o.ansi[i.index]=ci.toColor(...i.color));else{let o=n;this._themeService.modifyColors(l=>l[o]=ci.toColor(...i.color))}break;case 2:this._themeService.restoreColor(i.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(iO,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var e;return(e=this.textarea)==null?void 0:e.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(ce.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,i=this.buffer.lines.get(e);if(!i)return;let n=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=i.getWidth(n),o=this._renderService.dimensions.css.cell.width*r,l=this.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=c+"px",this.textarea.style.top=l+"px",this.textarea.style.width=o+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Be(this.element,"copy",i=>{this.hasSelection()&&Eie(i,this._selectionService)}));let e=i=>Mie(i,this.textarea,this.coreService,this.optionsService);this._register(Be(this.textarea,"paste",e)),this._register(Be(this.element,"paste",e)),ez?this._register(Be(this.element,"mousedown",i=>{i.button===2&&ZP(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Be(this.element,"contextmenu",i=>{ZP(i,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),zw&&this._register(Be(this.element,"auxclick",i=>{i.button===1&&C6(i,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Be(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Be(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Be(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Be(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Be(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Be(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Be(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var r;if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((r=this.element)==null?void 0:r.ownerDocument.defaultView)&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let i=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Be(this.screenElement,"mousemove",o=>this.updateCursorStyle(o))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement);let n=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",Wb.get()),nz||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(fse,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(xo,this._coreBrowserService),this._register(Be(this.textarea,"focus",o=>this._handleTextAreaFocus(o))),this._register(Be(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(gS,this._document,this._helperContainer),this._instantiationService.setService(TO,this._charSizeService),this._themeService=this._instantiationService.createInstance(yS),this._instantiationService.setService(Ch,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Jg),this._instantiationService.setService(Q6,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(vS,this.rows,this.screenElement)),this._instantiationService.setService(wo,this._renderService),this._register(this._renderService.onRenderedViewportChange(o=>this._onRender.fire(o))),this.onResize(o=>this._renderService.resize(o.cols,o.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(dS,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(OS),this._instantiationService.setService(Mw,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(AS,this.screenElement));this.element.appendChild(i);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(uS,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(o=>{super.scrollLines(o,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(_S,this.element,this.screenElement,s)),this._instantiationService.setService(zie,this._selectionService),this._register(this._selectionService.onRequestScrollLines(o=>this.scrollLines(o.amount,o.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(o=>this._renderService.handleSelectionChanged(o.start,o.end,o.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(o=>{this.textarea.value=o,this.textarea.focus(),this.textarea.select()})),this._register(Gi.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var o;this._selectionService.refresh(),(o=this._viewport)==null||o.queueSync()})),this._register(this._instantiationService.createInstance(fS,this.screenElement)),this._register(Be(this.element,"mousedown",o=>this._selectionService.handleMouseDown(o))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(iO,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",o=>this._handleScreenReaderModeOptionChange(o))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Kg,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",o=>{!this._overviewRulerRenderer&&o&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Kg,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(mS,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,i=this.element;function n(o){var d,p,g,O,_;let l=e._mouseService.getMouseReportCoords(o,e.screenElement);if(!l)return!1;let c,u;switch(o.overrideType||o.type){case"mousemove":u=32,o.buttons===void 0?(c=3,o.button!==void 0&&(c=o.button<3?o.button:3)):c=o.buttons&1?0:o.buttons&4?1:o.buttons&2?2:3;break;case"mouseup":u=0,c=o.button<3?o.button:3;break;case"mousedown":u=1,c=o.button<3?o.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(o)===!1)return!1;let b=o.deltaY;if(b===0||e.coreMouseService.consumeWheelEvent(o,(O=(g=(p=(d=e._renderService)==null?void 0:d.dimensions)==null?void 0:p.device)==null?void 0:g.cell)==null?void 0:O.height,(_=e._coreBrowserService)==null?void 0:_.dpr)===0)return!1;u=b<0?0:1,c=4;break;default:return!1}return u===void 0||c===void 0||c>4?!1:e.coreMouseService.triggerMouseEvent({col:l.col,row:l.row,x:l.x,y:l.y,button:c,action:u,ctrl:o.ctrlKey,alt:o.altKey,shift:o.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:o=>(n(o),o.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(o)),wheel:o=>(n(o),this.cancel(o,!0)),mousedrag:o=>{o.buttons&&n(o)},mousemove:o=>{o.buttons||n(o)}};this._register(this.coreMouseService.onProtocolChange(o=>{o?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(o)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),o&8?s.mousemove||(i.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(i.removeEventListener("mousemove",s.mousemove),s.mousemove=null),o&16?s.wheel||(i.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(i.removeEventListener("wheel",s.wheel),s.wheel=null),o&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),o&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Be(i,"mousedown",o=>{if(o.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(o)))return n(o),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(o)})),this._register(Be(i,"wheel",o=>{var l,c,u,d,p;if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(o)===!1)return!1;if(!this.buffer.hasScrollback){if(o.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(o,(d=(u=(c=(l=e._renderService)==null?void 0:l.dimensions)==null?void 0:c.device)==null?void 0:u.cell)==null?void 0:d.height,(p=e._coreBrowserService)==null?void 0:p.dpr)===0)return this.cancel(o,!0);let g=ce.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(o.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(g,!0),this.cancel(o,!0)}}},{passive:!1}))}refresh(e,i){var n;(n=this._renderService)==null||n.refreshRows(e,i)}updateCursorStyle(e){var i;(i=this._selectionService)!=null&&i.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,i){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,i),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let i=e-this._bufferService.buffer.ydisp;i!==0&&this.scrollLines(i)}paste(e){w6(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let i=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),i}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,i,n){this._selectionService.setSelection(e,i,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var e;(e=this._selectionService)==null||e.clearSelection()}selectAll(){var e;(e=this._selectionService)==null||e.selectAll()}selectLines(e,i){var n;(n=this._selectionService)==null||n.selectLines(e,i)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let i=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!i&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!i&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let n=vre(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let s=this.rows-1;return this.scrollLines(n.type===2?-s:s),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===ce.ETX||n.key===ce.CR)&&(this.textarea.value=""),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,i){let n=e.isMac&&!this.options.macOptionIsMeta&&i.altKey&&!i.ctrlKey&&!i.metaKey||e.isWindows&&i.altKey&&i.ctrlKey&&!i.metaKey||e.isWindows&&i.getModifierState("AltGraph");return i.type==="keypress"?n:n&&(!i.keyCode||i.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(kre(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let i;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)i=e.charCode;else if(e.which===null||e.which===void 0)i=e.keyCode;else if(e.which!==0&&e.charCode!==0)i=e.which;else return!1;return!i||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(i=String.fromCharCode(i),this._onKey.fire({key:i,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let i=e.data;return this.coreService.triggerDataEvent(i,!0),this.cancel(e),!0}return!1}resize(e,i){if(e===this.cols&&i===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,i)}_afterResize(e,i){var n;(n=this._charSizeService)==null||n.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(oi));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var i;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(i=this._selectionService)==null||i.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){var e;(e=this._renderService)==null||e.clearTextureAtlas()}_reportFocus(){var e;(e=this.element)!=null&&e.classList.contains("focus")?this.coreService.triggerDataEvent(ce.ESC+"[I"):this.coreService.triggerDataEvent(ce.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let i=this._renderService.dimensions.css.canvas.width.toFixed(0),n=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[4;${n};${i}t`);break;case 1:let s=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${ce.ESC}[6;${r};${s}t`);break}}cancel(e,i){if(!(!this.options.cancelEvents&&!i))return e.preventDefault(),e.stopPropagation(),!1}};function kre(t){return t.keyCode===16||t.keyCode===17||t.keyCode===18}var Tre=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,i){let n={instance:i,dispose:i.dispose,isDisposed:!1};this._addons.push(n),i.dispose=()=>this._wrappedAddonDispose(n),i.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let i=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){i=n;break}if(i===-1)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(i,1)}},Are=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,i){if(!(e<0||e>=this._line.length))return i?(this._line.loadCell(e,i),i):this._line.loadCell(e,new Rs)}translateToString(e,i,n){return this._line.translateToString(e,i,n)}},DR=class{constructor(t,e){this._buffer=t,this.type=e}init(t){return this._buffer=t,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(t){let e=this._buffer.lines.get(t);if(e)return new Are(e)}getNullCell(){return new Rs}},Ere=class extends We{constructor(t){super(),this._core=t,this._onBufferChange=this._register(new me),this.onBufferChange=this._onBufferChange.event,this._normal=new DR(this._core.buffers.normal,"normal"),this._alternate=new DR(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},Mre=class{constructor(t){this._core=t}registerCsiHandler(t,e){return this._core.registerCsiHandler(t,i=>e(i.toArray()))}addCsiHandler(t,e){return this.registerCsiHandler(t,e)}registerDcsHandler(t,e){return this._core.registerDcsHandler(t,(i,n)=>e(i,n.toArray()))}addDcsHandler(t,e){return this.registerDcsHandler(t,e)}registerEscHandler(t,e){return this._core.registerEscHandler(t,e)}addEscHandler(t,e){return this.registerEscHandler(t,e)}registerOscHandler(t,e){return this._core.registerOscHandler(t,e)}addOscHandler(t,e){return this.registerOscHandler(t,e)}},Pre=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},Rre=["cols","rows"],cr=0,Qre=class extends We{constructor(t){super(),this._core=this._register(new Cre(t)),this._addonManager=this._register(new Tre),this._publicOptions={...this._core.options};let e=n=>this._core.options[n],i=(n,s)=>{this._checkReadonlyOptions(n),this._core.options[n]=s};for(let n in this._core.options){let s={get:e.bind(this,n),set:i.bind(this,n)};Object.defineProperty(this._publicOptions,n,s)}}_checkReadonlyOptions(t){if(Rre.includes(t))throw new Error(`Option "${t}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new Mre(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new Pre(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new Ere(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let t=this._core.coreService.decPrivateModes,e="none";switch(this._core.coreMouseService.activeProtocol){case"X10":e="x10";break;case"VT200":e="vt200";break;case"DRAG":e="drag";break;case"ANY":e="any";break}return{applicationCursorKeysMode:t.applicationCursorKeys,applicationKeypadMode:t.applicationKeypad,bracketedPasteMode:t.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:e,originMode:t.origin,reverseWraparoundMode:t.reverseWraparound,sendFocusMode:t.sendFocus,synchronizedOutputMode:t.synchronizedOutput,wraparoundMode:t.wraparound}}get options(){return this._publicOptions}set options(t){for(let e in t)this._publicOptions[e]=t[e]}blur(){this._core.blur()}focus(){this._core.focus()}input(t,e=!0){this._core.input(t,e)}resize(t,e){this._verifyIntegers(t,e),this._core.resize(t,e)}open(t){this._core.open(t)}attachCustomKeyEventHandler(t){this._core.attachCustomKeyEventHandler(t)}attachCustomWheelEventHandler(t){this._core.attachCustomWheelEventHandler(t)}registerLinkProvider(t){return this._core.registerLinkProvider(t)}registerCharacterJoiner(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)}deregisterCharacterJoiner(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)}registerMarker(t=0){return this._verifyIntegers(t),this._core.registerMarker(t)}registerDecoration(t){return this._checkProposedApi(),this._verifyPositiveIntegers(t.x??0,t.width??0,t.height??0),this._core.registerDecoration(t)}hasSelection(){return this._core.hasSelection()}select(t,e,i){this._verifyIntegers(t,e,i),this._core.select(t,e,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(t,e){this._verifyIntegers(t,e),this._core.selectLines(t,e)}dispose(){super.dispose()}scrollLines(t){this._verifyIntegers(t),this._core.scrollLines(t)}scrollPages(t){this._verifyIntegers(t),this._core.scrollPages(t)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(t){this._verifyIntegers(t),this._core.scrollToLine(t)}clear(){this._core.clear()}write(t,e){this._core.write(t,e)}writeln(t,e){this._core.write(t),this._core.write(`\r
119
+ `,e)}paste(t){this._core.paste(t)}refresh(t,e){this._verifyIntegers(t,e),this._core.refresh(t,e)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(t){this._addonManager.loadAddon(this,t)}static get strings(){return{get promptLabel(){return Wb.get()},set promptLabel(t){Wb.set(t)},get tooMuchOutput(){return Ub.get()},set tooMuchOutput(t){Ub.set(t)}}}_verifyIntegers(...t){for(cr of t)if(cr===1/0||isNaN(cr)||cr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...t){for(cr of t)if(cr&&(cr===1/0||isNaN(cr)||cr%1!==0||cr<0))throw new Error("This API only accepts positive integers")}};/**
120
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
121
+ * @license MIT
122
+ *
123
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
124
+ * @license MIT
125
+ *
126
+ * Originally forked from (with the author's permission):
127
+ * Fabrice Bellard's javascript vt100 for jslinux:
128
+ * http://bellard.org/jslinux/
129
+ * Copyright (c) 2011 Fabrice Bellard
130
+ */var Lre=2,Dre=1,Bre=class{activate(t){this._terminal=t}dispose(){}fit(){let t=this.proposeDimensions();if(!t||!this._terminal||isNaN(t.cols)||isNaN(t.rows))return;let e=this._terminal._core;(this._terminal.rows!==t.rows||this._terminal.cols!==t.cols)&&(e._renderService.clear(),this._terminal.resize(t.cols,t.rows))}proposeDimensions(){var p;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let t=this._terminal._core._renderService.dimensions;if(t.css.cell.width===0||t.css.cell.height===0)return;let e=this._terminal.options.scrollback===0?0:((p=this._terminal.options.overviewRuler)==null?void 0:p.width)||14,i=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(i.getPropertyValue("height")),s=Math.max(0,parseInt(i.getPropertyValue("width"))),r=window.getComputedStyle(this._terminal.element),o={top:parseInt(r.getPropertyValue("padding-top")),bottom:parseInt(r.getPropertyValue("padding-bottom")),right:parseInt(r.getPropertyValue("padding-right")),left:parseInt(r.getPropertyValue("padding-left"))},l=o.top+o.bottom,c=o.right+o.left,u=n-l,d=s-c-e;return{cols:Math.max(Lre,Math.floor(d/t.css.cell.width)),rows:Math.max(Dre,Math.floor(u/t.css.cell.height))}}};/**
131
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
132
+ * @license MIT
133
+ *
134
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
135
+ * @license MIT
136
+ *
137
+ * Originally forked from (with the author's permission):
138
+ * Fabrice Bellard's javascript vt100 for jslinux:
139
+ * http://bellard.org/jslinux/
140
+ * Copyright (c) 2011 Fabrice Bellard
141
+ */var $re=(t,e,i,n)=>{for(var s=e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(s=o(s)||s);return s},zre=(t,e)=>(i,n)=>e(i,n,t),Nre=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?BR.isErrorNoTelemetry(t)?new BR(t.message+`
142
+
143
+ `+t.stack):new Error(t.message+`
144
+
145
+ `+t.stack):t},0)}}addListener(t){return this.listeners.push(t),()=>{this._removeListener(t)}}emit(t){this.listeners.forEach(e=>{e(t)})}_removeListener(t){this.listeners.splice(this.listeners.indexOf(t),1)}setUnexpectedErrorHandler(t){this.unexpectedErrorHandler=t}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}},jre=new Nre;function Wy(t){Ire(t)||jre.onUnexpectedError(t)}var ES="Canceled";function Ire(t){return t instanceof Vre?!0:t instanceof Error&&t.name===ES&&t.message===ES}var Vre=class extends Error{constructor(){super(ES),this.name=this.message}},BR=class MS extends Error{constructor(e){super(e),this.name="CodeExpectedError"}static fromError(e){if(e instanceof MS)return e;let i=new MS;return i.message=e.message,i.stack=e.stack,i}static isErrorNoTelemetry(e){return e.name==="CodeExpectedError"}},Xre;(t=>{function e(r){return r<0}t.isLessThan=e;function i(r){return r<=0}t.isLessThanOrEqual=i;function n(r){return r>0}t.isGreaterThan=n;function s(r){return r===0}t.isNeitherLessOrGreaterThan=s,t.greaterThan=1,t.lessThan=-1,t.neitherLessOrGreaterThan=0})(Xre||(Xre={}));function Zre(t,e){let i=this,n=!1,s;return function(){return n||(n=!0,e||(s=t.apply(i,arguments))),s}}var dz;(t=>{function e(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}t.is=e;let i=Object.freeze([]);function n(){return i}t.empty=n;function*s(A){yield A}t.single=s;function r(A){return e(A)?A:s(A)}t.wrap=r;function o(A){return A||i}t.from=o;function*l(A){for(let L=A.length-1;L>=0;L--)yield A[L]}t.reverse=l;function c(A){return!A||A[Symbol.iterator]().next().done===!0}t.isEmpty=c;function u(A){return A[Symbol.iterator]().next().value}t.first=u;function d(A,L){let E=0;for(let z of A)if(L(z,E++))return!0;return!1}t.some=d;function p(A,L){for(let E of A)if(L(E))return E}t.find=p;function*g(A,L){for(let E of A)L(E)&&(yield E)}t.filter=g;function*O(A,L){let E=0;for(let z of A)yield L(z,E++)}t.map=O;function*_(A,L){let E=0;for(let z of A)yield*L(z,E++)}t.flatMap=_;function*b(...A){for(let L of A)yield*L}t.concat=b;function x(A,L,E){let z=E;for(let N of A)z=L(z,N);return z}t.reduce=x;function*w(A,L,E=A.length){for(L<0&&(L+=A.length),E<0?E+=A.length:E>A.length&&(E=A.length);L<E;L++)yield A[L]}t.slice=w;function k(A,L=Number.POSITIVE_INFINITY){let E=[];if(L===0)return[E,A];let z=A[Symbol.iterator]();for(let N=0;N<L;N++){let q=z.next();if(q.done)return[E,t.empty()];E.push(q.value)}return[E,{[Symbol.iterator](){return z}}]}t.consume=k;async function T(A){let L=[];for await(let E of A)L.push(E);return Promise.resolve(L)}t.asyncToArray=T})(dz||(dz={}));function pz(t){if(dz.is(t)){let e=[];for(let i of t)if(i)try{i.dispose()}catch(n){e.push(n)}if(e.length===1)throw e[0];if(e.length>1)throw new AggregateError(e,"Encountered errors while disposing of store");return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function mz(...t){return sn(()=>pz(t))}function sn(t){return{dispose:Zre(()=>{t()})}}var gz=class Oz{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{pz(this._toDispose)}finally{this._toDispose.clear()}}add(e){if(!e)return e;if(e===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Oz.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(e),e}delete(e){if(e){if(e===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),void 0)}};gz.DISABLE_DISPOSED_WARNING=!1;var eh=gz,Fs=class{constructor(){this._store=new eh,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Fs.None=Object.freeze({dispose(){}});var Iu=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(t){var e;this._isDisposed||t===this._value||((e=this._value)==null||e.dispose(),this._value=t)}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,(t=this._value)==null||t.dispose(),this._value=void 0}clearAndLeak(){let t=this._value;return this._value=void 0,t}},Nw=typeof process<"u"&&"title"in process,MO=Nw?"node":navigator.userAgent,qre=Nw?"node":navigator.platform,Wre=MO.includes("Firefox"),Ure=MO.includes("Edge"),vz=/^((?!chrome|android).)*safari/i.test(MO);function Yre(){if(!vz)return 0;let t=MO.match(/Version\/(\d+)/);return t===null||t.length<2?0:parseInt(t[1])}qre.indexOf("Linux")>=0;var Hre="",Ai=0,Ei=0,Mi=0,qt=0,ys={css:"#00000000",rgba:0},gn;(t=>{function e(s,r,o,l){return l!==void 0?`#${nl(s)}${nl(r)}${nl(o)}${nl(l)}`:`#${nl(s)}${nl(r)}${nl(o)}`}t.toCss=e;function i(s,r,o,l=255){return(s<<24|r<<16|o<<8|l)>>>0}t.toRgba=i;function n(s,r,o,l){return{css:t.toCss(s,r,o,l),rgba:t.toRgba(s,r,o,l)}}t.toColor=n})(gn||(gn={}));var af;(t=>{function e(c,u){if(qt=(u.rgba&255)/255,qt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,g=u.rgba>>8&255,O=c.rgba>>24&255,_=c.rgba>>16&255,b=c.rgba>>8&255;Ai=O+Math.round((d-O)*qt),Ei=_+Math.round((p-_)*qt),Mi=b+Math.round((g-b)*qt);let x=gn.toCss(Ai,Ei,Mi),w=gn.toRgba(Ai,Ei,Mi);return{css:x,rgba:w}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function n(c,u,d){let p=wl.ensureContrastRatio(c.rgba,u.rgba,d);if(p)return gn.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=n;function s(c){let u=(c.rgba|255)>>>0;return[Ai,Ei,Mi]=wl.toChannels(u),{css:gn.toCss(Ai,Ei,Mi),rgba:u}}t.opaque=s;function r(c,u){return qt=Math.round(u*255),[Ai,Ei,Mi]=wl.toChannels(c.rgba),{css:gn.toCss(Ai,Ei,Mi,qt),rgba:gn.toRgba(Ai,Ei,Mi,qt)}}t.opacity=r;function o(c,u){return qt=c.rgba&255,r(c,qt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(af||(af={}));var Fre;(t=>{let e,i;try{let s=document.createElement("canvas");s.width=1,s.height=1;let r=s.getContext("2d",{willReadFrequently:!0});r&&(e=r,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Ai=parseInt(s.slice(1,2).repeat(2),16),Ei=parseInt(s.slice(2,3).repeat(2),16),Mi=parseInt(s.slice(3,4).repeat(2),16),gn.toColor(Ai,Ei,Mi);case 5:return Ai=parseInt(s.slice(1,2).repeat(2),16),Ei=parseInt(s.slice(2,3).repeat(2),16),Mi=parseInt(s.slice(3,4).repeat(2),16),qt=parseInt(s.slice(4,5).repeat(2),16),gn.toColor(Ai,Ei,Mi,qt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let r=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return Ai=parseInt(r[1]),Ei=parseInt(r[2]),Mi=parseInt(r[3]),qt=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),gn.toColor(Ai,Ei,Mi,qt);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=s,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Ai,Ei,Mi,qt]=e.getImageData(0,0,1,1).data,qt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:gn.toRgba(Ai,Ei,Mi,qt),css:s}}t.toColor=n})(Fre||(Fre={}));var dn;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,s,r){let o=n/255,l=s/255,c=r/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+p*.0722}t.relativeLuminance2=i})(dn||(dn={}));var wl;(t=>{function e(o,l){if(qt=(l&255)/255,qt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,p=o>>24&255,g=o>>16&255,O=o>>8&255;return Ai=p+Math.round((c-p)*qt),Ei=g+Math.round((u-g)*qt),Mi=O+Math.round((d-O)*qt),gn.toRgba(Ai,Ei,Mi)}t.blend=e;function i(o,l,c){let u=dn.relativeLuminance(o>>8),d=dn.relativeLuminance(l>>8);if(so(u,d)<c){if(d<u){let O=n(o,l,c),_=so(u,dn.relativeLuminance(O>>8));if(_<c){let b=s(o,l,c),x=so(u,dn.relativeLuminance(b>>8));return _>x?O:b}return O}let p=s(o,l,c),g=so(u,dn.relativeLuminance(p>>8));if(g<c){let O=n(o,l,c),_=so(u,dn.relativeLuminance(O>>8));return g>_?p:O}return p}}t.ensureContrastRatio=i;function n(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=so(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));for(;b<c&&(g>0||O>0||_>0);)g-=Math.max(0,Math.ceil(g*.1)),O-=Math.max(0,Math.ceil(O*.1)),_-=Math.max(0,Math.ceil(_*.1)),b=so(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.reduceLuminance=n;function s(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=so(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));for(;b<c&&(g<255||O<255||_<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),O=Math.min(255,O+Math.ceil((255-O)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),b=so(dn.relativeLuminance2(g,O,_),dn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.increaseLuminance=s;function r(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=r})(wl||(wl={}));function nl(t){let e=t.toString(16);return e.length<2?"0"+e:e}function so(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}function li(t){if(!t)throw new Error("value must not be falsy");return t}function jw(t){return 57508<=t&&t<=57558}function Gre(t){return 57520<=t&&t<=57527}function Kre(t){return 57344<=t&&t<=63743}function Jre(t){return 9472<=t&&t<=9631}function eoe(t){return t>=128512&&t<=128591||t>=127744&&t<=128511||t>=128640&&t<=128767||t>=9728&&t<=9983||t>=9984&&t<=10175||t>=65024&&t<=65039||t>=129280&&t<=129535||t>=127462&&t<=127487}function toe(t,e,i,n){return e===1&&i>Math.ceil(n*1.5)&&t!==void 0&&t>255&&!eoe(t)&&!jw(t)&&!Kre(t)}function _z(t){return jw(t)||Jre(t)}function ioe(){return{css:{canvas:Am(),cell:Am()},device:{canvas:Am(),cell:Am(),char:{width:0,height:0,left:0,top:0}}}}function Am(){return{width:0,height:0}}function noe(t,e,i=0){return(t-(Math.round(e)*2-i))%(Math.round(e)*2)}var Xi=0,xi=0,hr=!1,ro=!1,Em=!1,Pn,Uy=0,soe=class{constructor(t,e,i,n,s,r){this._terminal=t,this._optionService=e,this._selectionRenderModel=i,this._decorationService=n,this._coreBrowserService=s,this._themeService=r,this.result={fg:0,bg:0,ext:0}}resolve(t,e,i,n){if(this.result.bg=t.bg,this.result.fg=t.fg,this.result.ext=t.bg&268435456?t.extended.ext:0,xi=0,Xi=0,ro=!1,hr=!1,Em=!1,Pn=this._themeService.colors,Uy=0,t.getCode()!==0&&t.extended.underlineStyle===4){let s=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Uy=e*n%(Math.round(s)*2)}if(this._decorationService.forEachDecorationAtCell(e,i,"bottom",s=>{s.backgroundColorRGB&&(xi=s.backgroundColorRGB.rgba>>8&16777215,ro=!0),s.foregroundColorRGB&&(Xi=s.foregroundColorRGB.rgba>>8&16777215,hr=!0)}),Em=this._selectionRenderModel.isCellSelected(this._terminal,e,i),Em){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:xi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:xi=(this.result.fg&16777215)<<8|255;break;case 0:default:xi=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:xi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:xi=(this.result.bg&16777215)<<8|255;break}xi=wl.blend(xi,(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else xi=(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(ro=!0,Pn.selectionForeground&&(Xi=Pn.selectionForeground.rgba>>8&16777215,hr=!0),_z(t.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Xi=(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Xi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Xi=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Xi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Xi=(this.result.fg&16777215)<<8|255;break;case 0:default:Xi=this._themeService.colors.foreground.rgba}Xi=wl.blend(Xi,(this._coreBrowserService.isFocused?Pn.selectionBackgroundOpaque:Pn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}hr=!0}}this._decorationService.forEachDecorationAtCell(e,i,"top",s=>{s.backgroundColorRGB&&(xi=s.backgroundColorRGB.rgba>>8&16777215,ro=!0),s.foregroundColorRGB&&(Xi=s.foregroundColorRGB.rgba>>8&16777215,hr=!0)}),ro&&(Em?xi=t.bg&-16777216&-134217729|xi|50331648:xi=t.bg&-16777216|xi|50331648),hr&&(Xi=t.fg&-16777216&-67108865|Xi|50331648),this.result.fg&67108864&&(ro&&!hr&&((this.result.bg&50331648)===0?Xi=this.result.fg&-134217728|Pn.background.rgba>>8&16777215&16777215|50331648:Xi=this.result.fg&-134217728|this.result.bg&67108863,hr=!0),!ro&&hr&&((this.result.fg&50331648)===0?xi=this.result.bg&-67108864|Pn.foreground.rgba>>8&16777215&16777215|50331648:xi=this.result.bg&-67108864|this.result.fg&67108863,ro=!0)),Pn=void 0,this.result.bg=ro?xi:this.result.bg,this.result.fg=hr?Xi:this.result.fg,this.result.ext&=536870911,this.result.ext|=Uy<<29&3758096384}},roe=.5,yz=Wre||Ure?"bottom":"ideographic",ooe={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},aoe={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},loe={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"║":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╒":{1:(t,e)=>`M.5,1 L.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╓":{1:(t,e)=>`M${.5-t},1 L${.5-t},.5 L1,.5 M${.5+t},.5 L${.5+t},1`},"╔":{1:(t,e)=>`M1,${.5-e} L${.5-t},${.5-e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╕":{1:(t,e)=>`M0,${.5-e} L.5,${.5-e} L.5,1 M0,${.5+e} L.5,${.5+e}`},"╖":{1:(t,e)=>`M${.5+t},1 L${.5+t},.5 L0,.5 M${.5-t},.5 L${.5-t},1`},"╗":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5+t},${.5-e} L${.5+t},1`},"╘":{1:(t,e)=>`M.5,0 L.5,${.5+e} L1,${.5+e} M.5,${.5-e} L1,${.5-e}`},"╙":{1:(t,e)=>`M1,.5 L${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╚":{1:(t,e)=>`M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0 M1,${.5+e} L${.5-t},${.5+e} L${.5-t},0`},"╛":{1:(t,e)=>`M0,${.5+e} L.5,${.5+e} L.5,0 M0,${.5-e} L.5,${.5-e}`},"╜":{1:(t,e)=>`M0,.5 L${.5+t},.5 L${.5+t},0 M${.5-t},.5 L${.5-t},0`},"╝":{1:(t,e)=>`M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M0,${.5+e} L${.5+t},${.5+e} L${.5+t},0`},"╞":{1:(t,e)=>`M.5,0 L.5,1 M.5,${.5-e} L1,${.5-e} M.5,${.5+e} L1,${.5+e}`},"╟":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1 M${.5+t},.5 L1,.5`},"╠":{1:(t,e)=>`M${.5-t},0 L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╡":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L.5,${.5-e} M0,${.5+e} L.5,${.5+e}`},"╢":{1:(t,e)=>`M0,.5 L${.5-t},.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╣":{1:(t,e)=>`M${.5+t},0 L${.5+t},1 M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0`},"╤":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e} M.5,${.5+e} L.5,1`},"╥":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},1 M${.5+t},.5 L${.5+t},1`},"╦":{1:(t,e)=>`M0,${.5-e} L1,${.5-e} M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1`},"╧":{1:(t,e)=>`M.5,0 L.5,${.5-e} M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╨":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},.5 L${.5-t},0 M${.5+t},.5 L${.5+t},0`},"╩":{1:(t,e)=>`M0,${.5+e} L1,${.5+e} M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╪":{1:(t,e)=>`M.5,0 L.5,1 M0,${.5-e} L1,${.5-e} M0,${.5+e} L1,${.5+e}`},"╫":{1:(t,e)=>`M0,.5 L1,.5 M${.5-t},0 L${.5-t},1 M${.5+t},0 L${.5+t},1`},"╬":{1:(t,e)=>`M0,${.5+e} L${.5-t},${.5+e} L${.5-t},1 M1,${.5+e} L${.5+t},${.5+e} L${.5+t},1 M0,${.5-e} L${.5-t},${.5-e} L${.5-t},0 M1,${.5-e} L${.5+t},${.5-e} L${.5+t},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,1,.5`},"╮":{1:(t,e)=>`M.5,1 L.5,${.5+e/.15*.5} C.5,${.5+e/.15*.5},.5,.5,0,.5`},"╯":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,0,.5`},"╰":{1:(t,e)=>`M.5,0 L.5,${.5-e/.15*.5} C.5,${.5-e/.15*.5},.5,.5,1,.5`}},sd={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};sd[""]=sd[""];sd[""]=sd[""];function coe(t,e,i,n,s,r,o,l){let c=ooe[e];if(c)return hoe(t,c,i,n,s,r),!0;let u=aoe[e];if(u)return uoe(t,u,i,n,s,r),!0;let d=loe[e];if(d)return foe(t,d,i,n,s,r,l),!0;let p=sd[e];return p?(doe(t,p,i,n,s,r,o,l),!0):!1}function hoe(t,e,i,n,s,r){for(let o=0;o<e.length;o++){let l=e[o],c=s/8,u=r/8;t.fillRect(i+l.x*c,n+l.y*u,l.w*c,l.h*u)}}var $R=new Map;function uoe(t,e,i,n,s,r){let o=$R.get(e);o||(o=new Map,$R.set(e,o));let l=t.fillStyle;if(typeof l!="string")throw new Error(`Unexpected fillStyle type "${l}"`);let c=o.get(l);if(!c){let u=e[0].length,d=e.length,p=t.canvas.ownerDocument.createElement("canvas");p.width=u,p.height=d;let g=li(p.getContext("2d")),O=new ImageData(u,d),_,b,x,w;if(l.startsWith("#"))_=parseInt(l.slice(1,3),16),b=parseInt(l.slice(3,5),16),x=parseInt(l.slice(5,7),16),w=l.length>7&&parseInt(l.slice(7,9),16)||1;else if(l.startsWith("rgba"))[_,b,x,w]=l.substring(5,l.length-1).split(",").map(k=>parseFloat(k));else throw new Error(`Unexpected fillStyle color format "${l}" when drawing pattern glyph`);for(let k=0;k<d;k++)for(let T=0;T<u;T++)O.data[(k*u+T)*4]=_,O.data[(k*u+T)*4+1]=b,O.data[(k*u+T)*4+2]=x,O.data[(k*u+T)*4+3]=e[k][T]*(w*255);g.putImageData(O,0,0),c=li(t.createPattern(p,null)),o.set(l,c)}t.fillStyle=c,t.fillRect(i,n,s,r)}function foe(t,e,i,n,s,r,o){t.strokeStyle=t.fillStyle;for(let[l,c]of Object.entries(e)){t.beginPath(),t.lineWidth=o*Number.parseInt(l);let u;if(typeof c=="function"){let d=.15/r*s;u=c(.15,d)}else u=c;for(let d of u.split(" ")){let p=d[0],g=bz[p];if(!g){console.error(`Could not find drawing instructions for "${p}"`);continue}let O=d.substring(1).split(",");!O[0]||!O[1]||g(t,Sz(O,s,r,i,n,!0,o))}t.stroke(),t.closePath()}}function doe(t,e,i,n,s,r,o,l){let c=new Path2D;c.rect(i,n,s,r),t.clip(c),t.beginPath();let u=o/12;t.lineWidth=l*u;for(let d of e.d.split(" ")){let p=d[0],g=bz[p];if(!g){console.error(`Could not find drawing instructions for "${p}"`);continue}let O=d.substring(1).split(",");!O[0]||!O[1]||g(t,Sz(O,s,r,i,n,!1,l,(e.leftPadding??0)*(u/2),(e.rightPadding??0)*(u/2)))}e.type===1?(t.strokeStyle=t.fillStyle,t.stroke()):t.fill(),t.closePath()}function zR(t,e,i=0){return Math.max(Math.min(t,e),i)}var bz={C:(t,e)=>t.bezierCurveTo(e[0],e[1],e[2],e[3],e[4],e[5]),L:(t,e)=>t.lineTo(e[0],e[1]),M:(t,e)=>t.moveTo(e[0],e[1])};function Sz(t,e,i,n,s,r,o,l=0,c=0){let u=t.map(d=>parseFloat(d)||parseInt(d));if(u.length<2)throw new Error("Too few arguments for instruction");for(let d=0;d<u.length;d+=2)u[d]*=e-l*o-c*o,r&&u[d]!==0&&(u[d]=zR(Math.round(u[d]+.5)-.5,e,0)),u[d]+=n+l*o;for(let d=1;d<u.length;d+=2)u[d]*=i,r&&u[d]!==0&&(u[d]=zR(Math.round(u[d]+.5)-.5,i,0)),u[d]+=s;return u}var NR=class{constructor(){this._data={}}set(t,e,i){this._data[t]||(this._data[t]={}),this._data[t][e]=i}get(t,e){return this._data[t]?this._data[t][e]:void 0}clear(){this._data={}}},jR=class{constructor(){this._data=new NR}set(t,e,i,n,s){this._data.get(t,e)||this._data.set(t,e,new NR),this._data.get(t,e).set(i,n,s)}get(t,e,i,n){var s;return(s=this._data.get(t,e))==null?void 0:s.get(i,n)}clear(){this._data.clear()}},xz=class{constructor(){this._tasks=[],this._i=0}enqueue(t){this._tasks.push(t),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(t){this._idleCallback=void 0;let e=0,i=0,n=t.timeRemaining(),s=0;for(;this._i<this._tasks.length;){if(e=performance.now(),this._tasks[this._i]()||this._i++,e=Math.max(1,performance.now()-e),i=Math.max(e,i),s=t.timeRemaining(),i*1.5>s){n-e<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-e))}ms`),this._start();return}n=s}this.clear()}},poe=class extends xz{_requestCallback(t){return setTimeout(()=>t(this._createDeadline(16)))}_cancelCallback(t){clearTimeout(t)}_createDeadline(t){let e=performance.now()+t;return{timeRemaining:()=>Math.max(0,e-performance.now())}}},moe=class extends xz{_requestCallback(t){return requestIdleCallback(t)}_cancelCallback(t){cancelIdleCallback(t)}},goe=!Nw&&"requestIdleCallback"in window?moe:poe,Xc=class wz{constructor(){this.fg=0,this.bg=0,this.extended=new Cz}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let e=new wz;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Cz=class kz{constructor(e=0,i=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new kz(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ooe=globalThis.performance&&typeof globalThis.performance.now=="function",voe=class Tz{static create(e){return new Tz(e)}constructor(e){this._now=Ooe&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},po;(t=>{t.None=()=>Fs.None;function e(R,B){return p(R,()=>{},0,void 0,!0,void 0,B)}t.defer=e;function i(R){return(B,D=null,j)=>{let $=!1,X;return X=R(H=>{if(!$)return X?X.dispose():$=!0,B.call(D,H)},null,j),$&&X.dispose(),X}}t.once=i;function n(R,B,D){return u((j,$=null,X)=>R(H=>j.call($,B(H)),null,X),D)}t.map=n;function s(R,B,D){return u((j,$=null,X)=>R(H=>{B(H),j.call($,H)},null,X),D)}t.forEach=s;function r(R,B,D){return u((j,$=null,X)=>R(H=>B(H)&&j.call($,H),null,X),D)}t.filter=r;function o(R){return R}t.signal=o;function l(...R){return(B,D=null,j)=>{let $=mz(...R.map(X=>X(H=>B.call(D,H))));return d($,j)}}t.any=l;function c(R,B,D,j){let $=D;return n(R,X=>($=B($,X),$),j)}t.reduce=c;function u(R,B){let D,j={onWillAddFirstListener(){D=R($.fire,$)},onDidRemoveLastListener(){D==null||D.dispose()}},$=new Rt(j);return B==null||B.add($),$.event}function d(R,B){return B instanceof Array?B.push(R):B&&B.add(R),R}function p(R,B,D=100,j=!1,$=!1,X,H){let F,M,I,K=0,Q,ue={leakWarningThreshold:X,onWillAddFirstListener(){F=R(fe=>{K++,M=B(M,fe),j&&!I&&(he.fire(M),M=void 0),Q=()=>{let Oe=M;M=void 0,I=void 0,(!j||K>1)&&he.fire(Oe),K=0},typeof D=="number"?(clearTimeout(I),I=setTimeout(Q,D)):I===void 0&&(I=0,queueMicrotask(Q))})},onWillRemoveListener(){$&&K>0&&(Q==null||Q())},onDidRemoveLastListener(){Q=void 0,F.dispose()}},he=new Rt(ue);return H==null||H.add(he),he.event}t.debounce=p;function g(R,B=0,D){return t.debounce(R,(j,$)=>j?(j.push($),j):[$],B,void 0,!0,void 0,D)}t.accumulate=g;function O(R,B=(j,$)=>j===$,D){let j=!0,$;return r(R,X=>{let H=j||!B(X,$);return j=!1,$=X,H},D)}t.latch=O;function _(R,B,D){return[t.filter(R,B,D),t.filter(R,j=>!B(j),D)]}t.split=_;function b(R,B=!1,D=[],j){let $=D.slice(),X=R(M=>{$?$.push(M):F.fire(M)});j&&j.add(X);let H=()=>{$==null||$.forEach(M=>F.fire(M)),$=null},F=new Rt({onWillAddFirstListener(){X||(X=R(M=>F.fire(M)),j&&j.add(X))},onDidAddFirstListener(){$&&(B?setTimeout(H):H())},onDidRemoveLastListener(){X&&X.dispose(),X=null}});return j&&j.add(F),F.event}t.buffer=b;function x(R,B){return(D,j,$)=>{let X=B(new k);return R(function(H){let F=X.evaluate(H);F!==w&&D.call(j,F)},void 0,$)}}t.chain=x;let w=Symbol("HaltChainable");class k{constructor(){this.steps=[]}map(B){return this.steps.push(B),this}forEach(B){return this.steps.push(D=>(B(D),D)),this}filter(B){return this.steps.push(D=>B(D)?D:w),this}reduce(B,D){let j=D;return this.steps.push($=>(j=B(j,$),j)),this}latch(B=(D,j)=>D===j){let D=!0,j;return this.steps.push($=>{let X=D||!B($,j);return D=!1,j=$,X?$:w}),this}evaluate(B){for(let D of this.steps)if(B=D(B),B===w)break;return B}}function T(R,B,D=j=>j){let j=(...F)=>H.fire(D(...F)),$=()=>R.on(B,j),X=()=>R.removeListener(B,j),H=new Rt({onWillAddFirstListener:$,onDidRemoveLastListener:X});return H.event}t.fromNodeEventEmitter=T;function A(R,B,D=j=>j){let j=(...F)=>H.fire(D(...F)),$=()=>R.addEventListener(B,j),X=()=>R.removeEventListener(B,j),H=new Rt({onWillAddFirstListener:$,onDidRemoveLastListener:X});return H.event}t.fromDOMEventEmitter=A;function L(R){return new Promise(B=>i(R)(B))}t.toPromise=L;function E(R){let B=new Rt;return R.then(D=>{B.fire(D)},()=>{B.fire(void 0)}).finally(()=>{B.dispose()}),B.event}t.fromPromise=E;function z(R,B){return R(D=>B.fire(D))}t.forward=z;function N(R,B,D){return B(D),R(j=>B(j))}t.runAndSubscribe=N;class q{constructor(B,D){this._observable=B,this._counter=0,this._hasChanged=!1;let j={onWillAddFirstListener:()=>{B.addObserver(this)},onDidRemoveLastListener:()=>{B.removeObserver(this)}};this.emitter=new Rt(j),D&&D.add(this.emitter)}beginUpdate(B){this._counter++}handlePossibleChange(B){}handleChange(B,D){this._hasChanged=!0}endUpdate(B){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function J(R,B){return new q(R,B).emitter.event}t.fromObservable=J;function U(R){return(B,D,j)=>{let $=0,X=!1,H={beginUpdate(){$++},endUpdate(){$--,$===0&&(R.reportChanges(),X&&(X=!1,B.call(D)))},handlePossibleChange(){},handleChange(){X=!0}};R.addObserver(H),R.reportChanges();let F={dispose(){R.removeObserver(H)}};return j instanceof eh?j.add(F):Array.isArray(j)&&j.push(F),F}}t.fromObservableLight=U})(po||(po={}));var PS=class RS{constructor(e){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${e}_${RS._idPool++}`,RS.all.add(this)}start(e){this._stopWatch=new voe,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};PS.all=new Set,PS._idPool=0;var _oe=PS,yoe=-1,Az=class Ez{constructor(e,i,n=(Ez._idPool++).toString(16).padStart(3,"0")){this._errorHandler=e,this.threshold=i,this.name=n,this._warnCountdown=0}dispose(){var e;(e=this._stacks)==null||e.clear()}check(e,i){let n=this.threshold;if(n<=0||i<n)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[r,o]=this.getMostFrequentStack(),l=`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`;console.warn(l),console.warn(r);let c=new xoe(l,r);this._errorHandler(c)}return()=>{let r=this._stacks.get(e.value)||0;this._stacks.set(e.value,r-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,i=0;for(let[n,s]of this._stacks)(!e||i<s)&&(e=[n,s],i=s);return e}};Az._idPool=1;var boe=Az,Soe=class Mz{constructor(e){this.value=e}static create(){let e=new Error;return new Mz(e.stack??"")}print(){console.warn(this.value.split(`
146
+ `).slice(2).join(`
147
+ `))}},xoe=class extends Error{constructor(t,e){super(t),this.name="ListenerLeakError",this.stack=e}},woe=class extends Error{constructor(t,e){super(t),this.name="ListenerRefusalError",this.stack=e}},Coe=0,Yy=class{constructor(t){this.value=t,this.id=Coe++}},koe=2,Toe,Rt=class{constructor(e){var i,n,s,r;this._size=0,this._options=e,this._leakageMon=(i=this._options)!=null&&i.leakWarningThreshold?new boe((e==null?void 0:e.onListenerError)??Wy,((n=this._options)==null?void 0:n.leakWarningThreshold)??yoe):void 0,this._perfMon=(s=this._options)!=null&&s._profName?new _oe(this._options._profName):void 0,this._deliveryQueue=(r=this._options)==null?void 0:r.deliveryQueue}dispose(){var e,i,n,s;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(n=(i=this._options)==null?void 0:i.onDidRemoveLastListener)==null||n.call(i),(s=this._leakageMon)==null||s.dispose())}get event(){return this._event??(this._event=(e,i,n)=>{var l,c,u,d,p;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let g=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(g);let O=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],_=new woe(`${g}. HINT: Stack shows most frequent listener (${O[1]}-times)`,O[0]);return(((l=this._options)==null?void 0:l.onListenerError)||Wy)(_),Fs.None}if(this._disposed)return Fs.None;i&&(e=e.bind(i));let s=new Yy(e),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=Soe.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Yy?(this._deliveryQueue??(this._deliveryQueue=new Aoe),this._listeners=[this._listeners,s]):this._listeners.push(s):((u=(c=this._options)==null?void 0:c.onWillAddFirstListener)==null||u.call(c,this),this._listeners=s,(p=(d=this._options)==null?void 0:d.onDidAddFirstListener)==null||p.call(d,this)),this._size++;let o=sn(()=>{r==null||r(),this._removeListener(s)});return n instanceof eh?n.add(o):Array.isArray(n)&&n.push(o),o}),this._event}_removeListener(e){var r,o,l,c;if((o=(r=this._options)==null?void 0:r.onWillRemoveListener)==null||o.call(r,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(c=(l=this._options)==null?void 0:l.onDidRemoveLastListener)==null||c.call(l,this),this._size=0;return}let i=this._listeners,n=i.indexOf(e);if(n===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,i[n]=void 0;let s=this._deliveryQueue.current===this;if(this._size*koe<=i.length){let u=0;for(let d=0;d<i.length;d++)i[d]?i[u++]=i[d]:s&&(this._deliveryQueue.end--,u<this._deliveryQueue.i&&this._deliveryQueue.i--);i.length=u}}_deliver(e,i){var s;if(!e)return;let n=((s=this._options)==null?void 0:s.onListenerError)||Wy;if(!n){e.value(i);return}try{e.value(i)}catch(r){n(r)}}_deliverQueue(e){let i=e.current._listeners;for(;e.i<e.end;)this._deliver(i[e.i++],e.value);e.reset()}fire(e){var i,n,s,r;if((i=this._deliveryQueue)!=null&&i.current&&(this._deliverQueue(this._deliveryQueue),(n=this._perfMon)==null||n.stop()),(s=this._perfMon)==null||s.start(this._size),this._listeners)if(this._listeners instanceof Yy)this._deliver(this._listeners,e);else{let o=this._deliveryQueue;o.enqueue(this,e,this._listeners.length),this._deliverQueue(o)}(r=this._perfMon)==null||r.stop()}hasListeners(){return this._size>0}},Aoe=class{constructor(){this.i=-1,this.end=0}enqueue(t,e,i){this.i=0,this.end=i,this.current=t,this.value=e}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},IR={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},Vu=2,Xu,ha=class Qc{constructor(e,i,n){this._document=e,this._config=i,this._unicodeService=n,this._didWarmUp=!1,this._cacheMap=new jR,this._cacheMapCombined=new jR,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Xc,this._textureSize=512,this._onAddTextureAtlasCanvas=new Rt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Rt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=Pz(e,this._config.deviceCellWidth*4+Vu*2,this._config.deviceCellHeight+Vu*2),this._tmpCtx=li(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let e of this.pages)e.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let e=new goe;for(let i=33;i<126;i++)e.enqueue(()=>{if(!this._cacheMap.get(i,0,0,0)){let n=this._drawToCache(i,0,0,0,!1,void 0);this._cacheMap.set(i,0,0,0,n)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let e of this._pages)e.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Qc.maxAtlasPages&&this._pages.length>=Math.max(4,Qc.maxAtlasPages)){let i=this._pages.filter(u=>u.canvas.width*2<=(Qc.maxTextureSize||4096)).sort((u,d)=>d.canvas.width!==u.canvas.width?d.canvas.width-u.canvas.width:d.percentageUsed-u.percentageUsed),n=-1,s=0;for(let u=0;u<i.length;u++)if(i[u].canvas.width!==s)n=u,s=i[u].canvas.width;else if(u-n===3)break;let r=i.slice(n,n+4),o=r.map(u=>u.glyphs[0].texturePage).sort((u,d)=>u>d?1:-1),l=this.pages.length-r.length,c=this._mergePages(r,l);c.version++;for(let u=o.length-1;u>=0;u--)this._deletePage(o[u]);this.pages.push(c),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(c.canvas)}let e=new Hy(this._document,this._textureSize);return this._pages.push(e),this._activePages.push(e),this._onAddTextureAtlasCanvas.fire(e.canvas),e}_mergePages(e,i){let n=e[0].canvas.width*2,s=new Hy(this._document,n,e);for(let[r,o]of e.entries()){let l=r*o.canvas.width%n,c=Math.floor(r/2)*o.canvas.height;s.ctx.drawImage(o.canvas,l,c);for(let d of o.glyphs)d.texturePage=i,d.sizeClipSpace.x=d.size.x/n,d.sizeClipSpace.y=d.size.y/n,d.texturePosition.x+=l,d.texturePosition.y+=c,d.texturePositionClipSpace.x=d.texturePosition.x/n,d.texturePositionClipSpace.y=d.texturePosition.y/n;this._onRemoveTextureAtlasCanvas.fire(o.canvas);let u=this._activePages.indexOf(o);u!==-1&&this._activePages.splice(u,1)}return s}_deletePage(e){this._pages.splice(e,1);for(let i=e;i<this._pages.length;i++){let n=this._pages[i];for(let s of n.glyphs)s.texturePage--;n.version++}}getRasterizedGlyphCombinedChar(e,i,n,s,r,o){return this._getFromCacheMap(this._cacheMapCombined,e,i,n,s,r,o)}getRasterizedGlyph(e,i,n,s,r,o){return this._getFromCacheMap(this._cacheMap,e,i,n,s,r,o)}_getFromCacheMap(e,i,n,s,r,o,l){return Xu=e.get(i,n,s,r),Xu||(Xu=this._drawToCache(i,n,s,r,o,l),e.set(i,n,s,r,Xu)),Xu}_getColorFromAnsiIndex(e){if(e>=this._config.colors.ansi.length)throw new Error("No color found for idx "+e);return this._config.colors.ansi[e]}_getBackgroundColor(e,i,n,s){if(this._config.allowTransparency)return ys;let r;switch(e){case 16777216:case 33554432:r=this._getColorFromAnsiIndex(i);break;case 50331648:let o=Xc.toColorRGB(i);r=gn.toColor(o[0],o[1],o[2]);break;case 0:default:n?r=af.opaque(this._config.colors.foreground):r=this._config.colors.background;break}return this._config.allowTransparency||(r=af.opaque(r)),r}_getForegroundColor(e,i,n,s,r,o,l,c,u,d){let p=this._getMinimumContrastColor(e,i,n,s,r,o,l,u,c,d);if(p)return p;let g;switch(r){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&u&&o<8&&(o+=8),g=this._getColorFromAnsiIndex(o);break;case 50331648:let O=Xc.toColorRGB(o);g=gn.toColor(O[0],O[1],O[2]);break;case 0:default:l?g=this._config.colors.background:g=this._config.colors.foreground}return this._config.allowTransparency&&(g=af.opaque(g)),c&&(g=af.multiplyOpacity(g,roe)),g}_resolveBackgroundRgba(e,i,n){switch(e){case 16777216:case 33554432:return this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;case 0:default:return n?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(e,i,n,s){switch(e){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&s&&i<8&&(i+=8),this._getColorFromAnsiIndex(i).rgba;case 50331648:return i<<8;case 0:default:return n?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(e,i,n,s,r,o,l,c,u,d){if(this._config.minimumContrastRatio===1||d)return;let p=this._getContrastCache(u),g=p.getColor(e,s);if(g!==void 0)return g||void 0;let O=this._resolveBackgroundRgba(i,n,l),_=this._resolveForegroundRgba(r,o,l,c),b=wl.ensureContrastRatio(O,_,this._config.minimumContrastRatio/(u?2:1));if(!b){p.setColor(e,s,null);return}let x=gn.toColor(b>>24&255,b>>16&255,b>>8&255);return p.setColor(e,s,x),x}_getContrastCache(e){return e?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(e,i,n,s,r,o){let l=typeof e=="number"?String.fromCharCode(e):e;o&&this._tmpCanvas.parentElement!==o&&(this._tmpCanvas.style.display="none",o.append(this._tmpCanvas));let c=Math.min(this._config.deviceCellWidth*Math.max(l.length,2)+Vu*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<c&&(this._tmpCanvas.width=c);let u=Math.min(this._config.deviceCellHeight+Vu*4,this._textureSize);if(this._tmpCanvas.height<u&&(this._tmpCanvas.height=u),this._tmpCtx.save(),this._workAttributeData.fg=n,this._workAttributeData.bg=i,this._workAttributeData.extended.ext=s,!!this._workAttributeData.isInvisible())return IR;let d=!!this._workAttributeData.isBold(),p=!!this._workAttributeData.isInverse(),g=!!this._workAttributeData.isDim(),O=!!this._workAttributeData.isItalic(),_=!!this._workAttributeData.isUnderline(),b=!!this._workAttributeData.isStrikethrough(),x=!!this._workAttributeData.isOverline(),w=this._workAttributeData.getFgColor(),k=this._workAttributeData.getFgColorMode(),T=this._workAttributeData.getBgColor(),A=this._workAttributeData.getBgColorMode();if(p){let M=w;w=T,T=M;let I=k;k=A,A=I}let L=this._getBackgroundColor(A,T,p,g);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let E=d?this._config.fontWeightBold:this._config.fontWeight,z=O?"italic":"";this._tmpCtx.font=`${z} ${E} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=yz;let N=l.length===1&&jw(l.charCodeAt(0)),q=l.length===1&&Gre(l.charCodeAt(0)),J=this._getForegroundColor(i,A,T,n,k,w,p,g,d,_z(l.charCodeAt(0)));this._tmpCtx.fillStyle=J.css;let U=q?0:Vu*2,R=!1;this._config.customGlyphs!==!1&&(R=coe(this._tmpCtx,l,U,U,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let B=!N,D;if(typeof e=="number"?D=this._unicodeService.wcwidth(e):D=this._unicodeService.getStringCellWidth(e),_){this._tmpCtx.save();let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),I=M%2===1?.5:0;if(this._tmpCtx.lineWidth=M,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())B=!1,this._tmpCtx.strokeStyle=`rgb(${Xc.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{B=!1;let Oe=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Oe<8&&(Oe+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Oe).css}this._tmpCtx.beginPath();let K=U,Q=Math.ceil(U+this._config.deviceCharHeight)-I-(r?M*2:0),ue=Q+M,he=Q+M*2,fe=this._workAttributeData.getUnderlineVariantOffset();for(let Oe=0;Oe<D;Oe++){this._tmpCtx.save();let Ce=K+Oe*this._config.deviceCellWidth,ye=K+(Oe+1)*this._config.deviceCellWidth,nt=Ce+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ce,Q),this._tmpCtx.lineTo(ye,Q),this._tmpCtx.moveTo(Ce,he),this._tmpCtx.lineTo(ye,he);break;case 3:let Qt=M<=1?he:Math.ceil(U+this._config.deviceCharHeight-M/2)-I,Yt=M<=1?Q:Math.ceil(U+this._config.deviceCharHeight+M/2)-I,ei=new Path2D;ei.rect(Ce,Q,this._config.deviceCellWidth,he-Q),this._tmpCtx.clip(ei),this._tmpCtx.moveTo(Ce-this._config.deviceCellWidth/2,ue),this._tmpCtx.bezierCurveTo(Ce-this._config.deviceCellWidth/2,Yt,Ce,Yt,Ce,ue),this._tmpCtx.bezierCurveTo(Ce,Qt,nt,Qt,nt,ue),this._tmpCtx.bezierCurveTo(nt,Yt,ye,Yt,ye,ue),this._tmpCtx.bezierCurveTo(ye,Qt,ye+this._config.deviceCellWidth/2,Qt,ye+this._config.deviceCellWidth/2,ue);break;case 4:let Le=fe===0?0:fe>=M?M*2-fe:M-fe;fe>=M||Le===0?(this._tmpCtx.setLineDash([Math.round(M),Math.round(M)]),this._tmpCtx.moveTo(Ce+Le,Q),this._tmpCtx.lineTo(ye,Q)):(this._tmpCtx.setLineDash([Math.round(M),Math.round(M)]),this._tmpCtx.moveTo(Ce,Q),this._tmpCtx.lineTo(Ce+Le,Q),this._tmpCtx.moveTo(Ce+Le+M,Q),this._tmpCtx.lineTo(ye,Q)),fe=noe(ye-Ce,M,fe);break;case 5:let as=.6,Co=.3,ko=ye-Ce,La=Math.floor(as*ko),Dr=Math.floor(Co*ko),To=ko-La-Dr;this._tmpCtx.setLineDash([La,Dr,To]),this._tmpCtx.moveTo(Ce,Q),this._tmpCtx.lineTo(ye,Q);break;case 1:default:this._tmpCtx.moveTo(Ce,Q),this._tmpCtx.lineTo(ye,Q);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!R&&this._config.fontSize>=12&&!this._config.allowTransparency&&l!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Oe=this._tmpCtx.measureText(l);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Oe&&Oe.actualBoundingBoxDescent>0){this._tmpCtx.save();let Ce=new Path2D;Ce.rect(K,Q-Math.ceil(M/2),this._config.deviceCellWidth*D,he-Q+Math.ceil(M/2)),this._tmpCtx.clip(Ce),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(l,U,U+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(x){let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),I=M%2===1?.5:0;this._tmpCtx.lineWidth=M,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+I),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*D,U+I),this._tmpCtx.stroke()}if(R||this._tmpCtx.fillText(l,U,U+this._config.deviceCharHeight),l==="_"&&!this._config.allowTransparency){let M=Fy(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),L,J,B);if(M)for(let I=1;I<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(l,U,U+this._config.deviceCharHeight-I),M=Fy(this._tmpCtx.getImageData(U,U,this._config.deviceCellWidth,this._config.deviceCellHeight),L,J,B),!!M);I++);}if(b){let M=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),I=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=M,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(U,U+Math.floor(this._config.deviceCharHeight/2)-I),this._tmpCtx.lineTo(U+this._config.deviceCharWidth*D,U+Math.floor(this._config.deviceCharHeight/2)-I),this._tmpCtx.stroke()}this._tmpCtx.restore();let j=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),$;if(this._config.allowTransparency?$=Eoe(j):$=Fy(j,L,J,B),$)return IR;let X=this._findGlyphBoundingBox(j,this._workBoundingBox,c,q,R,U),H,F;for(;;){if(this._activePages.length===0){let M=this._createNewPage();H=M,F=M.currentRow,F.height=X.size.y;break}H=this._activePages[this._activePages.length-1],F=H.currentRow;for(let M of this._activePages)X.size.y<=M.currentRow.height&&(H=M,F=M.currentRow);for(let M=this._activePages.length-1;M>=0;M--)for(let I of this._activePages[M].fixedRows)I.height<=F.height&&X.size.y<=I.height&&(H=this._activePages[M],F=I);if(X.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Hy(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),H=this._overflowSizePage,F=this._overflowSizePage.currentRow,F.x+X.size.x>=H.canvas.width&&(F.x=0,F.y+=F.height,F.height=0);break}if(F.y+X.size.y>=H.canvas.height||F.height>X.size.y+2){let M=!1;if(H.currentRow.y+H.currentRow.height+X.size.y>=H.canvas.height){let I;for(let K of this._activePages)if(K.currentRow.y+K.currentRow.height+X.size.y<K.canvas.height){I=K;break}if(I)H=I;else if(Qc.maxAtlasPages&&this._pages.length>=Qc.maxAtlasPages&&F.y+X.size.y<=H.canvas.height&&F.height>=X.size.y&&F.x+X.size.x<=H.canvas.width)M=!0;else{let K=this._createNewPage();H=K,F=K.currentRow,F.height=X.size.y,M=!0}}M||(H.currentRow.height>0&&H.fixedRows.push(H.currentRow),F={x:0,y:H.currentRow.y+H.currentRow.height,height:X.size.y},H.fixedRows.push(F),H.currentRow={x:0,y:F.y+F.height,height:0})}if(F.x+X.size.x<=H.canvas.width)break;F===H.currentRow?(F.x=0,F.y+=F.height,F.height=0):H.fixedRows.splice(H.fixedRows.indexOf(F),1)}return X.texturePage=this._pages.indexOf(H),X.texturePosition.x=F.x,X.texturePosition.y=F.y,X.texturePositionClipSpace.x=F.x/H.canvas.width,X.texturePositionClipSpace.y=F.y/H.canvas.height,X.sizeClipSpace.x/=H.canvas.width,X.sizeClipSpace.y/=H.canvas.height,F.height=Math.max(F.height,X.size.y),F.x+=X.size.x,H.ctx.putImageData(j,X.texturePosition.x-this._workBoundingBox.left,X.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,X.size.x,X.size.y),H.addGlyph(X),H.version++,X}_findGlyphBoundingBox(e,i,n,s,r,o){i.top=0;let l=s?this._config.deviceCellHeight:this._tmpCanvas.height,c=s?this._config.deviceCellWidth:n,u=!1;for(let d=0;d<l;d++){for(let p=0;p<c;p++){let g=d*this._tmpCanvas.width*4+p*4+3;if(e.data[g]!==0){i.top=d,u=!0;break}}if(u)break}i.left=0,u=!1;for(let d=0;d<o+c;d++){for(let p=0;p<l;p++){let g=p*this._tmpCanvas.width*4+d*4+3;if(e.data[g]!==0){i.left=d,u=!0;break}}if(u)break}i.right=c,u=!1;for(let d=o+c-1;d>=o;d--){for(let p=0;p<l;p++){let g=p*this._tmpCanvas.width*4+d*4+3;if(e.data[g]!==0){i.right=d,u=!0;break}}if(u)break}i.bottom=l,u=!1;for(let d=l-1;d>=0;d--){for(let p=0;p<c;p++){let g=d*this._tmpCanvas.width*4+p*4+3;if(e.data[g]!==0){i.bottom=d,u=!0;break}}if(u)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:i.right-i.left+1,y:i.bottom-i.top+1},sizeClipSpace:{x:i.right-i.left+1,y:i.bottom-i.top+1},offset:{x:-i.left+o+(s||r?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-i.top+o+(s||r?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Hy=class{constructor(t,e,i){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],i)for(let n of i)this._glyphs.push(...n.glyphs),this._usedPixels+=n._usedPixels;this.canvas=Pz(t,e,e),this.ctx=li(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(t){this._glyphs.push(t),this._usedPixels+=t.size.x*t.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function Fy(t,e,i,n){let s=e.rgba>>>24,r=e.rgba>>>16&255,o=e.rgba>>>8&255,l=i.rgba>>>24,c=i.rgba>>>16&255,u=i.rgba>>>8&255,d=Math.floor((Math.abs(s-l)+Math.abs(r-c)+Math.abs(o-u))/12),p=!0;for(let g=0;g<t.data.length;g+=4)t.data[g]===s&&t.data[g+1]===r&&t.data[g+2]===o||n&&Math.abs(t.data[g]-s)+Math.abs(t.data[g+1]-r)+Math.abs(t.data[g+2]-o)<d?t.data[g+3]=0:p=!1;return p}function Eoe(t){for(let e=0;e<t.data.length;e+=4)if(t.data[e+3]>0)return!1;return!0}function Pz(t,e,i){let n=t.createElement("canvas");return n.width=e,n.height=i,n}function Moe(t,e,i,n,s,r,o,l){let c={foreground:r.foreground,background:r.background,cursor:ys,cursorAccent:ys,selectionForeground:ys,selectionBackgroundTransparent:ys,selectionBackgroundOpaque:ys,selectionInactiveBackgroundTransparent:ys,selectionInactiveBackgroundOpaque:ys,overviewRulerBorder:ys,scrollbarSliderBackground:ys,scrollbarSliderHoverBackground:ys,scrollbarSliderActiveBackground:ys,ansi:r.ansi.slice(),contrastCache:r.contrastCache,halfContrastCache:r.halfContrastCache};return{customGlyphs:s.customGlyphs,devicePixelRatio:o,deviceMaxTextureSize:l,letterSpacing:s.letterSpacing,lineHeight:s.lineHeight,deviceCellWidth:t,deviceCellHeight:e,deviceCharWidth:i,deviceCharHeight:n,fontFamily:s.fontFamily,fontSize:s.fontSize,fontWeight:s.fontWeight,fontWeightBold:s.fontWeightBold,allowTransparency:s.allowTransparency,drawBoldTextInBrightColors:s.drawBoldTextInBrightColors,minimumContrastRatio:s.minimumContrastRatio,colors:c}}function VR(t,e){for(let i=0;i<t.colors.ansi.length;i++)if(t.colors.ansi[i].rgba!==e.colors.ansi[i].rgba)return!1;return t.devicePixelRatio===e.devicePixelRatio&&t.customGlyphs===e.customGlyphs&&t.lineHeight===e.lineHeight&&t.letterSpacing===e.letterSpacing&&t.fontFamily===e.fontFamily&&t.fontSize===e.fontSize&&t.fontWeight===e.fontWeight&&t.fontWeightBold===e.fontWeightBold&&t.allowTransparency===e.allowTransparency&&t.deviceCharWidth===e.deviceCharWidth&&t.deviceCharHeight===e.deviceCharHeight&&t.drawBoldTextInBrightColors===e.drawBoldTextInBrightColors&&t.minimumContrastRatio===e.minimumContrastRatio&&t.colors.foreground.rgba===e.colors.foreground.rgba&&t.colors.background.rgba===e.colors.background.rgba}function Poe(t){return(t&50331648)===16777216||(t&50331648)===33554432}var xs=[];function Rz(t,e,i,n,s,r,o,l,c){let u=Moe(n,s,r,o,e,i,l,c);for(let g=0;g<xs.length;g++){let O=xs[g],_=O.ownedBy.indexOf(t);if(_>=0){if(VR(O.config,u))return O.atlas;O.ownedBy.length===1?(O.atlas.dispose(),xs.splice(g,1)):O.ownedBy.splice(_,1);break}}for(let g=0;g<xs.length;g++){let O=xs[g];if(VR(O.config,u))return O.ownedBy.push(t),O.atlas}let d=t._core,p={atlas:new ha(document,u,d.unicodeService),config:u,ownedBy:[t]};return xs.push(p),p.atlas}function XR(t){for(let e=0;e<xs.length;e++){let i=xs[e].ownedBy.indexOf(t);if(i!==-1){xs[e].ownedBy.length===1?(xs[e].atlas.dispose(),xs.splice(e,1)):xs[e].ownedBy.splice(i,1);break}}}var Mm=600,Roe=class{constructor(t,e){this._renderCallback=t,this._coreBrowserService=e,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(t=Mm){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let e=Mm-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,e>0){this._restartInterval(e);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let e=Mm-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(e);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},Mm)},t)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function ZR(t,e,i){let n=new e.ResizeObserver(s=>{let r=s.find(c=>c.target===t);if(!r)return;if(!("devicePixelContentBoxSize"in r)){n==null||n.disconnect(),n=void 0;return}let o=r.devicePixelContentBoxSize[0].inlineSize,l=r.devicePixelContentBoxSize[0].blockSize;o>0&&l>0&&i(o,l)});try{n.observe(t,{box:["device-pixel-content-box"]})}catch{n.disconnect(),n=void 0}return sn(()=>n==null?void 0:n.disconnect())}function Qoe(t){return t>65535?(t-=65536,String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)}var qR=class Qz extends Xc{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Cz,this.combinedData=""}static fromCharData(e){let i=new Qz;return i.setFromCharData(e),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?Qoe(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let i=!1;if(e[1].length>2)i=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let s=e[1].charCodeAt(1);56320<=s&&s<=57343?this.content=(n-55296)*1024+s-56320+65536|e[2]<<22:i=!0}else i=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;i&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Lz=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function Dz(t,e,i){let n=li(t.createProgram());if(t.attachShader(n,li(WR(t,t.VERTEX_SHADER,e))),t.attachShader(n,li(WR(t,t.FRAGMENT_SHADER,i))),t.linkProgram(n),t.getProgramParameter(n,t.LINK_STATUS))return n;console.error(t.getProgramInfoLog(n)),t.deleteProgram(n)}function WR(t,e,i){let n=li(t.createShader(e));if(t.shaderSource(n,i),t.compileShader(n),t.getShaderParameter(n,t.COMPILE_STATUS))return n;console.error(t.getShaderInfoLog(n)),t.deleteShader(n)}function Loe(t,e){let i=Math.min(t.length*2,e),n=new Float32Array(i);for(let s=0;s<t.length;s++)n[s]=t[s];return n}var Doe=class{constructor(t){this.texture=t,this.version=-1}},Boe=`#version 300 es
148
+ layout (location = 0) in vec2 a_unitquad;
149
+ layout (location = 1) in vec2 a_cellpos;
150
+ layout (location = 2) in vec2 a_offset;
151
+ layout (location = 3) in vec2 a_size;
152
+ layout (location = 4) in float a_texpage;
153
+ layout (location = 5) in vec2 a_texcoord;
154
+ layout (location = 6) in vec2 a_texsize;
155
+
156
+ uniform mat4 u_projection;
157
+ uniform vec2 u_resolution;
158
+
159
+ out vec2 v_texcoord;
160
+ flat out int v_texpage;
161
+
162
+ void main() {
163
+ vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
164
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
165
+ v_texpage = int(a_texpage);
166
+ v_texcoord = a_texcoord + a_unitquad * a_texsize;
167
+ }`;function $oe(t){let e="";for(let i=1;i<t;i++)e+=` else if (v_texpage == ${i}) { outColor = texture(u_texture[${i}], v_texcoord); }`;return`#version 300 es
168
+ precision lowp float;
169
+
170
+ in vec2 v_texcoord;
171
+ flat in int v_texpage;
172
+
173
+ uniform sampler2D u_texture[${t}];
174
+
175
+ out vec4 outColor;
176
+
177
+ void main() {
178
+ if (v_texpage == 0) {
179
+ outColor = texture(u_texture[0], v_texcoord);
180
+ } ${e}
181
+ }`}var ua=11,kc=ua*Float32Array.BYTES_PER_ELEMENT,zoe=2,Vt=0,Mt,Gy=0,Zu=0,Noe=class extends Fs{constructor(t,e,i,n){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._optionsService=n,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let s=this._gl;ha.maxAtlasPages===void 0&&(ha.maxAtlasPages=Math.min(32,li(s.getParameter(s.MAX_TEXTURE_IMAGE_UNITS))),ha.maxTextureSize=li(s.getParameter(s.MAX_TEXTURE_SIZE))),this._program=li(Dz(s,Boe,$oe(ha.maxAtlasPages))),this._register(sn(()=>s.deleteProgram(this._program))),this._projectionLocation=li(s.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=li(s.getUniformLocation(this._program,"u_resolution")),this._textureLocation=li(s.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=s.createVertexArray(),s.bindVertexArray(this._vertexArrayObject);let r=new Float32Array([0,0,1,0,0,1,1,1]),o=s.createBuffer();this._register(sn(()=>s.deleteBuffer(o))),s.bindBuffer(s.ARRAY_BUFFER,o),s.bufferData(s.ARRAY_BUFFER,r,s.STATIC_DRAW),s.enableVertexAttribArray(0),s.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let l=new Uint8Array([0,1,2,3]),c=s.createBuffer();this._register(sn(()=>s.deleteBuffer(c))),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,c),s.bufferData(s.ELEMENT_ARRAY_BUFFER,l,s.STATIC_DRAW),this._attributesBuffer=li(s.createBuffer()),this._register(sn(()=>s.deleteBuffer(this._attributesBuffer))),s.bindBuffer(s.ARRAY_BUFFER,this._attributesBuffer),s.enableVertexAttribArray(2),s.vertexAttribPointer(2,2,s.FLOAT,!1,kc,0),s.vertexAttribDivisor(2,1),s.enableVertexAttribArray(3),s.vertexAttribPointer(3,2,s.FLOAT,!1,kc,2*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(3,1),s.enableVertexAttribArray(4),s.vertexAttribPointer(4,1,s.FLOAT,!1,kc,4*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(4,1),s.enableVertexAttribArray(5),s.vertexAttribPointer(5,2,s.FLOAT,!1,kc,5*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(5,1),s.enableVertexAttribArray(6),s.vertexAttribPointer(6,2,s.FLOAT,!1,kc,7*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(6,1),s.enableVertexAttribArray(1),s.vertexAttribPointer(1,2,s.FLOAT,!1,kc,9*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(1,1),s.useProgram(this._program);let u=new Int32Array(ha.maxAtlasPages);for(let d=0;d<ha.maxAtlasPages;d++)u[d]=d;s.uniform1iv(this._textureLocation,u),s.uniformMatrix4fv(this._projectionLocation,!1,Lz),this._atlasTextures=[];for(let d=0;d<ha.maxAtlasPages;d++){let p=new Doe(li(s.createTexture()));this._register(sn(()=>s.deleteTexture(p.texture))),s.activeTexture(s.TEXTURE0+d),s.bindTexture(s.TEXTURE_2D,p.texture),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_S,s.CLAMP_TO_EDGE),s.texParameteri(s.TEXTURE_2D,s.TEXTURE_WRAP_T,s.CLAMP_TO_EDGE),s.texImage2D(s.TEXTURE_2D,0,s.RGBA,1,1,0,s.RGBA,s.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[d]=p}s.enable(s.BLEND),s.blendFunc(s.SRC_ALPHA,s.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(t,e,i,n,s,r,o,l,c){this._updateCell(this._vertices.attributes,t,e,i,n,s,r,o,l,c)}_updateCell(t,e,i,n,s,r,o,l,c,u){if(Vt=(i*this._terminal.cols+e)*ua,n===0||n===void 0){t.fill(0,Vt,Vt+ua-1-zoe);return}this._atlas&&(l&&l.length>1?Mt=this._atlas.getRasterizedGlyphCombinedChar(l,s,r,o,!1,this._terminal.element):Mt=this._atlas.getRasterizedGlyph(n,s,r,o,!1,this._terminal.element),Gy=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),s!==u&&Mt.offset.x>Gy?(Zu=Mt.offset.x-Gy,t[Vt]=-(Mt.offset.x-Zu)+this._dimensions.device.char.left,t[Vt+1]=-Mt.offset.y+this._dimensions.device.char.top,t[Vt+2]=(Mt.size.x-Zu)/this._dimensions.device.canvas.width,t[Vt+3]=Mt.size.y/this._dimensions.device.canvas.height,t[Vt+4]=Mt.texturePage,t[Vt+5]=Mt.texturePositionClipSpace.x+Zu/this._atlas.pages[Mt.texturePage].canvas.width,t[Vt+6]=Mt.texturePositionClipSpace.y,t[Vt+7]=Mt.sizeClipSpace.x-Zu/this._atlas.pages[Mt.texturePage].canvas.width,t[Vt+8]=Mt.sizeClipSpace.y):(t[Vt]=-Mt.offset.x+this._dimensions.device.char.left,t[Vt+1]=-Mt.offset.y+this._dimensions.device.char.top,t[Vt+2]=Mt.size.x/this._dimensions.device.canvas.width,t[Vt+3]=Mt.size.y/this._dimensions.device.canvas.height,t[Vt+4]=Mt.texturePage,t[Vt+5]=Mt.texturePositionClipSpace.x,t[Vt+6]=Mt.texturePositionClipSpace.y,t[Vt+7]=Mt.sizeClipSpace.x,t[Vt+8]=Mt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&toe(n,c,Mt.size.x,this._dimensions.device.cell.width)&&(t[Vt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let t=this._terminal,e=t.cols*t.rows*ua;this._vertices.count!==e?this._vertices.attributes=new Float32Array(e):this._vertices.attributes.fill(0);let i=0;for(;i<this._vertices.attributesBuffers.length;i++)this._vertices.count!==e?this._vertices.attributesBuffers[i]=new Float32Array(e):this._vertices.attributesBuffers[i].fill(0);this._vertices.count=e,i=0;for(let n=0;n<t.rows;n++)for(let s=0;s<t.cols;s++)this._vertices.attributes[i+9]=s/t.cols,this._vertices.attributes[i+10]=n/t.rows,i+=ua}handleResize(){let t=this._gl;t.useProgram(this._program),t.viewport(0,0,t.canvas.width,t.canvas.height),t.uniform2f(this._resolutionLocation,t.canvas.width,t.canvas.height),this.clear()}render(t){if(!this._atlas)return;let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let i=this._vertices.attributesBuffers[this._activeBuffer],n=0;for(let s=0;s<t.lineLengths.length;s++){let r=s*this._terminal.cols*ua,o=this._vertices.attributes.subarray(r,r+t.lineLengths[s]*ua);i.set(o,n),n+=o.length}e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,i.subarray(0,n),e.STREAM_DRAW);for(let s=0;s<this._atlas.pages.length;s++)this._atlas.pages[s].version!==this._atlasTextures[s].version&&this._bindAtlasPageTexture(e,this._atlas,s);e.drawElementsInstanced(e.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,n/ua)}setAtlas(t){this._atlas=t;for(let e of this._atlasTextures)e.version=-1}_bindAtlasPageTexture(t,e,i){t.activeTexture(t.TEXTURE0+i),t.bindTexture(t.TEXTURE_2D,this._atlasTextures[i].texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,e.pages[i].canvas),t.generateMipmap(t.TEXTURE_2D),this._atlasTextures[i].version=e.pages[i].version}setDimensions(t){this._dimensions=t}},joe=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(t,e,i,n=!1){if(this.selectionStart=e,this.selectionEnd=i,!e||!i||e[0]===i[0]&&e[1]===i[1]){this.clear();return}let s=t.buffers.active.ydisp,r=e[1]-s,o=i[1]-s,l=Math.max(r,0),c=Math.min(o,t.rows-1);if(l>=t.rows||c<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=r,this.viewportEndRow=o,this.viewportCappedStartRow=l,this.viewportCappedEndRow=c,this.startCol=e[0],this.endCol=i[0]}isCellSelected(t,e,i){return this.hasSelection?(i-=t.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?e>=this.startCol&&i>=this.viewportCappedStartRow&&e<this.endCol&&i<=this.viewportCappedEndRow:e<this.startCol&&i>=this.viewportCappedStartRow&&e>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&i===this.viewportStartRow&&e>=this.startCol&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportEndRow&&e<this.endCol||this.viewportStartRow<this.viewportEndRow&&i===this.viewportStartRow&&e>=this.startCol):!1}};function Ioe(){return new joe}var nO=4,rg=1,og=2,Ky=3,Voe=2147483648,Xoe=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=Ioe()}resize(t,e){let i=t*e*nO;i!==this.cells.length&&(this.cells=new Uint32Array(i),this.lineLengths=new Uint32Array(e))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},Zoe=`#version 300 es
182
+ layout (location = 0) in vec2 a_position;
183
+ layout (location = 1) in vec2 a_size;
184
+ layout (location = 2) in vec4 a_color;
185
+ layout (location = 3) in vec2 a_unitquad;
186
+
187
+ uniform mat4 u_projection;
188
+
189
+ out vec4 v_color;
190
+
191
+ void main() {
192
+ vec2 zeroToOne = a_position + (a_unitquad * a_size);
193
+ gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
194
+ v_color = a_color;
195
+ }`,qoe=`#version 300 es
196
+ precision lowp float;
197
+
198
+ in vec4 v_color;
199
+
200
+ out vec4 outColor;
201
+
202
+ void main() {
203
+ outColor = v_color;
204
+ }`,co=8,Jy=co*Float32Array.BYTES_PER_ELEMENT,Woe=20*co,UR=class{constructor(){this.attributes=new Float32Array(Woe),this.count=0}},oo=0,YR=0,HR=0,FR=0,GR=0,KR=0,JR=0,Uoe=class extends Fs{constructor(t,e,i,n){super(),this._terminal=t,this._gl=e,this._dimensions=i,this._themeService=n,this._vertices=new UR,this._verticesCursor=new UR;let s=this._gl;this._program=li(Dz(s,Zoe,qoe)),this._register(sn(()=>s.deleteProgram(this._program))),this._projectionLocation=li(s.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=s.createVertexArray(),s.bindVertexArray(this._vertexArrayObject);let r=new Float32Array([0,0,1,0,0,1,1,1]),o=s.createBuffer();this._register(sn(()=>s.deleteBuffer(o))),s.bindBuffer(s.ARRAY_BUFFER,o),s.bufferData(s.ARRAY_BUFFER,r,s.STATIC_DRAW),s.enableVertexAttribArray(3),s.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let l=new Uint8Array([0,1,2,3]),c=s.createBuffer();this._register(sn(()=>s.deleteBuffer(c))),s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,c),s.bufferData(s.ELEMENT_ARRAY_BUFFER,l,s.STATIC_DRAW),this._attributesBuffer=li(s.createBuffer()),this._register(sn(()=>s.deleteBuffer(this._attributesBuffer))),s.bindBuffer(s.ARRAY_BUFFER,this._attributesBuffer),s.enableVertexAttribArray(0),s.vertexAttribPointer(0,2,s.FLOAT,!1,Jy,0),s.vertexAttribDivisor(0,1),s.enableVertexAttribArray(1),s.vertexAttribPointer(1,2,s.FLOAT,!1,Jy,2*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(1,1),s.enableVertexAttribArray(2),s.vertexAttribPointer(2,4,s.FLOAT,!1,Jy,4*Float32Array.BYTES_PER_ELEMENT),s.vertexAttribDivisor(2,1),this._updateCachedColors(n.colors),this._register(this._themeService.onChangeColors(u=>{this._updateCachedColors(u),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(t){let e=this._gl;e.useProgram(this._program),e.bindVertexArray(this._vertexArrayObject),e.uniformMatrix4fv(this._projectionLocation,!1,Lz),e.bindBuffer(e.ARRAY_BUFFER,this._attributesBuffer),e.bufferData(e.ARRAY_BUFFER,t.attributes,e.DYNAMIC_DRAW),e.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,e.UNSIGNED_BYTE,0,t.count)}handleResize(){this._updateViewportRectangle()}setDimensions(t){this._dimensions=t}_updateCachedColors(t){this._bgFloat=this._colorToFloat32Array(t.background),this._cursorFloat=this._colorToFloat32Array(t.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(t){let e=this._terminal,i=this._vertices,n=1,s,r,o,l,c,u,d,p,g,O,_;for(s=0;s<e.rows;s++){for(o=-1,l=0,c=0,u=!1,r=0;r<e.cols;r++)d=(s*e.cols+r)*nO,p=t.cells[d+rg],g=t.cells[d+og],O=!!(g&67108864),(p!==l||g!==c&&(u||O))&&((l!==0||u&&c!==0)&&(_=n++*co,this._updateRectangle(i,_,c,l,o,r,s)),o=r,l=p,c=g,u=O);(l!==0||u&&c!==0)&&(_=n++*co,this._updateRectangle(i,_,c,l,o,e.cols,s))}i.count=n}updateCursor(t){let e=this._verticesCursor,i=t.cursor;if(!i||i.style==="block"){e.count=0;return}let n,s=0;(i.style==="bar"||i.style==="outline")&&(n=s++*co,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.style==="bar"?i.dpr*i.cursorWidth:i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(i.style==="underline"||i.style==="outline")&&(n=s++*co,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,(i.y+1)*this._dimensions.device.cell.height-i.dpr,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat)),i.style==="outline"&&(n=s++*co,this._addRectangleFloat(e.attributes,n,i.x*this._dimensions.device.cell.width,i.y*this._dimensions.device.cell.height,i.width*this._dimensions.device.cell.width,i.dpr,this._cursorFloat),n=s++*co,this._addRectangleFloat(e.attributes,n,(i.x+i.width)*this._dimensions.device.cell.width-i.dpr,i.y*this._dimensions.device.cell.height,i.dpr,this._dimensions.device.cell.height,this._cursorFloat)),e.count=s}_updateRectangle(t,e,i,n,s,r,o){if(i&67108864)switch(i&50331648){case 16777216:case 33554432:oo=this._themeService.colors.ansi[i&255].rgba;break;case 50331648:oo=(i&16777215)<<8;break;case 0:default:oo=this._themeService.colors.foreground.rgba}else switch(n&50331648){case 16777216:case 33554432:oo=this._themeService.colors.ansi[n&255].rgba;break;case 50331648:oo=(n&16777215)<<8;break;case 0:default:oo=this._themeService.colors.background.rgba}t.attributes.length<e+4&&(t.attributes=Loe(t.attributes,this._terminal.rows*this._terminal.cols*co)),YR=s*this._dimensions.device.cell.width,HR=o*this._dimensions.device.cell.height,FR=(oo>>24&255)/255,GR=(oo>>16&255)/255,KR=(oo>>8&255)/255,JR=1,this._addRectangle(t.attributes,e,YR,HR,(r-s)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,FR,GR,KR,JR)}_addRectangle(t,e,i,n,s,r,o,l,c,u){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=n/this._dimensions.device.canvas.height,t[e+2]=s/this._dimensions.device.canvas.width,t[e+3]=r/this._dimensions.device.canvas.height,t[e+4]=o,t[e+5]=l,t[e+6]=c,t[e+7]=u}_addRectangleFloat(t,e,i,n,s,r,o){t[e]=i/this._dimensions.device.canvas.width,t[e+1]=n/this._dimensions.device.canvas.height,t[e+2]=s/this._dimensions.device.canvas.width,t[e+3]=r/this._dimensions.device.canvas.height,t[e+4]=o[0],t[e+5]=o[1],t[e+6]=o[2],t[e+7]=o[3]}_colorToFloat32Array(t){return new Float32Array([(t.rgba>>24&255)/255,(t.rgba>>16&255)/255,(t.rgba>>8&255)/255,(t.rgba&255)/255])}},Yoe=class extends Fs{constructor(t,e,i,n,s,r,o,l){super(),this._container=e,this._alpha=s,this._coreBrowserService=r,this._optionsService=o,this._themeService=l,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${i}-layer`),this._canvas.style.zIndex=n.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(c=>{this._refreshCharAtlas(t,c),this.reset(t)})),this._register(sn(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=li(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(t){}handleFocus(t){}handleCursorMove(t){}handleGridChanged(t,e,i){}handleSelectionChanged(t,e,i,n=!1){}_setTransparency(t,e){if(e===this._alpha)return;let i=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(t,this._themeService.colors),this.handleGridChanged(t,0,t.rows-1)}_refreshCharAtlas(t,e){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Rz(t,this._optionsService.rawOptions,e,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(t,e){this._deviceCellWidth=e.device.cell.width,this._deviceCellHeight=e.device.cell.height,this._deviceCharWidth=e.device.char.width,this._deviceCharHeight=e.device.char.height,this._deviceCharLeft=e.device.char.left,this._deviceCharTop=e.device.char.top,this._canvas.width=e.device.canvas.width,this._canvas.height=e.device.canvas.height,this._canvas.style.width=`${e.css.canvas.width}px`,this._canvas.style.height=`${e.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(t,this._themeService.colors)}_fillBottomLineAtCells(t,e,i=1){this._ctx.fillRect(t*this._deviceCellWidth,(e+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,i*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(t,e,i,n){this._alpha?this._ctx.clearRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,n*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,n*this._deviceCellHeight))}_fillCharTrueColor(t,e,i,n){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline=yz,this._clipCell(i,n,e.getWidth()),this._ctx.fillText(e.getChars(),i*this._deviceCellWidth+this._deviceCharLeft,n*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(t,e,i){this._ctx.beginPath(),this._ctx.rect(t*this._deviceCellWidth,e*this._deviceCellHeight,i*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(t,e,i){let n=e?t.options.fontWeightBold:t.options.fontWeight;return`${i?"italic":""} ${n} ${t.options.fontSize*this._coreBrowserService.dpr}px ${t.options.fontFamily}`}},Hoe=class extends Yoe{constructor(t,e,i,n,s,r,o){super(i,t,"link",e,!0,s,r,o),this._register(n.onShowLinkUnderline(l=>this._handleShowLinkUnderline(l))),this._register(n.onHideLinkUnderline(l=>this._handleHideLinkUnderline(l)))}resize(t,e){super.resize(t,e),this._state=void 0}reset(t){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let t=this._state.y2-this._state.y1-1;t>0&&this._clearCells(0,this._state.y1+1,this._state.cols,t),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(t){if(t.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:t.fg!==void 0&&Poe(t.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[t.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,t.y1===t.y2)this._fillBottomLineAtCells(t.x1,t.y1,t.x2-t.x1);else{this._fillBottomLineAtCells(t.x1,t.y1,t.cols-t.x1);for(let e=t.y1+1;e<t.y2;e++)this._fillBottomLineAtCells(0,e,t.cols);this._fillBottomLineAtCells(0,t.y2,t.x2)}this._state=t}_handleHideLinkUnderline(t){this._clearCurrentLink()}},yl=typeof window=="object"?window:globalThis,QS=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Rt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Rt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,i){if(this.getZoomLevel(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),e)}setFullscreen(e,i){if(this.isFullscreen(i)===e)return;let n=this.getWindowId(i);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};QS.INSTANCE=new QS;var Bz=QS;function Foe(t,e,i){typeof e=="string"&&(e=t.matchMedia(e)),e.addEventListener("change",i)}Bz.INSTANCE.onDidChangeZoomLevel;Bz.INSTANCE.onDidChangeFullscreen;var Th=typeof navigator=="object"?navigator.userAgent:"";Th.indexOf("Firefox")>=0;Th.indexOf("AppleWebKit")>=0;var Goe=Th.indexOf("Chrome")>=0;!Goe&&Th.indexOf("Safari")>=0;Th.indexOf("Electron/")>=0;Th.indexOf("Android")>=0;var e1=!1;if(typeof yl.matchMedia=="function"){let t=yl.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),e=yl.matchMedia("(display-mode: fullscreen)");e1=t.matches,Foe(yl,t,({matches:i})=>{e1&&e.matches||(e1=i)})}var Zc="en",t1=!1,$z=!1,Pm,ag=Zc,eQ=Zc,Koe,Vs,Cl=globalThis,Yi,JQ;typeof Cl.vscode<"u"&&typeof Cl.vscode.process<"u"?Yi=Cl.vscode.process:typeof process<"u"&&typeof((JQ=process==null?void 0:process.versions)==null?void 0:JQ.node)=="string"&&(Yi=process);var eL,Joe=typeof((eL=Yi==null?void 0:Yi.versions)==null?void 0:eL.electron)=="string",eae=Joe&&(Yi==null?void 0:Yi.type)==="renderer",tL;if(typeof Yi=="object"){Yi.platform,Yi.platform,t1=Yi.platform==="linux",t1&&Yi.env.SNAP&&Yi.env.SNAP_REVISION,Yi.env.CI||Yi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Pm=Zc,ag=Zc;let t=Yi.env.VSCODE_NLS_CONFIG;if(t)try{let e=JSON.parse(t);Pm=e.userLocale,eQ=e.osLocale,ag=e.resolvedLanguage||Zc,Koe=(tL=e.languagePack)==null?void 0:tL.translationsConfigFile}catch{}$z=!0}else typeof navigator=="object"&&!eae?(Vs=navigator.userAgent,Vs.indexOf("Windows")>=0,Vs.indexOf("Macintosh")>=0,(Vs.indexOf("Macintosh")>=0||Vs.indexOf("iPad")>=0||Vs.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,t1=Vs.indexOf("Linux")>=0,(Vs==null?void 0:Vs.indexOf("Mobi"))>=0,ag=globalThis._VSCODE_NLS_LANGUAGE||Zc,Pm=navigator.language.toLowerCase(),eQ=Pm):console.error("Unable to resolve platform.");var tQ=$z,Mr=Vs,oa=ag,tae;(t=>{function e(){return oa}t.value=e;function i(){return oa.length===2?oa==="en":oa.length>=3?oa[0]==="e"&&oa[1]==="n"&&oa[2]==="-":!1}t.isDefaultVariant=i;function n(){return oa==="en"}t.isDefault=n})(tae||(tae={}));var iae=typeof Cl.postMessage=="function"&&!Cl.importScripts;(()=>{if(iae){let t=[];Cl.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let n=0,s=t.length;n<s;n++){let r=t[n];if(r.id===i.data.vscodeScheduleAsyncWork){t.splice(n,1),r.callback();return}}});let e=0;return i=>{let n=++e;t.push({id:n,callback:i}),Cl.postMessage({vscodeScheduleAsyncWork:n},"*")}}return t=>setTimeout(t)})();var nae=!!(Mr&&Mr.indexOf("Chrome")>=0);Mr&&Mr.indexOf("Firefox")>=0;!nae&&Mr&&Mr.indexOf("Safari")>=0;Mr&&Mr.indexOf("Edg/")>=0;Mr&&Mr.indexOf("Android")>=0;var Tc=typeof navigator=="object"?navigator:{};tQ||document.queryCommandSupported&&document.queryCommandSupported("copy")||Tc&&Tc.clipboard&&Tc.clipboard.writeText,tQ||Tc&&Tc.clipboard&&Tc.clipboard.readText;var Iw=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(t,e){this._keyCodeToStr[t]=e,this._strToKeyCode[e.toLowerCase()]=t}keyCodeToStr(t){return this._keyCodeToStr[t]}strToKeyCode(t){return this._strToKeyCode[t.toLowerCase()]||0}},i1=new Iw,iQ=new Iw,nQ=new Iw;new Array(230);var sae;(t=>{function e(l){return i1.keyCodeToStr(l)}t.toString=e;function i(l){return i1.strToKeyCode(l)}t.fromString=i;function n(l){return iQ.keyCodeToStr(l)}t.toUserSettingsUS=n;function s(l){return nQ.keyCodeToStr(l)}t.toUserSettingsGeneral=s;function r(l){return iQ.strToKeyCode(l)||nQ.strToKeyCode(l)}t.fromUserSettings=r;function o(l){if(l>=98&&l<=113)return null;switch(l){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return i1.keyCodeToStr(l)}t.toElectronAccelerator=o})(sae||(sae={}));var zz=Object.freeze(function(t,e){let i=setTimeout(t.bind(e),0);return{dispose(){clearTimeout(i)}}}),rae;(t=>{function e(i){return i===t.None||i===t.Cancelled||i instanceof oae?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}t.isCancellationToken=e,t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:po.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:zz})})(rae||(rae={}));var oae=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?zz:(this._emitter||(this._emitter=new Rt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},aae;(t=>{async function e(n){let s,r=await Promise.all(n.map(o=>o.then(l=>l,l=>{s||(s=l)})));if(typeof s<"u")throw s;return r}t.settled=e;function i(n){return new Promise(async(s,r)=>{try{await n(s,r)}catch(o){r(o)}})}t.withAsyncBody=i})(aae||(aae={}));var sQ=class bs{static fromArray(e){return new bs(i=>{i.emitMany(e)})}static fromPromise(e){return new bs(async i=>{i.emitMany(await e)})}static fromPromises(e){return new bs(async i=>{await Promise.all(e.map(async n=>i.emitOne(await n)))})}static merge(e){return new bs(async i=>{await Promise.all(e.map(async n=>{for await(let s of n)i.emitOne(s)}))})}constructor(e,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new Rt,queueMicrotask(async()=>{let n={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(e(n)),this.resolve()}catch(s){this.reject(s)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await po.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var i;return(i=this._onReturn)==null||i.call(this),{done:!0,value:void 0}}}}static map(e,i){return new bs(async n=>{for await(let s of e)n.emitOne(i(s))})}map(e){return bs.map(this,e)}static filter(e,i){return new bs(async n=>{for await(let s of e)i(s)&&n.emitOne(s)})}filter(e){return bs.filter(this,e)}static coalesce(e){return bs.filter(e,i=>!!i)}coalesce(){return bs.coalesce(this)}static async toPromise(e){let i=[];for await(let n of e)i.push(n);return i}toPromise(){return bs.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};sQ.EMPTY=sQ.fromArray([]);var{getWindow:lae}=(function(){let t=new Map,e={window:yl,disposables:new eh};t.set(yl.vscodeWindowId,e);let i=new Rt,n=new Rt,s=new Rt;function r(o,l){return(typeof o=="number"?t.get(o):void 0)??(l?e:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:s.event,onDidUnregisterWindow:n.event,registerWindow(o){if(t.has(o.vscodeWindowId))return Fs.None;let l=new eh,c={window:o,disposables:l.add(new eh)};return t.set(o.vscodeWindowId,c),l.add(sn(()=>{t.delete(o.vscodeWindowId),n.fire(o)})),l.add(LS(o,hae.BEFORE_UNLOAD,()=>{s.fire(o)})),i.fire(c),l},getWindows(){return t.values()},getWindowsCount(){return t.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return t.has(o)},getWindowById:r,getWindow(o){var u;let l=o;if((u=l==null?void 0:l.ownerDocument)!=null&&u.defaultView)return l.ownerDocument.defaultView.window;let c=o;return c!=null&&c.view?c.view.window:yl},getDocument(o){return lae(o).document}}})(),cae=class{constructor(t,e,i,n){this._node=t,this._type=e,this._handler=i,this._options=n||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function LS(t,e,i,n){return new cae(t,e,i,n)}var hae={BEFORE_UNLOAD:"beforeunload"},uae=class extends Fs{constructor(t,e,i,n,s,r,o,l,c){super(),this._terminal=t,this._characterJoinerService=e,this._charSizeService=i,this._coreBrowserService=n,this._coreService=s,this._decorationService=r,this._optionsService=o,this._themeService=l,this._cursorBlinkStateManager=new Iu,this._charAtlasDisposable=this._register(new Iu),this._observerDisposable=this._register(new Iu),this._model=new Xoe,this._workCell=new qR,this._workCell2=new qR,this._rectangleRenderer=this._register(new Iu),this._glyphRenderer=this._register(new Iu),this._onChangeTextureAtlas=this._register(new Rt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Rt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Rt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Rt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Rt),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let u={antialias:!1,depth:!1,preserveDrawingBuffer:c};if(this._gl=this._canvas.getContext("webgl2",u),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new soe(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new Hoe(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,o,this._themeService)],this.dimensions=ioe(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(o.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(LS(this._canvas,"webglcontextlost",d=>{console.log("webglcontextlost event received"),d.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(d)},3e3)})),this._register(LS(this._canvas,"webglcontextrestored",d=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,XR(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=ZR(this._canvas,this._coreBrowserService.window,(d,p)=>this._setCanvasDevicePixelDimensions(d,p)),this._register(this._coreBrowserService.onWindowChange(d=>{this._observerDisposable.value=ZR(this._canvas,d,(p,g)=>this._setCanvasDevicePixelDimensions(p,g))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(sn(()=>{var d;for(let p of this._renderLayers)p.dispose();(d=this._canvas.parentElement)==null||d.removeChild(this._canvas),XR(this._terminal)}))}get textureAtlas(){var t;return(t=this._charAtlas)==null?void 0:t.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(t,e){var i,n,s,r;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let o of this._renderLayers)o.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(i=this._rectangleRenderer.value)==null||i.setDimensions(this.dimensions),(n=this._rectangleRenderer.value)==null||n.handleResize(),(s=this._glyphRenderer.value)==null||s.setDimensions(this.dimensions),(r=this._glyphRenderer.value)==null||r.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var t;for(let e of this._renderLayers)e.handleBlur(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.pause(),this._requestRedrawViewport()}handleFocus(){var t;for(let e of this._renderLayers)e.handleFocus(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.resume(),this._requestRedrawViewport()}handleSelectionChanged(t,e,i){for(let n of this._renderLayers)n.handleSelectionChanged(this._terminal,t,e,i);this._model.selection.update(this._core,t,e,i),this._requestRedrawViewport()}handleCursorMove(){var t;for(let e of this._renderLayers)e.handleCursorMove(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new Uoe(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new Noe(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var e;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let t=Rz(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==t&&(this._onChangeTextureAtlas.fire(t.pages[0].canvas),this._charAtlasDisposable.value=mz(po.forward(t.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),po.forward(t.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=t,this._charAtlas.warmUp(),(e=this._glyphRenderer.value)==null||e.setAtlas(this._charAtlas)}_clearModel(t){var e;this._model.clear(),t&&((e=this._glyphRenderer.value)==null||e.clear())}clearTextureAtlas(){var t;(t=this._charAtlas)==null||t.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var t;this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);(t=this._cursorBlinkStateManager.value)==null||t.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(t,e){var i;if(!this._isAttached)if((i=this._core.screenElement)!=null&&i.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let n of this._renderLayers)n.handleGridChanged(this._terminal,t,e);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(t,e),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new Roe(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(t,e){let i=this._core,n=this._workCell,s,r,o,l,c,u,d=0,p=!0,g,O,_,b,x,w,k,T,A;t=rQ(t,i.rows-1,0),e=rQ(e,i.rows-1,0);let L=this._coreService.decPrivateModes.cursorStyle??i.options.cursorStyle??"block",E=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,z=E-i.buffer.ydisp,N=Math.min(this._terminal.buffer.active.cursorX,i.cols-1),q=-1,J=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let U=!1;for(r=t;r<=e;r++)for(o=r+i.buffer.ydisp,l=i.buffer.lines.get(o),this._model.lineLengths[r]=0,_=E===o,d=0,c=this._characterJoinerService.getJoinedCharacters(o),T=0;T<i.cols;T++){if(s=this._cellColorResolver.result.bg,l.loadCell(T,n),T===0&&(s=this._cellColorResolver.result.bg),u=!1,p=T>=d,g=T,c.length>0&&T===c[0][0]&&p){O=c.shift();let R=this._model.selection.isCellSelected(this._terminal,O[0],o);for(k=O[0]+1;k<O[1];k++)p&&(p=R===this._model.selection.isCellSelected(this._terminal,k,o));p&&(p=!_||N<O[0]||N>=O[1]),p?(u=!0,n=new fae(n,l.translateToString(!0,O[0],O[1]),O[1]-O[0]),g=O[1]-1):d=O[1]}if(b=n.getChars(),x=n.getCode(),k=(r*i.cols+T)*nO,this._cellColorResolver.resolve(n,T,o,this.dimensions.device.cell.width),J&&o===E&&(T===N&&(this._model.cursor={x:N,y:z,width:n.getWidth(),style:this._coreBrowserService.isFocused?L:i.options.cursorInactiveStyle,cursorWidth:i.options.cursorWidth,dpr:this._devicePixelRatio},q=N+n.getWidth()-1),T>=N&&T<=q&&(this._coreBrowserService.isFocused&&L==="block"||this._coreBrowserService.isFocused===!1&&i.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),x!==0&&(this._model.lineLengths[r]=T+1),!(this._model.cells[k]===x&&this._model.cells[k+rg]===this._cellColorResolver.result.bg&&this._model.cells[k+og]===this._cellColorResolver.result.fg&&this._model.cells[k+Ky]===this._cellColorResolver.result.ext)&&(U=!0,b.length>1&&(x|=Voe),this._model.cells[k]=x,this._model.cells[k+rg]=this._cellColorResolver.result.bg,this._model.cells[k+og]=this._cellColorResolver.result.fg,this._model.cells[k+Ky]=this._cellColorResolver.result.ext,w=n.getWidth(),this._glyphRenderer.value.updateCell(T,r,x,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,b,w,s),u)){for(n=this._workCell,T++;T<=g;T++)A=(r*i.cols+T)*nO,this._glyphRenderer.value.updateCell(T,r,0,0,0,0,Hre,0,0),this._model.cells[A]=0,this._model.cells[A+rg]=this._cellColorResolver.result.bg,this._model.cells[A+og]=this._cellColorResolver.result.fg,this._model.cells[A+Ky]=this._cellColorResolver.result.ext;T--}}U&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(t,e){this._canvas.width===t&&this._canvas.height===e||(this._canvas.width=t,this._canvas.height=e,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let t=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:t,end:t})}},fae=class extends Xc{constructor(t,e,i){super(),this.content=0,this.combinedData="",this.fg=t.fg,this.bg=t.bg,this.combinedData=e,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(t){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function rQ(t,e,i=0){return Math.max(Math.min(t,e),i)}var oQ="di$target",aQ="di$dependencies",n1=new Map;function Lr(t){if(n1.has(t))return n1.get(t);let e=function(i,n,s){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");dae(e,i,s)};return e._id=t,n1.set(t,e),e}function dae(t,e,i){e[oQ]===e?e[aQ].push({id:t,index:i}):(e[aQ]=[{id:t,index:i}],e[oQ]=e)}Lr("BufferService");Lr("CoreMouseService");Lr("CoreService");Lr("CharsetService");Lr("InstantiationService");Lr("LogService");var pae=Lr("OptionsService");Lr("OscLinkService");Lr("UnicodeService");Lr("DecorationService");var mae={trace:0,debug:1,info:2,warn:3,error:4,off:5},gae="xterm.js: ",lQ=class extends Fs{constructor(t){super(),this._optionsService=t,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=mae[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(t){for(let e=0;e<t.length;e++)typeof t[e]=="function"&&(t[e]=t[e]())}_log(t,e,i){this._evalLazyOptionalParams(i),t.call(console,(this._optionsService.options.logger?"":gae)+e,...i)}trace(t,...e){var i;this._logLevel<=0&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.trace.bind(this._optionsService.options.logger))??console.log,t,e)}debug(t,...e){var i;this._logLevel<=1&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.debug.bind(this._optionsService.options.logger))??console.log,t,e)}info(t,...e){var i;this._logLevel<=2&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.info.bind(this._optionsService.options.logger))??console.info,t,e)}warn(t,...e){var i;this._logLevel<=3&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.warn.bind(this._optionsService.options.logger))??console.warn,t,e)}error(t,...e){var i;this._logLevel<=4&&this._log(((i=this._optionsService.options.logger)==null?void 0:i.error.bind(this._optionsService.options.logger))??console.error,t,e)}};lQ=$re([zre(0,pae)],lQ);var Oae=class extends Fs{constructor(t){if(vz&&Yre()<16){let e={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",e))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=t,this._onChangeTextureAtlas=this._register(new Rt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Rt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Rt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Rt),this.onContextLoss=this._onContextLoss.event}activate(t){let e=t._core;if(!t.element){this._register(e.onWillOpen(()=>this.activate(t)));return}this._terminal=t;let i=e.coreService,n=e.optionsService,s=e,r=s._renderService,o=s._characterJoinerService,l=s._charSizeService,c=s._coreBrowserService,u=s._decorationService;s._logService;let d=s._themeService;this._renderer=this._register(new uae(t,o,l,c,i,u,n,d,this._preserveDrawingBuffer)),this._register(po.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(po.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(po.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(po.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),r.setRenderer(this._renderer),this._register(sn(()=>{if(this._terminal._core._store._isDisposed)return;let p=this._terminal._core._renderService;p.setRenderer(this._terminal._core._createRenderer()),p.handleResize(t.cols,t.rows)}))}get textureAtlas(){var t;return(t=this._renderer)==null?void 0:t.textureAtlas}clearTextureAtlas(){var t;(t=this._renderer)==null||t.clearTextureAtlas()}};/**
205
+ * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
206
+ * @license MIT
207
+ *
208
+ * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
209
+ * @license MIT
210
+ *
211
+ * Originally forked from (with the author's permission):
212
+ * Fabrice Bellard's javascript vt100 for jslinux:
213
+ * http://bellard.org/jslinux/
214
+ * Copyright (c) 2011 Fabrice Bellard
215
+ */var Pi=0,Ri=0,Qi=0,Wt=0,nn;(t=>{function e(s,r,o,l){return l!==void 0?`#${sl(s)}${sl(r)}${sl(o)}${sl(l)}`:`#${sl(s)}${sl(r)}${sl(o)}`}t.toCss=e;function i(s,r,o,l=255){return(s<<24|r<<16|o<<8|l)>>>0}t.toRgba=i;function n(s,r,o,l){return{css:t.toCss(s,r,o,l),rgba:t.toRgba(s,r,o,l)}}t.toColor=n})(nn||(nn={}));var vae;(t=>{function e(c,u){if(Wt=(u.rgba&255)/255,Wt===1)return{css:u.css,rgba:u.rgba};let d=u.rgba>>24&255,p=u.rgba>>16&255,g=u.rgba>>8&255,O=c.rgba>>24&255,_=c.rgba>>16&255,b=c.rgba>>8&255;Pi=O+Math.round((d-O)*Wt),Ri=_+Math.round((p-_)*Wt),Qi=b+Math.round((g-b)*Wt);let x=nn.toCss(Pi,Ri,Qi),w=nn.toRgba(Pi,Ri,Qi);return{css:x,rgba:w}}t.blend=e;function i(c){return(c.rgba&255)===255}t.isOpaque=i;function n(c,u,d){let p=lg.ensureContrastRatio(c.rgba,u.rgba,d);if(p)return nn.toColor(p>>24&255,p>>16&255,p>>8&255)}t.ensureContrastRatio=n;function s(c){let u=(c.rgba|255)>>>0;return[Pi,Ri,Qi]=lg.toChannels(u),{css:nn.toCss(Pi,Ri,Qi),rgba:u}}t.opaque=s;function r(c,u){return Wt=Math.round(u*255),[Pi,Ri,Qi]=lg.toChannels(c.rgba),{css:nn.toCss(Pi,Ri,Qi,Wt),rgba:nn.toRgba(Pi,Ri,Qi,Wt)}}t.opacity=r;function o(c,u){return Wt=c.rgba&255,r(c,Wt*u/255)}t.multiplyOpacity=o;function l(c){return[c.rgba>>24&255,c.rgba>>16&255,c.rgba>>8&255]}t.toColorRGB=l})(vae||(vae={}));var Zi;(t=>{let e,i;try{let s=document.createElement("canvas");s.width=1,s.height=1;let r=s.getContext("2d",{willReadFrequently:!0});r&&(e=r,e.globalCompositeOperation="copy",i=e.createLinearGradient(0,0,1,1))}catch{}function n(s){if(s.match(/#[\da-f]{3,8}/i))switch(s.length){case 4:return Pi=parseInt(s.slice(1,2).repeat(2),16),Ri=parseInt(s.slice(2,3).repeat(2),16),Qi=parseInt(s.slice(3,4).repeat(2),16),nn.toColor(Pi,Ri,Qi);case 5:return Pi=parseInt(s.slice(1,2).repeat(2),16),Ri=parseInt(s.slice(2,3).repeat(2),16),Qi=parseInt(s.slice(3,4).repeat(2),16),Wt=parseInt(s.slice(4,5).repeat(2),16),nn.toColor(Pi,Ri,Qi,Wt);case 7:return{css:s,rgba:(parseInt(s.slice(1),16)<<8|255)>>>0};case 9:return{css:s,rgba:parseInt(s.slice(1),16)>>>0}}let r=s.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return Pi=parseInt(r[1]),Ri=parseInt(r[2]),Qi=parseInt(r[3]),Wt=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),nn.toColor(Pi,Ri,Qi,Wt);if(!e||!i)throw new Error("css.toColor: Unsupported css format");if(e.fillStyle=i,e.fillStyle=s,typeof e.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(e.fillRect(0,0,1,1),[Pi,Ri,Qi,Wt]=e.getImageData(0,0,1,1).data,Wt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:nn.toRgba(Pi,Ri,Qi,Wt),css:s}}t.toColor=n})(Zi||(Zi={}));var pn;(t=>{function e(n){return i(n>>16&255,n>>8&255,n&255)}t.relativeLuminance=e;function i(n,s,r){let o=n/255,l=s/255,c=r/255,u=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=l<=.03928?l/12.92:Math.pow((l+.055)/1.055,2.4),p=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4);return u*.2126+d*.7152+p*.0722}t.relativeLuminance2=i})(pn||(pn={}));var lg;(t=>{function e(o,l){if(Wt=(l&255)/255,Wt===1)return l;let c=l>>24&255,u=l>>16&255,d=l>>8&255,p=o>>24&255,g=o>>16&255,O=o>>8&255;return Pi=p+Math.round((c-p)*Wt),Ri=g+Math.round((u-g)*Wt),Qi=O+Math.round((d-O)*Wt),nn.toRgba(Pi,Ri,Qi)}t.blend=e;function i(o,l,c){let u=pn.relativeLuminance(o>>8),d=pn.relativeLuminance(l>>8);if(ao(u,d)<c){if(d<u){let O=n(o,l,c),_=ao(u,pn.relativeLuminance(O>>8));if(_<c){let b=s(o,l,c),x=ao(u,pn.relativeLuminance(b>>8));return _>x?O:b}return O}let p=s(o,l,c),g=ao(u,pn.relativeLuminance(p>>8));if(g<c){let O=n(o,l,c),_=ao(u,pn.relativeLuminance(O>>8));return g>_?p:O}return p}}t.ensureContrastRatio=i;function n(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));for(;b<c&&(g>0||O>0||_>0);)g-=Math.max(0,Math.ceil(g*.1)),O-=Math.max(0,Math.ceil(O*.1)),_-=Math.max(0,Math.ceil(_*.1)),b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.reduceLuminance=n;function s(o,l,c){let u=o>>24&255,d=o>>16&255,p=o>>8&255,g=l>>24&255,O=l>>16&255,_=l>>8&255,b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));for(;b<c&&(g<255||O<255||_<255);)g=Math.min(255,g+Math.ceil((255-g)*.1)),O=Math.min(255,O+Math.ceil((255-O)*.1)),_=Math.min(255,_+Math.ceil((255-_)*.1)),b=ao(pn.relativeLuminance2(g,O,_),pn.relativeLuminance2(u,d,p));return(g<<24|O<<16|_<<8|255)>>>0}t.increaseLuminance=s;function r(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}t.toChannels=r})(lg||(lg={}));function sl(t){let e=t.toString(16);return e.length<2?"0"+e:e}function ao(t,e){return t<e?(e+.05)/(t+.05):(t+.05)/(e+.05)}var _ae=Object.freeze((()=>{let t=[Zi.toColor("#2e3436"),Zi.toColor("#cc0000"),Zi.toColor("#4e9a06"),Zi.toColor("#c4a000"),Zi.toColor("#3465a4"),Zi.toColor("#75507b"),Zi.toColor("#06989a"),Zi.toColor("#d3d7cf"),Zi.toColor("#555753"),Zi.toColor("#ef2929"),Zi.toColor("#8ae234"),Zi.toColor("#fce94f"),Zi.toColor("#729fcf"),Zi.toColor("#ad7fa8"),Zi.toColor("#34e2e2"),Zi.toColor("#eeeeec")],e=[0,95,135,175,215,255];for(let i=0;i<216;i++){let n=e[i/36%6|0],s=e[i/6%6|0],r=e[i%6];t.push({css:nn.toCss(n,s,r),rgba:nn.toRgba(n,s,r)})}for(let i=0;i<24;i++){let n=8+i*10;t.push({css:nn.toCss(n,n,n),rgba:nn.toRgba(n,n,n)})}return t})());function cQ(t,e,i){return Math.max(e,Math.min(t,i))}function yae(t){switch(t){case"&":return"&amp;";case"<":return"&lt;"}return t}var Nz=class{constructor(t){this._buffer=t}serialize(t,e){let i=this._buffer.getNullCell(),n=this._buffer.getNullCell(),s=i,r=t.start.y,o=t.end.y,l=t.start.x,c=t.end.x;this._beforeSerialize(o-r,r,o);for(let u=r;u<=o;u++){let d=this._buffer.getLine(u);if(d){let p=u===t.start.y?l:0,g=u===t.end.y?c:d.length;for(let O=p;O<g;O++){let _=d.getCell(O,s===i?n:i);if(!_){console.warn(`Can't get cell at row=${u}, col=${O}`);continue}this._nextCell(_,s,u,O),s=_}}this._rowEnd(u,u===o)}return this._afterSerialize(),this._serializeString(e)}_nextCell(t,e,i,n){}_rowEnd(t,e){}_beforeSerialize(t,e,i){}_afterSerialize(){}_serializeString(t){return""}};function jz(t,e){return t.getFgColorMode()===e.getFgColorMode()&&t.getFgColor()===e.getFgColor()}function lo(t,e){return t.getBgColorMode()===e.getBgColorMode()&&t.getBgColor()===e.getBgColor()}function Iz(t,e){return t.isInverse()===e.isInverse()&&t.isBold()===e.isBold()&&t.isUnderline()===e.isUnderline()&&t.isOverline()===e.isOverline()&&t.isBlink()===e.isBlink()&&t.isInvisible()===e.isInvisible()&&t.isItalic()===e.isItalic()&&t.isDim()===e.isDim()&&t.isStrikethrough()===e.isStrikethrough()}var bae=class extends Nz{constructor(t,e){super(t),this._terminal=e,this._rowIndex=0,this._allRows=new Array,this._allRowSeparators=new Array,this._currentRow="",this._nullCellCount=0,this._cursorStyle=this._buffer.getNullCell(),this._cursorStyleRow=0,this._cursorStyleCol=0,this._backgroundCell=this._buffer.getNullCell(),this._firstRow=0,this._lastCursorRow=0,this._lastCursorCol=0,this._lastContentCursorRow=0,this._lastContentCursorCol=0,this._thisRowLastChar=this._buffer.getNullCell(),this._thisRowLastSecondChar=this._buffer.getNullCell(),this._nextRowFirstChar=this._buffer.getNullCell()}_beforeSerialize(t,e,i){this._allRows=new Array(t),this._lastContentCursorRow=e,this._lastCursorRow=e,this._firstRow=e}_rowEnd(t,e){var n;this._nullCellCount>0&&!lo(this._cursorStyle,this._backgroundCell)&&(this._currentRow+=`\x1B[${this._nullCellCount}X`);let i="";if(!e){t-this._firstRow>=this._terminal.rows&&((n=this._buffer.getLine(this._cursorStyleRow))==null||n.getCell(this._cursorStyleCol,this._backgroundCell));let s=this._buffer.getLine(t),r=this._buffer.getLine(t+1);if(!r.isWrapped)i=`\r
216
+ `,this._lastCursorRow=t+1,this._lastCursorCol=0;else{i="";let o=s.getCell(s.length-1,this._thisRowLastChar),l=s.getCell(s.length-2,this._thisRowLastSecondChar),c=r.getCell(0,this._nextRowFirstChar),u=c.getWidth()>1,d=!1;(c.getChars()&&u?this._nullCellCount<=1:this._nullCellCount<=0)&&((o.getChars()||o.getWidth()===0)&&lo(o,c)&&(d=!0),u&&(l.getChars()||l.getWidth()===0)&&lo(o,c)&&lo(l,c)&&(d=!0)),d||(i="-".repeat(this._nullCellCount+1),i+="\x1B[1D\x1B[1X",this._nullCellCount>0&&(i+="\x1B[A",i+=`\x1B[${s.length-this._nullCellCount}C`,i+=`\x1B[${this._nullCellCount}X`,i+=`\x1B[${s.length-this._nullCellCount}D`,i+="\x1B[B"),this._lastContentCursorRow=t+1,this._lastContentCursorCol=0,this._lastCursorRow=t+1,this._lastCursorCol=0)}}this._allRows[this._rowIndex]=this._currentRow,this._allRowSeparators[this._rowIndex++]=i,this._currentRow="",this._nullCellCount=0}_diffStyle(t,e){let i=[],n=!jz(t,e),s=!lo(t,e),r=!Iz(t,e);if(n||s||r)if(t.isAttributeDefault())e.isAttributeDefault()||i.push(0);else{if(n){let o=t.getFgColor();t.isFgRGB()?i.push(38,2,o>>>16&255,o>>>8&255,o&255):t.isFgPalette()?o>=16?i.push(38,5,o):i.push(o&8?90+(o&7):30+(o&7)):i.push(39)}if(s){let o=t.getBgColor();t.isBgRGB()?i.push(48,2,o>>>16&255,o>>>8&255,o&255):t.isBgPalette()?o>=16?i.push(48,5,o):i.push(o&8?100+(o&7):40+(o&7)):i.push(49)}r&&(t.isInverse()!==e.isInverse()&&i.push(t.isInverse()?7:27),t.isBold()!==e.isBold()&&i.push(t.isBold()?1:22),t.isUnderline()!==e.isUnderline()&&i.push(t.isUnderline()?4:24),t.isOverline()!==e.isOverline()&&i.push(t.isOverline()?53:55),t.isBlink()!==e.isBlink()&&i.push(t.isBlink()?5:25),t.isInvisible()!==e.isInvisible()&&i.push(t.isInvisible()?8:28),t.isItalic()!==e.isItalic()&&i.push(t.isItalic()?3:23),t.isDim()!==e.isDim()&&i.push(t.isDim()?2:22),t.isStrikethrough()!==e.isStrikethrough()&&i.push(t.isStrikethrough()?9:29))}return i}_nextCell(t,e,i,n){if(t.getWidth()===0)return;let s=t.getChars()==="",r=this._diffStyle(t,this._cursorStyle);if(s?!lo(this._cursorStyle,t):r.length>0){this._nullCellCount>0&&(lo(this._cursorStyle,this._backgroundCell)||(this._currentRow+=`\x1B[${this._nullCellCount}X`),this._currentRow+=`\x1B[${this._nullCellCount}C`,this._nullCellCount=0),this._lastContentCursorRow=this._lastCursorRow=i,this._lastContentCursorCol=this._lastCursorCol=n,this._currentRow+=`\x1B[${r.join(";")}m`;let o=this._buffer.getLine(i);o!==void 0&&(o.getCell(n,this._cursorStyle),this._cursorStyleRow=i,this._cursorStyleCol=n)}s?this._nullCellCount+=t.getWidth():(this._nullCellCount>0&&(lo(this._cursorStyle,this._backgroundCell)?this._currentRow+=`\x1B[${this._nullCellCount}C`:(this._currentRow+=`\x1B[${this._nullCellCount}X`,this._currentRow+=`\x1B[${this._nullCellCount}C`),this._nullCellCount=0),this._currentRow+=t.getChars(),this._lastContentCursorRow=this._lastCursorRow=i,this._lastContentCursorCol=this._lastCursorCol=n+t.getWidth())}_serializeString(t){let e=this._allRows.length;this._buffer.length-this._firstRow<=this._terminal.rows&&(e=this._lastContentCursorRow+1-this._firstRow,this._lastCursorCol=this._lastContentCursorCol,this._lastCursorRow=this._lastContentCursorRow);let i="";for(let r=0;r<e;r++)i+=this._allRows[r],r+1<e&&(i+=this._allRowSeparators[r]);if(!t){let r=this._buffer.baseY+this._buffer.cursorY,o=this._buffer.cursorX,l=r!==this._lastCursorRow||o!==this._lastCursorCol,c=u=>{u>0?i+=`\x1B[${u}C`:u<0&&(i+=`\x1B[${-u}D`)};l&&((u=>{u>0?i+=`\x1B[${u}B`:u<0&&(i+=`\x1B[${-u}A`)})(r-this._lastCursorRow),c(o-this._lastCursorCol))}let n=this._terminal._core._inputHandler._curAttrData,s=this._diffStyle(n,this._cursorStyle);return s.length>0&&(i+=`\x1B[${s.join(";")}m`),i}},Sae=class{activate(t){this._terminal=t}_serializeBufferByScrollback(t,e,i){let n=e.length,s=i===void 0?n:cQ(i+t.rows,0,n);return this._serializeBufferByRange(t,e,{start:n-s,end:n-1},!1)}_serializeBufferByRange(t,e,i,n){return new bae(e,t).serialize({start:{x:0,y:typeof i.start=="number"?i.start:i.start.line},end:{x:t.cols,y:typeof i.end=="number"?i.end:i.end.line}},n)}_serializeBufferAsHTML(t,e){var l;let i=t.buffer.active,n=new xae(i,t,e),s=e.onlySelection??!1,r=e.range;if(r)return n.serialize({start:{x:r.startCol,y:(r.startLine,r.startLine)},end:{x:t.cols,y:(r.endLine,r.endLine)}});if(!s){let c=i.length,u=e.scrollback,d=u===void 0?c:cQ(u+t.rows,0,c);return n.serialize({start:{x:0,y:c-d},end:{x:t.cols,y:c-1}})}let o=(l=this._terminal)==null?void 0:l.getSelectionPosition();return o!==void 0?n.serialize({start:{x:o.start.x,y:o.start.y},end:{x:o.end.x,y:o.end.y}}):""}_serializeModes(t){let e="",i=t.modes;if(i.applicationCursorKeysMode&&(e+="\x1B[?1h"),i.applicationKeypadMode&&(e+="\x1B[?66h"),i.bracketedPasteMode&&(e+="\x1B[?2004h"),i.insertMode&&(e+="\x1B[4h"),i.originMode&&(e+="\x1B[?6h"),i.reverseWraparoundMode&&(e+="\x1B[?45h"),i.sendFocusMode&&(e+="\x1B[?1004h"),i.wraparoundMode===!1&&(e+="\x1B[?7l"),i.mouseTrackingMode!=="none")switch(i.mouseTrackingMode){case"x10":e+="\x1B[?9h";break;case"vt200":e+="\x1B[?1000h";break;case"drag":e+="\x1B[?1002h";break;case"any":e+="\x1B[?1003h";break}return e}serialize(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");let e=t!=null&&t.range?this._serializeBufferByRange(this._terminal,this._terminal.buffer.normal,t.range,!0):this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.normal,t==null?void 0:t.scrollback);if(!(t!=null&&t.excludeAltBuffer)&&this._terminal.buffer.active.type==="alternate"){let i=this._serializeBufferByScrollback(this._terminal,this._terminal.buffer.alternate,void 0);e+=`\x1B[?1049h\x1B[H${i}`}return t!=null&&t.excludeModes||(e+=this._serializeModes(this._terminal)),e}serializeAsHTML(t){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");return this._serializeBufferAsHTML(this._terminal,t||{})}dispose(){}},xae=class extends Nz{constructor(t,e,i){super(t),this._terminal=e,this._options=i,this._currentRow="",this._htmlContent="",e._core._themeService?this._ansiColors=e._core._themeService.colors.ansi:this._ansiColors=_ae}_padStart(t,e,i){return e=e>>0,i=i??" ",t.length>e?t:(e-=t.length,e>i.length&&(i+=i.repeat(e/i.length)),i.slice(0,e)+t)}_beforeSerialize(t,e,i){var o,l;this._htmlContent+="<html><body><!--StartFragment--><pre>";let n="#000000",s="#ffffff";(this._options.includeGlobalBackground??!1)&&(n=((o=this._terminal.options.theme)==null?void 0:o.foreground)??"#ffffff",s=((l=this._terminal.options.theme)==null?void 0:l.background)??"#000000");let r=[];r.push("color: "+n+";"),r.push("background-color: "+s+";"),r.push("font-family: "+this._terminal.options.fontFamily+";"),r.push("font-size: "+this._terminal.options.fontSize+"px;"),this._htmlContent+="<div style='"+r.join(" ")+"'>"}_afterSerialize(){this._htmlContent+="</div>",this._htmlContent+="</pre><!--EndFragment--></body></html>"}_rowEnd(t,e){this._htmlContent+="<div><span>"+this._currentRow+"</span></div>",this._currentRow=""}_getHexColor(t,e){let i=e?t.getFgColor():t.getBgColor();if(e?t.isFgRGB():t.isBgRGB())return"#"+[i>>16&255,i>>8&255,i&255].map(n=>this._padStart(n.toString(16),2,"0")).join("");if(e?t.isFgPalette():t.isBgPalette())return this._ansiColors[i].css}_diffStyle(t,e){let i=[],n=!jz(t,e),s=!lo(t,e),r=!Iz(t,e);if(n||s||r){let o=this._getHexColor(t,!0);o&&i.push("color: "+o+";");let l=this._getHexColor(t,!1);return l&&i.push("background-color: "+l+";"),t.isInverse()&&i.push("color: #000000; background-color: #BFBFBF;"),t.isBold()&&i.push("font-weight: bold;"),t.isUnderline()&&t.isOverline()?i.push("text-decoration: overline underline;"):t.isUnderline()?i.push("text-decoration: underline;"):t.isOverline()&&i.push("text-decoration: overline;"),t.isBlink()&&i.push("text-decoration: blink;"),t.isInvisible()&&i.push("visibility: hidden;"),t.isItalic()&&i.push("font-style: italic;"),t.isDim()&&i.push("opacity: 0.5;"),t.isStrikethrough()&&i.push("text-decoration: line-through;"),i}}_nextCell(t,e,i,n){if(t.getWidth()===0)return;let s=t.getChars()==="",r=this._diffStyle(t,e);r&&(this._currentRow+=r.length===0?"</span><span>":"</span><span style='"+r.join(" ")+"'>"),s?this._currentRow+=" ":this._currentRow+=yae(t.getChars())}_serializeString(){return this._htmlContent}};const wae=10,Cae=2e3;function kae(t={}){const{autoSpawn:e=!1,skipPermissions:i=!1}=t,[n,s]=Z.useState(!1),[r,o]=Z.useState(!1),[l,c]=Z.useState(null),[u,d]=Z.useState(null),p=Z.useRef(null),g=Z.useRef(0),O=Z.useRef(null),_=Z.useRef(!0),b=Z.useRef(null),x=Z.useRef(null),w=Z.useRef(e),k=Z.useRef(i);w.current=e,k.current=i;const T=Z.useCallback(N=>{const q=p.current;q&&q.readyState===WebSocket.OPEN&&q.send(JSON.stringify(N))},[]),A=Z.useCallback(N=>{T({type:"spawn",skipPermissions:N})},[T]),L=Z.useCallback(()=>{T({type:"kill"})},[T]),E=Z.useCallback((N,q)=>{T({type:"resize",cols:N,rows:q})},[T]),z=Z.useCallback(N=>{T({type:"input",data:N})},[T]);return Z.useEffect(()=>{_.current=!0;function N(){if(!_.current)return;const J=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/terminal`,U=new WebSocket(J);p.current=U,U.onopen=()=>{_.current&&(s(!0),g.current=0,w.current&&U.send(JSON.stringify({type:"spawn",skipPermissions:k.current})))},U.onclose=()=>{_.current&&(s(!1),p.current=null,g.current<wae&&(g.current++,O.current=setTimeout(N,Cae)))},U.onmessage=R=>{var B,D;if(_.current)try{const j=JSON.parse(R.data);switch(j.type){case"output":(B=b.current)==null||B.call(b,j.data);break;case"scrollback":(D=x.current)==null||D.call(x,j.data);break;case"status":c({pid:j.pid,uptime:j.uptime,cwd:j.cwd,memoryMB:j.memoryMB,isActive:j.isActive,skipPermissions:j.skipPermissions,alive:j.alive});break;case"exit":d(j.code??1);break;case"started":d(null);break;case"unavailable":o(!0);break}}catch{}},U.onerror=()=>{}}return N(),()=>{_.current=!1,O.current!==null&&(clearTimeout(O.current),O.current=null),p.current&&(p.current.onclose=null,p.current.close(),p.current=null)}},[]),{connected:n,unavailable:r,status:l,exitCode:u,send:T,spawn:A,kill:L,resize:E,writeInput:z,onOutput:b,onScrollback:x}}function Tae(t){const e=Math.floor(t/60),i=t%60;return`${e}m ${i}s`}function Aae(t){const e=t.replace(/\\/g,"/").split("/").filter(Boolean);return e.length<=2?t:".../"+e.slice(-2).join("/")}function Eae({status:t,connected:e,exitCode:i,skipPermissions:n,onToggleSkipPermissions:s,onStop:r,onRestart:o}){const l=e&&(t==null?void 0:t.alive),c=e?l?"bg-green-500":"bg-yellow-500":"bg-red-500",u=e?l?`Running (PID ${(t==null?void 0:t.pid)??"?"})`:"Stopped":"Disconnected";return S.jsxs("div",{className:"flex items-center justify-between border-t border-border bg-card px-3 py-1.5 font-mono text-xs text-muted-foreground",children:[S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("span",{className:Fe("inline-block h-2 w-2 rounded-full",c),title:u}),S.jsx("span",{children:u}),t&&l&&S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"text-border",children:"|"}),S.jsx("span",{children:Tae(t.uptime)}),S.jsx("span",{className:"text-border",children:"|"}),S.jsx("span",{title:t.cwd,children:Aae(t.cwd)}),S.jsx("span",{className:"text-border",children:"|"}),S.jsxs("span",{children:[t.memoryMB," MB"]})]})]}),S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsxs("label",{className:"flex cursor-pointer items-center gap-1.5",children:[S.jsx("input",{type:"checkbox",checked:n,onChange:s,className:"h-3 w-3 accent-accent"}),S.jsx("span",{children:"Skip Perms"})]}),l&&S.jsx("button",{type:"button",onClick:r,className:"rounded-sm px-2 py-0.5 text-red-400 transition-colors hover:bg-red-500/20",children:"Stop"}),S.jsx("button",{type:"button",onClick:o,className:"rounded-sm px-2 py-0.5 transition-colors hover:bg-accent/20",children:"Restart"})]})]})}const Mae=[{label:"Progress",command:"/maxsim:progress"},{label:"New Project",command:"/maxsim:new-project"},{label:"Discuss",command:"/maxsim:discuss-phase N"},{label:"Plan",command:"/maxsim:plan-phase N"},{label:"Execute",command:"/maxsim:execute-phase N"},{label:"Roadmap",command:"/maxsim:roadmap"},{label:"Verify",command:"/maxsim:verify-work"},{label:"Resume",command:"/maxsim:resume-work"}],Vz="maxsim-quick-commands",Pae=3e4;function Rae(){try{const t=localStorage.getItem(Vz);if(t)return JSON.parse(t)}catch{}return Mae}function Qae(t){localStorage.setItem(Vz,JSON.stringify(t))}function Lae({onSendCommand:t,isActive:e,isAlive:i,unavailable:n=!1}){const[s,r]=Z.useState(!1),[o,l]=Z.useState(Rae),[c,u]=Z.useState(!1),[d,p]=Z.useState(null),g=Z.useRef(null),O=Z.useCallback(async E=>{if(!E.includes(" N"))return E;const z=g.current;if(z&&Date.now()-z.ts<Pae)return E.replace(" N",` ${z.value}`);try{const N=await fetch("/api/state");if(N.ok){const q=await N.json(),J=String(q.currentPhase??"1");return g.current={value:J,ts:Date.now()},E.replace(" N",` ${J}`)}}catch{}return E},[]),_=n||!i,b=Z.useCallback(async E=>{if(_)return;const z=await O(E.command);p({label:E.label,resolved:z})},[_,O]),x=Z.useCallback(()=>{d&&(t(d.resolved+`\r
217
+ `),p(null))},[d,t]),w=Z.useCallback(()=>{p(null)},[]);Z.useEffect(()=>{if(!d)return;const E=z=>{z.key==="Enter"?(z.preventDefault(),x()):z.key==="Escape"&&w()};return window.addEventListener("keydown",E),()=>window.removeEventListener("keydown",E)},[d,x,w]);const[k,T]=Z.useState([]),A=Z.useCallback(()=>{T([...o]),u(!0)},[o]),L=Z.useCallback(()=>{const E=k.filter(z=>z.label.trim()&&z.command.trim());l(E),Qae(E),u(!1)},[k]);return s?S.jsx("div",{className:"absolute bottom-2 right-2 z-20",children:S.jsx("button",{type:"button",onClick:()=>r(!1),className:"rounded-md bg-card/80 p-1.5 text-xs text-muted-foreground shadow-lg backdrop-blur-sm border border-border hover:text-foreground transition-colors",title:"Show quick actions",children:S.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M18 15l-6-6-6 6"})})})}):S.jsxs("div",{className:"absolute bottom-2 right-2 z-20 flex flex-col items-end gap-1",children:[d&&S.jsxs("div",{className:"rounded-lg bg-card border border-border shadow-lg p-2 text-xs mb-1 backdrop-blur-sm",children:[S.jsxs("p",{className:"text-muted-foreground mb-1.5",children:["Send"," ",S.jsx("span",{className:"font-mono text-foreground",children:d.resolved}),"?"]}),S.jsxs("div",{className:"flex gap-1.5",children:[S.jsx("button",{type:"button",onClick:x,className:"rounded-sm bg-accent px-2 py-0.5 text-foreground hover:bg-accent-glow transition-colors",children:"Confirm"}),S.jsx("button",{type:"button",onClick:w,className:"rounded-sm bg-muted px-2 py-0.5 text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"})]})]}),c&&S.jsxs("div",{className:"rounded-lg bg-card border border-border shadow-lg p-3 text-xs mb-1 backdrop-blur-sm w-72 max-h-64 overflow-y-auto",children:[S.jsx("p",{className:"text-muted-foreground font-medium mb-2",children:"Quick Commands"}),k.map((E,z)=>S.jsxs("div",{className:"flex gap-1 mb-1",children:[S.jsx("input",{className:"flex-[1] rounded-sm border border-border bg-muted px-1.5 py-0.5 text-xs text-foreground",value:E.label,onChange:N=>{const q=[...k];q[z]={...q[z],label:N.target.value},T(q)},placeholder:"Label"}),S.jsx("input",{className:"flex-[2] rounded-sm border border-border bg-muted px-1.5 py-0.5 text-xs font-mono text-foreground",value:E.command,onChange:N=>{const q=[...k];q[z]={...q[z],command:N.target.value},T(q)},placeholder:"Command"}),S.jsx("button",{type:"button",onClick:()=>T(k.filter((N,q)=>q!==z)),className:"text-muted-foreground hover:text-destructive transition-colors px-0.5",title:"Remove",children:"x"})]},z)),S.jsxs("div",{className:"flex justify-between mt-2",children:[S.jsx("button",{type:"button",onClick:()=>T([...k,{label:"",command:""}]),className:"text-muted-foreground hover:text-foreground transition-colors",children:"+ Add"}),S.jsxs("div",{className:"flex gap-1.5",children:[S.jsx("button",{type:"button",onClick:()=>u(!1),className:"rounded-sm bg-muted px-2 py-0.5 text-muted-foreground hover:text-foreground transition-colors",children:"Cancel"}),S.jsx("button",{type:"button",onClick:L,className:"rounded-sm bg-accent px-2 py-0.5 text-foreground hover:bg-accent-glow transition-colors",children:"Save"})]})]})]}),S.jsxs("div",{className:"flex items-center gap-1 rounded-lg bg-card/80 border border-border shadow-lg p-1.5 backdrop-blur-sm",children:[o.map(E=>S.jsx("button",{type:"button",onClick:()=>b(E),disabled:_,className:"rounded-md px-2 py-0.5 text-xs text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40 disabled:cursor-not-allowed",title:n?"Terminal unavailable — node-pty not installed":E.command,children:E.label},E.label)),S.jsx("button",{type:"button",onClick:A,className:"rounded-md px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors ml-0.5",title:"Settings",children:S.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[S.jsx("circle",{cx:"12",cy:"12",r:"3"}),S.jsx("path",{d:"M19.4 15a1.65 1.65 0 00.33 1.82l.06.06a2 2 0 010 2.83 2 2 0 01-2.83 0l-.06-.06a1.65 1.65 0 00-1.82-.33 1.65 1.65 0 00-1 1.51V21a2 2 0 01-4 0v-.09A1.65 1.65 0 009 19.4a1.65 1.65 0 00-1.82.33l-.06.06a2 2 0 01-2.83-2.83l.06-.06A1.65 1.65 0 004.68 15a1.65 1.65 0 00-1.51-1H3a2 2 0 010-4h.09A1.65 1.65 0 004.6 9a1.65 1.65 0 00-.33-1.82l-.06-.06a2 2 0 012.83-2.83l.06.06A1.65 1.65 0 009 4.68a1.65 1.65 0 001-1.51V3a2 2 0 014 0v.09a1.65 1.65 0 001 1.51 1.65 1.65 0 001.82-.33l.06-.06a2 2 0 012.83 2.83l-.06.06A1.65 1.65 0 0019.32 9a1.65 1.65 0 001.51 1H21a2 2 0 010 4h-.09a1.65 1.65 0 00-1.51 1z"})]})}),S.jsx("button",{type:"button",onClick:()=>r(!0),className:"rounded-md px-1 py-0.5 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Minimize",children:S.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:S.jsx("path",{d:"M6 9l6 6 6-6"})})})]})]})}function Dae({onReady:t,writeInputRef:e}){const i=Z.useRef(null),n=Z.useRef(null),s=Z.useRef(null),r=Z.useRef(null),o=Z.useRef(null),[l,c]=Z.useState(!0),{connected:u,unavailable:d,status:p,exitCode:g,writeInput:O,resize:_,spawn:b,kill:x,onOutput:w,onScrollback:k}=kae({autoSpawn:!0,skipPermissions:l});Z.useEffect(()=>(e&&(e.current=O),()=>{e&&(e.current=null)}),[O,e]);const T=Z.useCallback(N=>{var q;(q=n.current)==null||q.write(N)},[]),A=Z.useCallback(N=>{var q;(q=n.current)==null||q.write(N)},[]);Z.useEffect(()=>(w.current=T,k.current=A,()=>{w.current=null,k.current=null}),[T,A,w,k]),Z.useEffect(()=>{if(!i.current)return;const N=new Qre({cursorBlink:!0,fontSize:14,lineHeight:1.2,theme:{background:"#0a0a0a",foreground:"#e0e0e0",cursor:"#e0e0e0"}}),q=new Bre,J=new Sae;N.loadAddon(q),N.loadAddon(J);try{N.loadAddon(new Oae)}catch{}N.open(i.current),q.fit(),n.current=N,s.current=q;const U=N.onData(B=>{O(B)}),R=new ResizeObserver(()=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{s.current&&n.current&&(s.current.fit(),_(n.current.cols,n.current.rows))},100)});return R.observe(i.current),r.current=R,t==null||t(N),()=>{U.dispose(),R.disconnect(),o.current&&clearTimeout(o.current),N.dispose(),n.current=null,s.current=null,r.current=null}},[]);const L=Z.useCallback(()=>{b(l),setTimeout(()=>{var N;return(N=n.current)==null?void 0:N.focus()},100)},[b,l]),E=Z.useCallback(()=>{x()},[x]),z=Z.useCallback(()=>{c(N=>!N)},[]);return S.jsxs("div",{className:"flex h-full w-full flex-col",onWheel:N=>N.stopPropagation(),children:[S.jsxs("div",{className:"relative min-h-0 flex-1 overflow-hidden",children:[S.jsx("div",{ref:i,className:"h-full w-full"}),S.jsx(Lae,{onSendCommand:O,isActive:(p==null?void 0:p.isActive)??!1,isAlive:(p==null?void 0:p.alive)??!1,unavailable:d}),d&&S.jsx("div",{className:"absolute inset-0 z-20 flex items-center justify-center bg-card",children:S.jsxs("div",{className:"max-w-sm text-center",children:[S.jsx("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Terminal unavailable"}),S.jsxs("p",{className:"text-sm text-muted-foreground",children:["node-pty is not installed. Run ",S.jsx("code",{className:"rounded bg-muted px-1.5 py-0.5 font-mono text-xs",children:"npm install node-pty"})," in the dashboard directory."]})]})}),!u&&g===null&&S.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-black/60",children:S.jsxs("div",{className:"flex items-center gap-3 font-mono text-sm text-muted-foreground",children:[S.jsxs("svg",{className:"h-5 w-5 animate-spin",viewBox:"0 0 24 24",fill:"none",children:[S.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),S.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"})]}),"Reconnecting..."]})}),g!==null&&S.jsxs("div",{className:"absolute inset-x-0 bottom-0 z-10 flex items-center justify-between bg-card/90 px-4 py-2 font-mono text-sm backdrop-blur-sm",children:[S.jsxs("span",{className:"text-muted-foreground",children:["Process exited (code ",g,")"]}),S.jsx("button",{type:"button",onClick:L,className:"rounded-sm bg-accent px-3 py-1 text-xs text-foreground transition-colors hover:bg-accent-glow",children:"Restart"})]})]}),S.jsx(Eae,{status:p,connected:u,exitCode:g,skipPermissions:l,onToggleSkipPermissions:z,onStop:E,onRestart:L})]})}function Bae(){const[t,e]=Z.useState(!1),i=Z.useCallback(()=>e(n=>!n),[]);return{splitMode:t,toggleSplit:i}}function $ae({splitMode:t,onToggle:e}){return S.jsx("button",{type:"button",onClick:e,title:t?"Full-height mode":"Split-panel mode",className:"absolute right-3 top-2 z-20 flex h-7 w-7 items-center justify-center rounded-sm border border-border bg-card text-muted-foreground transition-colors hover:bg-card-hover hover:text-foreground",children:t?S.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:S.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5"})}):S.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:[S.jsx("rect",{x:"1",y:"1",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),S.jsx("line",{x1:"1",y1:"7",x2:"13",y2:"7",stroke:"currentColor",strokeWidth:"1.5"})]})})}function zae({mode:t,onToggle:e}){const[i,n]=Z.useState(!1);function s(){n(!0),e(),setTimeout(()=>n(!1),420)}const r=t==="simple",o=r?"Switch to Advanced Mode":"Switch to Simple Mode";return S.jsx("button",{type:"button",onClick:s,title:o,"aria-label":o,className:"flex h-8 w-8 items-center justify-center text-muted-foreground transition-colors hover:text-foreground",children:S.jsx(vo.span,{animate:{rotate:i?360:0},transition:{duration:.4,ease:"easeInOut"},style:{display:"flex",alignItems:"center",justifyContent:"center"},children:r?S.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"6"}),S.jsx("ellipse",{cx:"8",cy:"8",rx:"2.5",ry:"6"}),S.jsx("path",{d:"M2 8h12M3.5 5h9M3.5 11h9",strokeLinecap:"round"})]}):S.jsxs("svg",{className:"h-4 w-4",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"1.5",y:"2.5",width:"13",height:"11",rx:"1"}),S.jsx("path",{d:"M4 6l2.5 2L4 10M8 10h4",strokeLinecap:"round",strokeLinejoin:"round"})]})})})}function Nae({onChoose:t}){return S.jsxs("div",{className:"absolute inset-0 z-50 flex items-center justify-center",children:[S.jsx("div",{className:"absolute inset-0 backdrop-blur-sm bg-background/60"}),S.jsxs("div",{className:"relative z-10 border border-border bg-card p-8 max-w-lg w-full mx-4",children:[S.jsx("h2",{className:"font-bold text-lg tracking-tight text-foreground mb-1",children:"Choose Your Dashboard Mode"}),S.jsx("p",{className:"text-sm text-muted-foreground mb-6",children:"You can switch between modes at any time from the header toggle."}),S.jsxs("div",{className:"flex gap-4",children:[S.jsxs("div",{className:"flex-1 border border-border p-4 flex flex-col gap-3",children:[S.jsxs("svg",{viewBox:"0 0 120 70",className:"w-full h-auto border border-border/40 bg-muted/20","aria-hidden":"true",children:[S.jsx("rect",{x:"0",y:"0",width:"120",height:"12",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"8",y:"3",width:"30",height:"6",rx:"1",fill:"#14b8a6",fillOpacity:"0.6"}),S.jsx("rect",{x:"8",y:"18",width:"104",height:"8",rx:"1",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"8",y:"32",width:"50",height:"30",rx:"1",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"62",y:"32",width:"50",height:"30",rx:"1",fill:"currentColor",fillOpacity:"0.08"})]}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-medium text-foreground",children:"Simple Mode"}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Clean action cards. No terminal required."})]}),S.jsx("button",{type:"button",onClick:()=>t("simple"),className:"border border-simple-accent bg-simple-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Use Simple Mode"})]}),S.jsxs("div",{className:"flex-1 border border-border p-4 flex flex-col gap-3",children:[S.jsxs("svg",{viewBox:"0 0 120 70",className:"w-full h-auto border border-border/40 bg-muted/20","aria-hidden":"true",children:[S.jsx("rect",{x:"0",y:"0",width:"120",height:"70",fill:"currentColor",fillOpacity:"0.03"}),S.jsx("rect",{x:"0",y:"0",width:"28",height:"70",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"3",y:"3",width:"22",height:"5",rx:"1",fill:"currentColor",fillOpacity:"0.2"}),S.jsx("rect",{x:"3",y:"12",width:"22",height:"3",rx:"0.5",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"3",y:"18",width:"22",height:"3",rx:"0.5",fill:"currentColor",fillOpacity:"0.12"}),S.jsx("rect",{x:"30",y:"4",width:"86",height:"28",rx:"1",fill:"currentColor",fillOpacity:"0.08"}),S.jsx("rect",{x:"30",y:"36",width:"86",height:"28",rx:"1",fill:"#3b82f6",fillOpacity:"0.1"}),S.jsx("rect",{x:"33",y:"39",width:"12",height:"2",rx:"0.5",fill:"#3b82f6",fillOpacity:"0.5"})]}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-medium text-foreground",children:"Advanced Mode"}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:"Full dashboard with terminal and phase viewer."})]}),S.jsx("button",{type:"button",onClick:()=>t("advanced"),className:"border border-accent bg-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Use Advanced Mode"})]})]})]})]})}function rl(t){var e;return(((e=t==null?void 0:t.phases)==null?void 0:e.length)??0)>0}function hQ(t){var e;return((e=t==null?void 0:t.phases)==null?void 0:e.some(i=>i.disk_status==="partial"||i.disk_status==="planned"||i.disk_status==="discussed"||i.disk_status==="researched"))??!1}const DS=[{id:"plan-new-phase",tab:"plan",title:"Plan New Phase",description:"Create a detailed execution plan for the next phase",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"3",y:"4",width:"14",height:"13",rx:"1"}),S.jsx("path",{d:"M7 8h6M7 11h4M10 2v4",strokeLinecap:"round"})]}),requiresInput:!0,command:"/maxsim:plan-phase",isAvailable:t=>rl(t),unavailableReason:"No phases found in ROADMAP.md — create a project first"},{id:"add-phase",tab:"plan",title:"Add Phase",description:"Insert a new phase into the roadmap",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("rect",{x:"3",y:"4",width:"14",height:"13",rx:"1"}),S.jsx("path",{d:"M10 8v6M7 11h6",strokeLinecap:"round"})]}),requiresInput:!0,command:"/maxsim:add-phase",isAvailable:t=>rl(t),unavailableReason:"No project loaded — create a project first"},{id:"discuss-phase",tab:"plan",title:"Discuss Phase",description:"Answer planning questions to define requirements for a phase",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M3 6a1 1 0 011-1h12a1 1 0 011 1v7a1 1 0 01-1 1H7l-4 3V6z",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:discuss-phase",isAvailable:t=>hQ(t),unavailableReason:"No active phase to discuss — plan a phase first"},{id:"init-existing",tab:"plan",title:"Init Existing",description:"Set up MAXSIM planning for an existing project",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M10 3v10M10 13l-3-3M10 13l3-3",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M4 17h12",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:init-existing",isAvailable:()=>!0,unavailableReason:""},{id:"new-project",tab:"plan",title:"New Project",description:"Start a brand new MAXSIM project from scratch",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M10 4v12M4 10h12",strokeLinecap:"round"})}),requiresInput:!1,command:"/maxsim:quick",isAvailable:()=>!0,unavailableReason:""},{id:"execute-phase",tab:"execute",title:"Execute Phase",description:"Run the current phase plan and implement the changes",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M6 4l10 6-10 6V4z",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:execute-phase",isAvailable:t=>hQ(t),unavailableReason:"No phase is currently planned — plan a phase first"},{id:"verify-work",tab:"execute",title:"Verify Work",description:"Check that completed phase work meets all acceptance criteria",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M4 10l4 4 8-8",strokeLinecap:"round",strokeLinejoin:"round"})}),requiresInput:!1,command:"/maxsim:verify-work",isAvailable:t=>rl(t),unavailableReason:"No phases to verify — complete a phase first"},{id:"audit-milestone",tab:"execute",title:"Audit Milestone",description:"Review and archive a completed milestone",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M4 5h12M4 10h8M4 15h10",strokeLinecap:"round"}),S.jsx("circle",{cx:"16",cy:"14",r:"2.5"}),S.jsx("path",{d:"M18 16l1.5 1.5",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:audit-milestone",isAvailable:t=>rl(t),unavailableReason:"No milestone to audit — complete some phases first"},{id:"fix-gaps",tab:"execute",title:"Fix Gaps",description:"Create plans to close verification failures",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("path",{d:"M10 4v6h6",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M4 10a6 6 0 1012 0",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:plan-phase --gaps",isAvailable:t=>rl(t),unavailableReason:"No phases to fix — complete a verification first"},{id:"find-gaps",tab:"execute",title:"Find Gaps",description:"Identify missing requirements or unverified work",icon:S.jsxs("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:[S.jsx("circle",{cx:"9",cy:"9",r:"5"}),S.jsx("path",{d:"M16 16l-3-3",strokeLinecap:"round"}),S.jsx("path",{d:"M9 7v2M9 11h.01",strokeLinecap:"round"})]}),requiresInput:!1,command:"/maxsim:verify-work --find-gaps",isAvailable:t=>rl(t),unavailableReason:"No phases to analyze — create some phases first"},{id:"view-roadmap",tab:"execute",title:"View Roadmap",description:"See all phases and their status inline",icon:S.jsx("svg",{className:"h-5 w-5 shrink-0",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M3 5h14M3 10h14M3 15h8",strokeLinecap:"round"})}),requiresInput:!1,command:"",isAvailable:t=>rl(t),unavailableReason:"No roadmap to display"}];function jae(){var c,u;const{roadmap:t}=Rl(),{setTab:e,setExpanded:i}=oO(),n=(c=t==null?void 0:t.phases)==null?void 0:c.find(d=>d.number===(t==null?void 0:t.current_phase));let s=null;if(n){const d=n.disk_status;d==="empty"||d==="no_directory"||d==="discussed"||d==="researched"?s="plan-new-phase":d==="planned"||d==="partial"?s="execute-phase":d==="complete"&&(s="verify-work")}else(((u=t==null?void 0:t.phases)==null?void 0:u.length)??0)===0&&(s="new-project");if(!s)return null;const r=DS.find(d=>d.id===s);if(!r)return null;const o=n?`Phase ${n.number}: ${n.name}`:"your project";function l(){const d=r.tab;e(d),i(r.id)}return S.jsxs("div",{className:"border border-simple-accent/40 bg-simple-accent/5 p-4 flex items-center justify-between gap-4 mb-4",children:[S.jsxs("div",{className:"min-w-0",children:[S.jsx("p",{className:"text-xs uppercase tracking-widest text-simple-accent font-mono mb-1",children:"Recommended"}),S.jsxs("p",{className:"text-sm text-foreground",children:[S.jsx("span",{className:"font-medium",children:o})," is ready to"," ",S.jsx("span",{className:"text-simple-accent",children:r.title.toLowerCase()})]})]}),S.jsx("button",{type:"button",onClick:l,className:"shrink-0 border border-simple-accent bg-simple-accent/10 px-3 py-1.5 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:r.title})]})}function Iae({action:t,onExecute:e}){const{inputValues:i,setInput:n,reset:s}=oO(),{roadmap:r}=Rl(),o=Z.useRef(null),[l,c]=Z.useState(!1),[u,d]=Z.useState(!1),p=(()=>{var L;if(!t.requiresInput)return"";const A=(L=r==null?void 0:r.phases)==null?void 0:L.find(E=>!E.roadmap_complete&&(E.disk_status==="empty"||E.disk_status==="no_directory"));return A?`Phase ${A.number}: ${A.name}`:""})(),g=i[t.id]??p;Z.useEffect(()=>{const A=o.current;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)},[g]);function O(){const A=o.current;A&&(A.style.height="auto",A.style.height=`${A.scrollHeight}px`)}function _(A){n(t.id,A)}function b(A){A.key==="Enter"&&!A.shiftKey&&(A.preventDefault(),w())}function x(){const A=g.trim();return t.command===""?"":A?`${t.command} "${A}"`:t.command}function w(){if(t.requiresInput&&!g.trim()||t.id==="view-roadmap")return;const A=x();A&&e(A)}function k(){u?(s(),d(!1),c(!1)):(d(!0),setTimeout(()=>d(!1),3e3))}const T=t.requiresInput&&!g.trim();return S.jsxs("div",{className:"flex flex-col gap-3 relative",children:[S.jsx("p",{className:"text-xs text-muted-foreground",children:t.requiresInput?"Describe what this phase should accomplish.":"Add optional context (or leave blank to use defaults)."}),S.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 flex gap-2 items-start",children:S.jsx("textarea",{ref:o,value:g,onChange:A=>{_(A.target.value),O()},onKeyDown:b,placeholder:t.requiresInput?"e.g. Phase 31: Simple Mode UI Shell":"Additional context (optional)",rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground placeholder:text-muted-foreground outline-none leading-relaxed"})}),S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsxs("button",{type:"button",onClick:w,disabled:T,className:Fe("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",T?"border-border text-muted-foreground cursor-not-allowed":"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background"),children:[S.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"currentColor","aria-hidden":"true",children:S.jsx("path",{d:"M2 2l8 4-8 4V2z"})}),"Run in Terminal"]}),S.jsxs("div",{className:"relative ml-auto",children:[S.jsx("button",{type:"button",onClick:()=>c(A=>!A),"aria-label":"More options",className:"flex h-6 w-6 items-center justify-center text-muted-foreground hover:text-foreground",children:S.jsxs("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:[S.jsx("circle",{cx:"4",cy:"8",r:"1.2"}),S.jsx("circle",{cx:"8",cy:"8",r:"1.2"}),S.jsx("circle",{cx:"12",cy:"8",r:"1.2"})]})}),l&&S.jsx("div",{className:"absolute right-0 bottom-8 z-20 border border-border bg-card shadow-lg min-w-max",children:S.jsx("button",{type:"button",onClick:k,className:Fe("flex w-full items-center gap-2 px-4 py-2.5 text-xs text-left transition-colors",u?"text-danger hover:bg-danger/10":"text-muted-foreground hover:text-foreground hover:bg-card-hover"),children:u?"Click again to confirm reset":"Reset Simple Mode"})})]})]})]})}function Vae({action:t,roadmap:e,onExecute:i}){var g,O;const{expandedCardId:n,setExpanded:s}=oO(),{roadmap:r}=Rl(),o=n===t.id,l=!t.isAvailable(e),c=(g=r==null?void 0:r.phases)==null?void 0:g.find(_=>_.number===(r==null?void 0:r.current_phase));let u=null;if(c){const _=c.disk_status;_==="empty"||_==="no_directory"||_==="discussed"||_==="researched"?u="plan-new-phase":_==="planned"||_==="partial"?u="execute-phase":_==="complete"&&(u="verify-work")}else(((O=r==null?void 0:r.phases)==null?void 0:O.length)??0)===0&&(u="new-project");const d=t.id===u;function p(){l||s(o?null:t.id)}return S.jsxs("div",{className:Fe("bg-card border-0 transition-all duration-200",l?"opacity-50":"cursor-pointer hover:shadow-md hover:-translate-y-px",o&&"ring-1 ring-simple-accent/40"),title:l?t.unavailableReason:void 0,children:[S.jsxs("button",{type:"button",disabled:l,onClick:p,className:"flex w-full items-start gap-3 p-4 text-left","aria-expanded":o,children:[S.jsx("span",{className:Fe("mt-0.5 shrink-0",l?"text-muted-foreground":"text-simple-accent"),children:t.icon}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.title}),S.jsx("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:t.description}),d&&!l&&S.jsx("span",{className:"mt-1 inline-block bg-simple-accent/20 border border-simple-accent/40 px-1.5 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent",children:"Recommended"})]}),S.jsx("svg",{className:Fe("mt-1 h-3.5 w-3.5 shrink-0 text-muted-foreground transition-transform duration-200",o&&"rotate-180"),viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M2 4l4 4 4-4",strokeLinecap:"round",strokeLinejoin:"round"})})]}),S.jsx(xx,{initial:!1,children:o&&S.jsx(vo.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden border-t border-border/60",children:S.jsx("div",{className:"p-4",children:S.jsx(Iae,{action:t,onExecute:i})})},"expanded")})]})}const s1=6;function Xae({onExecute:t}){var T;const{roadmap:e}=Rl(),{activeTab:i,setTab:n}=oO(),s=Z.useRef(i),[r,o]=Z.useState({plan:!1,execute:!1}),l=e??null,c=DS.filter(A=>A.tab==="plan"),u=DS.filter(A=>A.tab==="execute"),d=(((T=e==null?void 0:e.phases)==null?void 0:T.length)??0)===0,p=d?c.filter(A=>A.id==="new-project"||A.id==="init-existing"):c,g=d?[]:u,O=i==="plan"?p:g,_=r[i],b=_?O:O.slice(0,s1),x=O.length>s1&&!_;function w(A){s.current=i,n(A)}const k=i==="plan"&&s.current==="execute"?-1:1;return S.jsxs("div",{className:"flex flex-col gap-0",children:[S.jsx("div",{className:"flex border-b border-border",children:["plan","execute"].map(A=>{const L=A==="plan"?p.length:g.length,E=A==="plan"?"Plan & Discuss":"Execute & Verify";return S.jsxs("button",{type:"button",onClick:()=>w(A),className:Fe("flex-1 py-2.5 text-xs font-mono uppercase tracking-widest transition-colors duration-200 border-b-2",i===A?"border-b-simple-accent text-simple-accent":"border-b-transparent text-muted-foreground hover:text-foreground"),children:[E," (",L,")"]},A)})}),S.jsx("div",{className:"overflow-hidden",children:S.jsx(xx,{mode:"wait",initial:!1,children:S.jsx(vo.div,{initial:{x:k*20,opacity:0},animate:{x:0,opacity:1},exit:{x:k*-20,opacity:0},transition:{duration:.15},children:O.length===0?S.jsx("div",{className:"py-12 text-center",children:S.jsx("p",{className:"text-sm text-muted-foreground",children:"No actions available in this tab."})}):S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"grid grid-cols-2 gap-px bg-border lg:grid-cols-3",children:b.map(A=>S.jsx(Vae,{action:A,roadmap:l,onExecute:t},A.id))}),x&&S.jsxs("button",{type:"button",onClick:()=>o(A=>({...A,[i]:!0})),className:"w-full border-t border-border py-2.5 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:text-foreground hover:bg-card-hover",children:["Show more (",O.length-s1," more)"]})]})},i)})})]})}function Zae(t,e){const i={};return(t[t.length-1]===""?[...t,""]:t).join((i.padRight?" ":"")+","+(i.padLeft===!1?"":" ")).trim()}const qae=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Wae=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Uae={};function uQ(t,e){return(Uae.jsx?Wae:qae).test(t)}const Yae=/[ \t\n\f\r]/g;function Hae(t){return typeof t=="object"?t.type==="text"?fQ(t.value):!1:fQ(t)}function fQ(t){return t.replace(Yae,"")===""}class Cd{constructor(e,i,n){this.normal=i,this.property=e,n&&(this.space=n)}}Cd.prototype.normal={};Cd.prototype.property={};Cd.prototype.space=void 0;function Xz(t,e){const i={},n={};for(const s of t)Object.assign(i,s.property),Object.assign(n,s.normal);return new Cd(i,n,e)}function BS(t){return t.toLowerCase()}class jn{constructor(e,i){this.attribute=i,this.property=e}}jn.prototype.attribute="";jn.prototype.booleanish=!1;jn.prototype.boolean=!1;jn.prototype.commaOrSpaceSeparated=!1;jn.prototype.commaSeparated=!1;jn.prototype.defined=!1;jn.prototype.mustUseProperty=!1;jn.prototype.number=!1;jn.prototype.overloadedBoolean=!1;jn.prototype.property="";jn.prototype.spaceSeparated=!1;jn.prototype.space=void 0;let Fae=0;const Xe=zl(),ri=zl(),$S=zl(),de=zl(),wt=zl(),th=zl(),es=zl();function zl(){return 2**++Fae}const zS=Object.freeze(Object.defineProperty({__proto__:null,boolean:Xe,booleanish:ri,commaOrSpaceSeparated:es,commaSeparated:th,number:de,overloadedBoolean:$S,spaceSeparated:wt},Symbol.toStringTag,{value:"Module"})),r1=Object.keys(zS);class Vw extends jn{constructor(e,i,n,s){let r=-1;if(super(e,i),dQ(this,"space",s),typeof n=="number")for(;++r<r1.length;){const o=r1[r];dQ(this,r1[r],(n&zS[o])===zS[o])}}}Vw.prototype.defined=!0;function dQ(t,e,i){i&&(t[e]=i)}function Ah(t){const e={},i={};for(const[n,s]of Object.entries(t.properties)){const r=new Vw(n,t.transform(t.attributes||{},n),s,t.space);t.mustUseProperty&&t.mustUseProperty.includes(n)&&(r.mustUseProperty=!0),e[n]=r,i[BS(n)]=n,i[BS(r.attribute)]=n}return new Cd(e,i,t.space)}const Zz=Ah({properties:{ariaActiveDescendant:null,ariaAtomic:ri,ariaAutoComplete:null,ariaBusy:ri,ariaChecked:ri,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:wt,ariaCurrent:null,ariaDescribedBy:wt,ariaDetails:null,ariaDisabled:ri,ariaDropEffect:wt,ariaErrorMessage:null,ariaExpanded:ri,ariaFlowTo:wt,ariaGrabbed:ri,ariaHasPopup:null,ariaHidden:ri,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:wt,ariaLevel:de,ariaLive:null,ariaModal:ri,ariaMultiLine:ri,ariaMultiSelectable:ri,ariaOrientation:null,ariaOwns:wt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:ri,ariaReadOnly:ri,ariaRelevant:null,ariaRequired:ri,ariaRoleDescription:wt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:ri,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function qz(t,e){return e in t?t[e]:e}function Wz(t,e){return qz(t,e.toLowerCase())}const Gae=Ah({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:th,acceptCharset:wt,accessKey:wt,action:null,allow:null,allowFullScreen:Xe,allowPaymentRequest:Xe,allowUserMedia:Xe,alt:null,as:null,async:Xe,autoCapitalize:null,autoComplete:wt,autoFocus:Xe,autoPlay:Xe,blocking:wt,capture:null,charSet:null,checked:Xe,cite:null,className:wt,cols:de,colSpan:null,content:null,contentEditable:ri,controls:Xe,controlsList:wt,coords:de|th,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Xe,defer:Xe,dir:null,dirName:null,disabled:Xe,download:$S,draggable:ri,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Xe,formTarget:null,headers:wt,height:de,hidden:$S,high:de,href:null,hrefLang:null,htmlFor:wt,httpEquiv:wt,id:null,imageSizes:null,imageSrcSet:null,inert:Xe,inputMode:null,integrity:null,is:null,isMap:Xe,itemId:null,itemProp:wt,itemRef:wt,itemScope:Xe,itemType:wt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Xe,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Xe,muted:Xe,name:null,nonce:null,noModule:Xe,noValidate:Xe,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Xe,optimum:de,pattern:null,ping:wt,placeholder:null,playsInline:Xe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Xe,referrerPolicy:null,rel:wt,required:Xe,reversed:Xe,rows:de,rowSpan:de,sandbox:wt,scope:null,scoped:Xe,seamless:Xe,selected:Xe,shadowRootClonable:Xe,shadowRootDelegatesFocus:Xe,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:ri,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Xe,useMap:null,value:ri,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:wt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Xe,declare:Xe,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Xe,noHref:Xe,noShade:Xe,noWrap:Xe,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:ri,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Xe,disableRemotePlayback:Xe,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:Wz}),Kae=Ah({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:es,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:wt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Xe,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:th,g2:th,glyphName:th,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:es,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:wt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:es,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:es,rev:es,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:es,requiredFeatures:es,requiredFonts:es,requiredFormats:es,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:es,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:es,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:es,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:qz}),Uz=Ah({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),Yz=Ah({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Wz}),Hz=Ah({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),Jae={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},ele=/[A-Z]/g,pQ=/-[a-z]/g,tle=/^data[-\w.:]+$/i;function ile(t,e){const i=BS(e);let n=e,s=jn;if(i in t.normal)return t.property[t.normal[i]];if(i.length>4&&i.slice(0,4)==="data"&&tle.test(e)){if(e.charAt(4)==="-"){const r=e.slice(5).replace(pQ,sle);n="data"+r.charAt(0).toUpperCase()+r.slice(1)}else{const r=e.slice(4);if(!pQ.test(r)){let o=r.replace(ele,nle);o.charAt(0)!=="-"&&(o="-"+o),e="data"+o}}s=Vw}return new s(n,e)}function nle(t){return"-"+t.toLowerCase()}function sle(t){return t.charAt(1).toUpperCase()}const rle=Xz([Zz,Gae,Uz,Yz,Hz],"html"),Xw=Xz([Zz,Kae,Uz,Yz,Hz],"svg");function ole(t){return t.join(" ").trim()}var Ac={},o1,mQ;function ale(){if(mQ)return o1;mQ=1;var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,e=/\n/g,i=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,r=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
218
+ `,u="/",d="*",p="",g="comment",O="declaration";function _(x,w){if(typeof x!="string")throw new TypeError("First argument must be a string");if(!x)return[];w=w||{};var k=1,T=1;function A(D){var j=D.match(e);j&&(k+=j.length);var $=D.lastIndexOf(c);T=~$?D.length-$:T+D.length}function L(){var D={line:k,column:T};return function(j){return j.position=new E(D),q(),j}}function E(D){this.start=D,this.end={line:k,column:T},this.source=w.source}E.prototype.content=x;function z(D){var j=new Error(w.source+":"+k+":"+T+": "+D);if(j.reason=D,j.filename=w.source,j.line=k,j.column=T,j.source=x,!w.silent)throw j}function N(D){var j=D.exec(x);if(j){var $=j[0];return A($),x=x.slice($.length),j}}function q(){N(i)}function J(D){var j;for(D=D||[];j=U();)j!==!1&&D.push(j);return D}function U(){var D=L();if(!(u!=x.charAt(0)||d!=x.charAt(1))){for(var j=2;p!=x.charAt(j)&&(d!=x.charAt(j)||u!=x.charAt(j+1));)++j;if(j+=2,p===x.charAt(j-1))return z("End of comment missing");var $=x.slice(2,j-2);return T+=2,A($),x=x.slice(j),T+=2,D({type:g,comment:$})}}function R(){var D=L(),j=N(n);if(j){if(U(),!N(s))return z("property missing ':'");var $=N(r),X=D({type:O,property:b(j[0].replace(t,p)),value:$?b($[0].replace(t,p)):p});return N(o),X}}function B(){var D=[];J(D);for(var j;j=R();)j!==!1&&(D.push(j),J(D));return D}return q(),B()}function b(x){return x?x.replace(l,p):p}return o1=_,o1}var gQ;function lle(){if(gQ)return Ac;gQ=1;var t=Ac&&Ac.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Ac,"__esModule",{value:!0}),Ac.default=i;const e=t(ale());function i(n,s){let r=null;if(!n||typeof n!="string")return r;const o=(0,e.default)(n),l=typeof s=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:u,value:d}=c;l?s(u,d,c):d&&(r=r||{},r[u]=d)}),r}return Ac}var qu={},OQ;function cle(){if(OQ)return qu;OQ=1,Object.defineProperty(qu,"__esModule",{value:!0}),qu.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,e=/-([a-z])/g,i=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,r=function(u){return!u||i.test(u)||t.test(u)},o=function(u,d){return d.toUpperCase()},l=function(u,d){return"".concat(d,"-")},c=function(u,d){return d===void 0&&(d={}),r(u)?u:(u=u.toLowerCase(),d.reactCompat?u=u.replace(s,l):u=u.replace(n,l),u.replace(e,o))};return qu.camelCase=c,qu}var Wu,vQ;function hle(){if(vQ)return Wu;vQ=1;var t=Wu&&Wu.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},e=t(lle()),i=cle();function n(s,r){var o={};return!s||typeof s!="string"||(0,e.default)(s,function(l,c){l&&c&&(o[(0,i.camelCase)(l,r)]=c)}),o}return n.default=n,Wu=n,Wu}var ule=hle();const fle=WS(ule),Fz=Gz("end"),Zw=Gz("start");function Gz(t){return e;function e(i){const n=i&&i.position&&i.position[t]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function dle(t){const e=Zw(t),i=Fz(t);if(e&&i)return{start:e,end:i}}function Sf(t){return!t||typeof t!="object"?"":"position"in t||"type"in t?_Q(t.position):"start"in t||"end"in t?_Q(t):"line"in t||"column"in t?NS(t):""}function NS(t){return yQ(t&&t.line)+":"+yQ(t&&t.column)}function _Q(t){return NS(t&&t.start)+"-"+NS(t&&t.end)}function yQ(t){return t&&typeof t=="number"?t:1}class ln extends Error{constructor(e,i,n){super(),typeof i=="string"&&(n=i,i=void 0);let s="",r={},o=!1;if(i&&("line"in i&&"column"in i?r={place:i}:"start"in i&&"end"in i?r={place:i}:"type"in i?r={ancestors:[i],place:i.position}:r={...i}),typeof e=="string"?s=e:!r.cause&&e&&(o=!0,s=e.message,r.cause=e),!r.ruleId&&!r.source&&typeof n=="string"){const c=n.indexOf(":");c===-1?r.ruleId=n:(r.source=n.slice(0,c),r.ruleId=n.slice(c+1))}if(!r.place&&r.ancestors&&r.ancestors){const c=r.ancestors[r.ancestors.length-1];c&&(r.place=c.position)}const l=r.place&&"start"in r.place?r.place.start:r.place;this.ancestors=r.ancestors||void 0,this.cause=r.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=l?l.line:void 0,this.name=Sf(r.place)||"1:1",this.place=r.place||void 0,this.reason=this.message,this.ruleId=r.ruleId||void 0,this.source=r.source||void 0,this.stack=o&&r.cause&&typeof r.cause.stack=="string"?r.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ln.prototype.file="";ln.prototype.name="";ln.prototype.reason="";ln.prototype.message="";ln.prototype.stack="";ln.prototype.column=void 0;ln.prototype.line=void 0;ln.prototype.ancestors=void 0;ln.prototype.cause=void 0;ln.prototype.fatal=void 0;ln.prototype.place=void 0;ln.prototype.ruleId=void 0;ln.prototype.source=void 0;const qw={}.hasOwnProperty,ple=new Map,mle=/[A-Z]/g,gle=new Set(["table","tbody","thead","tfoot","tr"]),Ole=new Set(["td","th"]),Kz="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function vle(t,e){if(!e||e.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const i=e.filePath||void 0;let n;if(e.development){if(typeof e.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=kle(i,e.jsxDEV)}else{if(typeof e.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof e.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=Cle(i,e.jsx,e.jsxs)}const s={Fragment:e.Fragment,ancestors:[],components:e.components||{},create:n,elementAttributeNameCase:e.elementAttributeNameCase||"react",evaluater:e.createEvaluater?e.createEvaluater():void 0,filePath:i,ignoreInvalidStyle:e.ignoreInvalidStyle||!1,passKeys:e.passKeys!==!1,passNode:e.passNode||!1,schema:e.space==="svg"?Xw:rle,stylePropertyNameCase:e.stylePropertyNameCase||"dom",tableCellAlignToStyle:e.tableCellAlignToStyle!==!1},r=Jz(s,t,void 0);return r&&typeof r!="string"?r:s.create(t,s.Fragment,{children:r||void 0},void 0)}function Jz(t,e,i){if(e.type==="element")return _le(t,e,i);if(e.type==="mdxFlowExpression"||e.type==="mdxTextExpression")return yle(t,e);if(e.type==="mdxJsxFlowElement"||e.type==="mdxJsxTextElement")return Sle(t,e,i);if(e.type==="mdxjsEsm")return ble(t,e);if(e.type==="root")return xle(t,e,i);if(e.type==="text")return wle(t,e)}function _le(t,e,i){const n=t.schema;let s=n;e.tagName.toLowerCase()==="svg"&&n.space==="html"&&(s=Xw,t.schema=s),t.ancestors.push(e);const r=tN(t,e.tagName,!1),o=Tle(t,e);let l=Uw(t,e);return gle.has(e.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!Hae(c):!0})),eN(t,o,r,e),Ww(o,l),t.ancestors.pop(),t.schema=n,t.create(e,r,o,i)}function yle(t,e){if(e.data&&e.data.estree&&t.evaluater){const n=e.data.estree.body[0];return n.type,t.evaluater.evaluateExpression(n.expression)}rd(t,e.position)}function ble(t,e){if(e.data&&e.data.estree&&t.evaluater)return t.evaluater.evaluateProgram(e.data.estree);rd(t,e.position)}function Sle(t,e,i){const n=t.schema;let s=n;e.name==="svg"&&n.space==="html"&&(s=Xw,t.schema=s),t.ancestors.push(e);const r=e.name===null?t.Fragment:tN(t,e.name,!0),o=Ale(t,e),l=Uw(t,e);return eN(t,o,r,e),Ww(o,l),t.ancestors.pop(),t.schema=n,t.create(e,r,o,i)}function xle(t,e,i){const n={};return Ww(n,Uw(t,e)),t.create(e,t.Fragment,n,i)}function wle(t,e){return e.value}function eN(t,e,i,n){typeof i!="string"&&i!==t.Fragment&&t.passNode&&(e.node=n)}function Ww(t,e){if(e.length>0){const i=e.length>1?e:e[0];i&&(t.children=i)}}function Cle(t,e,i){return n;function n(s,r,o,l){const u=Array.isArray(o.children)?i:e;return l?u(r,o,l):u(r,o)}}function kle(t,e){return i;function i(n,s,r,o){const l=Array.isArray(r.children),c=Zw(n);return e(s,r,o,l,{columnNumber:c?c.column-1:void 0,fileName:t,lineNumber:c?c.line:void 0},void 0)}}function Tle(t,e){const i={};let n,s;for(s in e.properties)if(s!=="children"&&qw.call(e.properties,s)){const r=Ele(t,s,e.properties[s]);if(r){const[o,l]=r;t.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&Ole.has(e.tagName)?n=l:i[o]=l}}if(n){const r=i.style||(i.style={});r[t.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return i}function Ale(t,e){const i={};for(const n of e.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&t.evaluater){const r=n.data.estree.body[0];r.type;const o=r.expression;o.type;const l=o.properties[0];l.type,Object.assign(i,t.evaluater.evaluateExpression(l.argument))}else rd(t,e.position);else{const s=n.name;let r;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&t.evaluater){const l=n.value.data.estree.body[0];l.type,r=t.evaluater.evaluateExpression(l.expression)}else rd(t,e.position);else r=n.value===null?!0:n.value;i[s]=r}return i}function Uw(t,e){const i=[];let n=-1;const s=t.passKeys?new Map:ple;for(;++n<e.children.length;){const r=e.children[n];let o;if(t.passKeys){const c=r.type==="element"?r.tagName:r.type==="mdxJsxFlowElement"||r.type==="mdxJsxTextElement"?r.name:void 0;if(c){const u=s.get(c)||0;o=c+"-"+u,s.set(c,u+1)}}const l=Jz(t,r,o);l!==void 0&&i.push(l)}return i}function Ele(t,e,i){const n=ile(t.schema,e);if(!(i==null||typeof i=="number"&&Number.isNaN(i))){if(Array.isArray(i)&&(i=n.commaSeparated?Zae(i):ole(i)),n.property==="style"){let s=typeof i=="object"?i:Mle(t,String(i));return t.stylePropertyNameCase==="css"&&(s=Ple(s)),["style",s]}return[t.elementAttributeNameCase==="react"&&n.space?Jae[n.property]||n.property:n.attribute,i]}}function Mle(t,e){try{return fle(e,{reactCompat:!0})}catch(i){if(t.ignoreInvalidStyle)return{};const n=i,s=new ln("Cannot parse `style` attribute",{ancestors:t.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=t.filePath||void 0,s.url=Kz+"#cannot-parse-style-attribute",s}}function tN(t,e,i){let n;if(!i)n={type:"Literal",value:e};else if(e.includes(".")){const s=e.split(".");let r=-1,o;for(;++r<s.length;){const l=uQ(s[r])?{type:"Identifier",name:s[r]}:{type:"Literal",value:s[r]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(r&&l.type==="Literal"),optional:!1}:l}n=o}else n=uQ(e)&&!/^[a-z]/.test(e)?{type:"Identifier",name:e}:{type:"Literal",value:e};if(n.type==="Literal"){const s=n.value;return qw.call(t.components,s)?t.components[s]:s}if(t.evaluater)return t.evaluater.evaluateExpression(n);rd(t)}function rd(t,e){const i=new ln("Cannot handle MDX estrees without `createEvaluater`",{ancestors:t.ancestors,place:e,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw i.file=t.filePath||void 0,i.url=Kz+"#cannot-handle-mdx-estrees-without-createevaluater",i}function Ple(t){const e={};let i;for(i in t)qw.call(t,i)&&(e[Rle(i)]=t[i]);return e}function Rle(t){let e=t.replace(mle,Qle);return e.slice(0,3)==="ms-"&&(e="-"+e),e}function Qle(t){return"-"+t.toLowerCase()}const a1={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},Lle={};function Dle(t,e){const i=Lle,n=typeof i.includeImageAlt=="boolean"?i.includeImageAlt:!0,s=typeof i.includeHtml=="boolean"?i.includeHtml:!0;return iN(t,n,s)}function iN(t,e,i){if(Ble(t)){if("value"in t)return t.type==="html"&&!i?"":t.value;if(e&&"alt"in t&&t.alt)return t.alt;if("children"in t)return bQ(t.children,e,i)}return Array.isArray(t)?bQ(t,e,i):""}function bQ(t,e,i){const n=[];let s=-1;for(;++s<t.length;)n[s]=iN(t[s],e,i);return n.join("")}function Ble(t){return!!(t&&typeof t=="object")}const SQ=document.createElement("i");function Yw(t){const e="&"+t+";";SQ.innerHTML=e;const i=SQ.textContent;return i.charCodeAt(i.length-1)===59&&t!=="semi"||i===e?!1:i}function Pr(t,e,i,n){const s=t.length;let r=0,o;if(e<0?e=-e>s?0:s+e:e=e>s?s:e,i=i>0?i:0,n.length<1e4)o=Array.from(n),o.unshift(e,i),t.splice(...o);else for(i&&t.splice(e,i);r<n.length;)o=n.slice(r,r+1e4),o.unshift(e,0),t.splice(...o),r+=1e4,e+=1e4}function ws(t,e){return t.length>0?(Pr(t,t.length,0,e),t):e}const xQ={}.hasOwnProperty;function $le(t){const e={};let i=-1;for(;++i<t.length;)zle(e,t[i]);return e}function zle(t,e){let i;for(i in e){const s=(xQ.call(t,i)?t[i]:void 0)||(t[i]={}),r=e[i];let o;if(r)for(o in r){xQ.call(s,o)||(s[o]=[]);const l=r[o];Nle(s[o],Array.isArray(l)?l:l?[l]:[])}}}function Nle(t,e){let i=-1;const n=[];for(;++i<e.length;)(e[i].add==="after"?t:n).push(e[i]);Pr(t,0,0,n)}function nN(t,e){const i=Number.parseInt(t,e);return i<9||i===11||i>13&&i<32||i>126&&i<160||i>55295&&i<57344||i>64975&&i<65008||(i&65535)===65535||(i&65535)===65534||i>1114111?"�":String.fromCodePoint(i)}function ih(t){return t.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const vr=Qa(/[A-Za-z]/),rs=Qa(/[\dA-Za-z]/),jle=Qa(/[#-'*+\--9=?A-Z^-~]/);function jS(t){return t!==null&&(t<32||t===127)}const IS=Qa(/\d/),Ile=Qa(/[\dA-Fa-f]/),Vle=Qa(/[!-/:-@[-`{-~]/);function $e(t){return t!==null&&t<-2}function Nn(t){return t!==null&&(t<0||t===32)}function lt(t){return t===-2||t===-1||t===32}const Xle=Qa(new RegExp("\\p{P}|\\p{S}","u")),Zle=Qa(/\s/);function Qa(t){return e;function e(i){return i!==null&&i>-1&&t.test(String.fromCharCode(i))}}function Eh(t){const e=[];let i=-1,n=0,s=0;for(;++i<t.length;){const r=t.charCodeAt(i);let o="";if(r===37&&rs(t.charCodeAt(i+1))&&rs(t.charCodeAt(i+2)))s=2;else if(r<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(r))||(o=String.fromCharCode(r));else if(r>55295&&r<57344){const l=t.charCodeAt(i+1);r<56320&&l>56319&&l<57344?(o=String.fromCharCode(r,l),s=1):o="�"}else o=String.fromCharCode(r);o&&(e.push(t.slice(n,i),encodeURIComponent(o)),n=i+s+1,o=""),s&&(i+=s,s=0)}return e.join("")+t.slice(n)}function kt(t,e,i,n){const s=n?n-1:Number.POSITIVE_INFINITY;let r=0;return o;function o(c){return lt(c)?(t.enter(i),l(c)):e(c)}function l(c){return lt(c)&&r++<s?(t.consume(c),l):(t.exit(i),e(c))}}const qle={tokenize:Wle};function Wle(t){const e=t.attempt(this.parser.constructs.contentInitial,n,s);let i;return e;function n(l){if(l===null){t.consume(l);return}return t.enter("lineEnding"),t.consume(l),t.exit("lineEnding"),kt(t,e,"linePrefix")}function s(l){return t.enter("paragraph"),r(l)}function r(l){const c=t.enter("chunkText",{contentType:"text",previous:i});return i&&(i.next=c),i=c,o(l)}function o(l){if(l===null){t.exit("chunkText"),t.exit("paragraph"),t.consume(l);return}return $e(l)?(t.consume(l),t.exit("chunkText"),r):(t.consume(l),o)}}const Ule={tokenize:Yle},wQ={tokenize:Hle};function Yle(t){const e=this,i=[];let n=0,s,r,o;return l;function l(T){if(n<i.length){const A=i[n];return e.containerState=A[1],t.attempt(A[0].continuation,c,u)(T)}return u(T)}function c(T){if(n++,e.containerState._closeFlow){e.containerState._closeFlow=void 0,s&&k();const A=e.events.length;let L=A,E;for(;L--;)if(e.events[L][0]==="exit"&&e.events[L][1].type==="chunkFlow"){E=e.events[L][1].end;break}w(n);let z=A;for(;z<e.events.length;)e.events[z][1].end={...E},z++;return Pr(e.events,L+1,0,e.events.slice(A)),e.events.length=z,u(T)}return l(T)}function u(T){if(n===i.length){if(!s)return g(T);if(s.currentConstruct&&s.currentConstruct.concrete)return _(T);e.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return e.containerState={},t.check(wQ,d,p)(T)}function d(T){return s&&k(),w(n),g(T)}function p(T){return e.parser.lazy[e.now().line]=n!==i.length,o=e.now().offset,_(T)}function g(T){return e.containerState={},t.attempt(wQ,O,_)(T)}function O(T){return n++,i.push([e.currentConstruct,e.containerState]),g(T)}function _(T){if(T===null){s&&k(),w(0),t.consume(T);return}return s=s||e.parser.flow(e.now()),t.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:r}),b(T)}function b(T){if(T===null){x(t.exit("chunkFlow"),!0),w(0),t.consume(T);return}return $e(T)?(t.consume(T),x(t.exit("chunkFlow")),n=0,e.interrupt=void 0,l):(t.consume(T),b)}function x(T,A){const L=e.sliceStream(T);if(A&&L.push(null),T.previous=r,r&&(r.next=T),r=T,s.defineSkip(T.start),s.write(L),e.parser.lazy[T.start.line]){let E=s.events.length;for(;E--;)if(s.events[E][1].start.offset<o&&(!s.events[E][1].end||s.events[E][1].end.offset>o))return;const z=e.events.length;let N=z,q,J;for(;N--;)if(e.events[N][0]==="exit"&&e.events[N][1].type==="chunkFlow"){if(q){J=e.events[N][1].end;break}q=!0}for(w(n),E=z;E<e.events.length;)e.events[E][1].end={...J},E++;Pr(e.events,N+1,0,e.events.slice(z)),e.events.length=E}}function w(T){let A=i.length;for(;A-- >T;){const L=i[A];e.containerState=L[1],L[0].exit.call(e,t)}i.length=T}function k(){s.write([null]),r=void 0,s=void 0,e.containerState._closeFlow=void 0}}function Hle(t,e,i){return kt(t,t.attempt(this.parser.constructs.document,e,i),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function CQ(t){if(t===null||Nn(t)||Zle(t))return 1;if(Xle(t))return 2}function Hw(t,e,i){const n=[];let s=-1;for(;++s<t.length;){const r=t[s].resolveAll;r&&!n.includes(r)&&(e=r(e,i),n.push(r))}return e}const VS={name:"attention",resolveAll:Fle,tokenize:Gle};function Fle(t,e){let i=-1,n,s,r,o,l,c,u,d;for(;++i<t.length;)if(t[i][0]==="enter"&&t[i][1].type==="attentionSequence"&&t[i][1]._close){for(n=i;n--;)if(t[n][0]==="exit"&&t[n][1].type==="attentionSequence"&&t[n][1]._open&&e.sliceSerialize(t[n][1]).charCodeAt(0)===e.sliceSerialize(t[i][1]).charCodeAt(0)){if((t[n][1]._close||t[i][1]._open)&&(t[i][1].end.offset-t[i][1].start.offset)%3&&!((t[n][1].end.offset-t[n][1].start.offset+t[i][1].end.offset-t[i][1].start.offset)%3))continue;c=t[n][1].end.offset-t[n][1].start.offset>1&&t[i][1].end.offset-t[i][1].start.offset>1?2:1;const p={...t[n][1].end},g={...t[i][1].start};kQ(p,-c),kQ(g,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...t[n][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...t[i][1].start},end:g},r={type:c>1?"strongText":"emphasisText",start:{...t[n][1].end},end:{...t[i][1].start}},s={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},t[n][1].end={...o.start},t[i][1].start={...l.end},u=[],t[n][1].end.offset-t[n][1].start.offset&&(u=ws(u,[["enter",t[n][1],e],["exit",t[n][1],e]])),u=ws(u,[["enter",s,e],["enter",o,e],["exit",o,e],["enter",r,e]]),u=ws(u,Hw(e.parser.constructs.insideSpan.null,t.slice(n+1,i),e)),u=ws(u,[["exit",r,e],["enter",l,e],["exit",l,e],["exit",s,e]]),t[i][1].end.offset-t[i][1].start.offset?(d=2,u=ws(u,[["enter",t[i][1],e],["exit",t[i][1],e]])):d=0,Pr(t,n-1,i-n+3,u),i=n+u.length-d-2;break}}for(i=-1;++i<t.length;)t[i][1].type==="attentionSequence"&&(t[i][1].type="data");return t}function Gle(t,e){const i=this.parser.constructs.attentionMarkers.null,n=this.previous,s=CQ(n);let r;return o;function o(c){return r=c,t.enter("attentionSequence"),l(c)}function l(c){if(c===r)return t.consume(c),l;const u=t.exit("attentionSequence"),d=CQ(c),p=!d||d===2&&s||i.includes(c),g=!s||s===2&&d||i.includes(n);return u._open=!!(r===42?p:p&&(s||!g)),u._close=!!(r===42?g:g&&(d||!p)),e(c)}}function kQ(t,e){t.column+=e,t.offset+=e,t._bufferIndex+=e}const Kle={name:"autolink",tokenize:Jle};function Jle(t,e,i){let n=0;return s;function s(O){return t.enter("autolink"),t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.enter("autolinkProtocol"),r}function r(O){return vr(O)?(t.consume(O),o):O===64?i(O):u(O)}function o(O){return O===43||O===45||O===46||rs(O)?(n=1,l(O)):u(O)}function l(O){return O===58?(t.consume(O),n=0,c):(O===43||O===45||O===46||rs(O))&&n++<32?(t.consume(O),l):(n=0,u(O))}function c(O){return O===62?(t.exit("autolinkProtocol"),t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.exit("autolink"),e):O===null||O===32||O===60||jS(O)?i(O):(t.consume(O),c)}function u(O){return O===64?(t.consume(O),d):jle(O)?(t.consume(O),u):i(O)}function d(O){return rs(O)?p(O):i(O)}function p(O){return O===46?(t.consume(O),n=0,d):O===62?(t.exit("autolinkProtocol").type="autolinkEmail",t.enter("autolinkMarker"),t.consume(O),t.exit("autolinkMarker"),t.exit("autolink"),e):g(O)}function g(O){if((O===45||rs(O))&&n++<63){const _=O===45?g:p;return t.consume(O),_}return i(O)}}const PO={partial:!0,tokenize:ece};function ece(t,e,i){return n;function n(r){return lt(r)?kt(t,s,"linePrefix")(r):s(r)}function s(r){return r===null||$e(r)?e(r):i(r)}}const sN={continuation:{tokenize:ice},exit:nce,name:"blockQuote",tokenize:tce};function tce(t,e,i){const n=this;return s;function s(o){if(o===62){const l=n.containerState;return l.open||(t.enter("blockQuote",{_container:!0}),l.open=!0),t.enter("blockQuotePrefix"),t.enter("blockQuoteMarker"),t.consume(o),t.exit("blockQuoteMarker"),r}return i(o)}function r(o){return lt(o)?(t.enter("blockQuotePrefixWhitespace"),t.consume(o),t.exit("blockQuotePrefixWhitespace"),t.exit("blockQuotePrefix"),e):(t.exit("blockQuotePrefix"),e(o))}}function ice(t,e,i){const n=this;return s;function s(o){return lt(o)?kt(t,r,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):r(o)}function r(o){return t.attempt(sN,e,i)(o)}}function nce(t){t.exit("blockQuote")}const rN={name:"characterEscape",tokenize:sce};function sce(t,e,i){return n;function n(r){return t.enter("characterEscape"),t.enter("escapeMarker"),t.consume(r),t.exit("escapeMarker"),s}function s(r){return Vle(r)?(t.enter("characterEscapeValue"),t.consume(r),t.exit("characterEscapeValue"),t.exit("characterEscape"),e):i(r)}}const oN={name:"characterReference",tokenize:rce};function rce(t,e,i){const n=this;let s=0,r,o;return l;function l(p){return t.enter("characterReference"),t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),c}function c(p){return p===35?(t.enter("characterReferenceMarkerNumeric"),t.consume(p),t.exit("characterReferenceMarkerNumeric"),u):(t.enter("characterReferenceValue"),r=31,o=rs,d(p))}function u(p){return p===88||p===120?(t.enter("characterReferenceMarkerHexadecimal"),t.consume(p),t.exit("characterReferenceMarkerHexadecimal"),t.enter("characterReferenceValue"),r=6,o=Ile,d):(t.enter("characterReferenceValue"),r=7,o=IS,d(p))}function d(p){if(p===59&&s){const g=t.exit("characterReferenceValue");return o===rs&&!Yw(n.sliceSerialize(g))?i(p):(t.enter("characterReferenceMarker"),t.consume(p),t.exit("characterReferenceMarker"),t.exit("characterReference"),e)}return o(p)&&s++<r?(t.consume(p),d):i(p)}}const TQ={partial:!0,tokenize:ace},AQ={concrete:!0,name:"codeFenced",tokenize:oce};function oce(t,e,i){const n=this,s={partial:!0,tokenize:L};let r=0,o=0,l;return c;function c(E){return u(E)}function u(E){const z=n.events[n.events.length-1];return r=z&&z[1].type==="linePrefix"?z[2].sliceSerialize(z[1],!0).length:0,l=E,t.enter("codeFenced"),t.enter("codeFencedFence"),t.enter("codeFencedFenceSequence"),d(E)}function d(E){return E===l?(o++,t.consume(E),d):o<3?i(E):(t.exit("codeFencedFenceSequence"),lt(E)?kt(t,p,"whitespace")(E):p(E))}function p(E){return E===null||$e(E)?(t.exit("codeFencedFence"),n.interrupt?e(E):t.check(TQ,b,A)(E)):(t.enter("codeFencedFenceInfo"),t.enter("chunkString",{contentType:"string"}),g(E))}function g(E){return E===null||$e(E)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),p(E)):lt(E)?(t.exit("chunkString"),t.exit("codeFencedFenceInfo"),kt(t,O,"whitespace")(E)):E===96&&E===l?i(E):(t.consume(E),g)}function O(E){return E===null||$e(E)?p(E):(t.enter("codeFencedFenceMeta"),t.enter("chunkString",{contentType:"string"}),_(E))}function _(E){return E===null||$e(E)?(t.exit("chunkString"),t.exit("codeFencedFenceMeta"),p(E)):E===96&&E===l?i(E):(t.consume(E),_)}function b(E){return t.attempt(s,A,x)(E)}function x(E){return t.enter("lineEnding"),t.consume(E),t.exit("lineEnding"),w}function w(E){return r>0&&lt(E)?kt(t,k,"linePrefix",r+1)(E):k(E)}function k(E){return E===null||$e(E)?t.check(TQ,b,A)(E):(t.enter("codeFlowValue"),T(E))}function T(E){return E===null||$e(E)?(t.exit("codeFlowValue"),k(E)):(t.consume(E),T)}function A(E){return t.exit("codeFenced"),e(E)}function L(E,z,N){let q=0;return J;function J(j){return E.enter("lineEnding"),E.consume(j),E.exit("lineEnding"),U}function U(j){return E.enter("codeFencedFence"),lt(j)?kt(E,R,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):R(j)}function R(j){return j===l?(E.enter("codeFencedFenceSequence"),B(j)):N(j)}function B(j){return j===l?(q++,E.consume(j),B):q>=o?(E.exit("codeFencedFenceSequence"),lt(j)?kt(E,D,"whitespace")(j):D(j)):N(j)}function D(j){return j===null||$e(j)?(E.exit("codeFencedFence"),z(j)):N(j)}}}function ace(t,e,i){const n=this;return s;function s(o){return o===null?i(o):(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r)}function r(o){return n.parser.lazy[n.now().line]?i(o):e(o)}}const l1={name:"codeIndented",tokenize:cce},lce={partial:!0,tokenize:hce};function cce(t,e,i){const n=this;return s;function s(u){return t.enter("codeIndented"),kt(t,r,"linePrefix",5)(u)}function r(u){const d=n.events[n.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(u):i(u)}function o(u){return u===null?c(u):$e(u)?t.attempt(lce,o,c)(u):(t.enter("codeFlowValue"),l(u))}function l(u){return u===null||$e(u)?(t.exit("codeFlowValue"),o(u)):(t.consume(u),l)}function c(u){return t.exit("codeIndented"),e(u)}}function hce(t,e,i){const n=this;return s;function s(o){return n.parser.lazy[n.now().line]?i(o):$e(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),s):kt(t,r,"linePrefix",5)(o)}function r(o){const l=n.events[n.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(o):$e(o)?s(o):i(o)}}const uce={name:"codeText",previous:dce,resolve:fce,tokenize:pce};function fce(t){let e=t.length-4,i=3,n,s;if((t[i][1].type==="lineEnding"||t[i][1].type==="space")&&(t[e][1].type==="lineEnding"||t[e][1].type==="space")){for(n=i;++n<e;)if(t[n][1].type==="codeTextData"){t[i][1].type="codeTextPadding",t[e][1].type="codeTextPadding",i+=2,e-=2;break}}for(n=i-1,e++;++n<=e;)s===void 0?n!==e&&t[n][1].type!=="lineEnding"&&(s=n):(n===e||t[n][1].type==="lineEnding")&&(t[s][1].type="codeTextData",n!==s+2&&(t[s][1].end=t[n-1][1].end,t.splice(s+2,n-s-2),e-=n-s-2,n=s+2),s=void 0);return t}function dce(t){return t!==96||this.events[this.events.length-1][1].type==="characterEscape"}function pce(t,e,i){let n=0,s,r;return o;function o(p){return t.enter("codeText"),t.enter("codeTextSequence"),l(p)}function l(p){return p===96?(t.consume(p),n++,l):(t.exit("codeTextSequence"),c(p))}function c(p){return p===null?i(p):p===32?(t.enter("space"),t.consume(p),t.exit("space"),c):p===96?(r=t.enter("codeTextSequence"),s=0,d(p)):$e(p)?(t.enter("lineEnding"),t.consume(p),t.exit("lineEnding"),c):(t.enter("codeTextData"),u(p))}function u(p){return p===null||p===32||p===96||$e(p)?(t.exit("codeTextData"),c(p)):(t.consume(p),u)}function d(p){return p===96?(t.consume(p),s++,d):s===n?(t.exit("codeTextSequence"),t.exit("codeText"),e(p)):(r.type="codeTextData",u(p))}}class mce{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,i){const n=i??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,i,n){const s=i||0;this.setCursor(Math.trunc(e));const r=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return n&&Uu(this.left,n),r.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(e){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(e)}pushMany(e){this.setCursor(Number.POSITIVE_INFINITY),Uu(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Uu(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0))if(e<this.left.length){const i=this.left.splice(e,Number.POSITIVE_INFINITY);Uu(this.right,i.reverse())}else{const i=this.right.splice(this.left.length+this.right.length-e,Number.POSITIVE_INFINITY);Uu(this.left,i.reverse())}}}function Uu(t,e){let i=0;if(e.length<1e4)t.push(...e);else for(;i<e.length;)t.push(...e.slice(i,i+1e4)),i+=1e4}function aN(t){const e={};let i=-1,n,s,r,o,l,c,u;const d=new mce(t);for(;++i<d.length;){for(;i in e;)i=e[i];if(n=d.get(i),i&&n[1].type==="chunkFlow"&&d.get(i-1)[1].type==="listItemPrefix"&&(c=n[1]._tokenizer.events,r=0,r<c.length&&c[r][1].type==="lineEndingBlank"&&(r+=2),r<c.length&&c[r][1].type==="content"))for(;++r<c.length&&c[r][1].type!=="content";)c[r][1].type==="chunkText"&&(c[r][1]._isInFirstContentOfListItem=!0,r++);if(n[0]==="enter")n[1].contentType&&(Object.assign(e,gce(d,i)),i=e[i],u=!0);else if(n[1]._container){for(r=i,s=void 0;r--;)if(o=d.get(r),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(s&&(d.get(s)[1].type="lineEndingBlank"),o[1].type="lineEnding",s=r);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;s&&(n[1].end={...d.get(s)[1].start},l=d.slice(s,i),l.unshift(n),d.splice(s,i-s+1,l))}}return Pr(t,0,Number.POSITIVE_INFINITY,d.slice(0)),!u}function gce(t,e){const i=t.get(e)[1],n=t.get(e)[2];let s=e-1;const r=[];let o=i._tokenizer;o||(o=n.parser[i.contentType](i.start),i._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],u={};let d,p,g=-1,O=i,_=0,b=0;const x=[b];for(;O;){for(;t.get(++s)[1]!==O;);r.push(s),O._tokenizer||(d=n.sliceStream(O),O.next||d.push(null),p&&o.defineSkip(O.start),O._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),O._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=O,O=O.next}for(O=i;++g<l.length;)l[g][0]==="exit"&&l[g-1][0]==="enter"&&l[g][1].type===l[g-1][1].type&&l[g][1].start.line!==l[g][1].end.line&&(b=g+1,x.push(b),O._tokenizer=void 0,O.previous=void 0,O=O.next);for(o.events=[],O?(O._tokenizer=void 0,O.previous=void 0):x.pop(),g=x.length;g--;){const w=l.slice(x[g],x[g+1]),k=r.pop();c.push([k,k+w.length-1]),t.splice(k,2,w)}for(c.reverse(),g=-1;++g<c.length;)u[_+c[g][0]]=_+c[g][1],_+=c[g][1]-c[g][0]-1;return u}const Oce={resolve:_ce,tokenize:yce},vce={partial:!0,tokenize:bce};function _ce(t){return aN(t),t}function yce(t,e){let i;return n;function n(l){return t.enter("content"),i=t.enter("chunkContent",{contentType:"content"}),s(l)}function s(l){return l===null?r(l):$e(l)?t.check(vce,o,r)(l):(t.consume(l),s)}function r(l){return t.exit("chunkContent"),t.exit("content"),e(l)}function o(l){return t.consume(l),t.exit("chunkContent"),i.next=t.enter("chunkContent",{contentType:"content",previous:i}),i=i.next,s}}function bce(t,e,i){const n=this;return s;function s(o){return t.exit("chunkContent"),t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),kt(t,r,"linePrefix")}function r(o){if(o===null||$e(o))return i(o);const l=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?e(o):t.interrupt(n.parser.constructs.flow,i,e)(o)}}function lN(t,e,i,n,s,r,o,l,c){const u=c||Number.POSITIVE_INFINITY;let d=0;return p;function p(w){return w===60?(t.enter(n),t.enter(s),t.enter(r),t.consume(w),t.exit(r),g):w===null||w===32||w===41||jS(w)?i(w):(t.enter(n),t.enter(o),t.enter(l),t.enter("chunkString",{contentType:"string"}),b(w))}function g(w){return w===62?(t.enter(r),t.consume(w),t.exit(r),t.exit(s),t.exit(n),e):(t.enter(l),t.enter("chunkString",{contentType:"string"}),O(w))}function O(w){return w===62?(t.exit("chunkString"),t.exit(l),g(w)):w===null||w===60||$e(w)?i(w):(t.consume(w),w===92?_:O)}function _(w){return w===60||w===62||w===92?(t.consume(w),O):O(w)}function b(w){return!d&&(w===null||w===41||Nn(w))?(t.exit("chunkString"),t.exit(l),t.exit(o),t.exit(n),e(w)):d<u&&w===40?(t.consume(w),d++,b):w===41?(t.consume(w),d--,b):w===null||w===32||w===40||jS(w)?i(w):(t.consume(w),w===92?x:b)}function x(w){return w===40||w===41||w===92?(t.consume(w),b):b(w)}}function cN(t,e,i,n,s,r){const o=this;let l=0,c;return u;function u(O){return t.enter(n),t.enter(s),t.consume(O),t.exit(s),t.enter(r),d}function d(O){return l>999||O===null||O===91||O===93&&!c||O===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?i(O):O===93?(t.exit(r),t.enter(s),t.consume(O),t.exit(s),t.exit(n),e):$e(O)?(t.enter("lineEnding"),t.consume(O),t.exit("lineEnding"),d):(t.enter("chunkString",{contentType:"string"}),p(O))}function p(O){return O===null||O===91||O===93||$e(O)||l++>999?(t.exit("chunkString"),d(O)):(t.consume(O),c||(c=!lt(O)),O===92?g:p)}function g(O){return O===91||O===92||O===93?(t.consume(O),l++,p):p(O)}}function hN(t,e,i,n,s,r){let o;return l;function l(g){return g===34||g===39||g===40?(t.enter(n),t.enter(s),t.consume(g),t.exit(s),o=g===40?41:g,c):i(g)}function c(g){return g===o?(t.enter(s),t.consume(g),t.exit(s),t.exit(n),e):(t.enter(r),u(g))}function u(g){return g===o?(t.exit(r),c(o)):g===null?i(g):$e(g)?(t.enter("lineEnding"),t.consume(g),t.exit("lineEnding"),kt(t,u,"linePrefix")):(t.enter("chunkString",{contentType:"string"}),d(g))}function d(g){return g===o||g===null||$e(g)?(t.exit("chunkString"),u(g)):(t.consume(g),g===92?p:d)}function p(g){return g===o||g===92?(t.consume(g),d):d(g)}}function xf(t,e){let i;return n;function n(s){return $e(s)?(t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),i=!0,n):lt(s)?kt(t,n,i?"linePrefix":"lineSuffix")(s):e(s)}}const Sce={name:"definition",tokenize:wce},xce={partial:!0,tokenize:Cce};function wce(t,e,i){const n=this;let s;return r;function r(O){return t.enter("definition"),o(O)}function o(O){return cN.call(n,t,l,i,"definitionLabel","definitionLabelMarker","definitionLabelString")(O)}function l(O){return s=ih(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),O===58?(t.enter("definitionMarker"),t.consume(O),t.exit("definitionMarker"),c):i(O)}function c(O){return Nn(O)?xf(t,u)(O):u(O)}function u(O){return lN(t,d,i,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(O)}function d(O){return t.attempt(xce,p,p)(O)}function p(O){return lt(O)?kt(t,g,"whitespace")(O):g(O)}function g(O){return O===null||$e(O)?(t.exit("definition"),n.parser.defined.push(s),e(O)):i(O)}}function Cce(t,e,i){return n;function n(l){return Nn(l)?xf(t,s)(l):i(l)}function s(l){return hN(t,r,i,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function r(l){return lt(l)?kt(t,o,"whitespace")(l):o(l)}function o(l){return l===null||$e(l)?e(l):i(l)}}const kce={name:"hardBreakEscape",tokenize:Tce};function Tce(t,e,i){return n;function n(r){return t.enter("hardBreakEscape"),t.consume(r),s}function s(r){return $e(r)?(t.exit("hardBreakEscape"),e(r)):i(r)}}const Ace={name:"headingAtx",resolve:Ece,tokenize:Mce};function Ece(t,e){let i=t.length-2,n=3,s,r;return t[n][1].type==="whitespace"&&(n+=2),i-2>n&&t[i][1].type==="whitespace"&&(i-=2),t[i][1].type==="atxHeadingSequence"&&(n===i-1||i-4>n&&t[i-2][1].type==="whitespace")&&(i-=n+1===i?2:4),i>n&&(s={type:"atxHeadingText",start:t[n][1].start,end:t[i][1].end},r={type:"chunkText",start:t[n][1].start,end:t[i][1].end,contentType:"text"},Pr(t,n,i-n+1,[["enter",s,e],["enter",r,e],["exit",r,e],["exit",s,e]])),t}function Mce(t,e,i){let n=0;return s;function s(d){return t.enter("atxHeading"),r(d)}function r(d){return t.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&n++<6?(t.consume(d),o):d===null||Nn(d)?(t.exit("atxHeadingSequence"),l(d)):i(d)}function l(d){return d===35?(t.enter("atxHeadingSequence"),c(d)):d===null||$e(d)?(t.exit("atxHeading"),e(d)):lt(d)?kt(t,l,"whitespace")(d):(t.enter("atxHeadingText"),u(d))}function c(d){return d===35?(t.consume(d),c):(t.exit("atxHeadingSequence"),l(d))}function u(d){return d===null||d===35||Nn(d)?(t.exit("atxHeadingText"),l(d)):(t.consume(d),u)}}const Pce=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],EQ=["pre","script","style","textarea"],Rce={concrete:!0,name:"htmlFlow",resolveTo:Dce,tokenize:Bce},Qce={partial:!0,tokenize:zce},Lce={partial:!0,tokenize:$ce};function Dce(t){let e=t.length;for(;e--&&!(t[e][0]==="enter"&&t[e][1].type==="htmlFlow"););return e>1&&t[e-2][1].type==="linePrefix"&&(t[e][1].start=t[e-2][1].start,t[e+1][1].start=t[e-2][1].start,t.splice(e-2,2)),t}function Bce(t,e,i){const n=this;let s,r,o,l,c;return u;function u(Q){return d(Q)}function d(Q){return t.enter("htmlFlow"),t.enter("htmlFlowData"),t.consume(Q),p}function p(Q){return Q===33?(t.consume(Q),g):Q===47?(t.consume(Q),r=!0,b):Q===63?(t.consume(Q),s=3,n.interrupt?e:M):vr(Q)?(t.consume(Q),o=String.fromCharCode(Q),x):i(Q)}function g(Q){return Q===45?(t.consume(Q),s=2,O):Q===91?(t.consume(Q),s=5,l=0,_):vr(Q)?(t.consume(Q),s=4,n.interrupt?e:M):i(Q)}function O(Q){return Q===45?(t.consume(Q),n.interrupt?e:M):i(Q)}function _(Q){const ue="CDATA[";return Q===ue.charCodeAt(l++)?(t.consume(Q),l===ue.length?n.interrupt?e:R:_):i(Q)}function b(Q){return vr(Q)?(t.consume(Q),o=String.fromCharCode(Q),x):i(Q)}function x(Q){if(Q===null||Q===47||Q===62||Nn(Q)){const ue=Q===47,he=o.toLowerCase();return!ue&&!r&&EQ.includes(he)?(s=1,n.interrupt?e(Q):R(Q)):Pce.includes(o.toLowerCase())?(s=6,ue?(t.consume(Q),w):n.interrupt?e(Q):R(Q)):(s=7,n.interrupt&&!n.parser.lazy[n.now().line]?i(Q):r?k(Q):T(Q))}return Q===45||rs(Q)?(t.consume(Q),o+=String.fromCharCode(Q),x):i(Q)}function w(Q){return Q===62?(t.consume(Q),n.interrupt?e:R):i(Q)}function k(Q){return lt(Q)?(t.consume(Q),k):J(Q)}function T(Q){return Q===47?(t.consume(Q),J):Q===58||Q===95||vr(Q)?(t.consume(Q),A):lt(Q)?(t.consume(Q),T):J(Q)}function A(Q){return Q===45||Q===46||Q===58||Q===95||rs(Q)?(t.consume(Q),A):L(Q)}function L(Q){return Q===61?(t.consume(Q),E):lt(Q)?(t.consume(Q),L):T(Q)}function E(Q){return Q===null||Q===60||Q===61||Q===62||Q===96?i(Q):Q===34||Q===39?(t.consume(Q),c=Q,z):lt(Q)?(t.consume(Q),E):N(Q)}function z(Q){return Q===c?(t.consume(Q),c=null,q):Q===null||$e(Q)?i(Q):(t.consume(Q),z)}function N(Q){return Q===null||Q===34||Q===39||Q===47||Q===60||Q===61||Q===62||Q===96||Nn(Q)?L(Q):(t.consume(Q),N)}function q(Q){return Q===47||Q===62||lt(Q)?T(Q):i(Q)}function J(Q){return Q===62?(t.consume(Q),U):i(Q)}function U(Q){return Q===null||$e(Q)?R(Q):lt(Q)?(t.consume(Q),U):i(Q)}function R(Q){return Q===45&&s===2?(t.consume(Q),$):Q===60&&s===1?(t.consume(Q),X):Q===62&&s===4?(t.consume(Q),I):Q===63&&s===3?(t.consume(Q),M):Q===93&&s===5?(t.consume(Q),F):$e(Q)&&(s===6||s===7)?(t.exit("htmlFlowData"),t.check(Qce,K,B)(Q)):Q===null||$e(Q)?(t.exit("htmlFlowData"),B(Q)):(t.consume(Q),R)}function B(Q){return t.check(Lce,D,K)(Q)}function D(Q){return t.enter("lineEnding"),t.consume(Q),t.exit("lineEnding"),j}function j(Q){return Q===null||$e(Q)?B(Q):(t.enter("htmlFlowData"),R(Q))}function $(Q){return Q===45?(t.consume(Q),M):R(Q)}function X(Q){return Q===47?(t.consume(Q),o="",H):R(Q)}function H(Q){if(Q===62){const ue=o.toLowerCase();return EQ.includes(ue)?(t.consume(Q),I):R(Q)}return vr(Q)&&o.length<8?(t.consume(Q),o+=String.fromCharCode(Q),H):R(Q)}function F(Q){return Q===93?(t.consume(Q),M):R(Q)}function M(Q){return Q===62?(t.consume(Q),I):Q===45&&s===2?(t.consume(Q),M):R(Q)}function I(Q){return Q===null||$e(Q)?(t.exit("htmlFlowData"),K(Q)):(t.consume(Q),I)}function K(Q){return t.exit("htmlFlow"),e(Q)}}function $ce(t,e,i){const n=this;return s;function s(o){return $e(o)?(t.enter("lineEnding"),t.consume(o),t.exit("lineEnding"),r):i(o)}function r(o){return n.parser.lazy[n.now().line]?i(o):e(o)}}function zce(t,e,i){return n;function n(s){return t.enter("lineEnding"),t.consume(s),t.exit("lineEnding"),t.attempt(PO,e,i)}}const Nce={name:"htmlText",tokenize:jce};function jce(t,e,i){const n=this;let s,r,o;return l;function l(M){return t.enter("htmlText"),t.enter("htmlTextData"),t.consume(M),c}function c(M){return M===33?(t.consume(M),u):M===47?(t.consume(M),L):M===63?(t.consume(M),T):vr(M)?(t.consume(M),N):i(M)}function u(M){return M===45?(t.consume(M),d):M===91?(t.consume(M),r=0,_):vr(M)?(t.consume(M),k):i(M)}function d(M){return M===45?(t.consume(M),O):i(M)}function p(M){return M===null?i(M):M===45?(t.consume(M),g):$e(M)?(o=p,X(M)):(t.consume(M),p)}function g(M){return M===45?(t.consume(M),O):p(M)}function O(M){return M===62?$(M):M===45?g(M):p(M)}function _(M){const I="CDATA[";return M===I.charCodeAt(r++)?(t.consume(M),r===I.length?b:_):i(M)}function b(M){return M===null?i(M):M===93?(t.consume(M),x):$e(M)?(o=b,X(M)):(t.consume(M),b)}function x(M){return M===93?(t.consume(M),w):b(M)}function w(M){return M===62?$(M):M===93?(t.consume(M),w):b(M)}function k(M){return M===null||M===62?$(M):$e(M)?(o=k,X(M)):(t.consume(M),k)}function T(M){return M===null?i(M):M===63?(t.consume(M),A):$e(M)?(o=T,X(M)):(t.consume(M),T)}function A(M){return M===62?$(M):T(M)}function L(M){return vr(M)?(t.consume(M),E):i(M)}function E(M){return M===45||rs(M)?(t.consume(M),E):z(M)}function z(M){return $e(M)?(o=z,X(M)):lt(M)?(t.consume(M),z):$(M)}function N(M){return M===45||rs(M)?(t.consume(M),N):M===47||M===62||Nn(M)?q(M):i(M)}function q(M){return M===47?(t.consume(M),$):M===58||M===95||vr(M)?(t.consume(M),J):$e(M)?(o=q,X(M)):lt(M)?(t.consume(M),q):$(M)}function J(M){return M===45||M===46||M===58||M===95||rs(M)?(t.consume(M),J):U(M)}function U(M){return M===61?(t.consume(M),R):$e(M)?(o=U,X(M)):lt(M)?(t.consume(M),U):q(M)}function R(M){return M===null||M===60||M===61||M===62||M===96?i(M):M===34||M===39?(t.consume(M),s=M,B):$e(M)?(o=R,X(M)):lt(M)?(t.consume(M),R):(t.consume(M),D)}function B(M){return M===s?(t.consume(M),s=void 0,j):M===null?i(M):$e(M)?(o=B,X(M)):(t.consume(M),B)}function D(M){return M===null||M===34||M===39||M===60||M===61||M===96?i(M):M===47||M===62||Nn(M)?q(M):(t.consume(M),D)}function j(M){return M===47||M===62||Nn(M)?q(M):i(M)}function $(M){return M===62?(t.consume(M),t.exit("htmlTextData"),t.exit("htmlText"),e):i(M)}function X(M){return t.exit("htmlTextData"),t.enter("lineEnding"),t.consume(M),t.exit("lineEnding"),H}function H(M){return lt(M)?kt(t,F,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):F(M)}function F(M){return t.enter("htmlTextData"),o(M)}}const Fw={name:"labelEnd",resolveAll:Zce,resolveTo:qce,tokenize:Wce},Ice={tokenize:Uce},Vce={tokenize:Yce},Xce={tokenize:Hce};function Zce(t){let e=-1;const i=[];for(;++e<t.length;){const n=t[e][1];if(i.push(t[e]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const s=n.type==="labelImage"?4:2;n.type="data",e+=s}}return t.length!==i.length&&Pr(t,0,t.length,i),t}function qce(t,e){let i=t.length,n=0,s,r,o,l;for(;i--;)if(s=t[i][1],r){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;t[i][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(o){if(t[i][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(r=i,s.type!=="labelLink")){n=2;break}}else s.type==="labelEnd"&&(o=i);const c={type:t[r][1].type==="labelLink"?"link":"image",start:{...t[r][1].start},end:{...t[t.length-1][1].end}},u={type:"label",start:{...t[r][1].start},end:{...t[o][1].end}},d={type:"labelText",start:{...t[r+n+2][1].end},end:{...t[o-2][1].start}};return l=[["enter",c,e],["enter",u,e]],l=ws(l,t.slice(r+1,r+n+3)),l=ws(l,[["enter",d,e]]),l=ws(l,Hw(e.parser.constructs.insideSpan.null,t.slice(r+n+4,o-3),e)),l=ws(l,[["exit",d,e],t[o-2],t[o-1],["exit",u,e]]),l=ws(l,t.slice(o+1)),l=ws(l,[["exit",c,e]]),Pr(t,r,t.length,l),t}function Wce(t,e,i){const n=this;let s=n.events.length,r,o;for(;s--;)if((n.events[s][1].type==="labelImage"||n.events[s][1].type==="labelLink")&&!n.events[s][1]._balanced){r=n.events[s][1];break}return l;function l(g){return r?r._inactive?p(g):(o=n.parser.defined.includes(ih(n.sliceSerialize({start:r.end,end:n.now()}))),t.enter("labelEnd"),t.enter("labelMarker"),t.consume(g),t.exit("labelMarker"),t.exit("labelEnd"),c):i(g)}function c(g){return g===40?t.attempt(Ice,d,o?d:p)(g):g===91?t.attempt(Vce,d,o?u:p)(g):o?d(g):p(g)}function u(g){return t.attempt(Xce,d,p)(g)}function d(g){return e(g)}function p(g){return r._balanced=!0,i(g)}}function Uce(t,e,i){return n;function n(p){return t.enter("resource"),t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),s}function s(p){return Nn(p)?xf(t,r)(p):r(p)}function r(p){return p===41?d(p):lN(t,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return Nn(p)?xf(t,c)(p):d(p)}function l(p){return i(p)}function c(p){return p===34||p===39||p===40?hN(t,u,i,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function u(p){return Nn(p)?xf(t,d)(p):d(p)}function d(p){return p===41?(t.enter("resourceMarker"),t.consume(p),t.exit("resourceMarker"),t.exit("resource"),e):i(p)}}function Yce(t,e,i){const n=this;return s;function s(l){return cN.call(n,t,r,o,"reference","referenceMarker","referenceString")(l)}function r(l){return n.parser.defined.includes(ih(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?e(l):i(l)}function o(l){return i(l)}}function Hce(t,e,i){return n;function n(r){return t.enter("reference"),t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),s}function s(r){return r===93?(t.enter("referenceMarker"),t.consume(r),t.exit("referenceMarker"),t.exit("reference"),e):i(r)}}const Fce={name:"labelStartImage",resolveAll:Fw.resolveAll,tokenize:Gce};function Gce(t,e,i){const n=this;return s;function s(l){return t.enter("labelImage"),t.enter("labelImageMarker"),t.consume(l),t.exit("labelImageMarker"),r}function r(l){return l===91?(t.enter("labelMarker"),t.consume(l),t.exit("labelMarker"),t.exit("labelImage"),o):i(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in n.parser.constructs?i(l):e(l)}}const Kce={name:"labelStartLink",resolveAll:Fw.resolveAll,tokenize:Jce};function Jce(t,e,i){const n=this;return s;function s(o){return t.enter("labelLink"),t.enter("labelMarker"),t.consume(o),t.exit("labelMarker"),t.exit("labelLink"),r}function r(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?i(o):e(o)}}const c1={name:"lineEnding",tokenize:ehe};function ehe(t,e){return i;function i(n){return t.enter("lineEnding"),t.consume(n),t.exit("lineEnding"),kt(t,e,"linePrefix")}}const cg={name:"thematicBreak",tokenize:the};function the(t,e,i){let n=0,s;return r;function r(u){return t.enter("thematicBreak"),o(u)}function o(u){return s=u,l(u)}function l(u){return u===s?(t.enter("thematicBreakSequence"),c(u)):n>=3&&(u===null||$e(u))?(t.exit("thematicBreak"),e(u)):i(u)}function c(u){return u===s?(t.consume(u),n++,c):(t.exit("thematicBreakSequence"),lt(u)?kt(t,l,"whitespace")(u):l(u))}}const Rn={continuation:{tokenize:rhe},exit:ahe,name:"list",tokenize:she},ihe={partial:!0,tokenize:lhe},nhe={partial:!0,tokenize:ohe};function she(t,e,i){const n=this,s=n.events[n.events.length-1];let r=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,o=0;return l;function l(O){const _=n.containerState.type||(O===42||O===43||O===45?"listUnordered":"listOrdered");if(_==="listUnordered"?!n.containerState.marker||O===n.containerState.marker:IS(O)){if(n.containerState.type||(n.containerState.type=_,t.enter(_,{_container:!0})),_==="listUnordered")return t.enter("listItemPrefix"),O===42||O===45?t.check(cg,i,u)(O):u(O);if(!n.interrupt||O===49)return t.enter("listItemPrefix"),t.enter("listItemValue"),c(O)}return i(O)}function c(O){return IS(O)&&++o<10?(t.consume(O),c):(!n.interrupt||o<2)&&(n.containerState.marker?O===n.containerState.marker:O===41||O===46)?(t.exit("listItemValue"),u(O)):i(O)}function u(O){return t.enter("listItemMarker"),t.consume(O),t.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||O,t.check(PO,n.interrupt?i:d,t.attempt(ihe,g,p))}function d(O){return n.containerState.initialBlankLine=!0,r++,g(O)}function p(O){return lt(O)?(t.enter("listItemPrefixWhitespace"),t.consume(O),t.exit("listItemPrefixWhitespace"),g):i(O)}function g(O){return n.containerState.size=r+n.sliceSerialize(t.exit("listItemPrefix"),!0).length,e(O)}}function rhe(t,e,i){const n=this;return n.containerState._closeFlow=void 0,t.check(PO,s,r);function s(l){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,kt(t,e,"listItemIndent",n.containerState.size+1)(l)}function r(l){return n.containerState.furtherBlankLines||!lt(l)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,o(l)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,t.attempt(nhe,e,o)(l))}function o(l){return n.containerState._closeFlow=!0,n.interrupt=void 0,kt(t,t.attempt(Rn,e,i),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function ohe(t,e,i){const n=this;return kt(t,s,"listItemIndent",n.containerState.size+1);function s(r){const o=n.events[n.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===n.containerState.size?e(r):i(r)}}function ahe(t){t.exit(this.containerState.type)}function lhe(t,e,i){const n=this;return kt(t,s,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(r){const o=n.events[n.events.length-1];return!lt(r)&&o&&o[1].type==="listItemPrefixWhitespace"?e(r):i(r)}}const MQ={name:"setextUnderline",resolveTo:che,tokenize:hhe};function che(t,e){let i=t.length,n,s,r;for(;i--;)if(t[i][0]==="enter"){if(t[i][1].type==="content"){n=i;break}t[i][1].type==="paragraph"&&(s=i)}else t[i][1].type==="content"&&t.splice(i,1),!r&&t[i][1].type==="definition"&&(r=i);const o={type:"setextHeading",start:{...t[n][1].start},end:{...t[t.length-1][1].end}};return t[s][1].type="setextHeadingText",r?(t.splice(s,0,["enter",o,e]),t.splice(r+1,0,["exit",t[n][1],e]),t[n][1].end={...t[r][1].end}):t[n][1]=o,t.push(["exit",o,e]),t}function hhe(t,e,i){const n=this;let s;return r;function r(u){let d=n.events.length,p;for(;d--;)if(n.events[d][1].type!=="lineEnding"&&n.events[d][1].type!=="linePrefix"&&n.events[d][1].type!=="content"){p=n.events[d][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||p)?(t.enter("setextHeadingLine"),s=u,o(u)):i(u)}function o(u){return t.enter("setextHeadingLineSequence"),l(u)}function l(u){return u===s?(t.consume(u),l):(t.exit("setextHeadingLineSequence"),lt(u)?kt(t,c,"lineSuffix")(u):c(u))}function c(u){return u===null||$e(u)?(t.exit("setextHeadingLine"),e(u)):i(u)}}const uhe={tokenize:fhe};function fhe(t){const e=this,i=t.attempt(PO,n,t.attempt(this.parser.constructs.flowInitial,s,kt(t,t.attempt(this.parser.constructs.flow,s,t.attempt(Oce,s)),"linePrefix")));return i;function n(r){if(r===null){t.consume(r);return}return t.enter("lineEndingBlank"),t.consume(r),t.exit("lineEndingBlank"),e.currentConstruct=void 0,i}function s(r){if(r===null){t.consume(r);return}return t.enter("lineEnding"),t.consume(r),t.exit("lineEnding"),e.currentConstruct=void 0,i}}const dhe={resolveAll:fN()},phe=uN("string"),mhe=uN("text");function uN(t){return{resolveAll:fN(t==="text"?ghe:void 0),tokenize:e};function e(i){const n=this,s=this.parser.constructs[t],r=i.attempt(s,o,l);return o;function o(d){return u(d)?r(d):l(d)}function l(d){if(d===null){i.consume(d);return}return i.enter("data"),i.consume(d),c}function c(d){return u(d)?(i.exit("data"),r(d)):(i.consume(d),c)}function u(d){if(d===null)return!0;const p=s[d];let g=-1;if(p)for(;++g<p.length;){const O=p[g];if(!O.previous||O.previous.call(n,n.previous))return!0}return!1}}}function fN(t){return e;function e(i,n){let s=-1,r;for(;++s<=i.length;)r===void 0?i[s]&&i[s][1].type==="data"&&(r=s,s++):(!i[s]||i[s][1].type!=="data")&&(s!==r+2&&(i[r][1].end=i[s-1][1].end,i.splice(r+2,s-r-2),s=r+2),r=void 0);return t?t(i,n):i}}function ghe(t,e){let i=0;for(;++i<=t.length;)if((i===t.length||t[i][1].type==="lineEnding")&&t[i-1][1].type==="data"){const n=t[i-1][1],s=e.sliceStream(n);let r=s.length,o=-1,l=0,c;for(;r--;){const u=s[r];if(typeof u=="string"){for(o=u.length;u.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(u===-2)c=!0,l++;else if(u!==-1){r++;break}}if(e._contentTypeTextTrailing&&i===t.length&&(l=0),l){const u={type:i===t.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:r?o:n.start._bufferIndex+o,_index:n.start._index+r,line:n.end.line,column:n.end.column-l,offset:n.end.offset-l},end:{...n.end}};n.end={...u.start},n.start.offset===n.end.offset?Object.assign(n,u):(t.splice(i,0,["enter",u,e],["exit",u,e]),i+=2)}i++}return t}const Ohe={42:Rn,43:Rn,45:Rn,48:Rn,49:Rn,50:Rn,51:Rn,52:Rn,53:Rn,54:Rn,55:Rn,56:Rn,57:Rn,62:sN},vhe={91:Sce},_he={[-2]:l1,[-1]:l1,32:l1},yhe={35:Ace,42:cg,45:[MQ,cg],60:Rce,61:MQ,95:cg,96:AQ,126:AQ},bhe={38:oN,92:rN},She={[-5]:c1,[-4]:c1,[-3]:c1,33:Fce,38:oN,42:VS,60:[Kle,Nce],91:Kce,92:[kce,rN],93:Fw,95:VS,96:uce},xhe={null:[VS,dhe]},whe={null:[42,95]},Che={null:[]},khe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:whe,contentInitial:vhe,disable:Che,document:Ohe,flow:yhe,flowInitial:_he,insideSpan:xhe,string:bhe,text:She},Symbol.toStringTag,{value:"Module"}));function The(t,e,i){let n={_bufferIndex:-1,_index:0,line:i&&i.line||1,column:i&&i.column||1,offset:i&&i.offset||0};const s={},r=[];let o=[],l=[];const c={attempt:z(L),check:z(E),consume:k,enter:T,exit:A,interrupt:z(E,{interrupt:!0})},u={code:null,containerState:{},defineSkip:b,events:[],now:_,parser:t,previous:null,sliceSerialize:g,sliceStream:O,write:p};let d=e.tokenize.call(u,c);return e.resolveAll&&r.push(e),u;function p(U){return o=ws(o,U),x(),o[o.length-1]!==null?[]:(N(e,0),u.events=Hw(r,u.events,u),u.events)}function g(U,R){return Ehe(O(U),R)}function O(U){return Ahe(o,U)}function _(){const{_bufferIndex:U,_index:R,line:B,column:D,offset:j}=n;return{_bufferIndex:U,_index:R,line:B,column:D,offset:j}}function b(U){s[U.line]=U.column,J()}function x(){let U;for(;n._index<o.length;){const R=o[n._index];if(typeof R=="string")for(U=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===U&&n._bufferIndex<R.length;)w(R.charCodeAt(n._bufferIndex));else w(R)}}function w(U){d=d(U)}function k(U){$e(U)?(n.line++,n.column=1,n.offset+=U===-3?2:1,J()):U!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===o[n._index].length&&(n._bufferIndex=-1,n._index++)),u.previous=U}function T(U,R){const B=R||{};return B.type=U,B.start=_(),u.events.push(["enter",B,u]),l.push(B),B}function A(U){const R=l.pop();return R.end=_(),u.events.push(["exit",R,u]),R}function L(U,R){N(U,R.from)}function E(U,R){R.restore()}function z(U,R){return B;function B(D,j,$){let X,H,F,M;return Array.isArray(D)?K(D):"tokenize"in D?K([D]):I(D);function I(fe){return Oe;function Oe(Ce){const ye=Ce!==null&&fe[Ce],nt=Ce!==null&&fe.null,Qt=[...Array.isArray(ye)?ye:ye?[ye]:[],...Array.isArray(nt)?nt:nt?[nt]:[]];return K(Qt)(Ce)}}function K(fe){return X=fe,H=0,fe.length===0?$:Q(fe[H])}function Q(fe){return Oe;function Oe(Ce){return M=q(),F=fe,fe.partial||(u.currentConstruct=fe),fe.name&&u.parser.constructs.disable.null.includes(fe.name)?he():fe.tokenize.call(R?Object.assign(Object.create(u),R):u,c,ue,he)(Ce)}}function ue(fe){return U(F,M),j}function he(fe){return M.restore(),++H<X.length?Q(X[H]):$}}}function N(U,R){U.resolveAll&&!r.includes(U)&&r.push(U),U.resolve&&Pr(u.events,R,u.events.length-R,U.resolve(u.events.slice(R),u)),U.resolveTo&&(u.events=U.resolveTo(u.events,u))}function q(){const U=_(),R=u.previous,B=u.currentConstruct,D=u.events.length,j=Array.from(l);return{from:D,restore:$};function $(){n=U,u.previous=R,u.currentConstruct=B,u.events.length=D,l=j,J()}}function J(){n.line in s&&n.column<2&&(n.column=s[n.line],n.offset+=s[n.line]-1)}}function Ahe(t,e){const i=e.start._index,n=e.start._bufferIndex,s=e.end._index,r=e.end._bufferIndex;let o;if(i===s)o=[t[i].slice(n,r)];else{if(o=t.slice(i,s),n>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(n):o.shift()}r>0&&o.push(t[s].slice(0,r))}return o}function Ehe(t,e){let i=-1;const n=[];let s;for(;++i<t.length;){const r=t[i];let o;if(typeof r=="string")o=r;else switch(r){case-5:{o="\r";break}case-4:{o=`
219
+ `;break}case-3:{o=`\r
220
+ `;break}case-2:{o=e?" ":" ";break}case-1:{if(!e&&s)continue;o=" ";break}default:o=String.fromCharCode(r)}s=r===-2,n.push(o)}return n.join("")}function Mhe(t){const n={constructs:$le([khe,...(t||{}).extensions||[]]),content:s(qle),defined:[],document:s(Ule),flow:s(uhe),lazy:{},string:s(phe),text:s(mhe)};return n;function s(r){return o;function o(l){return The(n,r,l)}}}function Phe(t){for(;!aN(t););return t}const PQ=/[\0\t\n\r]/g;function Rhe(){let t=1,e="",i=!0,n;return s;function s(r,o,l){const c=[];let u,d,p,g,O;for(r=e+(typeof r=="string"?r.toString():new TextDecoder(o||void 0).decode(r)),p=0,e="",i&&(r.charCodeAt(0)===65279&&p++,i=void 0);p<r.length;){if(PQ.lastIndex=p,u=PQ.exec(r),g=u&&u.index!==void 0?u.index:r.length,O=r.charCodeAt(g),!u){e=r.slice(p);break}if(O===10&&p===g&&n)c.push(-3),n=void 0;else switch(n&&(c.push(-5),n=void 0),p<g&&(c.push(r.slice(p,g)),t+=g-p),O){case 0:{c.push(65533),t++;break}case 9:{for(d=Math.ceil(t/4)*4,c.push(-2);t++<d;)c.push(-1);break}case 10:{c.push(-4),t=1;break}default:n=!0,t=1}p=g+1}return l&&(n&&c.push(-5),e&&c.push(e),c.push(null)),c}}const Qhe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Lhe(t){return t.replace(Qhe,Dhe)}function Dhe(t,e,i){if(e)return e;if(i.charCodeAt(0)===35){const s=i.charCodeAt(1),r=s===120||s===88;return nN(i.slice(r?2:1),r?16:10)}return Yw(i)||t}const dN={}.hasOwnProperty;function Bhe(t,e,i){return e&&typeof e=="object"&&(i=e,e=void 0),$he(i)(Phe(Mhe(i).document().write(Rhe()(t,e,!0))))}function $he(t){const e={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:r(Dr),autolinkProtocol:q,autolinkEmail:q,atxHeading:r(as),blockQuote:r(nt),characterEscape:q,characterReference:q,codeFenced:r(Qt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:r(Qt,o),codeText:r(Yt,o),codeTextData:q,data:q,codeFlowValue:q,definition:r(ei),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:r(Le),hardBreakEscape:r(Co),hardBreakTrailing:r(Co),htmlFlow:r(ko,o),htmlFlowData:q,htmlText:r(ko,o),htmlTextData:q,image:r(La),label:o,link:r(Dr),listItem:r(Mh),listItemValue:g,listOrdered:r(To,p),listUnordered:r(To),paragraph:r(LO),reference:Q,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:r(as),strong:r(DO),thematicBreak:r(BO)},exit:{atxHeading:c(),atxHeadingSequence:L,autolink:c(),autolinkEmail:ye,autolinkProtocol:Ce,blockQuote:c(),characterEscapeValue:J,characterReferenceMarkerHexadecimal:he,characterReferenceMarkerNumeric:he,characterReferenceValue:fe,characterReference:Oe,codeFenced:c(x),codeFencedFence:b,codeFencedFenceInfo:O,codeFencedFenceMeta:_,codeFlowValue:J,codeIndented:c(w),codeText:c(j),codeTextData:J,data:J,definition:c(),definitionDestinationString:A,definitionLabelString:k,definitionTitleString:T,emphasis:c(),hardBreakEscape:c(R),hardBreakTrailing:c(R),htmlFlow:c(B),htmlFlowData:J,htmlText:c(D),htmlTextData:J,image:c(X),label:F,labelText:H,lineEnding:U,link:c($),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ue,resourceDestinationString:M,resourceTitleString:I,resource:K,setextHeading:c(N),setextHeadingLineSequence:z,setextHeadingText:E,strong:c(),thematicBreak:c()}};pN(e,(t||{}).mdastExtensions||[]);const i={};return n;function n(oe){let ge={type:"root",children:[]};const De={stack:[ge],tokenStack:[],config:e,enter:l,exit:u,buffer:o,resume:d,data:i},Ue=[];let ht=-1;for(;++ht<oe.length;)if(oe[ht][1].type==="listOrdered"||oe[ht][1].type==="listUnordered")if(oe[ht][0]==="enter")Ue.push(ht);else{const In=Ue.pop();ht=s(oe,In,ht)}for(ht=-1;++ht<oe.length;){const In=e[oe[ht][0]];dN.call(In,oe[ht][1].type)&&In[oe[ht][1].type].call(Object.assign({sliceSerialize:oe[ht][2].sliceSerialize},De),oe[ht][1])}if(De.tokenStack.length>0){const In=De.tokenStack[De.tokenStack.length-1];(In[1]||RQ).call(De,void 0,In[0])}for(ge.position={start:aa(oe.length>0?oe[0][1].start:{line:1,column:1,offset:0}),end:aa(oe.length>0?oe[oe.length-2][1].end:{line:1,column:1,offset:0})},ht=-1;++ht<e.transforms.length;)ge=e.transforms[ht](ge)||ge;return ge}function s(oe,ge,De){let Ue=ge-1,ht=-1,In=!1,Br,hn,fi,Sn;for(;++Ue<=De;){const _t=oe[Ue];switch(_t[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{_t[0]==="enter"?ht++:ht--,Sn=void 0;break}case"lineEndingBlank":{_t[0]==="enter"&&(Br&&!Sn&&!ht&&!fi&&(fi=Ue),Sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Sn=void 0}if(!ht&&_t[0]==="enter"&&_t[1].type==="listItemPrefix"||ht===-1&&_t[0]==="exit"&&(_t[1].type==="listUnordered"||_t[1].type==="listOrdered")){if(Br){let Ao=Ue;for(hn=void 0;Ao--;){const Bs=oe[Ao];if(Bs[1].type==="lineEnding"||Bs[1].type==="lineEndingBlank"){if(Bs[0]==="exit")continue;hn&&(oe[hn][1].type="lineEndingBlank",In=!0),Bs[1].type="lineEnding",hn=Ao}else if(!(Bs[1].type==="linePrefix"||Bs[1].type==="blockQuotePrefix"||Bs[1].type==="blockQuotePrefixWhitespace"||Bs[1].type==="blockQuoteMarker"||Bs[1].type==="listItemIndent"))break}fi&&(!hn||fi<hn)&&(Br._spread=!0),Br.end=Object.assign({},hn?oe[hn][1].start:_t[1].end),oe.splice(hn||Ue,0,["exit",Br,_t[2]]),Ue++,De++}if(_t[1].type==="listItemPrefix"){const Ao={type:"listItem",_spread:!1,start:Object.assign({},_t[1].start),end:void 0};Br=Ao,oe.splice(Ue,0,["enter",Ao,_t[2]]),Ue++,De++,fi=void 0,Sn=!0}}}return oe[ge][1]._spread=In,De}function r(oe,ge){return De;function De(Ue){l.call(this,oe(Ue),Ue),ge&&ge.call(this,Ue)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(oe,ge,De){this.stack[this.stack.length-1].children.push(oe),this.stack.push(oe),this.tokenStack.push([ge,De||void 0]),oe.position={start:aa(ge.start),end:void 0}}function c(oe){return ge;function ge(De){oe&&oe.call(this,De),u.call(this,De)}}function u(oe,ge){const De=this.stack.pop(),Ue=this.tokenStack.pop();if(Ue)Ue[0].type!==oe.type&&(ge?ge.call(this,oe,Ue[0]):(Ue[1]||RQ).call(this,oe,Ue[0]));else throw new Error("Cannot close `"+oe.type+"` ("+Sf({start:oe.start,end:oe.end})+"): it’s not open");De.position.end=aa(oe.end)}function d(){return Dle(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function g(oe){if(this.data.expectingFirstListItemValue){const ge=this.stack[this.stack.length-2];ge.start=Number.parseInt(this.sliceSerialize(oe),10),this.data.expectingFirstListItemValue=void 0}}function O(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.lang=oe}function _(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.meta=oe}function b(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function x(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function w(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe.replace(/(\r?\n|\r)$/g,"")}function k(oe){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=ih(this.sliceSerialize(oe)).toLowerCase()}function T(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function A(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function L(oe){const ge=this.stack[this.stack.length-1];if(!ge.depth){const De=this.sliceSerialize(oe).length;ge.depth=De}}function E(){this.data.setextHeadingSlurpLineEnding=!0}function z(oe){const ge=this.stack[this.stack.length-1];ge.depth=this.sliceSerialize(oe).codePointAt(0)===61?1:2}function N(){this.data.setextHeadingSlurpLineEnding=void 0}function q(oe){const De=this.stack[this.stack.length-1].children;let Ue=De[De.length-1];(!Ue||Ue.type!=="text")&&(Ue=cn(),Ue.position={start:aa(oe.start),end:void 0},De.push(Ue)),this.stack.push(Ue)}function J(oe){const ge=this.stack.pop();ge.value+=this.sliceSerialize(oe),ge.position.end=aa(oe.end)}function U(oe){const ge=this.stack[this.stack.length-1];if(this.data.atHardBreak){const De=ge.children[ge.children.length-1];De.position.end=aa(oe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&e.canContainEols.includes(ge.type)&&(q.call(this,oe),J.call(this,oe))}function R(){this.data.atHardBreak=!0}function B(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function D(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function j(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.value=oe}function $(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function X(){const oe=this.stack[this.stack.length-1];if(this.data.inReference){const ge=this.data.referenceType||"shortcut";oe.type+="Reference",oe.referenceType=ge,delete oe.url,delete oe.title}else delete oe.identifier,delete oe.label;this.data.referenceType=void 0}function H(oe){const ge=this.sliceSerialize(oe),De=this.stack[this.stack.length-2];De.label=Lhe(ge),De.identifier=ih(ge).toLowerCase()}function F(){const oe=this.stack[this.stack.length-1],ge=this.resume(),De=this.stack[this.stack.length-1];if(this.data.inReference=!0,De.type==="link"){const Ue=oe.children;De.children=Ue}else De.alt=ge}function M(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.url=oe}function I(){const oe=this.resume(),ge=this.stack[this.stack.length-1];ge.title=oe}function K(){this.data.inReference=void 0}function Q(){this.data.referenceType="collapsed"}function ue(oe){const ge=this.resume(),De=this.stack[this.stack.length-1];De.label=ge,De.identifier=ih(this.sliceSerialize(oe)).toLowerCase(),this.data.referenceType="full"}function he(oe){this.data.characterReferenceType=oe.type}function fe(oe){const ge=this.sliceSerialize(oe),De=this.data.characterReferenceType;let Ue;De?(Ue=nN(ge,De==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ue=Yw(ge);const ht=this.stack[this.stack.length-1];ht.value+=Ue}function Oe(oe){const ge=this.stack.pop();ge.position.end=aa(oe.end)}function Ce(oe){J.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url=this.sliceSerialize(oe)}function ye(oe){J.call(this,oe);const ge=this.stack[this.stack.length-1];ge.url="mailto:"+this.sliceSerialize(oe)}function nt(){return{type:"blockquote",children:[]}}function Qt(){return{type:"code",lang:null,meta:null,value:""}}function Yt(){return{type:"inlineCode",value:""}}function ei(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Le(){return{type:"emphasis",children:[]}}function as(){return{type:"heading",depth:0,children:[]}}function Co(){return{type:"break"}}function ko(){return{type:"html",value:""}}function La(){return{type:"image",title:null,url:"",alt:null}}function Dr(){return{type:"link",title:null,url:"",children:[]}}function To(oe){return{type:"list",ordered:oe.type==="listOrdered",start:null,spread:oe._spread,children:[]}}function Mh(oe){return{type:"listItem",spread:oe._spread,checked:null,children:[]}}function LO(){return{type:"paragraph",children:[]}}function DO(){return{type:"strong",children:[]}}function cn(){return{type:"text",value:""}}function BO(){return{type:"thematicBreak"}}}function aa(t){return{line:t.line,column:t.column,offset:t.offset}}function pN(t,e){let i=-1;for(;++i<e.length;){const n=e[i];Array.isArray(n)?pN(t,n):zhe(t,n)}}function zhe(t,e){let i;for(i in e)if(dN.call(e,i))switch(i){case"canContainEols":{const n=e[i];n&&t[i].push(...n);break}case"transforms":{const n=e[i];n&&t[i].push(...n);break}case"enter":case"exit":{const n=e[i];n&&Object.assign(t[i],n);break}}}function RQ(t,e){throw t?new Error("Cannot close `"+t.type+"` ("+Sf({start:t.start,end:t.end})+"): a different token (`"+e.type+"`, "+Sf({start:e.start,end:e.end})+") is open"):new Error("Cannot close document, a token (`"+e.type+"`, "+Sf({start:e.start,end:e.end})+") is still open")}function Nhe(t){const e=this;e.parser=i;function i(n){return Bhe(n,{...e.data("settings"),...t,extensions:e.data("micromarkExtensions")||[],mdastExtensions:e.data("fromMarkdownExtensions")||[]})}}function jhe(t,e){const i={type:"element",tagName:"blockquote",properties:{},children:t.wrap(t.all(e),!0)};return t.patch(e,i),t.applyData(e,i)}function Ihe(t,e){const i={type:"element",tagName:"br",properties:{},children:[]};return t.patch(e,i),[t.applyData(e,i),{type:"text",value:`
221
+ `}]}function Vhe(t,e){const i=e.value?e.value+`
222
+ `:"",n={},s=e.lang?e.lang.split(/\s+/):[];s.length>0&&(n.className=["language-"+s[0]]);let r={type:"element",tagName:"code",properties:n,children:[{type:"text",value:i}]};return e.meta&&(r.data={meta:e.meta}),t.patch(e,r),r=t.applyData(e,r),r={type:"element",tagName:"pre",properties:{},children:[r]},t.patch(e,r),r}function Xhe(t,e){const i={type:"element",tagName:"del",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Zhe(t,e){const i={type:"element",tagName:"em",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function qhe(t,e){const i=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",n=String(e.identifier).toUpperCase(),s=Eh(n.toLowerCase()),r=t.footnoteOrder.indexOf(n);let o,l=t.footnoteCounts.get(n);l===void 0?(l=0,t.footnoteOrder.push(n),o=t.footnoteOrder.length):o=r+1,l+=1,t.footnoteCounts.set(n,l);const c={type:"element",tagName:"a",properties:{href:"#"+i+"fn-"+s,id:i+"fnref-"+s+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};t.patch(e,c);const u={type:"element",tagName:"sup",properties:{},children:[c]};return t.patch(e,u),t.applyData(e,u)}function Whe(t,e){const i={type:"element",tagName:"h"+e.depth,properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function Uhe(t,e){if(t.options.allowDangerousHtml){const i={type:"raw",value:e.value};return t.patch(e,i),t.applyData(e,i)}}function mN(t,e){const i=e.referenceType;let n="]";if(i==="collapsed"?n+="[]":i==="full"&&(n+="["+(e.label||e.identifier)+"]"),e.type==="imageReference")return[{type:"text",value:"!["+e.alt+n}];const s=t.all(e),r=s[0];r&&r.type==="text"?r.value="["+r.value:s.unshift({type:"text",value:"["});const o=s[s.length-1];return o&&o.type==="text"?o.value+=n:s.push({type:"text",value:n}),s}function Yhe(t,e){const i=String(e.identifier).toUpperCase(),n=t.definitionById.get(i);if(!n)return mN(t,e);const s={src:Eh(n.url||""),alt:e.alt};n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"img",properties:s,children:[]};return t.patch(e,r),t.applyData(e,r)}function Hhe(t,e){const i={src:Eh(e.url)};e.alt!==null&&e.alt!==void 0&&(i.alt=e.alt),e.title!==null&&e.title!==void 0&&(i.title=e.title);const n={type:"element",tagName:"img",properties:i,children:[]};return t.patch(e,n),t.applyData(e,n)}function Fhe(t,e){const i={type:"text",value:e.value.replace(/\r?\n|\r/g," ")};t.patch(e,i);const n={type:"element",tagName:"code",properties:{},children:[i]};return t.patch(e,n),t.applyData(e,n)}function Ghe(t,e){const i=String(e.identifier).toUpperCase(),n=t.definitionById.get(i);if(!n)return mN(t,e);const s={href:Eh(n.url||"")};n.title!==null&&n.title!==void 0&&(s.title=n.title);const r={type:"element",tagName:"a",properties:s,children:t.all(e)};return t.patch(e,r),t.applyData(e,r)}function Khe(t,e){const i={href:Eh(e.url)};e.title!==null&&e.title!==void 0&&(i.title=e.title);const n={type:"element",tagName:"a",properties:i,children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Jhe(t,e,i){const n=t.all(e),s=i?eue(i):gN(e),r={},o=[];if(typeof e.checked=="boolean"){const d=n[0];let p;d&&d.type==="element"&&d.tagName==="p"?p=d:(p={type:"element",tagName:"p",properties:{},children:[]},n.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:e.checked,disabled:!0},children:[]}),r.className=["task-list-item"]}let l=-1;for(;++l<n.length;){const d=n[l];(s||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
223
+ `}),d.type==="element"&&d.tagName==="p"&&!s?o.push(...d.children):o.push(d)}const c=n[n.length-1];c&&(s||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
224
+ `});const u={type:"element",tagName:"li",properties:r,children:o};return t.patch(e,u),t.applyData(e,u)}function eue(t){let e=!1;if(t.type==="list"){e=t.spread||!1;const i=t.children;let n=-1;for(;!e&&++n<i.length;)e=gN(i[n])}return e}function gN(t){const e=t.spread;return e??t.children.length>1}function tue(t,e){const i={},n=t.all(e);let s=-1;for(typeof e.start=="number"&&e.start!==1&&(i.start=e.start);++s<n.length;){const o=n[s];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){i.className=["contains-task-list"];break}}const r={type:"element",tagName:e.ordered?"ol":"ul",properties:i,children:t.wrap(n,!0)};return t.patch(e,r),t.applyData(e,r)}function iue(t,e){const i={type:"element",tagName:"p",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function nue(t,e){const i={type:"root",children:t.wrap(t.all(e))};return t.patch(e,i),t.applyData(e,i)}function sue(t,e){const i={type:"element",tagName:"strong",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}function rue(t,e){const i=t.all(e),n=i.shift(),s=[];if(n){const o={type:"element",tagName:"thead",properties:{},children:t.wrap([n],!0)};t.patch(e.children[0],o),s.push(o)}if(i.length>0){const o={type:"element",tagName:"tbody",properties:{},children:t.wrap(i,!0)},l=Zw(e.children[1]),c=Fz(e.children[e.children.length-1]);l&&c&&(o.position={start:l,end:c}),s.push(o)}const r={type:"element",tagName:"table",properties:{},children:t.wrap(s,!0)};return t.patch(e,r),t.applyData(e,r)}function oue(t,e,i){const n=i?i.children:void 0,r=(n?n.indexOf(e):1)===0?"th":"td",o=i&&i.type==="table"?i.align:void 0,l=o?o.length:e.children.length;let c=-1;const u=[];for(;++c<l;){const p=e.children[c],g={},O=o?o[c]:void 0;O&&(g.align=O);let _={type:"element",tagName:r,properties:g,children:[]};p&&(_.children=t.all(p),t.patch(p,_),_=t.applyData(p,_)),u.push(_)}const d={type:"element",tagName:"tr",properties:{},children:t.wrap(u,!0)};return t.patch(e,d),t.applyData(e,d)}function aue(t,e){const i={type:"element",tagName:"td",properties:{},children:t.all(e)};return t.patch(e,i),t.applyData(e,i)}const QQ=9,LQ=32;function lue(t){const e=String(t),i=/\r?\n|\r/g;let n=i.exec(e),s=0;const r=[];for(;n;)r.push(DQ(e.slice(s,n.index),s>0,!0),n[0]),s=n.index+n[0].length,n=i.exec(e);return r.push(DQ(e.slice(s),s>0,!1)),r.join("")}function DQ(t,e,i){let n=0,s=t.length;if(e){let r=t.codePointAt(n);for(;r===QQ||r===LQ;)n++,r=t.codePointAt(n)}if(i){let r=t.codePointAt(s-1);for(;r===QQ||r===LQ;)s--,r=t.codePointAt(s-1)}return s>n?t.slice(n,s):""}function cue(t,e){const i={type:"text",value:lue(String(e.value))};return t.patch(e,i),t.applyData(e,i)}function hue(t,e){const i={type:"element",tagName:"hr",properties:{},children:[]};return t.patch(e,i),t.applyData(e,i)}const uue={blockquote:jhe,break:Ihe,code:Vhe,delete:Xhe,emphasis:Zhe,footnoteReference:qhe,heading:Whe,html:Uhe,imageReference:Yhe,image:Hhe,inlineCode:Fhe,linkReference:Ghe,link:Khe,listItem:Jhe,list:tue,paragraph:iue,root:nue,strong:sue,table:rue,tableCell:aue,tableRow:oue,text:cue,thematicBreak:hue,toml:Rm,yaml:Rm,definition:Rm,footnoteDefinition:Rm};function Rm(){}const ON=-1,RO=0,wf=1,sO=2,Gw=3,Kw=4,Jw=5,eC=6,vN=7,_N=8,BQ=typeof self=="object"?self:globalThis,fue=(t,e)=>{const i=(s,r)=>(t.set(r,s),s),n=s=>{if(t.has(s))return t.get(s);const[r,o]=e[s];switch(r){case RO:case ON:return i(o,s);case wf:{const l=i([],s);for(const c of o)l.push(n(c));return l}case sO:{const l=i({},s);for(const[c,u]of o)l[n(c)]=n(u);return l}case Gw:return i(new Date(o),s);case Kw:{const{source:l,flags:c}=o;return i(new RegExp(l,c),s)}case Jw:{const l=i(new Map,s);for(const[c,u]of o)l.set(n(c),n(u));return l}case eC:{const l=i(new Set,s);for(const c of o)l.add(n(c));return l}case vN:{const{name:l,message:c}=o;return i(new BQ[l](c),s)}case _N:return i(BigInt(o),s);case"BigInt":return i(Object(BigInt(o)),s);case"ArrayBuffer":return i(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return i(new DataView(l),o)}}return i(new BQ[r](o),s)};return n},$Q=t=>fue(new Map,t)(0),Ec="",{toString:due}={},{keys:pue}=Object,Yu=t=>{const e=typeof t;if(e!=="object"||!t)return[RO,e];const i=due.call(t).slice(8,-1);switch(i){case"Array":return[wf,Ec];case"Object":return[sO,Ec];case"Date":return[Gw,Ec];case"RegExp":return[Kw,Ec];case"Map":return[Jw,Ec];case"Set":return[eC,Ec];case"DataView":return[wf,i]}return i.includes("Array")?[wf,i]:i.includes("Error")?[vN,i]:[sO,i]},Qm=([t,e])=>t===RO&&(e==="function"||e==="symbol"),mue=(t,e,i,n)=>{const s=(o,l)=>{const c=n.push(o)-1;return i.set(l,c),c},r=o=>{if(i.has(o))return i.get(o);let[l,c]=Yu(o);switch(l){case RO:{let d=o;switch(c){case"bigint":l=_N,d=o.toString();break;case"function":case"symbol":if(t)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return s([ON],o)}return s([l,d],o)}case wf:{if(c){let g=o;return c==="DataView"?g=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(g=new Uint8Array(o)),s([c,[...g]],o)}const d=[],p=s([l,d],o);for(const g of o)d.push(r(g));return p}case sO:{if(c)switch(c){case"BigInt":return s([c,o.toString()],o);case"Boolean":case"Number":case"String":return s([c,o.valueOf()],o)}if(e&&"toJSON"in o)return r(o.toJSON());const d=[],p=s([l,d],o);for(const g of pue(o))(t||!Qm(Yu(o[g])))&&d.push([r(g),r(o[g])]);return p}case Gw:return s([l,o.toISOString()],o);case Kw:{const{source:d,flags:p}=o;return s([l,{source:d,flags:p}],o)}case Jw:{const d=[],p=s([l,d],o);for(const[g,O]of o)(t||!(Qm(Yu(g))||Qm(Yu(O))))&&d.push([r(g),r(O)]);return p}case eC:{const d=[],p=s([l,d],o);for(const g of o)(t||!Qm(Yu(g)))&&d.push(r(g));return p}}const{message:u}=o;return s([l,{name:c,message:u}],o)};return r},zQ=(t,{json:e,lossy:i}={})=>{const n=[];return mue(!(e||i),!!e,new Map,n)(t),n},rO=typeof structuredClone=="function"?(t,e)=>e&&("json"in e||"lossy"in e)?$Q(zQ(t,e)):structuredClone(t):(t,e)=>$Q(zQ(t,e));function gue(t,e){const i=[{type:"text",value:"↩"}];return e>1&&i.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(e)}]}),i}function Oue(t,e){return"Back to reference "+(t+1)+(e>1?"-"+e:"")}function vue(t){const e=typeof t.options.clobberPrefix=="string"?t.options.clobberPrefix:"user-content-",i=t.options.footnoteBackContent||gue,n=t.options.footnoteBackLabel||Oue,s=t.options.footnoteLabel||"Footnotes",r=t.options.footnoteLabelTagName||"h2",o=t.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<t.footnoteOrder.length;){const u=t.footnoteById.get(t.footnoteOrder[c]);if(!u)continue;const d=t.all(u),p=String(u.identifier).toUpperCase(),g=Eh(p.toLowerCase());let O=0;const _=[],b=t.footnoteCounts.get(p);for(;b!==void 0&&++O<=b;){_.length>0&&_.push({type:"text",value:" "});let k=typeof i=="string"?i:i(c,O);typeof k=="string"&&(k={type:"text",value:k}),_.push({type:"element",tagName:"a",properties:{href:"#"+e+"fnref-"+g+(O>1?"-"+O:""),dataFootnoteBackref:"",ariaLabel:typeof n=="string"?n:n(c,O),className:["data-footnote-backref"]},children:Array.isArray(k)?k:[k]})}const x=d[d.length-1];if(x&&x.type==="element"&&x.tagName==="p"){const k=x.children[x.children.length-1];k&&k.type==="text"?k.value+=" ":x.children.push({type:"text",value:" "}),x.children.push(..._)}else d.push(..._);const w={type:"element",tagName:"li",properties:{id:e+"fn-"+g},children:t.wrap(d,!0)};t.patch(u,w),l.push(w)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:r,properties:{...rO(o),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
225
+ `},{type:"element",tagName:"ol",properties:{},children:t.wrap(l,!0)},{type:"text",value:`
226
+ `}]}}const yN=(function(t){if(t==null)return Sue;if(typeof t=="function")return QO(t);if(typeof t=="object")return Array.isArray(t)?_ue(t):yue(t);if(typeof t=="string")return bue(t);throw new Error("Expected function, string, or object as test")});function _ue(t){const e=[];let i=-1;for(;++i<t.length;)e[i]=yN(t[i]);return QO(n);function n(...s){let r=-1;for(;++r<e.length;)if(e[r].apply(this,s))return!0;return!1}}function yue(t){const e=t;return QO(i);function i(n){const s=n;let r;for(r in t)if(s[r]!==e[r])return!1;return!0}}function bue(t){return QO(e);function e(i){return i&&i.type===t}}function QO(t){return e;function e(i,n,s){return!!(xue(i)&&t.call(this,i,typeof n=="number"?n:void 0,s||void 0))}}function Sue(){return!0}function xue(t){return t!==null&&typeof t=="object"&&"type"in t}const bN=[],wue=!0,NQ=!1,Cue="skip";function kue(t,e,i,n){let s;typeof e=="function"&&typeof i!="function"?(n=i,i=e):s=e;const r=yN(s),o=n?-1:1;l(t,void 0,[])();function l(c,u,d){const p=c&&typeof c=="object"?c:{};if(typeof p.type=="string"){const O=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(g,"name",{value:"node ("+(c.type+(O?"<"+O+">":""))+")"})}return g;function g(){let O=bN,_,b,x;if((!e||r(c,u,d[d.length-1]||void 0))&&(O=Tue(i(c,d)),O[0]===NQ))return O;if("children"in c&&c.children){const w=c;if(w.children&&O[0]!==Cue)for(b=(n?w.children.length:-1)+o,x=d.concat(w);b>-1&&b<w.children.length;){const k=w.children[b];if(_=l(k,b,x)(),_[0]===NQ)return _;b=typeof _[1]=="number"?_[1]:b+o}}return O}}}function Tue(t){return Array.isArray(t)?t:typeof t=="number"?[wue,t]:t==null?bN:[t]}function SN(t,e,i,n){let s,r,o;typeof e=="function"&&typeof i!="function"?(r=void 0,o=e,s=i):(r=e,o=i,s=n),kue(t,r,l,s);function l(c,u){const d=u[u.length-1],p=d?d.children.indexOf(c):void 0;return o(c,p,d)}}const XS={}.hasOwnProperty,Aue={};function Eue(t,e){const i=e||Aue,n=new Map,s=new Map,r=new Map,o={...uue,...i.handlers},l={all:u,applyData:Pue,definitionById:n,footnoteById:s,footnoteCounts:r,footnoteOrder:[],handlers:o,one:c,options:i,patch:Mue,wrap:Que};return SN(t,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const p=d.type==="definition"?n:s,g=String(d.identifier).toUpperCase();p.has(g)||p.set(g,d)}}),l;function c(d,p){const g=d.type,O=l.handlers[g];if(XS.call(l.handlers,g)&&O)return O(l,d,p);if(l.options.passThrough&&l.options.passThrough.includes(g)){if("children"in d){const{children:b,...x}=d,w=rO(x);return w.children=l.all(d),w}return rO(d)}return(l.options.unknownHandler||Rue)(l,d,p)}function u(d){const p=[];if("children"in d){const g=d.children;let O=-1;for(;++O<g.length;){const _=l.one(g[O],d);if(_){if(O&&g[O-1].type==="break"&&(!Array.isArray(_)&&_.type==="text"&&(_.value=jQ(_.value)),!Array.isArray(_)&&_.type==="element")){const b=_.children[0];b&&b.type==="text"&&(b.value=jQ(b.value))}Array.isArray(_)?p.push(..._):p.push(_)}}}return p}}function Mue(t,e){t.position&&(e.position=dle(t))}function Pue(t,e){let i=e;if(t&&t.data){const n=t.data.hName,s=t.data.hChildren,r=t.data.hProperties;if(typeof n=="string")if(i.type==="element")i.tagName=n;else{const o="children"in i?i.children:[i];i={type:"element",tagName:n,properties:{},children:o}}i.type==="element"&&r&&Object.assign(i.properties,rO(r)),"children"in i&&i.children&&s!==null&&s!==void 0&&(i.children=s)}return i}function Rue(t,e){const i=e.data||{},n="value"in e&&!(XS.call(i,"hProperties")||XS.call(i,"hChildren"))?{type:"text",value:e.value}:{type:"element",tagName:"div",properties:{},children:t.all(e)};return t.patch(e,n),t.applyData(e,n)}function Que(t,e){const i=[];let n=-1;for(e&&i.push({type:"text",value:`
227
+ `});++n<t.length;)n&&i.push({type:"text",value:`
228
+ `}),i.push(t[n]);return e&&t.length>0&&i.push({type:"text",value:`
229
+ `}),i}function jQ(t){let e=0,i=t.charCodeAt(e);for(;i===9||i===32;)e++,i=t.charCodeAt(e);return t.slice(e)}function IQ(t,e){const i=Eue(t,e),n=i.one(t,void 0),s=vue(i),r=Array.isArray(n)?{type:"root",children:n}:n||{type:"root",children:[]};return s&&r.children.push({type:"text",value:`
230
+ `},s),r}function Lue(t,e){return t&&"run"in t?async function(i,n){const s=IQ(i,{file:n,...e});await t.run(s,n)}:function(i,n){return IQ(i,{file:n,...t||e})}}function VQ(t){if(t)throw t}var h1,XQ;function Due(){if(XQ)return h1;XQ=1;var t=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Object.defineProperty,n=Object.getOwnPropertyDescriptor,s=function(u){return typeof Array.isArray=="function"?Array.isArray(u):e.call(u)==="[object Array]"},r=function(u){if(!u||e.call(u)!=="[object Object]")return!1;var d=t.call(u,"constructor"),p=u.constructor&&u.constructor.prototype&&t.call(u.constructor.prototype,"isPrototypeOf");if(u.constructor&&!d&&!p)return!1;var g;for(g in u);return typeof g>"u"||t.call(u,g)},o=function(u,d){i&&d.name==="__proto__"?i(u,d.name,{enumerable:!0,configurable:!0,value:d.newValue,writable:!0}):u[d.name]=d.newValue},l=function(u,d){if(d==="__proto__")if(t.call(u,d)){if(n)return n(u,d).value}else return;return u[d]};return h1=function c(){var u,d,p,g,O,_,b=arguments[0],x=1,w=arguments.length,k=!1;for(typeof b=="boolean"&&(k=b,b=arguments[1]||{},x=2),(b==null||typeof b!="object"&&typeof b!="function")&&(b={});x<w;++x)if(u=arguments[x],u!=null)for(d in u)p=l(b,d),g=l(u,d),b!==g&&(k&&g&&(r(g)||(O=s(g)))?(O?(O=!1,_=p&&s(p)?p:[]):_=p&&r(p)?p:{},o(b,{name:d,newValue:c(k,_,g)})):typeof g<"u"&&o(b,{name:d,newValue:g}));return b},h1}var Bue=Due();const u1=WS(Bue);function ZS(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}function $ue(){const t=[],e={run:i,use:n};return e;function i(...s){let r=-1;const o=s.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...s);function l(c,...u){const d=t[++r];let p=-1;if(c){o(c);return}for(;++p<s.length;)(u[p]===null||u[p]===void 0)&&(u[p]=s[p]);s=u,d?zue(d,l)(...u):o(null,...u)}}function n(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return t.push(s),e}}function zue(t,e){let i;return n;function n(...o){const l=t.length>o.length;let c;l&&o.push(s);try{c=t.apply(this,o)}catch(u){const d=u;if(l&&i)throw d;return s(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(r,s):c instanceof Error?s(c):r(c))}function s(o,...l){i||(i=!0,e(o,...l))}function r(o){s(null,o)}}const pr={basename:Nue,dirname:jue,extname:Iue,join:Vue,sep:"/"};function Nue(t,e){if(e!==void 0&&typeof e!="string")throw new TypeError('"ext" argument must be a string');kd(t);let i=0,n=-1,s=t.length,r;if(e===void 0||e.length===0||e.length>t.length){for(;s--;)if(t.codePointAt(s)===47){if(r){i=s+1;break}}else n<0&&(r=!0,n=s+1);return n<0?"":t.slice(i,n)}if(e===t)return"";let o=-1,l=e.length-1;for(;s--;)if(t.codePointAt(s)===47){if(r){i=s+1;break}}else o<0&&(r=!0,o=s+1),l>-1&&(t.codePointAt(s)===e.codePointAt(l--)?l<0&&(n=s):(l=-1,n=o));return i===n?n=o:n<0&&(n=t.length),t.slice(i,n)}function jue(t){if(kd(t),t.length===0)return".";let e=-1,i=t.length,n;for(;--i;)if(t.codePointAt(i)===47){if(n){e=i;break}}else n||(n=!0);return e<0?t.codePointAt(0)===47?"/":".":e===1&&t.codePointAt(0)===47?"//":t.slice(0,e)}function Iue(t){kd(t);let e=t.length,i=-1,n=0,s=-1,r=0,o;for(;e--;){const l=t.codePointAt(e);if(l===47){if(o){n=e+1;break}continue}i<0&&(o=!0,i=e+1),l===46?s<0?s=e:r!==1&&(r=1):s>-1&&(r=-1)}return s<0||i<0||r===0||r===1&&s===i-1&&s===n+1?"":t.slice(s,i)}function Vue(...t){let e=-1,i;for(;++e<t.length;)kd(t[e]),t[e]&&(i=i===void 0?t[e]:i+"/"+t[e]);return i===void 0?".":Xue(i)}function Xue(t){kd(t);const e=t.codePointAt(0)===47;let i=Zue(t,!e);return i.length===0&&!e&&(i="."),i.length>0&&t.codePointAt(t.length-1)===47&&(i+="/"),e?"/"+i:i}function Zue(t,e){let i="",n=0,s=-1,r=0,o=-1,l,c;for(;++o<=t.length;){if(o<t.length)l=t.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(s===o-1||r===1))if(s!==o-1&&r===2){if(i.length<2||n!==2||i.codePointAt(i.length-1)!==46||i.codePointAt(i.length-2)!==46){if(i.length>2){if(c=i.lastIndexOf("/"),c!==i.length-1){c<0?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),s=o,r=0;continue}}else if(i.length>0){i="",n=0,s=o,r=0;continue}}e&&(i=i.length>0?i+"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(s+1,o):i=t.slice(s+1,o),n=o-s-1;s=o,r=0}else l===46&&r>-1?r++:r=-1}return i}function kd(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}const que={cwd:Wue};function Wue(){return"/"}function qS(t){return!!(t!==null&&typeof t=="object"&&"href"in t&&t.href&&"protocol"in t&&t.protocol&&t.auth===void 0)}function Uue(t){if(typeof t=="string")t=new URL(t);else if(!qS(t)){const e=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+t+"`");throw e.code="ERR_INVALID_ARG_TYPE",e}if(t.protocol!=="file:"){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return Yue(t)}function Yue(t){if(t.hostname!==""){const n=new TypeError('File URL host must be "localhost" or empty on darwin');throw n.code="ERR_INVALID_FILE_URL_HOST",n}const e=t.pathname;let i=-1;for(;++i<e.length;)if(e.codePointAt(i)===37&&e.codePointAt(i+1)===50){const n=e.codePointAt(i+2);if(n===70||n===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(e)}const f1=["history","path","basename","stem","extname","dirname"];class xN{constructor(e){let i;e?qS(e)?i={path:e}:typeof e=="string"||Hue(e)?i={value:e}:i=e:i={},this.cwd="cwd"in i?"":que.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<f1.length;){const r=f1[n];r in i&&i[r]!==void 0&&i[r]!==null&&(this[r]=r==="history"?[...i[r]]:i[r])}let s;for(s in i)f1.includes(s)||(this[s]=i[s])}get basename(){return typeof this.path=="string"?pr.basename(this.path):void 0}set basename(e){p1(e,"basename"),d1(e,"basename"),this.path=pr.join(this.dirname||"",e)}get dirname(){return typeof this.path=="string"?pr.dirname(this.path):void 0}set dirname(e){ZQ(this.basename,"dirname"),this.path=pr.join(e||"",this.basename)}get extname(){return typeof this.path=="string"?pr.extname(this.path):void 0}set extname(e){if(d1(e,"extname"),ZQ(this.dirname,"extname"),e){if(e.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(e.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=pr.join(this.dirname,this.stem+(e||""))}get path(){return this.history[this.history.length-1]}set path(e){qS(e)&&(e=Uue(e)),p1(e,"path"),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path=="string"?pr.basename(this.path,this.extname):void 0}set stem(e){p1(e,"stem"),d1(e,"stem"),this.path=pr.join(this.dirname||"",e+(this.extname||""))}fail(e,i,n){const s=this.message(e,i,n);throw s.fatal=!0,s}info(e,i,n){const s=this.message(e,i,n);return s.fatal=void 0,s}message(e,i,n){const s=new ln(e,i,n);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(e){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(e||void 0).decode(this.value)}}function d1(t,e){if(t&&t.includes(pr.sep))throw new Error("`"+e+"` cannot be a path: did not expect `"+pr.sep+"`")}function p1(t,e){if(!t)throw new Error("`"+e+"` cannot be empty")}function ZQ(t,e){if(!t)throw new Error("Setting `"+e+"` requires `path` to be set too")}function Hue(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const Fue=(function(t){const n=this.constructor.prototype,s=n[t],r=function(){return s.apply(r,arguments)};return Object.setPrototypeOf(r,n),r}),Gue={}.hasOwnProperty;class tC extends Fue{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=$ue()}copy(){const e=new tC;let i=-1;for(;++i<this.attachers.length;){const n=this.attachers[i];e.use(...n)}return e.data(u1(!0,{},this.namespace)),e}data(e,i){return typeof e=="string"?arguments.length===2?(O1("data",this.frozen),this.namespace[e]=i,this):Gue.call(this.namespace,e)&&this.namespace[e]||void 0:e?(O1("data",this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;const e=this;for(;++this.freezeIndex<this.attachers.length;){const[i,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);const s=i.call(e,...n);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(e){this.freeze();const i=Lm(e),n=this.parser||this.Parser;return m1("parse",n),n(String(i),i)}process(e,i){const n=this;return this.freeze(),m1("process",this.parser||this.Parser),g1("process",this.compiler||this.Compiler),i?s(void 0,i):new Promise(s);function s(r,o){const l=Lm(e),c=n.parse(l);n.run(c,l,function(d,p,g){if(d||!p||!g)return u(d);const O=p,_=n.stringify(O,g);efe(_)?g.value=_:g.result=_,u(d,g)});function u(d,p){d||!p?o(d):r?r(p):i(void 0,p)}}}processSync(e){let i=!1,n;return this.freeze(),m1("processSync",this.parser||this.Parser),g1("processSync",this.compiler||this.Compiler),this.process(e,s),WQ("processSync","process",i),n;function s(r,o){i=!0,VQ(r),n=o}}run(e,i,n){qQ(e),this.freeze();const s=this.transformers;return!n&&typeof i=="function"&&(n=i,i=void 0),n?r(void 0,n):new Promise(r);function r(o,l){const c=Lm(i);s.run(e,c,u);function u(d,p,g){const O=p||e;d?l(d):o?o(O):n(void 0,O,g)}}}runSync(e,i){let n=!1,s;return this.run(e,i,r),WQ("runSync","run",n),s;function r(o,l){VQ(o),s=l,n=!0}}stringify(e,i){this.freeze();const n=Lm(i),s=this.compiler||this.Compiler;return g1("stringify",s),qQ(e),s(e,n)}use(e,...i){const n=this.attachers,s=this.namespace;if(O1("use",this.frozen),e!=null)if(typeof e=="function")c(e,i);else if(typeof e=="object")Array.isArray(e)?l(e):o(e);else throw new TypeError("Expected usable value, not `"+e+"`");return this;function r(u){if(typeof u=="function")c(u,[]);else if(typeof u=="object")if(Array.isArray(u)){const[d,...p]=u;c(d,p)}else o(u);else throw new TypeError("Expected usable value, not `"+u+"`")}function o(u){if(!("plugins"in u)&&!("settings"in u))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(u.plugins),u.settings&&(s.settings=u1(!0,s.settings,u.settings))}function l(u){let d=-1;if(u!=null)if(Array.isArray(u))for(;++d<u.length;){const p=u[d];r(p)}else throw new TypeError("Expected a list of plugins, not `"+u+"`")}function c(u,d){let p=-1,g=-1;for(;++p<n.length;)if(n[p][0]===u){g=p;break}if(g===-1)n.push([u,...d]);else if(d.length>0){let[O,..._]=d;const b=n[g][1];ZS(b)&&ZS(O)&&(O=u1(!0,b,O)),n[g]=[u,O,..._]}}}}const Kue=new tC().freeze();function m1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `parser`")}function g1(t,e){if(typeof e!="function")throw new TypeError("Cannot `"+t+"` without `compiler`")}function O1(t,e){if(e)throw new Error("Cannot call `"+t+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function qQ(t){if(!ZS(t)||typeof t.type!="string")throw new TypeError("Expected node, got `"+t+"`")}function WQ(t,e,i){if(!i)throw new Error("`"+t+"` finished async. Use `"+e+"` instead")}function Lm(t){return Jue(t)?t:new xN(t)}function Jue(t){return!!(t&&typeof t=="object"&&"message"in t&&"messages"in t)}function efe(t){return typeof t=="string"||tfe(t)}function tfe(t){return!!(t&&typeof t=="object"&&"byteLength"in t&&"byteOffset"in t)}const ife="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",UQ=[],YQ={allowDangerousHtml:!0},nfe=/^(https?|ircs?|mailto|xmpp)$/i,sfe=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function wN(t){const e=rfe(t),i=ofe(t);return afe(e.runSync(e.parse(i),i),t)}function rfe(t){const e=t.rehypePlugins||UQ,i=t.remarkPlugins||UQ,n=t.remarkRehypeOptions?{...t.remarkRehypeOptions,...YQ}:YQ;return Kue().use(Nhe).use(i).use(Lue,n).use(e)}function ofe(t){const e=t.children||"",i=new xN;return typeof e=="string"&&(i.value=e),i}function afe(t,e){const i=e.allowedElements,n=e.allowElement,s=e.components,r=e.disallowedElements,o=e.skipHtml,l=e.unwrapDisallowed,c=e.urlTransform||lfe;for(const d of sfe)Object.hasOwn(e,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+ife+d.id,void 0);return SN(t,u),vle(t,{Fragment:S.Fragment,components:s,ignoreInvalidStyle:!0,jsx:S.jsx,jsxs:S.jsxs,passKeys:!0,passNode:!0});function u(d,p,g){if(d.type==="raw"&&g&&typeof p=="number")return o?g.children.splice(p,1):g.children[p]={type:"text",value:d.value},p;if(d.type==="element"){let O;for(O in a1)if(Object.hasOwn(a1,O)&&Object.hasOwn(d.properties,O)){const _=d.properties[O],b=a1[O];(b===null||b.includes(d.tagName))&&(d.properties[O]=c(String(_||""),O,d))}}if(d.type==="element"){let O=i?!i.includes(d.tagName):r?r.includes(d.tagName):!1;if(!O&&n&&typeof p=="number"&&(O=!n(d,p,g)),O&&g&&typeof p=="number")return l&&d.children?g.children.splice(p,1,...d.children):g.children.splice(p,1),p}}}function lfe(t){const e=t.indexOf(":"),i=t.indexOf("?"),n=t.indexOf("#"),s=t.indexOf("/");return e===-1||s!==-1&&e>s||i!==-1&&e>i||n!==-1&&e>n||nfe.test(t.slice(0,e))?t:""}function cfe({option:t,selected:e,variant:i,onSelect:n,onFocus:s,onBlur:r}){var p;const[o,l]=Z.useState(!1),c=t.description.split(`
231
+ `),u=c.length>1||t.description.length>120,d=o?t.description:((p=c[0])==null?void 0:p.slice(0,120))??"";return S.jsxs("button",{type:"button",onClick:n,onMouseEnter:s,onMouseLeave:r,onFocus:s,onBlur:r,className:Fe("flex items-start gap-3 border p-3 text-left transition-colors w-full",e?"border-simple-accent bg-simple-accent/10":"border-border bg-card hover:border-muted-foreground/40"),children:[S.jsx("span",{className:"mt-0.5 shrink-0",children:i==="radio"?S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent":"border-muted-foreground"),style:{borderRadius:"50%"},children:e&&S.jsx("span",{className:"h-2 w-2 bg-simple-accent",style:{borderRadius:"50%"}})}):S.jsx("span",{className:Fe("flex h-4 w-4 items-center justify-center border",e?"border-simple-accent bg-simple-accent/20":"border-muted-foreground"),children:e&&S.jsx("svg",{className:"h-3 w-3 text-simple-accent",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("path",{d:"M2 6l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})})})}),S.jsxs("div",{className:"flex-1 min-w-0",children:[S.jsx("p",{className:"text-sm font-medium text-foreground leading-tight",children:t.label}),S.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5 leading-snug",children:[d,!o&&u&&"..."]}),u&&S.jsx("span",{role:"button",tabIndex:0,onClick:g=>{g.stopPropagation(),l(O=>!O)},onKeyDown:g=>{(g.key==="Enter"||g.key===" ")&&(g.stopPropagation(),g.preventDefault(),l(O=>!O))},className:"text-[10px] text-simple-accent mt-1 inline-block cursor-pointer hover:underline",children:o?"Show less":"Show more"})]})]})}function hfe({markdown:t,visible:e}){return e?S.jsx("div",{className:"border border-border bg-card p-4 text-xs font-mono text-foreground/80 leading-relaxed overflow-auto max-h-64 lg:absolute lg:right-0 lg:top-0 lg:w-80 lg:translate-x-[calc(100%+0.75rem)] lg:z-10 lg:shadow-lg mt-2 lg:mt-0",children:S.jsx(wN,{children:t})}):null}function ufe({question:t,onSubmit:e}){const[i,n]=Z.useState(null),[s,r]=Z.useState(new Set),[o,l]=Z.useState(""),[c,u]=Z.useState(null),d=Z.useRef(null);Z.useEffect(()=>{const k=d.current;k&&(k.style.height="auto",k.style.height=`${k.scrollHeight}px`)},[o]),Z.useEffect(()=>{n(null),r(new Set),l(""),u(null)},[t.id]);function p(k){t.multiSelect?r(T=>{const A=new Set(T);return A.has(k)?A.delete(k):A.add(k),A}):n(k)}function g(k){l(k),!t.multiSelect&&k.length>0&&n(null)}function O(k){k.key==="Enter"&&!k.shiftKey&&(k.preventDefault(),_())}function _(){if(b)if(t.multiSelect){const k=t.options.filter(T=>s.has(T.id)).map(T=>T.label);e({questionId:t.id,header:t.header,selectedOptionIds:Array.from(s),selectedLabels:k,freeText:o.trim()})}else if(i){const k=t.options.find(T=>T.id===i);e({questionId:t.id,header:t.header,selectedOptionIds:[i],selectedLabels:k?[k.label]:[],freeText:""})}else e({questionId:t.id,header:t.header,selectedOptionIds:[],selectedLabels:[],freeText:o.trim()})}const b=t.multiSelect?s.size>0||o.trim().length>0:i!==null||o.trim().length>0,x=c?t.options.find(k=>k.id===c):null,w=(x==null?void 0:x.markdown)??"";return S.jsxs("div",{className:"border border-border bg-card p-4 relative",children:[S.jsx("span",{className:"inline-block bg-simple-accent/20 border border-simple-accent/40 px-2 py-0.5 text-[10px] font-mono uppercase tracking-wider text-simple-accent mb-2",children:t.header}),S.jsx("div",{className:"text-sm text-foreground leading-relaxed mb-4 prose prose-invert prose-sm max-w-none [&_a]:text-simple-accent [&_code]:bg-muted [&_code]:px-1 [&_code]:py-0.5 [&_code]:text-xs",children:S.jsx(wN,{children:t.question})}),t.options.length>0&&S.jsxs("div",{className:"relative",children:[S.jsx("div",{className:"grid gap-2 mb-3",children:t.options.map(k=>{const T=t.multiSelect?s.has(k.id):i===k.id;return S.jsx(cfe,{option:k,selected:T,variant:t.multiSelect?"checkbox":"radio",onSelect:()=>p(k.id),onFocus:()=>u(k.id),onBlur:()=>u(null)},k.id)})}),S.jsx(hfe,{markdown:w,visible:!!w})]}),S.jsx("div",{className:"border border-border bg-muted/10 px-3 py-2 mb-3",children:S.jsx("textarea",{ref:d,value:o,onChange:k=>g(k.target.value),onKeyDown:O,rows:1,className:"w-full resize-none overflow-hidden bg-transparent font-mono text-xs text-foreground outline-none leading-relaxed"})}),S.jsx("button",{type:"button",onClick:_,disabled:!b,className:Fe("flex items-center gap-1.5 border px-3 py-1.5 text-xs font-mono uppercase tracking-widest transition-colors",b?"border-simple-accent bg-simple-accent/10 text-simple-accent hover:bg-simple-accent hover:text-background":"border-border text-muted-foreground cursor-not-allowed"),children:"Submit"})]})}function ffe({answer:t}){const e=t.selectedLabels.length>0?t.selectedLabels.join(", "):t.freeText.slice(0,80)+(t.freeText.length>80?"...":"");return S.jsx(vo.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},className:"overflow-hidden",children:S.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 border-b border-border/40 text-xs text-muted-foreground",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-success shrink-0",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true",children:S.jsx("path",{d:"M6.5 12.5l-4-4 1.4-1.4L6.5 9.7l5.6-5.6 1.4 1.4z"})}),S.jsx("span",{className:"font-mono text-simple-accent shrink-0",children:t.header}),S.jsx("span",{className:"text-foreground/70 truncate",children:e})]})})}function dfe(){return S.jsxs("div",{className:"border border-border bg-card p-4 animate-pulse",children:[S.jsx("div",{className:"h-3 w-16 bg-muted mb-3"}),S.jsx("div",{className:"h-4 w-3/4 bg-muted mb-2"}),S.jsx("div",{className:"h-4 w-1/2 bg-muted mb-4"}),S.jsxs("div",{className:"flex gap-2",children:[S.jsx("div",{className:"h-10 flex-1 bg-muted"}),S.jsx("div",{className:"h-10 flex-1 bg-muted"})]}),S.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Loading question..."})]})]})}function pfe({onAskMore:t,onDoneExecute:e,disabled:i}){return S.jsxs("div",{className:"sticky bottom-0 z-10 flex items-center justify-end gap-3 border-t border-border bg-background/95 backdrop-blur px-4 py-3",children:[S.jsx("button",{type:"button",onClick:t,disabled:i,className:"border border-simple-accent/50 px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent/10 disabled:opacity-50",children:"Ask me more"}),S.jsx("button",{type:"button",onClick:e,disabled:i,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background disabled:opacity-50",children:"Done, execute"})]})}function mfe({open:t,onConfirm:e,onCancel:i}){return S.jsx(xx,{children:t&&S.jsx(vo.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",onClick:i,children:S.jsxs(vo.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"mx-4 w-full max-w-sm border border-border bg-card p-6",onClick:n=>n.stopPropagation(),children:[S.jsx("p",{className:"text-sm text-foreground leading-relaxed mb-6",children:"This will end discussion and start execution. Continue?"}),S.jsxs("div",{className:"flex items-center justify-end gap-3",children:[S.jsx("button",{type:"button",onClick:i,className:"border border-border px-4 py-2 text-xs font-mono uppercase tracking-widest text-muted-foreground transition-colors hover:border-muted-foreground hover:text-foreground",children:"Cancel"}),S.jsx("button",{type:"button",onClick:e,className:"bg-simple-accent/15 border border-simple-accent px-4 py-2 text-xs font-mono uppercase tracking-widest text-simple-accent transition-colors hover:bg-simple-accent hover:text-background",children:"Confirm"})]})]})})})}function gfe({answerCount:t}){return S.jsxs(vo.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{duration:.25,ease:"easeOut"},className:"border border-border bg-card p-6 text-center",children:[S.jsx("div",{className:"flex justify-center mb-3",children:S.jsxs("svg",{className:"h-8 w-8 text-success",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:[S.jsx("circle",{cx:"12",cy:"12",r:"10"}),S.jsx("path",{d:"M8 12l3 3 5-5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),S.jsx("h3",{className:"text-sm font-medium text-foreground mb-1",children:"Discussion Complete"}),S.jsxs("p",{className:"text-xs text-muted-foreground mb-4",children:[t," ",t===1?"question":"questions"," answered"]}),S.jsxs("div",{className:"flex items-center justify-center gap-2",children:[S.jsx("svg",{className:"h-3.5 w-3.5 text-simple-accent animate-spin",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"2","aria-hidden":"true",children:S.jsx("circle",{cx:"8",cy:"8",r:"6",strokeDasharray:"28",strokeDashoffset:"8"})}),S.jsx("span",{className:"text-[10px] font-mono text-muted-foreground uppercase tracking-wider",children:"Execution queued..."})]})]})}function Ofe(){const{phase:t,currentQuestion:e,answeredQuestions:i,answerCount:n,submitAnswer:s,askMore:r,doneExecute:o,receiveQuestions:l}=oL(),{onQuestionReceivedRef:c}=Ea();Z.useEffect(()=>(c.current=x=>{l(x)},()=>{c.current=null}),[l,c]);const[u,d]=Z.useState(!1),p=Z.useRef(null);Z.useEffect(()=>{t==="active"&&p.current&&p.current.scrollIntoView({behavior:"smooth",block:"start"})},[t,e==null?void 0:e.id]);function g(){d(!0)}function O(){d(!1),o()}function _(){d(!1)}const b=t==="submitting"||t==="complete";return S.jsxs("div",{className:"flex flex-col h-full",children:[S.jsx("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-border",children:S.jsxs("span",{className:"text-xs font-mono uppercase tracking-wider text-muted-foreground",children:["Discussion (",n,"/?)"]})}),S.jsx("div",{className:"flex-1 overflow-y-auto pb-20",children:S.jsxs("div",{className:"mx-auto max-w-3xl p-4 flex flex-col gap-2",children:[i.map(x=>S.jsx(ffe,{answer:x},x.questionId)),t==="active"&&e&&S.jsx("div",{ref:p,children:S.jsx(ufe,{question:e,onSubmit:s})}),t==="loading"&&S.jsx(dfe,{}),t==="complete"&&S.jsx(gfe,{answerCount:n})]})}),t!=="complete"&&S.jsx(pfe,{onAskMore:r,onDoneExecute:g,disabled:b}),S.jsx(mfe,{open:u,onConfirm:O,onCancel:_})]})}function HQ(){var i;const{lifecycleEvent:t,pendingQuestionCount:e}=Ea();return!t&&e===0?null:S.jsxs("div",{className:"flex items-center justify-between px-4 py-1.5 bg-muted/50 border-b border-border text-xs font-mono text-muted-foreground",children:[t&&S.jsxs("span",{children:["Phase ",t.phase_number,": ",t.phase_name," — ",(i=t.event_type)==null?void 0:i.replace(/-/g," "),t.step&&t.total_steps?` (Step ${t.step}/${t.total_steps})`:""]}),e>0&&S.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:[e," pending"]})]})}function vfe({onExecute:t}){const{phase:e,startDiscussion:i,resetDiscussion:n}=oL(),{pendingQuestionCount:s}=Ea(),r=e!=="idle";function o(l){if(l.startsWith("/maxsim:discuss-phase")){i();return}t(l)}return r?S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx(HQ,{}),S.jsxs("div",{className:"px-4 pt-3 sm:px-6 flex items-center gap-2",children:[S.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 text-xs font-mono text-muted-foreground hover:text-foreground transition-colors",children:[S.jsx("svg",{className:"h-3 w-3",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:S.jsx("path",{d:"M8 1L3 6l5 5",strokeLinecap:"round",strokeLinejoin:"round"})}),"Back to actions"]}),s>0&&S.jsx("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full bg-teal-500/20 text-teal-400 text-[10px] font-semibold",children:s})]}),S.jsx("div",{className:"flex-1 min-h-0",children:S.jsx(Ofe,{})})]}):S.jsxs("div",{className:"flex flex-col gap-0 h-full",children:[S.jsx(HQ,{}),S.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",children:S.jsxs("div",{className:"mx-auto max-w-3xl flex flex-col gap-4",children:[S.jsx(jae,{}),S.jsx(Xae,{onExecute:o})]})})]})}function _fe(){return S.jsxs("div",{className:"flex flex-col gap-6",children:[S.jsxs("div",{className:"flex flex-col gap-4 border-b border-border pb-6",children:[S.jsx("div",{className:"h-2 w-32 animate-pulse bg-muted"}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"}),S.jsxs("div",{className:"flex gap-10",children:[S.jsx("div",{className:"h-8 w-16 animate-pulse bg-muted"}),S.jsx("div",{className:"h-8 w-40 animate-pulse bg-muted"}),S.jsxs("div",{className:"ml-auto flex gap-8",children:[S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-6 w-12 animate-pulse bg-muted"})]})]})]}),S.jsxs("div",{className:"flex flex-col",children:[S.jsxs("div",{className:"flex justify-between px-4 pb-3",children:[S.jsx("div",{className:"h-2 w-12 animate-pulse bg-muted"}),S.jsx("div",{className:"h-2 w-4 animate-pulse bg-muted"})]}),Array.from({length:6}).map((t,e)=>S.jsxs("div",{className:"border-b border-border",children:[S.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[S.jsx("div",{className:"h-1.5 w-1.5 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-6 animate-pulse bg-muted"}),S.jsx("div",{className:"h-3 w-36 animate-pulse bg-muted"})]}),S.jsx("div",{className:"h-px w-full animate-pulse bg-muted"})]},e))]})]})}function yfe({message:t,onRetry:e}){return S.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-4",children:[S.jsx("p",{className:"font-mono text-sm text-danger",children:t}),S.jsx("button",{type:"button",onClick:e,className:"border border-accent bg-accent/10 px-4 py-2 font-mono text-xs uppercase tracking-widest text-accent transition-colors hover:bg-accent hover:text-foreground",children:"Retry"})]})}function bfe(){const{roadmap:t,state:e,todos:i,loading:n,error:s}=Rl(),{mode:r,setMode:o,initialized:l}=s7(),[c,u]=Z.useState("overview"),[d,p]=Z.useState(null),[g,O]=Z.useState(!1),{splitMode:_,toggleSplit:b}=Bae(),x=Z.useRef(null),w=Z.useCallback(()=>{o(r==="simple"?"advanced":"simple")},[r,o]),k=l?S.jsx(zae,{mode:r,onToggle:w}):null,T=Z.useRef({view:"overview",phaseId:null}),A=Z.useCallback((D,j)=>{D!=="terminal"&&(T.current={view:D,phaseId:D==="phase"&&j?j:null}),u(D),D==="phase"&&j&&p(j),O(!1)},[]),L=Z.useCallback(D=>{var j;(j=x.current)==null||j.call(x,D+"\r"),A("terminal")},[A]),E=Z.useCallback(D=>{u("phase"),p(D)},[]),z=Z.useCallback(()=>{u("overview"),p(null)},[]),N=Z.useCallback(async(D,j)=>{try{const $=await fetch("/api/roadmap",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({phaseNumber:D,checked:j})});$.ok||console.error("[toggle-phase]",await $.text())}catch($){console.error("[toggle-phase]",$)}},[]),q=((t==null?void 0:t.phases)??[]).map(D=>({number:D.number,name:D.name,goal:D.goal??"",dependsOn:D.depends_on?[D.depends_on]:[],planCount:D.plan_count,summaryCount:D.summary_count,diskStatus:D.disk_status,roadmapComplete:D.roadmap_complete,hasContext:D.has_context,hasResearch:D.has_research})),J=(t==null?void 0:t.current_phase)??null;function U(){if(n)return S.jsx(_fe,{});if(s)return S.jsx(yfe,{message:s,onRetry:()=>window.location.reload()});switch(c){case"overview":return S.jsxs("div",{className:"mx-auto flex max-w-4xl flex-col gap-6",children:[S.jsx(K9,{roadmap:t,state:e,todos:i}),S.jsx(iZ,{phases:q,currentPhase:J,onPhaseClick:E,onToggleComplete:N})]});case"phase":return d?S.jsx("div",{className:"mx-auto max-w-4xl",children:S.jsx(Ute,{phaseId:d,onBack:z})}):null;case"todos":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Yte,{})});case"blockers":return S.jsx("div",{className:"mx-auto max-w-3xl",children:S.jsx(Gte,{})});case"terminal":return null;default:return null}}const R=c==="terminal",B=r==="simple";return S.jsxs(Kte,{mobileMenuOpen:g,onMobileMenuToggle:()=>O(D=>!D),onMobileMenuClose:()=>O(!1),headerRight:k,simpleMode:B,sidebar:S.jsx("div",{style:{display:B?"none":"contents"},children:S.jsx(wie,{activeView:c,activePhaseId:d,onNavigate:A,logoAction:k})}),children:[l&&r===null&&S.jsx(Nae,{onChoose:o}),B&&l&&S.jsx("div",{className:"flex flex-col flex-1 min-h-0",children:S.jsx(vfe,{onExecute:L})}),S.jsxs("div",{style:{display:B?"none":"contents"},children:[S.jsx("div",{style:{display:R&&!_?"none":"block"},className:R&&_?"h-1/2 min-h-0 overflow-auto border-b border-border p-4 sm:p-6":"flex-1 overflow-y-auto p-4 sm:p-6",children:U()}),S.jsxs("div",{style:{display:R?"flex":"none"},className:`relative min-h-0 flex-col overflow-hidden ${R&&_?"h-1/2":"flex-1"}`,children:[S.jsx($ae,{splitMode:_,onToggle:b}),S.jsx(Dae,{writeInputRef:x})]})]})]})}function Sfe(){return S.jsx(Kj,{children:S.jsx(t7,{children:S.jsx(n7,{children:S.jsx(bfe,{})})})})}const CN=document.getElementById("root");if(!CN)throw new Error("Root element not found");Hj.createRoot(CN).render(S.jsx(Z.StrictMode,{children:S.jsx(Sfe,{})}));