anycodex 0.0.20 → 0.0.21
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/apl-CORt7UWP.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-HNnZUWAn.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-BjGOyj-B.js","assets/html-derivative-DlHx6ybY.js","assets/sql-BLtJtn59.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nBiQ_Alo.js","assets/coffee-Ch7k5sss.js","assets/cpp-CofmeUqb.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-DNxU26gB.js","assets/shellscript-Yzrsuije.js","assets/edge-FbVlp4U3.js","assets/elixir-CkH2-t6x.js","assets/elm-DbKCFpqz.js","assets/erb-BYCe7drp.js","assets/ruby-Wjq7vjNf.js","assets/haml-D5jkg6IW.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-ByusRIyA.js","assets/glimmer-ts-BfAWNZQY.js","assets/hack-i7_Ulhet.js","assets/handlebars-BpdQsYii.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-CxzCAyBv.js","assets/r-Dspwwk_N.js","assets/just-VxiPbLrw.js","assets/perl-NvoQZIq0.js","assets/latex-CWtU0Tv5.js","assets/tex-idrVyKtj.js","assets/liquid-C0sCDyMI.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-DTYItulj.js","assets/nextflow-C-mBbutL.js","assets/nextflow-groovy-vE_lwT2v.js","assets/nginx-BpAMiNFr.js","assets/nim-BIad80T-.js","assets/php-R6g_5hLQ.js","assets/pug-DKIMFp6K.js","assets/qml-3beO22l8.js","assets/razor-BDqjjVU7.js","assets/csharp-COcwbKMJ.js","assets/rst-CRjBmOyv.js","assets/cmake-D1j8_8rp.js","assets/sas-cz2c8ADy.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-8wufbnw4.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-BH5u7GGu.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-Cy7k_4gC.js","assets/templ-DhtptRzy.js","assets/go-C27-OAKa.js","assets/ts-tags-DQrlYJgV.js","assets/twig-xg9kU7Mw.js","assets/vue-D2xRrEX4.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
var
|
|
2
|
+
var SC=Object.defineProperty;var bC=Object.getPrototypeOf;var wC=Reflect.get;var Dv=e=>{throw TypeError(e)};var CC=(e,t,r)=>t in e?SC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Y=(e,t,r)=>CC(e,typeof t!="symbol"?t+"":t,r),fd=(e,t,r)=>t.has(e)||Dv("Cannot "+r);var ei=(e,t,r)=>(fd(e,t,"read from private field"),r?r.call(e):t.get(e)),Is=(e,t,r)=>t.has(e)?Dv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),Fi=(e,t,r,n)=>(fd(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),_d=(e,t,r)=>(fd(e,t,"access private method"),r);var Lv=(e,t,r)=>wC(bC(e),r,t);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&n(u)}).observe(document,{childList:!0,subtree:!0});function r(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function n(l){if(l.ep)return;l.ep=!0;const c=r(l);fetch(l.href,c)}})();var pd={exports:{}},Za={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
5
5
|
*
|
|
@@ -7,7 +7,7 @@ var gC=Object.defineProperty;var vC=Object.getPrototypeOf;var yC=Reflect.get;var
|
|
|
7
7
|
*
|
|
8
8
|
* This source code is licensed under the MIT license found in the
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
|
-
*/var
|
|
10
|
+
*/var Ov;function EC(){if(Ov)return Za;Ov=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function r(n,l,c){var u=null;if(c!==void 0&&(u=""+c),l.key!==void 0&&(u=""+l.key),"key"in l){c={};for(var d in l)d!=="key"&&(c[d]=l[d])}else c=l;return l=c.ref,{$$typeof:e,type:n,key:u,ref:l!==void 0?l:null,props:c}}return Za.Fragment=t,Za.jsx=r,Za.jsxs=r,Za}var Mv;function xC(){return Mv||(Mv=1,pd.exports=EC()),pd.exports}var k=xC(),md={exports:{}},xe={};/**
|
|
11
11
|
* @license React
|
|
12
12
|
* react.production.js
|
|
13
13
|
*
|
|
@@ -15,7 +15,7 @@ var gC=Object.defineProperty;var vC=Object.getPrototypeOf;var yC=Reflect.get;var
|
|
|
15
15
|
*
|
|
16
16
|
* This source code is licensed under the MIT license found in the
|
|
17
17
|
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*/var
|
|
18
|
+
*/var Nv;function AC(){if(Nv)return xe;Nv=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),_=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function S(E){return E===null||typeof E!="object"?null:(E=y&&E[y]||E["@@iterator"],typeof E=="function"?E:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,T={};function O(E,M,X){this.props=E,this.context=M,this.refs=T,this.updater=X||b}O.prototype.isReactComponent={},O.prototype.setState=function(E,M){if(typeof E!="object"&&typeof E!="function"&&E!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,E,M,"setState")},O.prototype.forceUpdate=function(E){this.updater.enqueueForceUpdate(this,E,"forceUpdate")};function H(){}H.prototype=O.prototype;function B(E,M,X){this.props=E,this.context=M,this.refs=T,this.updater=X||b}var I=B.prototype=new H;I.constructor=B,x(I,O.prototype),I.isPureReactComponent=!0;var j=Array.isArray;function $(){}var ee={H:null,A:null,T:null,S:null},ge=Object.prototype.hasOwnProperty;function Se(E,M,X){var te=X.ref;return{$$typeof:e,type:E,key:M,ref:te!==void 0?te:null,props:X}}function _e(E,M){return Se(E.type,M,E.props)}function he(E){return typeof E=="object"&&E!==null&&E.$$typeof===e}function J(E){var M={"=":"=0",":":"=2"};return"$"+E.replace(/[=:]/g,function(X){return M[X]})}var W=/\/+/g;function ne(E,M){return typeof E=="object"&&E!==null&&E.key!=null?J(""+E.key):M.toString(36)}function se(E){switch(E.status){case"fulfilled":return E.value;case"rejected":throw E.reason;default:switch(typeof E.status=="string"?E.then($,$):(E.status="pending",E.then(function(M){E.status==="pending"&&(E.status="fulfilled",E.value=M)},function(M){E.status==="pending"&&(E.status="rejected",E.reason=M)})),E.status){case"fulfilled":return E.value;case"rejected":throw E.reason}}throw E}function D(E,M,X,te,ue){var pe=typeof E;(pe==="undefined"||pe==="boolean")&&(E=null);var we=!1;if(E===null)we=!0;else switch(pe){case"bigint":case"string":case"number":we=!0;break;case"object":switch(E.$$typeof){case e:case t:we=!0;break;case v:return we=E._init,D(we(E._payload),M,X,te,ue)}}if(we)return ue=ue(E),we=te===""?"."+ne(E,0):te,j(ue)?(X="",we!=null&&(X=we.replace(W,"$&/")+"/"),D(ue,M,X,"",function(Ft){return Ft})):ue!=null&&(he(ue)&&(ue=_e(ue,X+(ue.key==null||E&&E.key===ue.key?"":(""+ue.key).replace(W,"$&/")+"/")+we)),M.push(ue)),1;we=0;var We=te===""?".":te+":";if(j(E))for(var ze=0;ze<E.length;ze++)te=E[ze],pe=We+ne(te,ze),we+=D(te,M,X,pe,ue);else if(ze=S(E),typeof ze=="function")for(E=ze.call(E),ze=0;!(te=E.next()).done;)te=te.value,pe=We+ne(te,ze++),we+=D(te,M,X,pe,ue);else if(pe==="object"){if(typeof E.then=="function")return D(se(E),M,X,te,ue);throw M=String(E),Error("Objects are not valid as a React child (found: "+(M==="[object Object]"?"object with keys {"+Object.keys(E).join(", ")+"}":M)+"). If you meant to render a collection of children, use an array instead.")}return we}function q(E,M,X){if(E==null)return E;var te=[],ue=0;return D(E,te,"","",function(pe){return M.call(X,pe,ue++)}),te}function F(E){if(E._status===-1){var M=E._result;M=M(),M.then(function(X){(E._status===0||E._status===-1)&&(E._status=1,E._result=X)},function(X){(E._status===0||E._status===-1)&&(E._status=2,E._result=X)}),E._status===-1&&(E._status=0,E._result=M)}if(E._status===1)return E._result.default;throw E._result}var re=typeof reportError=="function"?reportError:function(E){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var M=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof E=="object"&&E!==null&&typeof E.message=="string"?String(E.message):String(E),error:E});if(!window.dispatchEvent(M))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",E);return}console.error(E)},le={map:q,forEach:function(E,M,X){q(E,function(){M.apply(this,arguments)},X)},count:function(E){var M=0;return q(E,function(){M++}),M},toArray:function(E){return q(E,function(M){return M})||[]},only:function(E){if(!he(E))throw Error("React.Children.only expected to receive a single React element child.");return E}};return xe.Activity=m,xe.Children=le,xe.Component=O,xe.Fragment=r,xe.Profiler=l,xe.PureComponent=B,xe.StrictMode=n,xe.Suspense=_,xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=ee,xe.__COMPILER_RUNTIME={__proto__:null,c:function(E){return ee.H.useMemoCache(E)}},xe.cache=function(E){return function(){return E.apply(null,arguments)}},xe.cacheSignal=function(){return null},xe.cloneElement=function(E,M,X){if(E==null)throw Error("The argument must be a React element, but you passed "+E+".");var te=x({},E.props),ue=E.key;if(M!=null)for(pe in M.key!==void 0&&(ue=""+M.key),M)!ge.call(M,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&M.ref===void 0||(te[pe]=M[pe]);var pe=arguments.length-2;if(pe===1)te.children=X;else if(1<pe){for(var we=Array(pe),We=0;We<pe;We++)we[We]=arguments[We+2];te.children=we}return Se(E.type,ue,te)},xe.createContext=function(E){return E={$$typeof:u,_currentValue:E,_currentValue2:E,_threadCount:0,Provider:null,Consumer:null},E.Provider=E,E.Consumer={$$typeof:c,_context:E},E},xe.createElement=function(E,M,X){var te,ue={},pe=null;if(M!=null)for(te in M.key!==void 0&&(pe=""+M.key),M)ge.call(M,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(ue[te]=M[te]);var we=arguments.length-2;if(we===1)ue.children=X;else if(1<we){for(var We=Array(we),ze=0;ze<we;ze++)We[ze]=arguments[ze+2];ue.children=We}if(E&&E.defaultProps)for(te in we=E.defaultProps,we)ue[te]===void 0&&(ue[te]=we[te]);return Se(E,pe,ue)},xe.createRef=function(){return{current:null}},xe.forwardRef=function(E){return{$$typeof:d,render:E}},xe.isValidElement=he,xe.lazy=function(E){return{$$typeof:v,_payload:{_status:-1,_result:E},_init:F}},xe.memo=function(E,M){return{$$typeof:f,type:E,compare:M===void 0?null:M}},xe.startTransition=function(E){var M=ee.T,X={};ee.T=X;try{var te=E(),ue=ee.S;ue!==null&&ue(X,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then($,re)}catch(pe){re(pe)}finally{M!==null&&X.types!==null&&(M.types=X.types),ee.T=M}},xe.unstable_useCacheRefresh=function(){return ee.H.useCacheRefresh()},xe.use=function(E){return ee.H.use(E)},xe.useActionState=function(E,M,X){return ee.H.useActionState(E,M,X)},xe.useCallback=function(E,M){return ee.H.useCallback(E,M)},xe.useContext=function(E){return ee.H.useContext(E)},xe.useDebugValue=function(){},xe.useDeferredValue=function(E,M){return ee.H.useDeferredValue(E,M)},xe.useEffect=function(E,M){return ee.H.useEffect(E,M)},xe.useEffectEvent=function(E){return ee.H.useEffectEvent(E)},xe.useId=function(){return ee.H.useId()},xe.useImperativeHandle=function(E,M,X){return ee.H.useImperativeHandle(E,M,X)},xe.useInsertionEffect=function(E,M){return ee.H.useInsertionEffect(E,M)},xe.useLayoutEffect=function(E,M){return ee.H.useLayoutEffect(E,M)},xe.useMemo=function(E,M){return ee.H.useMemo(E,M)},xe.useOptimistic=function(E,M){return ee.H.useOptimistic(E,M)},xe.useReducer=function(E,M,X){return ee.H.useReducer(E,M,X)},xe.useRef=function(E){return ee.H.useRef(E)},xe.useState=function(E){return ee.H.useState(E)},xe.useSyncExternalStore=function(E,M,X){return ee.H.useSyncExternalStore(E,M,X)},xe.useTransition=function(){return ee.H.useTransition()},xe.version="19.2.4",xe}var Bv;function e_(){return Bv||(Bv=1,md.exports=AC()),md.exports}var V=e_(),gd={exports:{}},Qa={},vd={exports:{}},yd={};/**
|
|
19
19
|
* @license React
|
|
20
20
|
* scheduler.production.js
|
|
21
21
|
*
|
|
@@ -23,7 +23,7 @@ var gC=Object.defineProperty;var vC=Object.getPrototypeOf;var yC=Reflect.get;var
|
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the MIT license found in the
|
|
25
25
|
* LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/var
|
|
26
|
+
*/var zv;function kC(){return zv||(zv=1,(function(e){function t(D,q){var F=D.length;D.push(q);e:for(;0<F;){var re=F-1>>>1,le=D[re];if(0<l(le,q))D[re]=q,D[F]=le,F=re;else break e}}function r(D){return D.length===0?null:D[0]}function n(D){if(D.length===0)return null;var q=D[0],F=D.pop();if(F!==q){D[0]=F;e:for(var re=0,le=D.length,E=le>>>1;re<E;){var M=2*(re+1)-1,X=D[M],te=M+1,ue=D[te];if(0>l(X,F))te<le&&0>l(ue,X)?(D[re]=ue,D[te]=F,re=te):(D[re]=X,D[M]=F,re=M);else if(te<le&&0>l(ue,F))D[re]=ue,D[te]=F,re=te;else break e}}return q}function l(D,q){var F=D.sortIndex-q.sortIndex;return F!==0?F:D.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var _=[],f=[],v=1,m=null,y=3,S=!1,b=!1,x=!1,T=!1,O=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function I(D){for(var q=r(f);q!==null;){if(q.callback===null)n(f);else if(q.startTime<=D)n(f),q.sortIndex=q.expirationTime,t(_,q);else break;q=r(f)}}function j(D){if(x=!1,I(D),!b)if(r(_)!==null)b=!0,$||($=!0,J());else{var q=r(f);q!==null&&se(j,q.startTime-D)}}var $=!1,ee=-1,ge=5,Se=-1;function _e(){return T?!0:!(e.unstable_now()-Se<ge)}function he(){if(T=!1,$){var D=e.unstable_now();Se=D;var q=!0;try{e:{b=!1,x&&(x=!1,H(ee),ee=-1),S=!0;var F=y;try{t:{for(I(D),m=r(_);m!==null&&!(m.expirationTime>D&&_e());){var re=m.callback;if(typeof re=="function"){m.callback=null,y=m.priorityLevel;var le=re(m.expirationTime<=D);if(D=e.unstable_now(),typeof le=="function"){m.callback=le,I(D),q=!0;break t}m===r(_)&&n(_),I(D)}else n(_);m=r(_)}if(m!==null)q=!0;else{var E=r(f);E!==null&&se(j,E.startTime-D),q=!1}}break e}finally{m=null,y=F,S=!1}q=void 0}}finally{q?J():$=!1}}}var J;if(typeof B=="function")J=function(){B(he)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,ne=W.port2;W.port1.onmessage=he,J=function(){ne.postMessage(null)}}else J=function(){O(he,0)};function se(D,q){ee=O(function(){D(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(D){D.callback=null},e.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ge=0<D?Math.floor(1e3/D):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(D){switch(y){case 1:case 2:case 3:var q=3;break;default:q=y}var F=y;y=q;try{return D()}finally{y=F}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(D,q){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var F=y;y=D;try{return q()}finally{y=F}},e.unstable_scheduleCallback=function(D,q,F){var re=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?re+F:re):F=re,D){case 1:var le=-1;break;case 2:le=250;break;case 5:le=1073741823;break;case 4:le=1e4;break;default:le=5e3}return le=F+le,D={id:v++,callback:q,priorityLevel:D,startTime:F,expirationTime:le,sortIndex:-1},F>re?(D.sortIndex=F,t(f,D),r(_)===null&&D===r(f)&&(x?(H(ee),ee=-1):x=!0,se(j,F-re))):(D.sortIndex=le,t(_,D),b||S||(b=!0,$||($=!0,J()))),D},e.unstable_shouldYield=_e,e.unstable_wrapCallback=function(D){var q=y;return function(){var F=y;y=q;try{return D.apply(this,arguments)}finally{y=F}}}})(yd)),yd}var Pv;function TC(){return Pv||(Pv=1,vd.exports=kC()),vd.exports}var Sd={exports:{}},Kt={};/**
|
|
27
27
|
* @license React
|
|
28
28
|
* react-dom.production.js
|
|
29
29
|
*
|
|
@@ -31,7 +31,7 @@ var gC=Object.defineProperty;var vC=Object.getPrototypeOf;var yC=Reflect.get;var
|
|
|
31
31
|
*
|
|
32
32
|
* This source code is licensed under the MIT license found in the
|
|
33
33
|
* LICENSE file in the root directory of this source tree.
|
|
34
|
-
*/var
|
|
34
|
+
*/var Iv;function RC(){if(Iv)return Kt;Iv=1;var e=e_();function t(_){var f="https://react.dev/errors/"+_;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)f+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+_+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var n={d:{f:r,r:function(){throw Error(t(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function c(_,f,v){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:m==null?null:""+m,children:_,containerInfo:f,implementation:v}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(_,f){if(_==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return Kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Kt.createPortal=function(_,f){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(t(299));return c(_,f,null,v)},Kt.flushSync=function(_){var f=u.T,v=n.p;try{if(u.T=null,n.p=2,_)return _()}finally{u.T=f,n.p=v,n.d.f()}},Kt.preconnect=function(_,f){typeof _=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,n.d.C(_,f))},Kt.prefetchDNS=function(_){typeof _=="string"&&n.d.D(_)},Kt.preinit=function(_,f){if(typeof _=="string"&&f&&typeof f.as=="string"){var v=f.as,m=d(v,f.crossOrigin),y=typeof f.integrity=="string"?f.integrity:void 0,S=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;v==="style"?n.d.S(_,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:S}):v==="script"&&n.d.X(_,{crossOrigin:m,integrity:y,fetchPriority:S,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},Kt.preinitModule=function(_,f){if(typeof _=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var v=d(f.as,f.crossOrigin);n.d.M(_,{crossOrigin:v,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&n.d.M(_)},Kt.preload=function(_,f){if(typeof _=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var v=f.as,m=d(v,f.crossOrigin);n.d.L(_,v,{crossOrigin:m,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},Kt.preloadModule=function(_,f){if(typeof _=="string")if(f){var v=d(f.as,f.crossOrigin);n.d.m(_,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:v,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else n.d.m(_)},Kt.requestFormReset=function(_){n.d.r(_)},Kt.unstable_batchedUpdates=function(_,f){return _(f)},Kt.useFormState=function(_,f,v){return u.H.useFormState(_,f,v)},Kt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Kt.version="19.2.4",Kt}var Hv;function DC(){if(Hv)return Sd.exports;Hv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Sd.exports=RC(),Sd.exports}/**
|
|
35
35
|
* @license React
|
|
36
36
|
* react-dom-client.production.js
|
|
37
37
|
*
|
|
@@ -39,17 +39,17 @@ var gC=Object.defineProperty;var vC=Object.getPrototypeOf;var yC=Reflect.get;var
|
|
|
39
39
|
*
|
|
40
40
|
* This source code is licensed under the MIT license found in the
|
|
41
41
|
* LICENSE file in the root directory of this source tree.
|
|
42
|
-
*/var
|
|
42
|
+
*/var Uv;function LC(){if(Uv)return Qa;Uv=1;var e=TC(),t=e_(),r=DC();function n(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)s+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function c(i){var s=i,a=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(a=s.return),i=s.return;while(i)}return s.tag===3?a:null}function u(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function d(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function _(i){if(c(i)!==i)throw Error(n(188))}function f(i){var s=i.alternate;if(!s){if(s=c(i),s===null)throw Error(n(188));return s!==i?null:i}for(var a=i,o=s;;){var h=a.return;if(h===null)break;var p=h.alternate;if(p===null){if(o=h.return,o!==null){a=o;continue}break}if(h.child===p.child){for(p=h.child;p;){if(p===a)return _(h),i;if(p===o)return _(h),s;p=p.sibling}throw Error(n(188))}if(a.return!==o.return)a=h,o=p;else{for(var g=!1,w=h.child;w;){if(w===a){g=!0,a=h,o=p;break}if(w===o){g=!0,o=h,a=p;break}w=w.sibling}if(!g){for(w=p.child;w;){if(w===a){g=!0,a=p,o=h;break}if(w===o){g=!0,o=p,a=h;break}w=w.sibling}if(!g)throw Error(n(189))}}if(a.alternate!==o)throw Error(n(190))}if(a.tag!==3)throw Error(n(188));return a.stateNode.current===a?i:s}function v(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=v(i),s!==null)return s;i=i.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),H=Symbol.for("react.consumer"),B=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),$=Symbol.for("react.suspense_list"),ee=Symbol.for("react.memo"),ge=Symbol.for("react.lazy"),Se=Symbol.for("react.activity"),_e=Symbol.for("react.memo_cache_sentinel"),he=Symbol.iterator;function J(i){return i===null||typeof i!="object"?null:(i=he&&i[he]||i["@@iterator"],typeof i=="function"?i:null)}var W=Symbol.for("react.client.reference");function ne(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===W?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case x:return"Fragment";case O:return"Profiler";case T:return"StrictMode";case j:return"Suspense";case $:return"SuspenseList";case Se:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case b:return"Portal";case B:return i.displayName||"Context";case H:return(i._context.displayName||"Context")+".Consumer";case I:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ee:return s=i.displayName||null,s!==null?s:ne(i.type)||"Memo";case ge:s=i._payload,i=i._init;try{return ne(i(s))}catch{}}return null}var se=Array.isArray,D=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},re=[],le=-1;function E(i){return{current:i}}function M(i){0>le||(i.current=re[le],re[le]=null,le--)}function X(i,s){le++,re[le]=i.current,i.current=s}var te=E(null),ue=E(null),pe=E(null),we=E(null);function We(i,s){switch(X(pe,s),X(ue,i),X(te,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Jg(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Jg(s),i=ev(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}M(te),X(te,i)}function ze(){M(te),M(ue),M(pe)}function Ft(i){i.memoizedState!==null&&X(we,i);var s=te.current,a=ev(s,i.type);s!==a&&(X(ue,i),X(te,a))}function $e(i){ue.current===i&&(M(te),M(ue)),we.current===i&&(M(we),Fa._currentValue=F)}var at,Te;function si(i){if(at===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);at=s&&s[1]||"",Te=-1<a.stack.indexOf(`
|
|
43
43
|
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
-
`+at+i+
|
|
44
|
+
`+at+i+Te}var ra=!1;function sa(i,s){if(!i||ra)return"";ra=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(s){var Z=function(){throw Error()};if(Object.defineProperty(Z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Z,[])}catch(U){var P=U}Reflect.construct(i,[],Z)}else{try{Z.call()}catch(U){P=U}i.call(Z.prototype)}}else{try{throw Error()}catch(U){P=U}(Z=i())&&typeof Z.catch=="function"&&Z.catch(function(){})}}catch(U){if(U&&P&&typeof U.stack=="string")return[U.stack,P.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=o.DetermineComponentFrameRoot(),g=p[0],w=p[1];if(g&&w){var A=g.split(`
|
|
45
45
|
`),z=w.split(`
|
|
46
|
-
`);for(h=o=0;o<A.length&&!A[o].includes("DetermineComponentFrameRoot");)o++;for(;h<z.length&&!z[h].includes("DetermineComponentFrameRoot");)h++;if(o===A.length||h===z.length)for(o=A.length-1,h=z.length-1;1<=o&&0<=h&&A[o]!==z[h];)h--;for(;1<=o&&0<=h;o--,h--)if(A[o]!==z[h]){if(o!==1||h!==1)do if(o--,h--,0>h||A[o]!==z[h]){var
|
|
47
|
-
`+A[o].replace(" at new "," at ");return i.displayName&&
|
|
46
|
+
`);for(h=o=0;o<A.length&&!A[o].includes("DetermineComponentFrameRoot");)o++;for(;h<z.length&&!z[h].includes("DetermineComponentFrameRoot");)h++;if(o===A.length||h===z.length)for(o=A.length-1,h=z.length-1;1<=o&&0<=h&&A[o]!==z[h];)h--;for(;1<=o&&0<=h;o--,h--)if(A[o]!==z[h]){if(o!==1||h!==1)do if(o--,h--,0>h||A[o]!==z[h]){var G=`
|
|
47
|
+
`+A[o].replace(" at new "," at ");return i.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",i.displayName)),G}while(1<=o&&0<=h);break}}}finally{ra=!1,Error.prepareStackTrace=a}return(a=i?i.displayName||i.name:"")?si(a):""}function eu(i,s){switch(i.tag){case 26:case 27:case 5:return si(i.type);case 16:return si("Lazy");case 13:return i.child!==s&&s!==null?si("Suspense Fallback"):si("Suspense");case 19:return si("SuspenseList");case 0:case 15:return sa(i.type,!1);case 11:return sa(i.type.render,!1);case 1:return sa(i.type,!0);case 31:return si("Activity");default:return""}}function ie(i){try{var s="",a=null;do s+=eu(i,a),a=i,i=i.return;while(i);return s}catch(o){return`
|
|
48
48
|
Error generating stack: `+o.message+`
|
|
49
|
-
`+o.stack}}var Ee=Object.prototype.hasOwnProperty,Ae=e.unstable_scheduleCallback,Ge=e.unstable_cancelCallback,Ll=e.unstable_shouldYield,Xb=e.unstable_requestPaint,fi=e.unstable_now,Zb=e.unstable_getCurrentPriorityLevel,D_=e.unstable_ImmediatePriority,L_=e.unstable_UserBlockingPriority,Ol=e.unstable_NormalPriority,Qb=e.unstable_LowPriority,O_=e.unstable_IdlePriority,Jb=e.log,e1=e.unstable_setDisableYieldValue,sa=null,_i=null;function zr(i){if(typeof Jb=="function"&&e1(i),_i&&typeof _i.setStrictMode=="function")try{_i.setStrictMode(sa,i)}catch{}}var pi=Math.clz32?Math.clz32:r1,t1=Math.log,i1=Math.LN2;function r1(i){return i>>>=0,i===0?32:31-(t1(i)/i1|0)|0}var Ml=256,Nl=262144,Bl=4194304;function Ss(i){var s=i&42;if(s!==0)return s;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function zl(i,s,a){var o=i.pendingLanes;if(o===0)return 0;var h=0,p=i.suspendedLanes,g=i.pingedLanes;i=i.warmLanes;var w=o&134217727;return w!==0?(o=w&~p,o!==0?h=Ss(o):(g&=w,g!==0?h=Ss(g):a||(a=w&~i,a!==0&&(h=Ss(a))))):(w=o&~p,w!==0?h=Ss(w):g!==0?h=Ss(g):a||(a=o&~i,a!==0&&(h=Ss(a)))),h===0?0:s!==0&&s!==h&&(s&p)===0&&(p=h&-h,a=s&-s,p>=a||p===32&&(a&4194048)!==0)?s:h}function na(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function s1(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 M_(){var i=Bl;return Bl<<=1,(Bl&62914560)===0&&(Bl=4194304),i}function eu(i){for(var s=[],a=0;31>a;a++)s.push(i);return s}function aa(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function n1(i,s,a,o,h,p){var g=i.pendingLanes;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=a,i.entangledLanes&=a,i.errorRecoveryDisabledLanes&=a,i.shellSuspendCounter=0;var w=i.entanglements,A=i.expirationTimes,z=i.hiddenUpdates;for(a=g&~a;0<a;){var V=31-pi(a),Z=1<<V;w[V]=0,A[V]=-1;var P=z[V];if(P!==null)for(z[V]=null,V=0;V<P.length;V++){var U=P[V];U!==null&&(U.lane&=-536870913)}a&=~Z}o!==0&&N_(i,o,0),p!==0&&h===0&&i.tag!==0&&(i.suspendedLanes|=p&~(g&~s))}function N_(i,s,a){i.pendingLanes|=s,i.suspendedLanes&=~s;var o=31-pi(s);i.entangledLanes|=s,i.entanglements[o]=i.entanglements[o]|1073741824|a&261930}function B_(i,s){var a=i.entangledLanes|=s;for(i=i.entanglements;a;){var o=31-pi(a),h=1<<o;h&s|i[o]&s&&(i[o]|=s),a&=~h}}function z_(i,s){var a=s&-s;return a=(a&42)!==0?1:tu(a),(a&(i.suspendedLanes|s))!==0?0:a}function tu(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function iu(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function P_(){var i=W.p;return i!==0?i:(i=window.event,i===void 0?32:wv(i.type))}function I_(i,s){var a=W.p;try{return W.p=i,s()}finally{W.p=a}}var Pr=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Pr,ri="__reactProps$"+Pr,rn="__reactContainer$"+Pr,ru="__reactEvents$"+Pr,a1="__reactListeners$"+Pr,l1="__reactHandles$"+Pr,H_="__reactResources$"+Pr,la="__reactMarker$"+Pr;function su(i){delete i[Ut],delete i[ri],delete i[ru],delete i[a1],delete i[l1]}function sn(i){var s=i[Ut];if(s)return s;for(var a=i.parentNode;a;){if(s=a[rn]||a[Ut]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(i=av(i);i!==null;){if(a=i[Ut])return a;i=av(i)}return s}i=a,a=i.parentNode}return null}function nn(i){if(i=i[Ut]||i[rn]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function oa(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(n(33))}function an(i){var s=i[H_];return s||(s=i[H_]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Lt(i){i[la]=!0}var U_=new Set,j_={};function bs(i,s){ln(i,s),ln(i+"Capture",s)}function ln(i,s){for(j_[i]=s,i=0;i<s.length;i++)U_.add(s[i])}var o1=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]*$"),V_={},$_={};function c1(i){return Ee.call($_,i)?!0:Ee.call(V_,i)?!1:o1.test(i)?$_[i]=!0:(V_[i]=!0,!1)}function Pl(i,s,a){if(c1(s))if(a===null)i.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var o=s.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+a)}}function Il(i,s,a){if(a===null)i.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+a)}}function or(i,s,a,o){if(o===null)i.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttributeNS(s,a,""+o)}}function Ai(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function G_(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function u1(i,s,a){var o=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,p=o.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return h.call(this)},set:function(g){a=""+g,p.call(this,g)}}),Object.defineProperty(i,s,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function nu(i){if(!i._valueTracker){var s=G_(i)?"checked":"value";i._valueTracker=u1(i,s,""+i[s])}}function q_(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var a=s.getValue(),o="";return i&&(o=G_(i)?i.checked?"true":"false":i.value),i=o,i!==a?(s.setValue(i),!0):!1}function Hl(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var h1=/[\n"\\]/g;function ki(i){return i.replace(h1,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function au(i,s,a,o,h,p,g,w){i.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?i.type=g:i.removeAttribute("type"),s!=null?g==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+Ai(s)):i.value!==""+Ai(s)&&(i.value=""+Ai(s)):g!=="submit"&&g!=="reset"||i.removeAttribute("value"),s!=null?lu(i,g,Ai(s)):a!=null?lu(i,g,Ai(a)):o!=null&&i.removeAttribute("value"),h==null&&p!=null&&(i.defaultChecked=!!p),h!=null&&(i.checked=h&&typeof h!="function"&&typeof h!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.name=""+Ai(w):i.removeAttribute("name")}function W_(i,s,a,o,h,p,g,w){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(i.type=p),s!=null||a!=null){if(!(p!=="submit"&&p!=="reset"||s!=null)){nu(i);return}a=a!=null?""+Ai(a):"",s=s!=null?""+Ai(s):a,w||s===i.value||(i.value=s),i.defaultValue=s}o=o??h,o=typeof o!="function"&&typeof o!="symbol"&&!!o,i.checked=w?i.checked:!!o,i.defaultChecked=!!o,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(i.name=g),nu(i)}function lu(i,s,a){s==="number"&&Hl(i.ownerDocument)===i||i.defaultValue===""+a||(i.defaultValue=""+a)}function on(i,s,a,o){if(i=i.options,s){s={};for(var h=0;h<a.length;h++)s["$"+a[h]]=!0;for(a=0;a<i.length;a++)h=s.hasOwnProperty("$"+i[a].value),i[a].selected!==h&&(i[a].selected=h),h&&o&&(i[a].defaultSelected=!0)}else{for(a=""+Ai(a),s=null,h=0;h<i.length;h++){if(i[h].value===a){i[h].selected=!0,o&&(i[h].defaultSelected=!0);return}s!==null||i[h].disabled||(s=i[h])}s!==null&&(s.selected=!0)}}function F_(i,s,a){if(s!=null&&(s=""+Ai(s),s!==i.value&&(i.value=s),a==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=a!=null?""+Ai(a):""}function Y_(i,s,a,o){if(s==null){if(o!=null){if(a!=null)throw Error(n(92));if(se(o)){if(1<o.length)throw Error(n(93));o=o[0]}a=o}a==null&&(a=""),s=a}a=Ai(s),i.defaultValue=a,o=i.textContent,o===a&&o!==""&&o!==null&&(i.value=o),nu(i)}function cn(i,s){if(s){var a=i.firstChild;if(a&&a===i.lastChild&&a.nodeType===3){a.nodeValue=s;return}}i.textContent=s}var d1=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 K_(i,s,a){var o=s.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":o?i.setProperty(s,a):typeof a!="number"||a===0||d1.has(s)?s==="float"?i.cssFloat=a:i[s]=(""+a).trim():i[s]=a+"px"}function X_(i,s,a){if(s!=null&&typeof s!="object")throw Error(n(62));if(i=i.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||s!=null&&s.hasOwnProperty(o)||(o.indexOf("--")===0?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="");for(var h in s)o=s[h],s.hasOwnProperty(h)&&a[h]!==o&&K_(i,h,o)}else for(var p in s)s.hasOwnProperty(p)&&K_(i,p,s[p])}function ou(i){if(i.indexOf("-")===-1)return!1;switch(i){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 f1=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"]]),_1=/^[\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 Ul(i){return _1.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function cr(){}var cu=null;function uu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var un=null,hn=null;function Z_(i){var s=nn(i);if(s&&(i=s.stateNode)){var a=i[ri]||null;e:switch(i=s.stateNode,s.type){case"input":if(au(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),s=a.name,a.type==="radio"&&s!=null){for(a=i;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ki(""+s)+'"][type="radio"]'),s=0;s<a.length;s++){var o=a[s];if(o!==i&&o.form===i.form){var h=o[ri]||null;if(!h)throw Error(n(90));au(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(s=0;s<a.length;s++)o=a[s],o.form===i.form&&q_(o)}break e;case"textarea":F_(i,a.value,a.defaultValue);break e;case"select":s=a.value,s!=null&&on(i,!!a.multiple,s,!1)}}}var hu=!1;function Q_(i,s,a){if(hu)return i(s,a);hu=!0;try{var o=i(s);return o}finally{if(hu=!1,(un!==null||hn!==null)&&(To(),un&&(s=un,i=hn,hn=un=null,Z_(s),i)))for(s=0;s<i.length;s++)Z_(i[s])}}function ca(i,s){var a=i.stateNode;if(a===null)return null;var o=a[ri]||null;if(o===null)return null;a=o[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(i=i.type,o=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!o;break e;default:i=!1}if(i)return null;if(a&&typeof a!="function")throw Error(n(231,s,typeof a));return a}var ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),du=!1;if(ur)try{var ua={};Object.defineProperty(ua,"passive",{get:function(){du=!0}}),window.addEventListener("test",ua,ua),window.removeEventListener("test",ua,ua)}catch{du=!1}var Ir=null,fu=null,jl=null;function J_(){if(jl)return jl;var i,s=fu,a=s.length,o,h="value"in Ir?Ir.value:Ir.textContent,p=h.length;for(i=0;i<a&&s[i]===h[i];i++);var g=a-i;for(o=1;o<=g&&s[a-o]===h[p-o];o++);return jl=h.slice(i,1<o?1-o:void 0)}function Vl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function $l(){return!0}function ep(){return!1}function si(i){function s(a,o,h,p,g){this._reactName=a,this._targetInst=h,this.type=o,this.nativeEvent=p,this.target=g,this.currentTarget=null;for(var w in i)i.hasOwnProperty(w)&&(a=i[w],this[w]=a?a(p):p[w]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?$l:ep,this.isPropagationStopped=ep,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=$l)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=$l)},persist:function(){},isPersistent:$l}),s}var ws={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gl=si(ws),ha=m({},ws,{view:0,detail:0}),p1=si(ha),_u,pu,da,ql=m({},ha,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gu,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==da&&(da&&i.type==="mousemove"?(_u=i.screenX-da.screenX,pu=i.screenY-da.screenY):pu=_u=0,da=i),_u)},movementY:function(i){return"movementY"in i?i.movementY:pu}}),tp=si(ql),m1=m({},ql,{dataTransfer:0}),g1=si(m1),v1=m({},ha,{relatedTarget:0}),mu=si(v1),y1=m({},ws,{animationName:0,elapsedTime:0,pseudoElement:0}),S1=si(y1),b1=m({},ws,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),w1=si(b1),C1=m({},ws,{data:0}),ip=si(C1),E1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},x1={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"},A1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function k1(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=A1[i])?!!s[i]:!1}function gu(){return k1}var T1=m({},ha,{key:function(i){if(i.key){var s=E1[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Vl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?x1[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gu,charCode:function(i){return i.type==="keypress"?Vl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Vl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),R1=si(T1),D1=m({},ql,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rp=si(D1),L1=m({},ha,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gu}),O1=si(L1),M1=m({},ws,{propertyName:0,elapsedTime:0,pseudoElement:0}),N1=si(M1),B1=m({},ql,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),z1=si(B1),P1=m({},ws,{newState:0,oldState:0}),I1=si(P1),H1=[9,13,27,32],vu=ur&&"CompositionEvent"in window,fa=null;ur&&"documentMode"in document&&(fa=document.documentMode);var U1=ur&&"TextEvent"in window&&!fa,sp=ur&&(!vu||fa&&8<fa&&11>=fa),np=" ",ap=!1;function lp(i,s){switch(i){case"keyup":return H1.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function op(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var dn=!1;function j1(i,s){switch(i){case"compositionend":return op(s);case"keypress":return s.which!==32?null:(ap=!0,np);case"textInput":return i=s.data,i===np&&ap?null:i;default:return null}}function V1(i,s){if(dn)return i==="compositionend"||!vu&&lp(i,s)?(i=J_(),jl=fu=Ir=null,dn=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return sp&&s.locale!=="ko"?null:s.data;default:return null}}var $1={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 cp(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!$1[i.type]:s==="textarea"}function up(i,s,a,o){un?hn?hn.push(o):hn=[o]:un=o,s=Bo(s,"onChange"),0<s.length&&(a=new Gl("onChange","change",null,a,o),i.push({event:a,listeners:s}))}var _a=null,pa=null;function G1(i){Wg(i,0)}function Wl(i){var s=oa(i);if(q_(s))return i}function hp(i,s){if(i==="change")return s}var dp=!1;if(ur){var yu;if(ur){var Su="oninput"in document;if(!Su){var fp=document.createElement("div");fp.setAttribute("oninput","return;"),Su=typeof fp.oninput=="function"}yu=Su}else yu=!1;dp=yu&&(!document.documentMode||9<document.documentMode)}function _p(){_a&&(_a.detachEvent("onpropertychange",pp),pa=_a=null)}function pp(i){if(i.propertyName==="value"&&Wl(pa)){var s=[];up(s,pa,i,uu(i)),Q_(G1,s)}}function q1(i,s,a){i==="focusin"?(_p(),_a=s,pa=a,_a.attachEvent("onpropertychange",pp)):i==="focusout"&&_p()}function W1(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Wl(pa)}function F1(i,s){if(i==="click")return Wl(s)}function Y1(i,s){if(i==="input"||i==="change")return Wl(s)}function K1(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var mi=typeof Object.is=="function"?Object.is:K1;function ma(i,s){if(mi(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var a=Object.keys(i),o=Object.keys(s);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var h=a[o];if(!Ee.call(s,h)||!mi(i[h],s[h]))return!1}return!0}function mp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function gp(i,s){var a=mp(i);i=0;for(var o;a;){if(a.nodeType===3){if(o=i+a.textContent.length,i<=s&&o>=s)return{node:a,offset:s-i};i=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=mp(a)}}function vp(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?vp(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function yp(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Hl(i.document);s instanceof i.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)i=s.contentWindow;else break;s=Hl(i.document)}return s}function bu(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var X1=ur&&"documentMode"in document&&11>=document.documentMode,fn=null,wu=null,ga=null,Cu=!1;function Sp(i,s,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Cu||fn==null||fn!==Hl(o)||(o=fn,"selectionStart"in o&&bu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ga&&ma(ga,o)||(ga=o,o=Bo(wu,"onSelect"),0<o.length&&(s=new Gl("onSelect","select",null,s,a),i.push({event:s,listeners:o}),s.target=fn)))}function Cs(i,s){var a={};return a[i.toLowerCase()]=s.toLowerCase(),a["Webkit"+i]="webkit"+s,a["Moz"+i]="moz"+s,a}var _n={animationend:Cs("Animation","AnimationEnd"),animationiteration:Cs("Animation","AnimationIteration"),animationstart:Cs("Animation","AnimationStart"),transitionrun:Cs("Transition","TransitionRun"),transitionstart:Cs("Transition","TransitionStart"),transitioncancel:Cs("Transition","TransitionCancel"),transitionend:Cs("Transition","TransitionEnd")},Eu={},bp={};ur&&(bp=document.createElement("div").style,"AnimationEvent"in window||(delete _n.animationend.animation,delete _n.animationiteration.animation,delete _n.animationstart.animation),"TransitionEvent"in window||delete _n.transitionend.transition);function Es(i){if(Eu[i])return Eu[i];if(!_n[i])return i;var s=_n[i],a;for(a in s)if(s.hasOwnProperty(a)&&a in bp)return Eu[i]=s[a];return i}var wp=Es("animationend"),Cp=Es("animationiteration"),Ep=Es("animationstart"),Z1=Es("transitionrun"),Q1=Es("transitionstart"),J1=Es("transitioncancel"),xp=Es("transitionend"),Ap=new Map,xu="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(" ");xu.push("scrollEnd");function Gi(i,s){Ap.set(i,s),bs(s,[i])}var Fl=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=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(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Ti=[],pn=0,Au=0;function Yl(){for(var i=pn,s=Au=pn=0;s<i;){var a=Ti[s];Ti[s++]=null;var o=Ti[s];Ti[s++]=null;var h=Ti[s];Ti[s++]=null;var p=Ti[s];if(Ti[s++]=null,o!==null&&h!==null){var g=o.pending;g===null?h.next=h:(h.next=g.next,g.next=h),o.pending=h}p!==0&&kp(a,h,p)}}function Kl(i,s,a,o){Ti[pn++]=i,Ti[pn++]=s,Ti[pn++]=a,Ti[pn++]=o,Au|=o,i.lanes|=o,i=i.alternate,i!==null&&(i.lanes|=o)}function ku(i,s,a,o){return Kl(i,s,a,o),Xl(i)}function xs(i,s){return Kl(i,null,null,s),Xl(i)}function kp(i,s,a){i.lanes|=a;var o=i.alternate;o!==null&&(o.lanes|=a);for(var h=!1,p=i.return;p!==null;)p.childLanes|=a,o=p.alternate,o!==null&&(o.childLanes|=a),p.tag===22&&(i=p.stateNode,i===null||i._visibility&1||(h=!0)),i=p,p=p.return;return i.tag===3?(p=i.stateNode,h&&s!==null&&(h=31-pi(a),i=p.hiddenUpdates,o=i[h],o===null?i[h]=[s]:o.push(s),s.lane=a|536870912),p):null}function Xl(i){if(50<Ha)throw Ha=0,zh=null,Error(n(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var mn={};function ew(i,s,a,o){this.tag=i,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gi(i,s,a,o){return new ew(i,s,a,o)}function Tu(i){return i=i.prototype,!(!i||!i.isReactComponent)}function hr(i,s){var a=i.alternate;return a===null?(a=gi(i.tag,s,i.key,i.mode),a.elementType=i.elementType,a.type=i.type,a.stateNode=i.stateNode,a.alternate=i,i.alternate=a):(a.pendingProps=s,a.type=i.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=i.flags&65011712,a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,s=i.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=i.sibling,a.index=i.index,a.ref=i.ref,a.refCleanup=i.refCleanup,a}function Tp(i,s){i.flags&=65011714;var a=i.alternate;return a===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,s=a.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Zl(i,s,a,o,h,p){var g=0;if(o=i,typeof i=="function")Tu(i)&&(g=1);else if(typeof i=="string")g=nC(i,a,ee.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case ve:return i=gi(31,a,s,h),i.elementType=ve,i.lanes=p,i;case E:return As(a.children,h,p,s);case T:g=8,h|=24;break;case O:return i=gi(12,a,s,h|2),i.elementType=O,i.lanes=p,i;case j:return i=gi(13,a,s,h),i.elementType=j,i.lanes=p,i;case Y:return i=gi(19,a,s,h),i.elementType=Y,i.lanes=p,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case B:g=10;break e;case H:g=9;break e;case I:g=11;break e;case te:g=14;break e;case ge:g=16,o=null;break e}g=29,a=Error(n(130,i===null?"null":typeof i,"")),o=null}return s=gi(g,a,s,h),s.elementType=i,s.type=o,s.lanes=p,s}function As(i,s,a,o){return i=gi(7,i,o,s),i.lanes=a,i}function Ru(i,s,a){return i=gi(6,i,null,s),i.lanes=a,i}function Rp(i){var s=gi(18,null,null,0);return s.stateNode=i,s}function Du(i,s,a){return s=gi(4,i.children!==null?i.children:[],i.key,s),s.lanes=a,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Dp=new WeakMap;function Ri(i,s){if(typeof i=="object"&&i!==null){var a=Dp.get(i);return a!==void 0?a:(s={value:i,source:s,stack:Se(s)},Dp.set(i,s),s)}return{value:i,source:s,stack:Se(s)}}var gn=[],vn=0,Ql=null,va=0,Di=[],Li=0,Hr=null,Xi=1,Zi="";function dr(i,s){gn[vn++]=va,gn[vn++]=Ql,Ql=i,va=s}function Lp(i,s,a){Di[Li++]=Xi,Di[Li++]=Zi,Di[Li++]=Hr,Hr=i;var o=Xi;i=Zi;var h=32-pi(o)-1;o&=~(1<<h),a+=1;var p=32-pi(s)+h;if(30<p){var g=h-h%5;p=(o&(1<<g)-1).toString(32),o>>=g,h-=g,Xi=1<<32-pi(s)+h|a<<h|o,Zi=p+i}else Xi=1<<p|a<<h|o,Zi=i}function Lu(i){i.return!==null&&(dr(i,1),Lp(i,1,0))}function Ou(i){for(;i===Ql;)Ql=gn[--vn],gn[vn]=null,va=gn[--vn],gn[vn]=null;for(;i===Hr;)Hr=Di[--Li],Di[Li]=null,Zi=Di[--Li],Di[Li]=null,Xi=Di[--Li],Di[Li]=null}function Op(i,s){Di[Li++]=Xi,Di[Li++]=Zi,Di[Li++]=Hr,Xi=s.id,Zi=s.overflow,Hr=i}var jt=null,tt=null,He=!1,Ur=null,Oi=!1,Mu=Error(n(519));function jr(i){var s=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ya(Ri(s,i)),Mu}function Mp(i){var s=i.stateNode,a=i.type,o=i.memoizedProps;switch(s[Ut]=i,s[ri]=o,a){case"dialog":Be("cancel",s),Be("close",s);break;case"iframe":case"object":case"embed":Be("load",s);break;case"video":case"audio":for(a=0;a<ja.length;a++)Be(ja[a],s);break;case"source":Be("error",s);break;case"img":case"image":case"link":Be("error",s),Be("load",s);break;case"details":Be("toggle",s);break;case"input":Be("invalid",s),W_(s,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Be("invalid",s);break;case"textarea":Be("invalid",s),Y_(s,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||s.textContent===""+a||o.suppressHydrationWarning===!0||Xg(s.textContent,a)?(o.popover!=null&&(Be("beforetoggle",s),Be("toggle",s)),o.onScroll!=null&&Be("scroll",s),o.onScrollEnd!=null&&Be("scrollend",s),o.onClick!=null&&(s.onclick=cr),s=!0):s=!1,s||jr(i,!0)}function Np(i){for(jt=i.return;jt;)switch(jt.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:jt=jt.return}}function yn(i){if(i!==jt)return!1;if(!He)return Np(i),He=!0,!1;var s=i.tag,a;if((a=s!==3&&s!==27)&&((a=s===5)&&(a=i.type,a=!(a!=="form"&&a!=="button")||Zh(i.type,i.memoizedProps)),a=!a),a&&tt&&jr(i),Np(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));tt=nv(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));tt=nv(i)}else s===27?(s=tt,ts(i.type)?(i=id,id=null,tt=i):tt=s):tt=jt?Ni(i.stateNode.nextSibling):null;return!0}function ks(){tt=jt=null,He=!1}function Nu(){var i=Ur;return i!==null&&(oi===null?oi=i:oi.push.apply(oi,i),Ur=null),i}function ya(i){Ur===null?Ur=[i]:Ur.push(i)}var Bu=x(null),Ts=null,fr=null;function Vr(i,s,a){X(Bu,s._currentValue),s._currentValue=a}function _r(i){i._currentValue=Bu.current,M(Bu)}function zu(i,s,a){for(;i!==null;){var o=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,o!==null&&(o.childLanes|=s)):o!==null&&(o.childLanes&s)!==s&&(o.childLanes|=s),i===a)break;i=i.return}}function Pu(i,s,a,o){var h=i.child;for(h!==null&&(h.return=i);h!==null;){var p=h.dependencies;if(p!==null){var g=h.child;p=p.firstContext;e:for(;p!==null;){var w=p;p=h;for(var A=0;A<s.length;A++)if(w.context===s[A]){p.lanes|=a,w=p.alternate,w!==null&&(w.lanes|=a),zu(p.return,a,i),o||(g=null);break e}p=w.next}}else if(h.tag===18){if(g=h.return,g===null)throw Error(n(341));g.lanes|=a,p=g.alternate,p!==null&&(p.lanes|=a),zu(g,a,i),g=null}else g=h.child;if(g!==null)g.return=h;else for(g=h;g!==null;){if(g===i){g=null;break}if(h=g.sibling,h!==null){h.return=g.return,g=h;break}g=g.return}h=g}}function Sn(i,s,a,o){i=null;for(var h=s,p=!1;h!==null;){if(!p){if((h.flags&524288)!==0)p=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var g=h.alternate;if(g===null)throw Error(n(387));if(g=g.memoizedProps,g!==null){var w=h.type;mi(h.pendingProps.value,g.value)||(i!==null?i.push(w):i=[w])}}else if(h===we.current){if(g=h.alternate,g===null)throw Error(n(387));g.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(i!==null?i.push(Wa):i=[Wa])}h=h.return}i!==null&&Pu(s,i,a,o),s.flags|=262144}function Jl(i){for(i=i.firstContext;i!==null;){if(!mi(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Rs(i){Ts=i,fr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Vt(i){return Bp(Ts,i)}function eo(i,s){return Ts===null&&Rs(i),Bp(i,s)}function Bp(i,s){var a=s._currentValue;if(s={context:s,memoizedValue:a,next:null},fr===null){if(i===null)throw Error(n(308));fr=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else fr=fr.next=s;return a}var tw=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(a,o){i.push(o)}};this.abort=function(){s.aborted=!0,i.forEach(function(a){return a()})}},iw=e.unstable_scheduleCallback,rw=e.unstable_NormalPriority,gt={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Iu(){return{controller:new tw,data:new Map,refCount:0}}function Sa(i){i.refCount--,i.refCount===0&&iw(rw,function(){i.controller.abort()})}var ba=null,Hu=0,bn=0,wn=null;function sw(i,s){if(ba===null){var a=ba=[];Hu=0,bn=Vh(),wn={status:"pending",value:void 0,then:function(o){a.push(o)}}}return Hu++,s.then(zp,zp),s}function zp(){if(--Hu===0&&ba!==null){wn!==null&&(wn.status="fulfilled");var i=ba;ba=null,bn=0,wn=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function nw(i,s){var a=[],o={status:"pending",value:null,reason:null,then:function(h){a.push(h)}};return i.then(function(){o.status="fulfilled",o.value=s;for(var h=0;h<a.length;h++)(0,a[h])(s)},function(h){for(o.status="rejected",o.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),o}var Pp=D.S;D.S=function(i,s){Sg=fi(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&sw(i,s),Pp!==null&&Pp(i,s)};var Ds=x(null);function Uu(){var i=Ds.current;return i!==null?i:Qe.pooledCache}function to(i,s){s===null?X(Ds,Ds.current):X(Ds,s.pool)}function Ip(){var i=Uu();return i===null?null:{parent:gt._currentValue,pool:i}}var Cn=Error(n(460)),ju=Error(n(474)),io=Error(n(542)),ro={then:function(){}};function Hp(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Up(i,s,a){switch(a=i[a],a===void 0?i.push(s):a!==s&&(s.then(cr,cr),s=a),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Vp(i),i;default:if(typeof s.status=="string")s.then(cr,cr);else{if(i=Qe,i!==null&&100<i.shellSuspendCounter)throw Error(n(482));i=s,i.status="pending",i.then(function(o){if(s.status==="pending"){var h=s;h.status="fulfilled",h.value=o}},function(o){if(s.status==="pending"){var h=s;h.status="rejected",h.reason=o}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Vp(i),i}throw Os=s,Cn}}function Ls(i){try{var s=i._init;return s(i._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Os=a,Cn):a}}var Os=null;function jp(){if(Os===null)throw Error(n(459));var i=Os;return Os=null,i}function Vp(i){if(i===Cn||i===io)throw Error(n(483))}var En=null,wa=0;function so(i){var s=wa;return wa+=1,En===null&&(En=[]),Up(En,i,s)}function Ca(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function no(i,s){throw s.$$typeof===y?Error(n(525)):(i=Object.prototype.toString.call(s),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function $p(i){function s(L,R){if(i){var N=L.deletions;N===null?(L.deletions=[R],L.flags|=16):N.push(R)}}function a(L,R){if(!i)return null;for(;R!==null;)s(L,R),R=R.sibling;return null}function o(L){for(var R=new Map;L!==null;)L.key!==null?R.set(L.key,L):R.set(L.index,L),L=L.sibling;return R}function h(L,R){return L=hr(L,R),L.index=0,L.sibling=null,L}function p(L,R,N){return L.index=N,i?(N=L.alternate,N!==null?(N=N.index,N<R?(L.flags|=67108866,R):N):(L.flags|=67108866,R)):(L.flags|=1048576,R)}function g(L){return i&&L.alternate===null&&(L.flags|=67108866),L}function w(L,R,N,K){return R===null||R.tag!==6?(R=Ru(N,L.mode,K),R.return=L,R):(R=h(R,N),R.return=L,R)}function A(L,R,N,K){var ye=N.type;return ye===E?V(L,R,N.props.children,K,N.key):R!==null&&(R.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===ge&&Ls(ye)===R.type)?(R=h(R,N.props),Ca(R,N),R.return=L,R):(R=Zl(N.type,N.key,N.props,null,L.mode,K),Ca(R,N),R.return=L,R)}function z(L,R,N,K){return R===null||R.tag!==4||R.stateNode.containerInfo!==N.containerInfo||R.stateNode.implementation!==N.implementation?(R=Du(N,L.mode,K),R.return=L,R):(R=h(R,N.children||[]),R.return=L,R)}function V(L,R,N,K,ye){return R===null||R.tag!==7?(R=As(N,L.mode,K,ye),R.return=L,R):(R=h(R,N),R.return=L,R)}function Z(L,R,N){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Ru(""+R,L.mode,N),R.return=L,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case S:return N=Zl(R.type,R.key,R.props,null,L.mode,N),Ca(N,R),N.return=L,N;case b:return R=Du(R,L.mode,N),R.return=L,R;case ge:return R=Ls(R),Z(L,R,N)}if(se(R)||J(R))return R=As(R,L.mode,N,null),R.return=L,R;if(typeof R.then=="function")return Z(L,so(R),N);if(R.$$typeof===B)return Z(L,eo(L,R),N);no(L,R)}return null}function P(L,R,N,K){var ye=R!==null?R.key:null;if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return ye!==null?null:w(L,R,""+N,K);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case S:return N.key===ye?A(L,R,N,K):null;case b:return N.key===ye?z(L,R,N,K):null;case ge:return N=Ls(N),P(L,R,N,K)}if(se(N)||J(N))return ye!==null?null:V(L,R,N,K,null);if(typeof N.then=="function")return P(L,R,so(N),K);if(N.$$typeof===B)return P(L,R,eo(L,N),K);no(L,N)}return null}function U(L,R,N,K,ye){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return L=L.get(N)||null,w(R,L,""+K,ye);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return L=L.get(K.key===null?N:K.key)||null,A(R,L,K,ye);case b:return L=L.get(K.key===null?N:K.key)||null,z(R,L,K,ye);case ge:return K=Ls(K),U(L,R,N,K,ye)}if(se(K)||J(K))return L=L.get(N)||null,V(R,L,K,ye,null);if(typeof K.then=="function")return U(L,R,N,so(K),ye);if(K.$$typeof===B)return U(L,R,N,eo(R,K),ye);no(R,K)}return null}function _e(L,R,N,K){for(var ye=null,Ue=null,me=R,Re=R=0,Ie=null;me!==null&&Re<N.length;Re++){me.index>Re?(Ie=me,me=null):Ie=me.sibling;var je=P(L,me,N[Re],K);if(je===null){me===null&&(me=Ie);break}i&&me&&je.alternate===null&&s(L,me),R=p(je,R,Re),Ue===null?ye=je:Ue.sibling=je,Ue=je,me=Ie}if(Re===N.length)return a(L,me),He&&dr(L,Re),ye;if(me===null){for(;Re<N.length;Re++)me=Z(L,N[Re],K),me!==null&&(R=p(me,R,Re),Ue===null?ye=me:Ue.sibling=me,Ue=me);return He&&dr(L,Re),ye}for(me=o(me);Re<N.length;Re++)Ie=U(me,L,Re,N[Re],K),Ie!==null&&(i&&Ie.alternate!==null&&me.delete(Ie.key===null?Re:Ie.key),R=p(Ie,R,Re),Ue===null?ye=Ie:Ue.sibling=Ie,Ue=Ie);return i&&me.forEach(function(as){return s(L,as)}),He&&dr(L,Re),ye}function be(L,R,N,K){if(N==null)throw Error(n(151));for(var ye=null,Ue=null,me=R,Re=R=0,Ie=null,je=N.next();me!==null&&!je.done;Re++,je=N.next()){me.index>Re?(Ie=me,me=null):Ie=me.sibling;var as=P(L,me,je.value,K);if(as===null){me===null&&(me=Ie);break}i&&me&&as.alternate===null&&s(L,me),R=p(as,R,Re),Ue===null?ye=as:Ue.sibling=as,Ue=as,me=Ie}if(je.done)return a(L,me),He&&dr(L,Re),ye;if(me===null){for(;!je.done;Re++,je=N.next())je=Z(L,je.value,K),je!==null&&(R=p(je,R,Re),Ue===null?ye=je:Ue.sibling=je,Ue=je);return He&&dr(L,Re),ye}for(me=o(me);!je.done;Re++,je=N.next())je=U(me,L,Re,je.value,K),je!==null&&(i&&je.alternate!==null&&me.delete(je.key===null?Re:je.key),R=p(je,R,Re),Ue===null?ye=je:Ue.sibling=je,Ue=je);return i&&me.forEach(function(mC){return s(L,mC)}),He&&dr(L,Re),ye}function Xe(L,R,N,K){if(typeof N=="object"&&N!==null&&N.type===E&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case S:e:{for(var ye=N.key;R!==null;){if(R.key===ye){if(ye=N.type,ye===E){if(R.tag===7){a(L,R.sibling),K=h(R,N.props.children),K.return=L,L=K;break e}}else if(R.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===ge&&Ls(ye)===R.type){a(L,R.sibling),K=h(R,N.props),Ca(K,N),K.return=L,L=K;break e}a(L,R);break}else s(L,R);R=R.sibling}N.type===E?(K=As(N.props.children,L.mode,K,N.key),K.return=L,L=K):(K=Zl(N.type,N.key,N.props,null,L.mode,K),Ca(K,N),K.return=L,L=K)}return g(L);case b:e:{for(ye=N.key;R!==null;){if(R.key===ye)if(R.tag===4&&R.stateNode.containerInfo===N.containerInfo&&R.stateNode.implementation===N.implementation){a(L,R.sibling),K=h(R,N.children||[]),K.return=L,L=K;break e}else{a(L,R);break}else s(L,R);R=R.sibling}K=Du(N,L.mode,K),K.return=L,L=K}return g(L);case ge:return N=Ls(N),Xe(L,R,N,K)}if(se(N))return _e(L,R,N,K);if(J(N)){if(ye=J(N),typeof ye!="function")throw Error(n(150));return N=ye.call(N),be(L,R,N,K)}if(typeof N.then=="function")return Xe(L,R,so(N),K);if(N.$$typeof===B)return Xe(L,R,eo(L,N),K);no(L,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,R!==null&&R.tag===6?(a(L,R.sibling),K=h(R,N),K.return=L,L=K):(a(L,R),K=Ru(N,L.mode,K),K.return=L,L=K),g(L)):a(L,R)}return function(L,R,N,K){try{wa=0;var ye=Xe(L,R,N,K);return En=null,ye}catch(me){if(me===Cn||me===io)throw me;var Ue=gi(29,me,null,L.mode);return Ue.lanes=K,Ue.return=L,Ue}finally{}}}var Ms=$p(!0),Gp=$p(!1),$r=!1;function Vu(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $u(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Gr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function qr(i,s,a){var o=i.updateQueue;if(o===null)return null;if(o=o.shared,(Ve&2)!==0){var h=o.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),o.pending=s,s=Xl(i),kp(i,null,a),s}return Kl(i,o,s,a),Xl(i)}function Ea(i,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194048)!==0)){var o=s.lanes;o&=i.pendingLanes,a|=o,s.lanes=a,B_(i,a)}}function Gu(i,s){var a=i.updateQueue,o=i.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var h=null,p=null;if(a=a.firstBaseUpdate,a!==null){do{var g={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};p===null?h=p=g:p=p.next=g,a=a.next}while(a!==null);p===null?h=p=s:p=p.next=s}else h=p=s;a={baseState:o.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:o.shared,callbacks:o.callbacks},i.updateQueue=a;return}i=a.lastBaseUpdate,i===null?a.firstBaseUpdate=s:i.next=s,a.lastBaseUpdate=s}var qu=!1;function xa(){if(qu){var i=wn;if(i!==null)throw i}}function Aa(i,s,a,o){qu=!1;var h=i.updateQueue;$r=!1;var p=h.firstBaseUpdate,g=h.lastBaseUpdate,w=h.shared.pending;if(w!==null){h.shared.pending=null;var A=w,z=A.next;A.next=null,g===null?p=z:g.next=z,g=A;var V=i.alternate;V!==null&&(V=V.updateQueue,w=V.lastBaseUpdate,w!==g&&(w===null?V.firstBaseUpdate=z:w.next=z,V.lastBaseUpdate=A))}if(p!==null){var Z=h.baseState;g=0,V=z=A=null,w=p;do{var P=w.lane&-536870913,U=P!==w.lane;if(U?(Pe&P)===P:(o&P)===P){P!==0&&P===bn&&(qu=!0),V!==null&&(V=V.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var _e=i,be=w;P=s;var Xe=a;switch(be.tag){case 1:if(_e=be.payload,typeof _e=="function"){Z=_e.call(Xe,Z,P);break e}Z=_e;break e;case 3:_e.flags=_e.flags&-65537|128;case 0:if(_e=be.payload,P=typeof _e=="function"?_e.call(Xe,Z,P):_e,P==null)break e;Z=m({},Z,P);break e;case 2:$r=!0}}P=w.callback,P!==null&&(i.flags|=64,U&&(i.flags|=8192),U=h.callbacks,U===null?h.callbacks=[P]:U.push(P))}else U={lane:P,tag:w.tag,payload:w.payload,callback:w.callback,next:null},V===null?(z=V=U,A=Z):V=V.next=U,g|=P;if(w=w.next,w===null){if(w=h.shared.pending,w===null)break;U=w,w=U.next,U.next=null,h.lastBaseUpdate=U,h.shared.pending=null}}while(!0);V===null&&(A=Z),h.baseState=A,h.firstBaseUpdate=z,h.lastBaseUpdate=V,p===null&&(h.shared.lanes=0),Xr|=g,i.lanes=g,i.memoizedState=Z}}function qp(i,s){if(typeof i!="function")throw Error(n(191,i));i.call(s)}function Wp(i,s){var a=i.callbacks;if(a!==null)for(i.callbacks=null,i=0;i<a.length;i++)qp(a[i],s)}var xn=x(null),ao=x(0);function Fp(i,s){i=Cr,X(ao,i),X(xn,s),Cr=i|s.baseLanes}function Wu(){X(ao,Cr),X(xn,xn.current)}function Fu(){Cr=ao.current,M(xn),M(ao)}var vi=x(null),Mi=null;function Wr(i){var s=i.alternate;X(ft,ft.current&1),X(vi,i),Mi===null&&(s===null||xn.current!==null||s.memoizedState!==null)&&(Mi=i)}function Yu(i){X(ft,ft.current),X(vi,i),Mi===null&&(Mi=i)}function Yp(i){i.tag===22?(X(ft,ft.current),X(vi,i),Mi===null&&(Mi=i)):Fr()}function Fr(){X(ft,ft.current),X(vi,vi.current)}function yi(i){M(vi),Mi===i&&(Mi=null),M(ft)}var ft=x(0);function lo(i){for(var s=i;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||ed(a)||td(a)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var pr=0,Te=null,Ye=null,vt=null,oo=!1,An=!1,Ns=!1,co=0,ka=0,kn=null,aw=0;function ct(){throw Error(n(321))}function Ku(i,s){if(s===null)return!1;for(var a=0;a<s.length&&a<i.length;a++)if(!mi(i[a],s[a]))return!1;return!0}function Xu(i,s,a,o,h,p){return pr=p,Te=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,D.H=i===null||i.memoizedState===null?Lm:hh,Ns=!1,p=a(o,h),Ns=!1,An&&(p=Xp(s,a,o,h)),Kp(i),p}function Kp(i){D.H=Da;var s=Ye!==null&&Ye.next!==null;if(pr=0,vt=Ye=Te=null,oo=!1,ka=0,kn=null,s)throw Error(n(300));i===null||yt||(i=i.dependencies,i!==null&&Jl(i)&&(yt=!0))}function Xp(i,s,a,o){Te=i;var h=0;do{if(An&&(kn=null),ka=0,An=!1,25<=h)throw Error(n(301));if(h+=1,vt=Ye=null,i.updateQueue!=null){var p=i.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}D.H=Om,p=s(a,o)}while(An);return p}function lw(){var i=D.H,s=i.useState()[0];return s=typeof s.then=="function"?Ta(s):s,i=i.useState()[0],(Ye!==null?Ye.memoizedState:null)!==i&&(Te.flags|=1024),s}function Zu(){var i=co!==0;return co=0,i}function Qu(i,s,a){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~a}function Ju(i){if(oo){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}oo=!1}pr=0,vt=Ye=Te=null,An=!1,ka=co=0,kn=null}function Qt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?Te.memoizedState=vt=i:vt=vt.next=i,vt}function _t(){if(Ye===null){var i=Te.alternate;i=i!==null?i.memoizedState:null}else i=Ye.next;var s=vt===null?Te.memoizedState:vt.next;if(s!==null)vt=s,Ye=i;else{if(i===null)throw Te.alternate===null?Error(n(467)):Error(n(310));Ye=i,i={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},vt===null?Te.memoizedState=vt=i:vt=vt.next=i}return vt}function uo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ta(i){var s=ka;return ka+=1,kn===null&&(kn=[]),i=Up(kn,i,s),s=Te,(vt===null?s.memoizedState:vt.next)===null&&(s=s.alternate,D.H=s===null||s.memoizedState===null?Lm:hh),i}function ho(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ta(i);if(i.$$typeof===B)return Vt(i)}throw Error(n(438,String(i)))}function eh(i){var s=null,a=Te.updateQueue;if(a!==null&&(s=a.memoCache),s==null){var o=Te.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(s={data:o.data.map(function(h){return h.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),a===null&&(a=uo(),Te.updateQueue=a),a.memoCache=s,a=s.data[s.index],a===void 0)for(a=s.data[s.index]=Array(i),o=0;o<i;o++)a[o]=fe;return s.index++,a}function mr(i,s){return typeof s=="function"?s(i):s}function fo(i){var s=_t();return th(s,Ye,i)}function th(i,s,a){var o=i.queue;if(o===null)throw Error(n(311));o.lastRenderedReducer=a;var h=i.baseQueue,p=o.pending;if(p!==null){if(h!==null){var g=h.next;h.next=p.next,p.next=g}s.baseQueue=h=p,o.pending=null}if(p=i.baseState,h===null)i.memoizedState=p;else{s=h.next;var w=g=null,A=null,z=s,V=!1;do{var Z=z.lane&-536870913;if(Z!==z.lane?(Pe&Z)===Z:(pr&Z)===Z){var P=z.revertLane;if(P===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Z===bn&&(V=!0);else if((pr&P)===P){z=z.next,P===bn&&(V=!0);continue}else Z={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},A===null?(w=A=Z,g=p):A=A.next=Z,Te.lanes|=P,Xr|=P;Z=z.action,Ns&&a(p,Z),p=z.hasEagerState?z.eagerState:a(p,Z)}else P={lane:Z,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},A===null?(w=A=P,g=p):A=A.next=P,Te.lanes|=Z,Xr|=Z;z=z.next}while(z!==null&&z!==s);if(A===null?g=p:A.next=w,!mi(p,i.memoizedState)&&(yt=!0,V&&(a=wn,a!==null)))throw a;i.memoizedState=p,i.baseState=g,i.baseQueue=A,o.lastRenderedState=p}return h===null&&(o.lanes=0),[i.memoizedState,o.dispatch]}function ih(i){var s=_t(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=i;var o=a.dispatch,h=a.pending,p=s.memoizedState;if(h!==null){a.pending=null;var g=h=h.next;do p=i(p,g.action),g=g.next;while(g!==h);mi(p,s.memoizedState)||(yt=!0),s.memoizedState=p,s.baseQueue===null&&(s.baseState=p),a.lastRenderedState=p}return[p,o]}function Zp(i,s,a){var o=Te,h=_t(),p=He;if(p){if(a===void 0)throw Error(n(407));a=a()}else a=s();var g=!mi((Ye||h).memoizedState,a);if(g&&(h.memoizedState=a,yt=!0),h=h.queue,nh(em.bind(null,o,h,i),[i]),h.getSnapshot!==s||g||vt!==null&&vt.memoizedState.tag&1){if(o.flags|=2048,Tn(9,{destroy:void 0},Jp.bind(null,o,h,a,s),null),Qe===null)throw Error(n(349));p||(pr&127)!==0||Qp(o,s,a)}return a}function Qp(i,s,a){i.flags|=16384,i={getSnapshot:s,value:a},s=Te.updateQueue,s===null?(s=uo(),Te.updateQueue=s,s.stores=[i]):(a=s.stores,a===null?s.stores=[i]:a.push(i))}function Jp(i,s,a,o){s.value=a,s.getSnapshot=o,tm(s)&&im(i)}function em(i,s,a){return a(function(){tm(s)&&im(i)})}function tm(i){var s=i.getSnapshot;i=i.value;try{var a=s();return!mi(i,a)}catch{return!0}}function im(i){var s=xs(i,2);s!==null&&ci(s,i,2)}function rh(i){var s=Qt();if(typeof i=="function"){var a=i;if(i=a(),Ns){zr(!0);try{a()}finally{zr(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mr,lastRenderedState:i},s}function rm(i,s,a,o){return i.baseState=a,th(i,Ye,typeof o=="function"?o:mr)}function ow(i,s,a,o,h){if(mo(i))throw Error(n(485));if(i=s.action,i!==null){var p={payload:h,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){p.listeners.push(g)}};D.T!==null?a(!0):p.isTransition=!1,o(p),a=s.pending,a===null?(p.next=s.pending=p,sm(s,p)):(p.next=a.next,s.pending=a.next=p)}}function sm(i,s){var a=s.action,o=s.payload,h=i.state;if(s.isTransition){var p=D.T,g={};D.T=g;try{var w=a(h,o),A=D.S;A!==null&&A(g,w),nm(i,s,w)}catch(z){sh(i,s,z)}finally{p!==null&&g.types!==null&&(p.types=g.types),D.T=p}}else try{p=a(h,o),nm(i,s,p)}catch(z){sh(i,s,z)}}function nm(i,s,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){am(i,s,o)},function(o){return sh(i,s,o)}):am(i,s,a)}function am(i,s,a){s.status="fulfilled",s.value=a,lm(s),i.state=a,s=i.pending,s!==null&&(a=s.next,a===s?i.pending=null:(a=a.next,s.next=a,sm(i,a)))}function sh(i,s,a){var o=i.pending;if(i.pending=null,o!==null){o=o.next;do s.status="rejected",s.reason=a,lm(s),s=s.next;while(s!==o)}i.action=null}function lm(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function om(i,s){return s}function cm(i,s){if(He){var a=Qe.formState;if(a!==null){e:{var o=Te;if(He){if(tt){t:{for(var h=tt,p=Oi;h.nodeType!==8;){if(!p){h=null;break t}if(h=Ni(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){tt=Ni(h.nextSibling),o=h.data==="F!";break e}}jr(o)}o=!1}o&&(s=a[0])}}return a=Qt(),a.memoizedState=a.baseState=s,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:om,lastRenderedState:s},a.queue=o,a=Tm.bind(null,Te,o),o.dispatch=a,o=rh(!1),p=uh.bind(null,Te,!1,o.queue),o=Qt(),h={state:s,dispatch:null,action:i,pending:null},o.queue=h,a=ow.bind(null,Te,h,p,a),h.dispatch=a,o.memoizedState=i,[s,a,!1]}function um(i){var s=_t();return hm(s,Ye,i)}function hm(i,s,a){if(s=th(i,s,om)[0],i=fo(mr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var o=Ta(s)}catch(g){throw g===Cn?io:g}else o=s;s=_t();var h=s.queue,p=h.dispatch;return a!==s.memoizedState&&(Te.flags|=2048,Tn(9,{destroy:void 0},cw.bind(null,h,a),null)),[o,p,i]}function cw(i,s){i.action=s}function dm(i){var s=_t(),a=Ye;if(a!==null)return hm(s,a,i);_t(),s=s.memoizedState,a=_t();var o=a.queue.dispatch;return a.memoizedState=i,[s,o,!1]}function Tn(i,s,a,o){return i={tag:i,create:a,deps:o,inst:s,next:null},s=Te.updateQueue,s===null&&(s=uo(),Te.updateQueue=s),a=s.lastEffect,a===null?s.lastEffect=i.next=i:(o=a.next,a.next=i,i.next=o,s.lastEffect=i),i}function fm(){return _t().memoizedState}function _o(i,s,a,o){var h=Qt();Te.flags|=i,h.memoizedState=Tn(1|s,{destroy:void 0},a,o===void 0?null:o)}function po(i,s,a,o){var h=_t();o=o===void 0?null:o;var p=h.memoizedState.inst;Ye!==null&&o!==null&&Ku(o,Ye.memoizedState.deps)?h.memoizedState=Tn(s,p,a,o):(Te.flags|=i,h.memoizedState=Tn(1|s,p,a,o))}function _m(i,s){_o(8390656,8,i,s)}function nh(i,s){po(2048,8,i,s)}function uw(i){Te.flags|=4;var s=Te.updateQueue;if(s===null)s=uo(),Te.updateQueue=s,s.events=[i];else{var a=s.events;a===null?s.events=[i]:a.push(i)}}function pm(i){var s=_t().memoizedState;return uw({ref:s,nextImpl:i}),function(){if((Ve&2)!==0)throw Error(n(440));return s.impl.apply(void 0,arguments)}}function mm(i,s){return po(4,2,i,s)}function gm(i,s){return po(4,4,i,s)}function vm(i,s){if(typeof s=="function"){i=i();var a=s(i);return function(){typeof a=="function"?a():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function ym(i,s,a){a=a!=null?a.concat([i]):null,po(4,4,vm.bind(null,s,i),a)}function ah(){}function Sm(i,s){var a=_t();s=s===void 0?null:s;var o=a.memoizedState;return s!==null&&Ku(s,o[1])?o[0]:(a.memoizedState=[i,s],i)}function bm(i,s){var a=_t();s=s===void 0?null:s;var o=a.memoizedState;if(s!==null&&Ku(s,o[1]))return o[0];if(o=i(),Ns){zr(!0);try{i()}finally{zr(!1)}}return a.memoizedState=[o,s],o}function lh(i,s,a){return a===void 0||(pr&1073741824)!==0&&(Pe&261930)===0?i.memoizedState=s:(i.memoizedState=a,i=wg(),Te.lanes|=i,Xr|=i,a)}function wm(i,s,a,o){return mi(a,s)?a:xn.current!==null?(i=lh(i,a,o),mi(i,s)||(yt=!0),i):(pr&42)===0||(pr&1073741824)!==0&&(Pe&261930)===0?(yt=!0,i.memoizedState=a):(i=wg(),Te.lanes|=i,Xr|=i,s)}function Cm(i,s,a,o,h){var p=W.p;W.p=p!==0&&8>p?p:8;var g=D.T,w={};D.T=w,uh(i,!1,s,a);try{var A=h(),z=D.S;if(z!==null&&z(w,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var V=nw(A,o);Ra(i,s,V,wi(i))}else Ra(i,s,o,wi(i))}catch(Z){Ra(i,s,{then:function(){},status:"rejected",reason:Z},wi())}finally{W.p=p,g!==null&&w.types!==null&&(g.types=w.types),D.T=g}}function hw(){}function oh(i,s,a,o){if(i.tag!==5)throw Error(n(476));var h=Em(i).queue;Cm(i,h,s,q,a===null?hw:function(){return xm(i),a(o)})}function Em(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mr,lastRenderedState:q},next:null};var a={};return s.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mr,lastRenderedState:a},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function xm(i){var s=Em(i);s.next===null&&(s=i.alternate.memoizedState),Ra(i,s.next.queue,{},wi())}function ch(){return Vt(Wa)}function Am(){return _t().memoizedState}function km(){return _t().memoizedState}function dw(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var a=wi();i=Gr(a);var o=qr(s,i,a);o!==null&&(ci(o,s,a),Ea(o,s,a)),s={cache:Iu()},i.payload=s;return}s=s.return}}function fw(i,s,a){var o=wi();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},mo(i)?Rm(s,a):(a=ku(i,s,a,o),a!==null&&(ci(a,i,o),Dm(a,s,o)))}function Tm(i,s,a){var o=wi();Ra(i,s,a,o)}function Ra(i,s,a,o){var h={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(mo(i))Rm(s,h);else{var p=i.alternate;if(i.lanes===0&&(p===null||p.lanes===0)&&(p=s.lastRenderedReducer,p!==null))try{var g=s.lastRenderedState,w=p(g,a);if(h.hasEagerState=!0,h.eagerState=w,mi(w,g))return Kl(i,s,h,0),Qe===null&&Yl(),!1}catch{}finally{}if(a=ku(i,s,h,o),a!==null)return ci(a,i,o),Dm(a,s,o),!0}return!1}function uh(i,s,a,o){if(o={lane:2,revertLane:Vh(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},mo(i)){if(s)throw Error(n(479))}else s=ku(i,a,o,2),s!==null&&ci(s,i,2)}function mo(i){var s=i.alternate;return i===Te||s!==null&&s===Te}function Rm(i,s){An=oo=!0;var a=i.pending;a===null?s.next=s:(s.next=a.next,a.next=s),i.pending=s}function Dm(i,s,a){if((a&4194048)!==0){var o=s.lanes;o&=i.pendingLanes,a|=o,s.lanes=a,B_(i,a)}}var Da={readContext:Vt,use:ho,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};Da.useEffectEvent=ct;var Lm={readContext:Vt,use:ho,useCallback:function(i,s){return Qt().memoizedState=[i,s===void 0?null:s],i},useContext:Vt,useEffect:_m,useImperativeHandle:function(i,s,a){a=a!=null?a.concat([i]):null,_o(4194308,4,vm.bind(null,s,i),a)},useLayoutEffect:function(i,s){return _o(4194308,4,i,s)},useInsertionEffect:function(i,s){_o(4,2,i,s)},useMemo:function(i,s){var a=Qt();s=s===void 0?null:s;var o=i();if(Ns){zr(!0);try{i()}finally{zr(!1)}}return a.memoizedState=[o,s],o},useReducer:function(i,s,a){var o=Qt();if(a!==void 0){var h=a(s);if(Ns){zr(!0);try{a(s)}finally{zr(!1)}}}else h=s;return o.memoizedState=o.baseState=h,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:h},o.queue=i,i=i.dispatch=fw.bind(null,Te,i),[o.memoizedState,i]},useRef:function(i){var s=Qt();return i={current:i},s.memoizedState=i},useState:function(i){i=rh(i);var s=i.queue,a=Tm.bind(null,Te,s);return s.dispatch=a,[i.memoizedState,a]},useDebugValue:ah,useDeferredValue:function(i,s){var a=Qt();return lh(a,i,s)},useTransition:function(){var i=rh(!1);return i=Cm.bind(null,Te,i.queue,!0,!1),Qt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,a){var o=Te,h=Qt();if(He){if(a===void 0)throw Error(n(407));a=a()}else{if(a=s(),Qe===null)throw Error(n(349));(Pe&127)!==0||Qp(o,s,a)}h.memoizedState=a;var p={value:a,getSnapshot:s};return h.queue=p,_m(em.bind(null,o,p,i),[i]),o.flags|=2048,Tn(9,{destroy:void 0},Jp.bind(null,o,p,a,s),null),a},useId:function(){var i=Qt(),s=Qe.identifierPrefix;if(He){var a=Zi,o=Xi;a=(o&~(1<<32-pi(o)-1)).toString(32)+a,s="_"+s+"R_"+a,a=co++,0<a&&(s+="H"+a.toString(32)),s+="_"}else a=aw++,s="_"+s+"r_"+a.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:ch,useFormState:cm,useActionState:cm,useOptimistic:function(i){var s=Qt();s.memoizedState=s.baseState=i;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=a,s=uh.bind(null,Te,!0,a),a.dispatch=s,[i,s]},useMemoCache:eh,useCacheRefresh:function(){return Qt().memoizedState=dw.bind(null,Te)},useEffectEvent:function(i){var s=Qt(),a={impl:i};return s.memoizedState=a,function(){if((Ve&2)!==0)throw Error(n(440));return a.impl.apply(void 0,arguments)}}},hh={readContext:Vt,use:ho,useCallback:Sm,useContext:Vt,useEffect:nh,useImperativeHandle:ym,useInsertionEffect:mm,useLayoutEffect:gm,useMemo:bm,useReducer:fo,useRef:fm,useState:function(){return fo(mr)},useDebugValue:ah,useDeferredValue:function(i,s){var a=_t();return wm(a,Ye.memoizedState,i,s)},useTransition:function(){var i=fo(mr)[0],s=_t().memoizedState;return[typeof i=="boolean"?i:Ta(i),s]},useSyncExternalStore:Zp,useId:Am,useHostTransitionStatus:ch,useFormState:um,useActionState:um,useOptimistic:function(i,s){var a=_t();return rm(a,Ye,i,s)},useMemoCache:eh,useCacheRefresh:km};hh.useEffectEvent=pm;var Om={readContext:Vt,use:ho,useCallback:Sm,useContext:Vt,useEffect:nh,useImperativeHandle:ym,useInsertionEffect:mm,useLayoutEffect:gm,useMemo:bm,useReducer:ih,useRef:fm,useState:function(){return ih(mr)},useDebugValue:ah,useDeferredValue:function(i,s){var a=_t();return Ye===null?lh(a,i,s):wm(a,Ye.memoizedState,i,s)},useTransition:function(){var i=ih(mr)[0],s=_t().memoizedState;return[typeof i=="boolean"?i:Ta(i),s]},useSyncExternalStore:Zp,useId:Am,useHostTransitionStatus:ch,useFormState:dm,useActionState:dm,useOptimistic:function(i,s){var a=_t();return Ye!==null?rm(a,Ye,i,s):(a.baseState=i,[i,a.queue.dispatch])},useMemoCache:eh,useCacheRefresh:km};Om.useEffectEvent=pm;function dh(i,s,a,o){s=i.memoizedState,a=a(o,s),a=a==null?s:m({},s,a),i.memoizedState=a,i.lanes===0&&(i.updateQueue.baseState=a)}var fh={enqueueSetState:function(i,s,a){i=i._reactInternals;var o=wi(),h=Gr(o);h.payload=s,a!=null&&(h.callback=a),s=qr(i,h,o),s!==null&&(ci(s,i,o),Ea(s,i,o))},enqueueReplaceState:function(i,s,a){i=i._reactInternals;var o=wi(),h=Gr(o);h.tag=1,h.payload=s,a!=null&&(h.callback=a),s=qr(i,h,o),s!==null&&(ci(s,i,o),Ea(s,i,o))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var a=wi(),o=Gr(a);o.tag=2,s!=null&&(o.callback=s),s=qr(i,o,a),s!==null&&(ci(s,i,a),Ea(s,i,a))}};function Mm(i,s,a,o,h,p,g){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(o,p,g):s.prototype&&s.prototype.isPureReactComponent?!ma(a,o)||!ma(h,p):!0}function Nm(i,s,a,o){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,o),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,o),s.state!==i&&fh.enqueueReplaceState(s,s.state,null)}function Bs(i,s){var a=s;if("ref"in s){a={};for(var o in s)o!=="ref"&&(a[o]=s[o])}if(i=i.defaultProps){a===s&&(a=m({},a));for(var h in i)a[h]===void 0&&(a[h]=i[h])}return a}function Bm(i){Fl(i)}function zm(i){console.error(i)}function Pm(i){Fl(i)}function go(i,s){try{var a=i.onUncaughtError;a(s.value,{componentStack:s.stack})}catch(o){setTimeout(function(){throw o})}}function Im(i,s,a){try{var o=i.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function _h(i,s,a){return a=Gr(a),a.tag=3,a.payload={element:null},a.callback=function(){go(i,s)},a}function Hm(i){return i=Gr(i),i.tag=3,i}function Um(i,s,a,o){var h=a.type.getDerivedStateFromError;if(typeof h=="function"){var p=o.value;i.payload=function(){return h(p)},i.callback=function(){Im(s,a,o)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(i.callback=function(){Im(s,a,o),typeof h!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var w=o.stack;this.componentDidCatch(o.value,{componentStack:w!==null?w:""})})}function _w(i,s,a,o,h){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(s=a.alternate,s!==null&&Sn(s,a,h,!0),a=vi.current,a!==null){switch(a.tag){case 31:case 13:return Mi===null?Ro():a.alternate===null&&ut===0&&(ut=3),a.flags&=-257,a.flags|=65536,a.lanes=h,o===ro?a.flags|=16384:(s=a.updateQueue,s===null?a.updateQueue=new Set([o]):s.add(o),Hh(i,o,h)),!1;case 22:return a.flags|=65536,o===ro?a.flags|=16384:(s=a.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=s):(a=s.retryQueue,a===null?s.retryQueue=new Set([o]):a.add(o)),Hh(i,o,h)),!1}throw Error(n(435,a.tag))}return Hh(i,o,h),Ro(),!1}if(He)return s=vi.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=h,o!==Mu&&(i=Error(n(422),{cause:o}),ya(Ri(i,a)))):(o!==Mu&&(s=Error(n(423),{cause:o}),ya(Ri(s,a))),i=i.current.alternate,i.flags|=65536,h&=-h,i.lanes|=h,o=Ri(o,a),h=_h(i.stateNode,o,h),Gu(i,h),ut!==4&&(ut=2)),!1;var p=Error(n(520),{cause:o});if(p=Ri(p,a),Ia===null?Ia=[p]:Ia.push(p),ut!==4&&(ut=2),s===null)return!0;o=Ri(o,a),a=s;do{switch(a.tag){case 3:return a.flags|=65536,i=h&-h,a.lanes|=i,i=_h(a.stateNode,o,i),Gu(a,i),!1;case 1:if(s=a.type,p=a.stateNode,(a.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Zr===null||!Zr.has(p))))return a.flags|=65536,h&=-h,a.lanes|=h,h=Hm(h),Um(h,i,a,o),Gu(a,h),!1}a=a.return}while(a!==null);return!1}var ph=Error(n(461)),yt=!1;function $t(i,s,a,o){s.child=i===null?Gp(s,null,a,o):Ms(s,i.child,a,o)}function jm(i,s,a,o,h){a=a.render;var p=s.ref;if("ref"in o){var g={};for(var w in o)w!=="ref"&&(g[w]=o[w])}else g=o;return Rs(s),o=Xu(i,s,a,g,p,h),w=Zu(),i!==null&&!yt?(Qu(i,s,h),gr(i,s,h)):(He&&w&&Lu(s),s.flags|=1,$t(i,s,o,h),s.child)}function Vm(i,s,a,o,h){if(i===null){var p=a.type;return typeof p=="function"&&!Tu(p)&&p.defaultProps===void 0&&a.compare===null?(s.tag=15,s.type=p,$m(i,s,p,o,h)):(i=Zl(a.type,null,o,s,s.mode,h),i.ref=s.ref,i.return=s,s.child=i)}if(p=i.child,!Ch(i,h)){var g=p.memoizedProps;if(a=a.compare,a=a!==null?a:ma,a(g,o)&&i.ref===s.ref)return gr(i,s,h)}return s.flags|=1,i=hr(p,o),i.ref=s.ref,i.return=s,s.child=i}function $m(i,s,a,o,h){if(i!==null){var p=i.memoizedProps;if(ma(p,o)&&i.ref===s.ref)if(yt=!1,s.pendingProps=o=p,Ch(i,h))(i.flags&131072)!==0&&(yt=!0);else return s.lanes=i.lanes,gr(i,s,h)}return mh(i,s,a,o,h)}function Gm(i,s,a,o){var h=o.children,p=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((s.flags&128)!==0){if(p=p!==null?p.baseLanes|a:a,i!==null){for(o=s.child=i.child,h=0;o!==null;)h=h|o.lanes|o.childLanes,o=o.sibling;o=h&~p}else o=0,s.child=null;return qm(i,s,p,a,o)}if((a&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&to(s,p!==null?p.cachePool:null),p!==null?Fp(s,p):Wu(),Yp(s);else return o=s.lanes=536870912,qm(i,s,p!==null?p.baseLanes|a:a,a,o)}else p!==null?(to(s,p.cachePool),Fp(s,p),Fr(),s.memoizedState=null):(i!==null&&to(s,null),Wu(),Fr());return $t(i,s,h,a),s.child}function La(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function qm(i,s,a,o,h){var p=Uu();return p=p===null?null:{parent:gt._currentValue,pool:p},s.memoizedState={baseLanes:a,cachePool:p},i!==null&&to(s,null),Wu(),Yp(s),i!==null&&Sn(i,s,o,!0),s.childLanes=h,null}function vo(i,s){return s=So({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function Wm(i,s,a){return Ms(s,i.child,null,a),i=vo(s,s.pendingProps),i.flags|=2,yi(s),s.memoizedState=null,i}function pw(i,s,a){var o=s.pendingProps,h=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(He){if(o.mode==="hidden")return i=vo(s,o),s.lanes=536870912,La(null,i);if(Yu(s),(i=tt)?(i=sv(i,Oi),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Hr!==null?{id:Xi,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},a=Rp(i),a.return=s,s.child=a,jt=s,tt=null)):i=null,i===null)throw jr(s);return s.lanes=536870912,null}return vo(s,o)}var p=i.memoizedState;if(p!==null){var g=p.dehydrated;if(Yu(s),h)if(s.flags&256)s.flags&=-257,s=Wm(i,s,a);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(n(558));else if(yt||Sn(i,s,a,!1),h=(a&i.childLanes)!==0,yt||h){if(o=Qe,o!==null&&(g=z_(o,a),g!==0&&g!==p.retryLane))throw p.retryLane=g,xs(i,g),ci(o,i,g),ph;Ro(),s=Wm(i,s,a)}else i=p.treeContext,tt=Ni(g.nextSibling),jt=s,He=!0,Ur=null,Oi=!1,i!==null&&Op(s,i),s=vo(s,o),s.flags|=4096;return s}return i=hr(i.child,{mode:o.mode,children:o.children}),i.ref=s.ref,s.child=i,i.return=s,i}function yo(i,s){var a=s.ref;if(a===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(n(284));(i===null||i.ref!==a)&&(s.flags|=4194816)}}function mh(i,s,a,o,h){return Rs(s),a=Xu(i,s,a,o,void 0,h),o=Zu(),i!==null&&!yt?(Qu(i,s,h),gr(i,s,h)):(He&&o&&Lu(s),s.flags|=1,$t(i,s,a,h),s.child)}function Fm(i,s,a,o,h,p){return Rs(s),s.updateQueue=null,a=Xp(s,o,a,h),Kp(i),o=Zu(),i!==null&&!yt?(Qu(i,s,p),gr(i,s,p)):(He&&o&&Lu(s),s.flags|=1,$t(i,s,a,p),s.child)}function Ym(i,s,a,o,h){if(Rs(s),s.stateNode===null){var p=mn,g=a.contextType;typeof g=="object"&&g!==null&&(p=Vt(g)),p=new a(o,p),s.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=fh,s.stateNode=p,p._reactInternals=s,p=s.stateNode,p.props=o,p.state=s.memoizedState,p.refs={},Vu(s),g=a.contextType,p.context=typeof g=="object"&&g!==null?Vt(g):mn,p.state=s.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(dh(s,a,g,o),p.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(g=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),g!==p.state&&fh.enqueueReplaceState(p,p.state,null),Aa(s,o,p,h),xa(),p.state=s.memoizedState),typeof p.componentDidMount=="function"&&(s.flags|=4194308),o=!0}else if(i===null){p=s.stateNode;var w=s.memoizedProps,A=Bs(a,w);p.props=A;var z=p.context,V=a.contextType;g=mn,typeof V=="object"&&V!==null&&(g=Vt(V));var Z=a.getDerivedStateFromProps;V=typeof Z=="function"||typeof p.getSnapshotBeforeUpdate=="function",w=s.pendingProps!==w,V||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w||z!==g)&&Nm(s,p,o,g),$r=!1;var P=s.memoizedState;p.state=P,Aa(s,o,p,h),xa(),z=s.memoizedState,w||P!==z||$r?(typeof Z=="function"&&(dh(s,a,Z,o),z=s.memoizedState),(A=$r||Mm(s,a,A,o,P,z,g))?(V||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(s.flags|=4194308)):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=o,s.memoizedState=z),p.props=o,p.state=z,p.context=g,o=A):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),o=!1)}else{p=s.stateNode,$u(i,s),g=s.memoizedProps,V=Bs(a,g),p.props=V,Z=s.pendingProps,P=p.context,z=a.contextType,A=mn,typeof z=="object"&&z!==null&&(A=Vt(z)),w=a.getDerivedStateFromProps,(z=typeof w=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(g!==Z||P!==A)&&Nm(s,p,o,A),$r=!1,P=s.memoizedState,p.state=P,Aa(s,o,p,h),xa();var U=s.memoizedState;g!==Z||P!==U||$r||i!==null&&i.dependencies!==null&&Jl(i.dependencies)?(typeof w=="function"&&(dh(s,a,w,o),U=s.memoizedState),(V=$r||Mm(s,a,V,o,P,U,A)||i!==null&&i.dependencies!==null&&Jl(i.dependencies))?(z||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(o,U,A),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(o,U,A)),typeof p.componentDidUpdate=="function"&&(s.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof p.componentDidUpdate!="function"||g===i.memoizedProps&&P===i.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||g===i.memoizedProps&&P===i.memoizedState||(s.flags|=1024),s.memoizedProps=o,s.memoizedState=U),p.props=o,p.state=U,p.context=A,o=V):(typeof p.componentDidUpdate!="function"||g===i.memoizedProps&&P===i.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||g===i.memoizedProps&&P===i.memoizedState||(s.flags|=1024),o=!1)}return p=o,yo(i,s),o=(s.flags&128)!==0,p||o?(p=s.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:p.render(),s.flags|=1,i!==null&&o?(s.child=Ms(s,i.child,null,h),s.child=Ms(s,null,a,h)):$t(i,s,a,h),s.memoizedState=p.state,i=s.child):i=gr(i,s,h),i}function Km(i,s,a,o){return ks(),s.flags|=256,$t(i,s,a,o),s.child}var gh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vh(i){return{baseLanes:i,cachePool:Ip()}}function yh(i,s,a){return i=i!==null?i.childLanes&~a:0,s&&(i|=bi),i}function Xm(i,s,a){var o=s.pendingProps,h=!1,p=(s.flags&128)!==0,g;if((g=p)||(g=i!==null&&i.memoizedState===null?!1:(ft.current&2)!==0),g&&(h=!0,s.flags&=-129),g=(s.flags&32)!==0,s.flags&=-33,i===null){if(He){if(h?Wr(s):Fr(),(i=tt)?(i=sv(i,Oi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Hr!==null?{id:Xi,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},a=Rp(i),a.return=s,s.child=a,jt=s,tt=null)):i=null,i===null)throw jr(s);return td(i)?s.lanes=32:s.lanes=536870912,null}var w=o.children;return o=o.fallback,h?(Fr(),h=s.mode,w=So({mode:"hidden",children:w},h),o=As(o,h,a,null),w.return=s,o.return=s,w.sibling=o,s.child=w,o=s.child,o.memoizedState=vh(a),o.childLanes=yh(i,g,a),s.memoizedState=gh,La(null,o)):(Wr(s),Sh(s,w))}var A=i.memoizedState;if(A!==null&&(w=A.dehydrated,w!==null)){if(p)s.flags&256?(Wr(s),s.flags&=-257,s=bh(i,s,a)):s.memoizedState!==null?(Fr(),s.child=i.child,s.flags|=128,s=null):(Fr(),w=o.fallback,h=s.mode,o=So({mode:"visible",children:o.children},h),w=As(w,h,a,null),w.flags|=2,o.return=s,w.return=s,o.sibling=w,s.child=o,Ms(s,i.child,null,a),o=s.child,o.memoizedState=vh(a),o.childLanes=yh(i,g,a),s.memoizedState=gh,s=La(null,o));else if(Wr(s),td(w)){if(g=w.nextSibling&&w.nextSibling.dataset,g)var z=g.dgst;g=z,o=Error(n(419)),o.stack="",o.digest=g,ya({value:o,source:null,stack:null}),s=bh(i,s,a)}else if(yt||Sn(i,s,a,!1),g=(a&i.childLanes)!==0,yt||g){if(g=Qe,g!==null&&(o=z_(g,a),o!==0&&o!==A.retryLane))throw A.retryLane=o,xs(i,o),ci(g,i,o),ph;ed(w)||Ro(),s=bh(i,s,a)}else ed(w)?(s.flags|=192,s.child=i.child,s=null):(i=A.treeContext,tt=Ni(w.nextSibling),jt=s,He=!0,Ur=null,Oi=!1,i!==null&&Op(s,i),s=Sh(s,o.children),s.flags|=4096);return s}return h?(Fr(),w=o.fallback,h=s.mode,A=i.child,z=A.sibling,o=hr(A,{mode:"hidden",children:o.children}),o.subtreeFlags=A.subtreeFlags&65011712,z!==null?w=hr(z,w):(w=As(w,h,a,null),w.flags|=2),w.return=s,o.return=s,o.sibling=w,s.child=o,La(null,o),o=s.child,w=i.child.memoizedState,w===null?w=vh(a):(h=w.cachePool,h!==null?(A=gt._currentValue,h=h.parent!==A?{parent:A,pool:A}:h):h=Ip(),w={baseLanes:w.baseLanes|a,cachePool:h}),o.memoizedState=w,o.childLanes=yh(i,g,a),s.memoizedState=gh,La(i.child,o)):(Wr(s),a=i.child,i=a.sibling,a=hr(a,{mode:"visible",children:o.children}),a.return=s,a.sibling=null,i!==null&&(g=s.deletions,g===null?(s.deletions=[i],s.flags|=16):g.push(i)),s.child=a,s.memoizedState=null,a)}function Sh(i,s){return s=So({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function So(i,s){return i=gi(22,i,null,s),i.lanes=0,i}function bh(i,s,a){return Ms(s,i.child,null,a),i=Sh(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Zm(i,s,a){i.lanes|=s;var o=i.alternate;o!==null&&(o.lanes|=s),zu(i.return,s,a)}function wh(i,s,a,o,h,p){var g=i.memoizedState;g===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:h,treeForkCount:p}:(g.isBackwards=s,g.rendering=null,g.renderingStartTime=0,g.last=o,g.tail=a,g.tailMode=h,g.treeForkCount=p)}function Qm(i,s,a){var o=s.pendingProps,h=o.revealOrder,p=o.tail;o=o.children;var g=ft.current,w=(g&2)!==0;if(w?(g=g&1|2,s.flags|=128):g&=1,X(ft,g),$t(i,s,o,a),o=He?va:0,!w&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Zm(i,a,s);else if(i.tag===19)Zm(i,a,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(h){case"forwards":for(a=s.child,h=null;a!==null;)i=a.alternate,i!==null&&lo(i)===null&&(h=a),a=a.sibling;a=h,a===null?(h=s.child,s.child=null):(h=a.sibling,a.sibling=null),wh(s,!1,h,a,p,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,h=s.child,s.child=null;h!==null;){if(i=h.alternate,i!==null&&lo(i)===null){s.child=h;break}i=h.sibling,h.sibling=a,a=h,h=i}wh(s,!0,a,null,p,o);break;case"together":wh(s,!1,null,null,void 0,o);break;default:s.memoizedState=null}return s.child}function gr(i,s,a){if(i!==null&&(s.dependencies=i.dependencies),Xr|=s.lanes,(a&s.childLanes)===0)if(i!==null){if(Sn(i,s,a,!1),(a&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(n(153));if(s.child!==null){for(i=s.child,a=hr(i,i.pendingProps),s.child=a,a.return=s;i.sibling!==null;)i=i.sibling,a=a.sibling=hr(i,i.pendingProps),a.return=s;a.sibling=null}return s.child}function Ch(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Jl(i)))}function mw(i,s,a){switch(s.tag){case 3:Fe(s,s.stateNode.containerInfo),Vr(s,gt,i.memoizedState.cache),ks();break;case 27:case 5:Ft(s);break;case 4:Fe(s,s.stateNode.containerInfo);break;case 10:Vr(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Yu(s),null;break;case 13:var o=s.memoizedState;if(o!==null)return o.dehydrated!==null?(Wr(s),s.flags|=128,null):(a&s.child.childLanes)!==0?Xm(i,s,a):(Wr(s),i=gr(i,s,a),i!==null?i.sibling:null);Wr(s);break;case 19:var h=(i.flags&128)!==0;if(o=(a&s.childLanes)!==0,o||(Sn(i,s,a,!1),o=(a&s.childLanes)!==0),h){if(o)return Qm(i,s,a);s.flags|=128}if(h=s.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),X(ft,ft.current),o)break;return null;case 22:return s.lanes=0,Gm(i,s,a,s.pendingProps);case 24:Vr(s,gt,i.memoizedState.cache)}return gr(i,s,a)}function Jm(i,s,a){if(i!==null)if(i.memoizedProps!==s.pendingProps)yt=!0;else{if(!Ch(i,a)&&(s.flags&128)===0)return yt=!1,mw(i,s,a);yt=(i.flags&131072)!==0}else yt=!1,He&&(s.flags&1048576)!==0&&Lp(s,va,s.index);switch(s.lanes=0,s.tag){case 16:e:{var o=s.pendingProps;if(i=Ls(s.elementType),s.type=i,typeof i=="function")Tu(i)?(o=Bs(i,o),s.tag=1,s=Ym(null,s,i,o,a)):(s.tag=0,s=mh(null,s,i,o,a));else{if(i!=null){var h=i.$$typeof;if(h===I){s.tag=11,s=jm(null,s,i,o,a);break e}else if(h===te){s.tag=14,s=Vm(null,s,i,o,a);break e}}throw s=re(i)||i,Error(n(306,s,""))}}return s;case 0:return mh(i,s,s.type,s.pendingProps,a);case 1:return o=s.type,h=Bs(o,s.pendingProps),Ym(i,s,o,h,a);case 3:e:{if(Fe(s,s.stateNode.containerInfo),i===null)throw Error(n(387));o=s.pendingProps;var p=s.memoizedState;h=p.element,$u(i,s),Aa(s,o,null,a);var g=s.memoizedState;if(o=g.cache,Vr(s,gt,o),o!==p.cache&&Pu(s,[gt],a,!0),xa(),o=g.element,p.isDehydrated)if(p={element:o,isDehydrated:!1,cache:g.cache},s.updateQueue.baseState=p,s.memoizedState=p,s.flags&256){s=Km(i,s,o,a);break e}else if(o!==h){h=Ri(Error(n(424)),s),ya(h),s=Km(i,s,o,a);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(tt=Ni(i.firstChild),jt=s,He=!0,Ur=null,Oi=!0,a=Gp(s,null,o,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(ks(),o===h){s=gr(i,s,a);break e}$t(i,s,o,a)}s=s.child}return s;case 26:return yo(i,s),i===null?(a=uv(s.type,null,s.pendingProps,null))?s.memoizedState=a:He||(a=s.type,i=s.pendingProps,o=zo(pe.current).createElement(a),o[Ut]=s,o[ri]=i,Gt(o,a,i),Lt(o),s.stateNode=o):s.memoizedState=uv(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Ft(s),i===null&&He&&(o=s.stateNode=lv(s.type,s.pendingProps,pe.current),jt=s,Oi=!0,h=tt,ts(s.type)?(id=h,tt=Ni(o.firstChild)):tt=h),$t(i,s,s.pendingProps.children,a),yo(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&He&&((h=o=tt)&&(o=Ww(o,s.type,s.pendingProps,Oi),o!==null?(s.stateNode=o,jt=s,tt=Ni(o.firstChild),Oi=!1,h=!0):h=!1),h||jr(s)),Ft(s),h=s.type,p=s.pendingProps,g=i!==null?i.memoizedProps:null,o=p.children,Zh(h,p)?o=null:g!==null&&Zh(h,g)&&(s.flags|=32),s.memoizedState!==null&&(h=Xu(i,s,lw,null,null,a),Wa._currentValue=h),yo(i,s),$t(i,s,o,a),s.child;case 6:return i===null&&He&&((i=a=tt)&&(a=Fw(a,s.pendingProps,Oi),a!==null?(s.stateNode=a,jt=s,tt=null,i=!0):i=!1),i||jr(s)),null;case 13:return Xm(i,s,a);case 4:return Fe(s,s.stateNode.containerInfo),o=s.pendingProps,i===null?s.child=Ms(s,null,o,a):$t(i,s,o,a),s.child;case 11:return jm(i,s,s.type,s.pendingProps,a);case 7:return $t(i,s,s.pendingProps,a),s.child;case 8:return $t(i,s,s.pendingProps.children,a),s.child;case 12:return $t(i,s,s.pendingProps.children,a),s.child;case 10:return o=s.pendingProps,Vr(s,s.type,o.value),$t(i,s,o.children,a),s.child;case 9:return h=s.type._context,o=s.pendingProps.children,Rs(s),h=Vt(h),o=o(h),s.flags|=1,$t(i,s,o,a),s.child;case 14:return Vm(i,s,s.type,s.pendingProps,a);case 15:return $m(i,s,s.type,s.pendingProps,a);case 19:return Qm(i,s,a);case 31:return pw(i,s,a);case 22:return Gm(i,s,a,s.pendingProps);case 24:return Rs(s),o=Vt(gt),i===null?(h=Uu(),h===null&&(h=Qe,p=Iu(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=a),h=p),s.memoizedState={parent:o,cache:h},Vu(s),Vr(s,gt,h)):((i.lanes&a)!==0&&($u(i,s),Aa(s,null,null,a),xa()),h=i.memoizedState,p=s.memoizedState,h.parent!==o?(h={parent:o,cache:o},s.memoizedState=h,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=h),Vr(s,gt,o)):(o=p.cache,Vr(s,gt,o),o!==h.cache&&Pu(s,[gt],a,!0))),$t(i,s,s.pendingProps.children,a),s.child;case 29:throw s.pendingProps}throw Error(n(156,s.tag))}function vr(i){i.flags|=4}function Eh(i,s,a,o,h){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(h&335544128)===h)if(i.stateNode.complete)i.flags|=8192;else if(Ag())i.flags|=8192;else throw Os=ro,ju}else i.flags&=-16777217}function eg(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!pv(s))if(Ag())i.flags|=8192;else throw Os=ro,ju}function bo(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?M_():536870912,i.lanes|=s,On|=s)}function Oa(i,s){if(!He)switch(i.tailMode){case"hidden":s=i.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?i.tail=null:a.sibling=null;break;case"collapsed":a=i.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:o.sibling=null}}function it(i){var s=i.alternate!==null&&i.alternate.child===i.child,a=0,o=0;if(s)for(var h=i.child;h!==null;)a|=h.lanes|h.childLanes,o|=h.subtreeFlags&65011712,o|=h.flags&65011712,h.return=i,h=h.sibling;else for(h=i.child;h!==null;)a|=h.lanes|h.childLanes,o|=h.subtreeFlags,o|=h.flags,h.return=i,h=h.sibling;return i.subtreeFlags|=o,i.childLanes=a,s}function gw(i,s,a){var o=s.pendingProps;switch(Ou(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(s),null;case 1:return it(s),null;case 3:return a=s.stateNode,o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),_r(gt),ze(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(i===null||i.child===null)&&(yn(s)?vr(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Nu())),it(s),null;case 26:var h=s.type,p=s.memoizedState;return i===null?(vr(s),p!==null?(it(s),eg(s,p)):(it(s),Eh(s,h,null,o,a))):p?p!==i.memoizedState?(vr(s),it(s),eg(s,p)):(it(s),s.flags&=-16777217):(i=i.memoizedProps,i!==o&&vr(s),it(s),Eh(s,h,i,o,a)),null;case 27:if($e(s),a=pe.current,h=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==o&&vr(s);else{if(!o){if(s.stateNode===null)throw Error(n(166));return it(s),null}i=ee.current,yn(s)?Mp(s):(i=lv(h,o,a),s.stateNode=i,vr(s))}return it(s),null;case 5:if($e(s),h=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==o&&vr(s);else{if(!o){if(s.stateNode===null)throw Error(n(166));return it(s),null}if(p=ee.current,yn(s))Mp(s);else{var g=zo(pe.current);switch(p){case 1:p=g.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:p=g.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":p=g.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":p=g.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":p=g.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof o.is=="string"?g.createElement("select",{is:o.is}):g.createElement("select"),o.multiple?p.multiple=!0:o.size&&(p.size=o.size);break;default:p=typeof o.is=="string"?g.createElement(h,{is:o.is}):g.createElement(h)}}p[Ut]=s,p[ri]=o;e:for(g=s.child;g!==null;){if(g.tag===5||g.tag===6)p.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===s)break e;for(;g.sibling===null;){if(g.return===null||g.return===s)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}s.stateNode=p;e:switch(Gt(p,h,o),h){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&vr(s)}}return it(s),Eh(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,a),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==o&&vr(s);else{if(typeof o!="string"&&s.stateNode===null)throw Error(n(166));if(i=pe.current,yn(s)){if(i=s.stateNode,a=s.memoizedProps,o=null,h=jt,h!==null)switch(h.tag){case 27:case 5:o=h.memoizedProps}i[Ut]=s,i=!!(i.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||Xg(i.nodeValue,a)),i||jr(s,!0)}else i=zo(i).createTextNode(o),i[Ut]=s,s.stateNode=i}return it(s),null;case 31:if(a=s.memoizedState,i===null||i.memoizedState!==null){if(o=yn(s),a!==null){if(i===null){if(!o)throw Error(n(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(557));i[Ut]=s}else ks(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;it(s),i=!1}else a=Nu(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=a),i=!0;if(!i)return s.flags&256?(yi(s),s):(yi(s),null);if((s.flags&128)!==0)throw Error(n(558))}return it(s),null;case 13:if(o=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(h=yn(s),o!==null&&o.dehydrated!==null){if(i===null){if(!h)throw Error(n(318));if(h=s.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(n(317));h[Ut]=s}else ks(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;it(s),h=!1}else h=Nu(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=h),h=!0;if(!h)return s.flags&256?(yi(s),s):(yi(s),null)}return yi(s),(s.flags&128)!==0?(s.lanes=a,s):(a=o!==null,i=i!==null&&i.memoizedState!==null,a&&(o=s.child,h=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(h=o.alternate.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==h&&(o.flags|=2048)),a!==i&&a&&(s.child.flags|=8192),bo(s,s.updateQueue),it(s),null);case 4:return ze(),i===null&&Wh(s.stateNode.containerInfo),it(s),null;case 10:return _r(s.type),it(s),null;case 19:if(M(ft),o=s.memoizedState,o===null)return it(s),null;if(h=(s.flags&128)!==0,p=o.rendering,p===null)if(h)Oa(o,!1);else{if(ut!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(p=lo(i),p!==null){for(s.flags|=128,Oa(o,!1),i=p.updateQueue,s.updateQueue=i,bo(s,i),s.subtreeFlags=0,i=a,a=s.child;a!==null;)Tp(a,i),a=a.sibling;return X(ft,ft.current&1|2),He&&dr(s,o.treeForkCount),s.child}i=i.sibling}o.tail!==null&&fi()>Ao&&(s.flags|=128,h=!0,Oa(o,!1),s.lanes=4194304)}else{if(!h)if(i=lo(p),i!==null){if(s.flags|=128,h=!0,i=i.updateQueue,s.updateQueue=i,bo(s,i),Oa(o,!0),o.tail===null&&o.tailMode==="hidden"&&!p.alternate&&!He)return it(s),null}else 2*fi()-o.renderingStartTime>Ao&&a!==536870912&&(s.flags|=128,h=!0,Oa(o,!1),s.lanes=4194304);o.isBackwards?(p.sibling=s.child,s.child=p):(i=o.last,i!==null?i.sibling=p:s.child=p,o.last=p)}return o.tail!==null?(i=o.tail,o.rendering=i,o.tail=i.sibling,o.renderingStartTime=fi(),i.sibling=null,a=ft.current,X(ft,h?a&1|2:a&1),He&&dr(s,o.treeForkCount),i):(it(s),null);case 22:case 23:return yi(s),Fu(),o=s.memoizedState!==null,i!==null?i.memoizedState!==null!==o&&(s.flags|=8192):o&&(s.flags|=8192),o?(a&536870912)!==0&&(s.flags&128)===0&&(it(s),s.subtreeFlags&6&&(s.flags|=8192)):it(s),a=s.updateQueue,a!==null&&bo(s,a.retryQueue),a=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),o=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),o!==a&&(s.flags|=2048),i!==null&&M(Ds),null;case 24:return a=null,i!==null&&(a=i.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),_r(gt),it(s),null;case 25:return null;case 30:return null}throw Error(n(156,s.tag))}function vw(i,s){switch(Ou(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return _r(gt),ze(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return $e(s),null;case 31:if(s.memoizedState!==null){if(yi(s),s.alternate===null)throw Error(n(340));ks()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(yi(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(n(340));ks()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return M(ft),null;case 4:return ze(),null;case 10:return _r(s.type),null;case 22:case 23:return yi(s),Fu(),i!==null&&M(Ds),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return _r(gt),null;case 25:return null;default:return null}}function tg(i,s){switch(Ou(s),s.tag){case 3:_r(gt),ze();break;case 26:case 27:case 5:$e(s);break;case 4:ze();break;case 31:s.memoizedState!==null&&yi(s);break;case 13:yi(s);break;case 19:M(ft);break;case 10:_r(s.type);break;case 22:case 23:yi(s),Fu(),i!==null&&M(Ds);break;case 24:_r(gt)}}function Ma(i,s){try{var a=s.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var h=o.next;a=h;do{if((a.tag&i)===i){o=void 0;var p=a.create,g=a.inst;o=p(),g.destroy=o}a=a.next}while(a!==h)}}catch(w){We(s,s.return,w)}}function Yr(i,s,a){try{var o=s.updateQueue,h=o!==null?o.lastEffect:null;if(h!==null){var p=h.next;o=p;do{if((o.tag&i)===i){var g=o.inst,w=g.destroy;if(w!==void 0){g.destroy=void 0,h=s;var A=a,z=w;try{z()}catch(V){We(h,A,V)}}}o=o.next}while(o!==p)}}catch(V){We(s,s.return,V)}}function ig(i){var s=i.updateQueue;if(s!==null){var a=i.stateNode;try{Wp(s,a)}catch(o){We(i,i.return,o)}}}function rg(i,s,a){a.props=Bs(i.type,i.memoizedProps),a.state=i.memoizedState;try{a.componentWillUnmount()}catch(o){We(i,s,o)}}function Na(i,s){try{var a=i.ref;if(a!==null){switch(i.tag){case 26:case 27:case 5:var o=i.stateNode;break;case 30:o=i.stateNode;break;default:o=i.stateNode}typeof a=="function"?i.refCleanup=a(o):a.current=o}}catch(h){We(i,s,h)}}function Qi(i,s){var a=i.ref,o=i.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(h){We(i,s,h)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){We(i,s,h)}else a.current=null}function sg(i){var s=i.type,a=i.memoizedProps,o=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(h){We(i,i.return,h)}}function xh(i,s,a){try{var o=i.stateNode;Uw(o,i.type,a,s),o[ri]=s}catch(h){We(i,i.return,h)}}function ng(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ts(i.type)||i.tag===4}function Ah(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||ng(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ts(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function kh(i,s,a){var o=i.tag;if(o===5||o===6)i=i.stateNode,s?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,s):(s=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,s.appendChild(i),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=cr));else if(o!==4&&(o===27&&ts(i.type)&&(a=i.stateNode,s=null),i=i.child,i!==null))for(kh(i,s,a),i=i.sibling;i!==null;)kh(i,s,a),i=i.sibling}function wo(i,s,a){var o=i.tag;if(o===5||o===6)i=i.stateNode,s?a.insertBefore(i,s):a.appendChild(i);else if(o!==4&&(o===27&&ts(i.type)&&(a=i.stateNode),i=i.child,i!==null))for(wo(i,s,a),i=i.sibling;i!==null;)wo(i,s,a),i=i.sibling}function ag(i){var s=i.stateNode,a=i.memoizedProps;try{for(var o=i.type,h=s.attributes;h.length;)s.removeAttributeNode(h[0]);Gt(s,o,a),s[Ut]=i,s[ri]=a}catch(p){We(i,i.return,p)}}var yr=!1,St=!1,Th=!1,lg=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function yw(i,s){if(i=i.containerInfo,Kh=$o,i=yp(i),bu(i)){if("selectionStart"in i)var a={start:i.selectionStart,end:i.selectionEnd};else e:{a=(a=i.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var h=o.anchorOffset,p=o.focusNode;o=o.focusOffset;try{a.nodeType,p.nodeType}catch{a=null;break e}var g=0,w=-1,A=-1,z=0,V=0,Z=i,P=null;t:for(;;){for(var U;Z!==a||h!==0&&Z.nodeType!==3||(w=g+h),Z!==p||o!==0&&Z.nodeType!==3||(A=g+o),Z.nodeType===3&&(g+=Z.nodeValue.length),(U=Z.firstChild)!==null;)P=Z,Z=U;for(;;){if(Z===i)break t;if(P===a&&++z===h&&(w=g),P===p&&++V===o&&(A=g),(U=Z.nextSibling)!==null)break;Z=P,P=Z.parentNode}Z=U}a=w===-1||A===-1?null:{start:w,end:A}}else a=null}a=a||{start:0,end:0}}else a=null;for(Xh={focusedElem:i,selectionRange:a},$o=!1,Ot=s;Ot!==null;)if(s=Ot,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Ot=i;else for(;Ot!==null;){switch(s=Ot,p=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(a=0;a<i.length;a++)h=i[a],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&p!==null){i=void 0,a=s,h=p.memoizedProps,p=p.memoizedState,o=a.stateNode;try{var _e=Bs(a.type,h);i=o.getSnapshotBeforeUpdate(_e,p),o.__reactInternalSnapshotBeforeUpdate=i}catch(be){We(a,a.return,be)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,a=i.nodeType,a===9)Jh(i);else if(a===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Jh(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(n(163))}if(i=s.sibling,i!==null){i.return=s.return,Ot=i;break}Ot=s.return}}function og(i,s,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:br(i,a),o&4&&Ma(5,a);break;case 1:if(br(i,a),o&4)if(i=a.stateNode,s===null)try{i.componentDidMount()}catch(g){We(a,a.return,g)}else{var h=Bs(a.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(h,s,i.__reactInternalSnapshotBeforeUpdate)}catch(g){We(a,a.return,g)}}o&64&&ig(a),o&512&&Na(a,a.return);break;case 3:if(br(i,a),o&64&&(i=a.updateQueue,i!==null)){if(s=null,a.child!==null)switch(a.child.tag){case 27:case 5:s=a.child.stateNode;break;case 1:s=a.child.stateNode}try{Wp(i,s)}catch(g){We(a,a.return,g)}}break;case 27:s===null&&o&4&&ag(a);case 26:case 5:br(i,a),s===null&&o&4&&sg(a),o&512&&Na(a,a.return);break;case 12:br(i,a);break;case 31:br(i,a),o&4&&hg(i,a);break;case 13:br(i,a),o&4&&dg(i,a),o&64&&(i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(a=Tw.bind(null,a),Yw(i,a))));break;case 22:if(o=a.memoizedState!==null||yr,!o){s=s!==null&&s.memoizedState!==null||St,h=yr;var p=St;yr=o,(St=s)&&!p?wr(i,a,(a.subtreeFlags&8772)!==0):br(i,a),yr=h,St=p}break;case 30:break;default:br(i,a)}}function cg(i){var s=i.alternate;s!==null&&(i.alternate=null,cg(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&su(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var st=null,ni=!1;function Sr(i,s,a){for(a=a.child;a!==null;)ug(i,s,a),a=a.sibling}function ug(i,s,a){if(_i&&typeof _i.onCommitFiberUnmount=="function")try{_i.onCommitFiberUnmount(sa,a)}catch{}switch(a.tag){case 26:St||Qi(a,s),Sr(i,s,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:St||Qi(a,s);var o=st,h=ni;ts(a.type)&&(st=a.stateNode,ni=!1),Sr(i,s,a),$a(a.stateNode),st=o,ni=h;break;case 5:St||Qi(a,s);case 6:if(o=st,h=ni,st=null,Sr(i,s,a),st=o,ni=h,st!==null)if(ni)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(a.stateNode)}catch(p){We(a,s,p)}else try{st.removeChild(a.stateNode)}catch(p){We(a,s,p)}break;case 18:st!==null&&(ni?(i=st,iv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.stateNode),Un(i)):iv(st,a.stateNode));break;case 4:o=st,h=ni,st=a.stateNode.containerInfo,ni=!0,Sr(i,s,a),st=o,ni=h;break;case 0:case 11:case 14:case 15:Yr(2,a,s),St||Yr(4,a,s),Sr(i,s,a);break;case 1:St||(Qi(a,s),o=a.stateNode,typeof o.componentWillUnmount=="function"&&rg(a,s,o)),Sr(i,s,a);break;case 21:Sr(i,s,a);break;case 22:St=(o=St)||a.memoizedState!==null,Sr(i,s,a),St=o;break;default:Sr(i,s,a)}}function hg(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Un(i)}catch(a){We(s,s.return,a)}}}function dg(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Un(i)}catch(a){We(s,s.return,a)}}function Sw(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new lg),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new lg),s;default:throw Error(n(435,i.tag))}}function Co(i,s){var a=Sw(i);s.forEach(function(o){if(!a.has(o)){a.add(o);var h=Rw.bind(null,i,o);o.then(h,h)}})}function ai(i,s){var a=s.deletions;if(a!==null)for(var o=0;o<a.length;o++){var h=a[o],p=i,g=s,w=g;e:for(;w!==null;){switch(w.tag){case 27:if(ts(w.type)){st=w.stateNode,ni=!1;break e}break;case 5:st=w.stateNode,ni=!1;break e;case 3:case 4:st=w.stateNode.containerInfo,ni=!0;break e}w=w.return}if(st===null)throw Error(n(160));ug(p,g,h),st=null,ni=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)fg(s,i),s=s.sibling}var qi=null;function fg(i,s){var a=i.alternate,o=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:ai(s,i),li(i),o&4&&(Yr(3,i,i.return),Ma(3,i),Yr(5,i,i.return));break;case 1:ai(s,i),li(i),o&512&&(St||a===null||Qi(a,a.return)),o&64&&yr&&(i=i.updateQueue,i!==null&&(o=i.callbacks,o!==null&&(a=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var h=qi;if(ai(s,i),li(i),o&512&&(St||a===null||Qi(a,a.return)),o&4){var p=a!==null?a.memoizedState:null;if(o=i.memoizedState,a===null)if(o===null)if(i.stateNode===null){e:{o=i.type,a=i.memoizedProps,h=h.ownerDocument||h;t:switch(o){case"title":p=h.getElementsByTagName("title")[0],(!p||p[la]||p[Ut]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(o),h.head.insertBefore(p,h.querySelector("head > title"))),Gt(p,o,a),p[Ut]=i,Lt(p),o=p;break e;case"link":var g=fv("link","href",h).get(o+(a.href||""));if(g){for(var w=0;w<g.length;w++)if(p=g[w],p.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&p.getAttribute("rel")===(a.rel==null?null:a.rel)&&p.getAttribute("title")===(a.title==null?null:a.title)&&p.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){g.splice(w,1);break t}}p=h.createElement(o),Gt(p,o,a),h.head.appendChild(p);break;case"meta":if(g=fv("meta","content",h).get(o+(a.content||""))){for(w=0;w<g.length;w++)if(p=g[w],p.getAttribute("content")===(a.content==null?null:""+a.content)&&p.getAttribute("name")===(a.name==null?null:a.name)&&p.getAttribute("property")===(a.property==null?null:a.property)&&p.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&p.getAttribute("charset")===(a.charSet==null?null:a.charSet)){g.splice(w,1);break t}}p=h.createElement(o),Gt(p,o,a),h.head.appendChild(p);break;default:throw Error(n(468,o))}p[Ut]=i,Lt(p),o=p}i.stateNode=o}else _v(h,i.type,i.stateNode);else i.stateNode=dv(h,o,i.memoizedProps);else p!==o?(p===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):p.count--,o===null?_v(h,i.type,i.stateNode):dv(h,o,i.memoizedProps)):o===null&&i.stateNode!==null&&xh(i,i.memoizedProps,a.memoizedProps)}break;case 27:ai(s,i),li(i),o&512&&(St||a===null||Qi(a,a.return)),a!==null&&o&4&&xh(i,i.memoizedProps,a.memoizedProps);break;case 5:if(ai(s,i),li(i),o&512&&(St||a===null||Qi(a,a.return)),i.flags&32){h=i.stateNode;try{cn(h,"")}catch(_e){We(i,i.return,_e)}}o&4&&i.stateNode!=null&&(h=i.memoizedProps,xh(i,h,a!==null?a.memoizedProps:h)),o&1024&&(Th=!0);break;case 6:if(ai(s,i),li(i),o&4){if(i.stateNode===null)throw Error(n(162));o=i.memoizedProps,a=i.stateNode;try{a.nodeValue=o}catch(_e){We(i,i.return,_e)}}break;case 3:if(Ho=null,h=qi,qi=Po(s.containerInfo),ai(s,i),qi=h,li(i),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Un(s.containerInfo)}catch(_e){We(i,i.return,_e)}Th&&(Th=!1,_g(i));break;case 4:o=qi,qi=Po(i.stateNode.containerInfo),ai(s,i),li(i),qi=o;break;case 12:ai(s,i),li(i);break;case 31:ai(s,i),li(i),o&4&&(o=i.updateQueue,o!==null&&(i.updateQueue=null,Co(i,o)));break;case 13:ai(s,i),li(i),i.child.flags&8192&&i.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(xo=fi()),o&4&&(o=i.updateQueue,o!==null&&(i.updateQueue=null,Co(i,o)));break;case 22:h=i.memoizedState!==null;var A=a!==null&&a.memoizedState!==null,z=yr,V=St;if(yr=z||h,St=V||A,ai(s,i),St=V,yr=z,li(i),o&8192)e:for(s=i.stateNode,s._visibility=h?s._visibility&-2:s._visibility|1,h&&(a===null||A||yr||St||zs(i)),a=null,s=i;;){if(s.tag===5||s.tag===26){if(a===null){A=a=s;try{if(p=A.stateNode,h)g=p.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{w=A.stateNode;var Z=A.memoizedProps.style,P=Z!=null&&Z.hasOwnProperty("display")?Z.display:null;w.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(_e){We(A,A.return,_e)}}}else if(s.tag===6){if(a===null){A=s;try{A.stateNode.nodeValue=h?"":A.memoizedProps}catch(_e){We(A,A.return,_e)}}}else if(s.tag===18){if(a===null){A=s;try{var U=A.stateNode;h?rv(U,!0):rv(A.stateNode,!1)}catch(_e){We(A,A.return,_e)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;a===s&&(a=null),s=s.return}a===s&&(a=null),s.sibling.return=s.return,s=s.sibling}o&4&&(o=i.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,Co(i,a))));break;case 19:ai(s,i),li(i),o&4&&(o=i.updateQueue,o!==null&&(i.updateQueue=null,Co(i,o)));break;case 30:break;case 21:break;default:ai(s,i),li(i)}}function li(i){var s=i.flags;if(s&2){try{for(var a,o=i.return;o!==null;){if(ng(o)){a=o;break}o=o.return}if(a==null)throw Error(n(160));switch(a.tag){case 27:var h=a.stateNode,p=Ah(i);wo(i,p,h);break;case 5:var g=a.stateNode;a.flags&32&&(cn(g,""),a.flags&=-33);var w=Ah(i);wo(i,w,g);break;case 3:case 4:var A=a.stateNode.containerInfo,z=Ah(i);kh(i,z,A);break;default:throw Error(n(161))}}catch(V){We(i,i.return,V)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function _g(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;_g(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function br(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)og(i,s.alternate,s),s=s.sibling}function zs(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:Yr(4,s,s.return),zs(s);break;case 1:Qi(s,s.return);var a=s.stateNode;typeof a.componentWillUnmount=="function"&&rg(s,s.return,a),zs(s);break;case 27:$a(s.stateNode);case 26:case 5:Qi(s,s.return),zs(s);break;case 22:s.memoizedState===null&&zs(s);break;case 30:zs(s);break;default:zs(s)}i=i.sibling}}function wr(i,s,a){for(a=a&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var o=s.alternate,h=i,p=s,g=p.flags;switch(p.tag){case 0:case 11:case 15:wr(h,p,a),Ma(4,p);break;case 1:if(wr(h,p,a),o=p,h=o.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(z){We(o,o.return,z)}if(o=p,h=o.updateQueue,h!==null){var w=o.stateNode;try{var A=h.shared.hiddenCallbacks;if(A!==null)for(h.shared.hiddenCallbacks=null,h=0;h<A.length;h++)qp(A[h],w)}catch(z){We(o,o.return,z)}}a&&g&64&&ig(p),Na(p,p.return);break;case 27:ag(p);case 26:case 5:wr(h,p,a),a&&o===null&&g&4&&sg(p),Na(p,p.return);break;case 12:wr(h,p,a);break;case 31:wr(h,p,a),a&&g&4&&hg(h,p);break;case 13:wr(h,p,a),a&&g&4&&dg(h,p);break;case 22:p.memoizedState===null&&wr(h,p,a),Na(p,p.return);break;case 30:break;default:wr(h,p,a)}s=s.sibling}}function Rh(i,s){var a=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==a&&(i!=null&&i.refCount++,a!=null&&Sa(a))}function Dh(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Sa(i))}function Wi(i,s,a,o){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)pg(i,s,a,o),s=s.sibling}function pg(i,s,a,o){var h=s.flags;switch(s.tag){case 0:case 11:case 15:Wi(i,s,a,o),h&2048&&Ma(9,s);break;case 1:Wi(i,s,a,o);break;case 3:Wi(i,s,a,o),h&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&Sa(i)));break;case 12:if(h&2048){Wi(i,s,a,o),i=s.stateNode;try{var p=s.memoizedProps,g=p.id,w=p.onPostCommit;typeof w=="function"&&w(g,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(A){We(s,s.return,A)}}else Wi(i,s,a,o);break;case 31:Wi(i,s,a,o);break;case 13:Wi(i,s,a,o);break;case 23:break;case 22:p=s.stateNode,g=s.alternate,s.memoizedState!==null?p._visibility&2?Wi(i,s,a,o):Ba(i,s):p._visibility&2?Wi(i,s,a,o):(p._visibility|=2,Rn(i,s,a,o,(s.subtreeFlags&10256)!==0||!1)),h&2048&&Rh(g,s);break;case 24:Wi(i,s,a,o),h&2048&&Dh(s.alternate,s);break;default:Wi(i,s,a,o)}}function Rn(i,s,a,o,h){for(h=h&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var p=i,g=s,w=a,A=o,z=g.flags;switch(g.tag){case 0:case 11:case 15:Rn(p,g,w,A,h),Ma(8,g);break;case 23:break;case 22:var V=g.stateNode;g.memoizedState!==null?V._visibility&2?Rn(p,g,w,A,h):Ba(p,g):(V._visibility|=2,Rn(p,g,w,A,h)),h&&z&2048&&Rh(g.alternate,g);break;case 24:Rn(p,g,w,A,h),h&&z&2048&&Dh(g.alternate,g);break;default:Rn(p,g,w,A,h)}s=s.sibling}}function Ba(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var a=i,o=s,h=o.flags;switch(o.tag){case 22:Ba(a,o),h&2048&&Rh(o.alternate,o);break;case 24:Ba(a,o),h&2048&&Dh(o.alternate,o);break;default:Ba(a,o)}s=s.sibling}}var za=8192;function Dn(i,s,a){if(i.subtreeFlags&za)for(i=i.child;i!==null;)mg(i,s,a),i=i.sibling}function mg(i,s,a){switch(i.tag){case 26:Dn(i,s,a),i.flags&za&&i.memoizedState!==null&&aC(a,qi,i.memoizedState,i.memoizedProps);break;case 5:Dn(i,s,a);break;case 3:case 4:var o=qi;qi=Po(i.stateNode.containerInfo),Dn(i,s,a),qi=o;break;case 22:i.memoizedState===null&&(o=i.alternate,o!==null&&o.memoizedState!==null?(o=za,za=16777216,Dn(i,s,a),za=o):Dn(i,s,a));break;default:Dn(i,s,a)}}function gg(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function Pa(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var o=s[a];Ot=o,yg(o,i)}gg(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)vg(i),i=i.sibling}function vg(i){switch(i.tag){case 0:case 11:case 15:Pa(i),i.flags&2048&&Yr(9,i,i.return);break;case 3:Pa(i);break;case 12:Pa(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Eo(i)):Pa(i);break;default:Pa(i)}}function Eo(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var o=s[a];Ot=o,yg(o,i)}gg(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:Yr(8,s,s.return),Eo(s);break;case 22:a=s.stateNode,a._visibility&2&&(a._visibility&=-3,Eo(s));break;default:Eo(s)}i=i.sibling}}function yg(i,s){for(;Ot!==null;){var a=Ot;switch(a.tag){case 0:case 11:case 15:Yr(8,a,s);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Sa(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,Ot=o;else e:for(a=i;Ot!==null;){o=Ot;var h=o.sibling,p=o.return;if(cg(o),o===a){Ot=null;break e}if(h!==null){h.return=p,Ot=h;break e}Ot=p}}}var bw={getCacheForType:function(i){var s=Vt(gt),a=s.data.get(i);return a===void 0&&(a=i(),s.data.set(i,a)),a},cacheSignal:function(){return Vt(gt).controller.signal}},ww=typeof WeakMap=="function"?WeakMap:Map,Ve=0,Qe=null,Ne=null,Pe=0,qe=0,Si=null,Kr=!1,Ln=!1,Lh=!1,Cr=0,ut=0,Xr=0,Ps=0,Oh=0,bi=0,On=0,Ia=null,oi=null,Mh=!1,xo=0,Sg=0,Ao=1/0,ko=null,Zr=null,Et=0,Qr=null,Mn=null,Er=0,Nh=0,Bh=null,bg=null,Ha=0,zh=null;function wi(){return(Ve&2)!==0&&Pe!==0?Pe&-Pe:D.T!==null?Vh():P_()}function wg(){if(bi===0)if((Pe&536870912)===0||He){var i=Nl;Nl<<=1,(Nl&3932160)===0&&(Nl=262144),bi=i}else bi=536870912;return i=vi.current,i!==null&&(i.flags|=32),bi}function ci(i,s,a){(i===Qe&&(qe===2||qe===9)||i.cancelPendingCommit!==null)&&(Nn(i,0),Jr(i,Pe,bi,!1)),aa(i,a),((Ve&2)===0||i!==Qe)&&(i===Qe&&((Ve&2)===0&&(Ps|=a),ut===4&&Jr(i,Pe,bi,!1)),Ji(i))}function Cg(i,s,a){if((Ve&6)!==0)throw Error(n(327));var o=!a&&(s&127)===0&&(s&i.expiredLanes)===0||na(i,s),h=o?xw(i,s):Ih(i,s,!0),p=o;do{if(h===0){Ln&&!o&&Jr(i,s,0,!1);break}else{if(a=i.current.alternate,p&&!Cw(a)){h=Ih(i,s,!1),p=!1;continue}if(h===2){if(p=s,i.errorRecoveryDisabledLanes&p)var g=0;else g=i.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){s=g;e:{var w=i;h=Ia;var A=w.current.memoizedState.isDehydrated;if(A&&(Nn(w,g).flags|=256),g=Ih(w,g,!1),g!==2){if(Lh&&!A){w.errorRecoveryDisabledLanes|=p,Ps|=p,h=4;break e}p=oi,oi=h,p!==null&&(oi===null?oi=p:oi.push.apply(oi,p))}h=g}if(p=!1,h!==2)continue}}if(h===1){Nn(i,0),Jr(i,s,0,!0);break}e:{switch(o=i,p=h,p){case 0:case 1:throw Error(n(345));case 4:if((s&4194048)!==s)break;case 6:Jr(o,s,bi,!Kr);break e;case 2:oi=null;break;case 3:case 5:break;default:throw Error(n(329))}if((s&62914560)===s&&(h=xo+300-fi(),10<h)){if(Jr(o,s,bi,!Kr),zl(o,0,!0)!==0)break e;Er=s,o.timeoutHandle=ev(Eg.bind(null,o,a,oi,ko,Mh,s,bi,Ps,On,Kr,p,"Throttled",-0,0),h);break e}Eg(o,a,oi,ko,Mh,s,bi,Ps,On,Kr,p,null,-0,0)}}break}while(!0);Ji(i)}function Eg(i,s,a,o,h,p,g,w,A,z,V,Z,P,U){if(i.timeoutHandle=-1,Z=s.subtreeFlags,Z&8192||(Z&16785408)===16785408){Z={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cr},mg(s,p,Z);var _e=(p&62914560)===p?xo-fi():(p&4194048)===p?Sg-fi():0;if(_e=lC(Z,_e),_e!==null){Er=p,i.cancelPendingCommit=_e(Og.bind(null,i,s,p,a,o,h,g,w,A,V,Z,null,P,U)),Jr(i,p,g,!z);return}}Og(i,s,p,a,o,h,g,w,A)}function Cw(i){for(var s=i;;){var a=s.tag;if((a===0||a===11||a===15)&&s.flags&16384&&(a=s.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var h=a[o],p=h.getSnapshot;h=h.value;try{if(!mi(p(),h))return!1}catch{return!1}}if(a=s.child,s.subtreeFlags&16384&&a!==null)a.return=s,s=a;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Jr(i,s,a,o){s&=~Oh,s&=~Ps,i.suspendedLanes|=s,i.pingedLanes&=~s,o&&(i.warmLanes|=s),o=i.expirationTimes;for(var h=s;0<h;){var p=31-pi(h),g=1<<p;o[p]=-1,h&=~g}a!==0&&N_(i,a,s)}function To(){return(Ve&6)===0?(Ua(0),!1):!0}function Ph(){if(Ne!==null){if(qe===0)var i=Ne.return;else i=Ne,fr=Ts=null,Ju(i),En=null,wa=0,i=Ne;for(;i!==null;)tg(i.alternate,i),i=i.return;Ne=null}}function Nn(i,s){var a=i.timeoutHandle;a!==-1&&(i.timeoutHandle=-1,$w(a)),a=i.cancelPendingCommit,a!==null&&(i.cancelPendingCommit=null,a()),Er=0,Ph(),Qe=i,Ne=a=hr(i.current,null),Pe=s,qe=0,Si=null,Kr=!1,Ln=na(i,s),Lh=!1,On=bi=Oh=Ps=Xr=ut=0,oi=Ia=null,Mh=!1,(s&8)!==0&&(s|=s&32);var o=i.entangledLanes;if(o!==0)for(i=i.entanglements,o&=s;0<o;){var h=31-pi(o),p=1<<h;s|=i[h],o&=~p}return Cr=s,Yl(),a}function xg(i,s){Te=null,D.H=Da,s===Cn||s===io?(s=jp(),qe=3):s===ju?(s=jp(),qe=4):qe=s===ph?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Si=s,Ne===null&&(ut=1,go(i,Ri(s,i.current)))}function Ag(){var i=vi.current;return i===null?!0:(Pe&4194048)===Pe?Mi===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?i===Mi:!1}function kg(){var i=D.H;return D.H=Da,i===null?Da:i}function Tg(){var i=D.A;return D.A=bw,i}function Ro(){ut=4,Kr||(Pe&4194048)!==Pe&&vi.current!==null||(Ln=!0),(Xr&134217727)===0&&(Ps&134217727)===0||Qe===null||Jr(Qe,Pe,bi,!1)}function Ih(i,s,a){var o=Ve;Ve|=2;var h=kg(),p=Tg();(Qe!==i||Pe!==s)&&(ko=null,Nn(i,s)),s=!1;var g=ut;e:do try{if(qe!==0&&Ne!==null){var w=Ne,A=Si;switch(qe){case 8:Ph(),g=6;break e;case 3:case 2:case 9:case 6:vi.current===null&&(s=!0);var z=qe;if(qe=0,Si=null,Bn(i,w,A,z),a&&Ln){g=0;break e}break;default:z=qe,qe=0,Si=null,Bn(i,w,A,z)}}Ew(),g=ut;break}catch(V){xg(i,V)}while(!0);return s&&i.shellSuspendCounter++,fr=Ts=null,Ve=o,D.H=h,D.A=p,Ne===null&&(Qe=null,Pe=0,Yl()),g}function Ew(){for(;Ne!==null;)Rg(Ne)}function xw(i,s){var a=Ve;Ve|=2;var o=kg(),h=Tg();Qe!==i||Pe!==s?(ko=null,Ao=fi()+500,Nn(i,s)):Ln=na(i,s);e:do try{if(qe!==0&&Ne!==null){s=Ne;var p=Si;t:switch(qe){case 1:qe=0,Si=null,Bn(i,s,p,1);break;case 2:case 9:if(Hp(p)){qe=0,Si=null,Dg(s);break}s=function(){qe!==2&&qe!==9||Qe!==i||(qe=7),Ji(i)},p.then(s,s);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:Hp(p)?(qe=0,Si=null,Dg(s)):(qe=0,Si=null,Bn(i,s,p,7));break;case 5:var g=null;switch(Ne.tag){case 26:g=Ne.memoizedState;case 5:case 27:var w=Ne;if(g?pv(g):w.stateNode.complete){qe=0,Si=null;var A=w.sibling;if(A!==null)Ne=A;else{var z=w.return;z!==null?(Ne=z,Do(z)):Ne=null}break t}}qe=0,Si=null,Bn(i,s,p,5);break;case 6:qe=0,Si=null,Bn(i,s,p,6);break;case 8:Ph(),ut=6;break e;default:throw Error(n(462))}}Aw();break}catch(V){xg(i,V)}while(!0);return fr=Ts=null,D.H=o,D.A=h,Ve=a,Ne!==null?0:(Qe=null,Pe=0,Yl(),ut)}function Aw(){for(;Ne!==null&&!Ll();)Rg(Ne)}function Rg(i){var s=Jm(i.alternate,i,Cr);i.memoizedProps=i.pendingProps,s===null?Do(i):Ne=s}function Dg(i){var s=i,a=s.alternate;switch(s.tag){case 15:case 0:s=Fm(a,s,s.pendingProps,s.type,void 0,Pe);break;case 11:s=Fm(a,s,s.pendingProps,s.type.render,s.ref,Pe);break;case 5:Ju(s);default:tg(a,s),s=Ne=Tp(s,Cr),s=Jm(a,s,Cr)}i.memoizedProps=i.pendingProps,s===null?Do(i):Ne=s}function Bn(i,s,a,o){fr=Ts=null,Ju(s),En=null,wa=0;var h=s.return;try{if(_w(i,h,s,a,Pe)){ut=1,go(i,Ri(a,i.current)),Ne=null;return}}catch(p){if(h!==null)throw Ne=h,p;ut=1,go(i,Ri(a,i.current)),Ne=null;return}s.flags&32768?(He||o===1?i=!0:Ln||(Pe&536870912)!==0?i=!1:(Kr=i=!0,(o===2||o===9||o===3||o===6)&&(o=vi.current,o!==null&&o.tag===13&&(o.flags|=16384))),Lg(s,i)):Do(s)}function Do(i){var s=i;do{if((s.flags&32768)!==0){Lg(s,Kr);return}i=s.return;var a=gw(s.alternate,s,Cr);if(a!==null){Ne=a;return}if(s=s.sibling,s!==null){Ne=s;return}Ne=s=i}while(s!==null);ut===0&&(ut=5)}function Lg(i,s){do{var a=vw(i.alternate,i);if(a!==null){a.flags&=32767,Ne=a;return}if(a=i.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!s&&(i=i.sibling,i!==null)){Ne=i;return}Ne=i=a}while(i!==null);ut=6,Ne=null}function Og(i,s,a,o,h,p,g,w,A){i.cancelPendingCommit=null;do Lo();while(Et!==0);if((Ve&6)!==0)throw Error(n(327));if(s!==null){if(s===i.current)throw Error(n(177));if(p=s.lanes|s.childLanes,p|=Au,n1(i,a,p,g,w,A),i===Qe&&(Ne=Qe=null,Pe=0),Mn=s,Qr=i,Er=a,Nh=p,Bh=h,bg=o,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,Dw(Ol,function(){return Pg(),null})):(i.callbackNode=null,i.callbackPriority=0),o=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||o){o=D.T,D.T=null,h=W.p,W.p=2,g=Ve,Ve|=4;try{yw(i,s,a)}finally{Ve=g,W.p=h,D.T=o}}Et=1,Mg(),Ng(),Bg()}}function Mg(){if(Et===1){Et=0;var i=Qr,s=Mn,a=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var o=W.p;W.p=2;var h=Ve;Ve|=4;try{fg(s,i);var p=Xh,g=yp(i.containerInfo),w=p.focusedElem,A=p.selectionRange;if(g!==w&&w&&w.ownerDocument&&vp(w.ownerDocument.documentElement,w)){if(A!==null&&bu(w)){var z=A.start,V=A.end;if(V===void 0&&(V=z),"selectionStart"in w)w.selectionStart=z,w.selectionEnd=Math.min(V,w.value.length);else{var Z=w.ownerDocument||document,P=Z&&Z.defaultView||window;if(P.getSelection){var U=P.getSelection(),_e=w.textContent.length,be=Math.min(A.start,_e),Xe=A.end===void 0?be:Math.min(A.end,_e);!U.extend&&be>Xe&&(g=Xe,Xe=be,be=g);var L=gp(w,be),R=gp(w,Xe);if(L&&R&&(U.rangeCount!==1||U.anchorNode!==L.node||U.anchorOffset!==L.offset||U.focusNode!==R.node||U.focusOffset!==R.offset)){var N=Z.createRange();N.setStart(L.node,L.offset),U.removeAllRanges(),be>Xe?(U.addRange(N),U.extend(R.node,R.offset)):(N.setEnd(R.node,R.offset),U.addRange(N))}}}}for(Z=[],U=w;U=U.parentNode;)U.nodeType===1&&Z.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<Z.length;w++){var K=Z[w];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}$o=!!Kh,Xh=Kh=null}finally{Ve=h,W.p=o,D.T=a}}i.current=s,Et=2}}function Ng(){if(Et===2){Et=0;var i=Qr,s=Mn,a=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var o=W.p;W.p=2;var h=Ve;Ve|=4;try{og(i,s.alternate,s)}finally{Ve=h,W.p=o,D.T=a}}Et=3}}function Bg(){if(Et===4||Et===3){Et=0,Xb();var i=Qr,s=Mn,a=Er,o=bg;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Et=5:(Et=0,Mn=Qr=null,zg(i,i.pendingLanes));var h=i.pendingLanes;if(h===0&&(Zr=null),iu(a),s=s.stateNode,_i&&typeof _i.onCommitFiberRoot=="function")try{_i.onCommitFiberRoot(sa,s,void 0,(s.current.flags&128)===128)}catch{}if(o!==null){s=D.T,h=W.p,W.p=2,D.T=null;try{for(var p=i.onRecoverableError,g=0;g<o.length;g++){var w=o[g];p(w.value,{componentStack:w.stack})}}finally{D.T=s,W.p=h}}(Er&3)!==0&&Lo(),Ji(i),h=i.pendingLanes,(a&261930)!==0&&(h&42)!==0?i===zh?Ha++:(Ha=0,zh=i):Ha=0,Ua(0)}}function zg(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Sa(s)))}function Lo(){return Mg(),Ng(),Bg(),Pg()}function Pg(){if(Et!==5)return!1;var i=Qr,s=Nh;Nh=0;var a=iu(Er),o=D.T,h=W.p;try{W.p=32>a?32:a,D.T=null,a=Bh,Bh=null;var p=Qr,g=Er;if(Et=0,Mn=Qr=null,Er=0,(Ve&6)!==0)throw Error(n(331));var w=Ve;if(Ve|=4,vg(p.current),pg(p,p.current,g,a),Ve=w,Ua(0,!1),_i&&typeof _i.onPostCommitFiberRoot=="function")try{_i.onPostCommitFiberRoot(sa,p)}catch{}return!0}finally{W.p=h,D.T=o,zg(i,s)}}function Ig(i,s,a){s=Ri(a,s),s=_h(i.stateNode,s,2),i=qr(i,s,2),i!==null&&(aa(i,2),Ji(i))}function We(i,s,a){if(i.tag===3)Ig(i,i,a);else for(;s!==null;){if(s.tag===3){Ig(s,i,a);break}else if(s.tag===1){var o=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Zr===null||!Zr.has(o))){i=Ri(a,i),a=Hm(2),o=qr(s,a,2),o!==null&&(Um(a,o,s,i),aa(o,2),Ji(o));break}}s=s.return}}function Hh(i,s,a){var o=i.pingCache;if(o===null){o=i.pingCache=new ww;var h=new Set;o.set(s,h)}else h=o.get(s),h===void 0&&(h=new Set,o.set(s,h));h.has(a)||(Lh=!0,h.add(a),i=kw.bind(null,i,s,a),s.then(i,i))}function kw(i,s,a){var o=i.pingCache;o!==null&&o.delete(s),i.pingedLanes|=i.suspendedLanes&a,i.warmLanes&=~a,Qe===i&&(Pe&a)===a&&(ut===4||ut===3&&(Pe&62914560)===Pe&&300>fi()-xo?(Ve&2)===0&&Nn(i,0):Oh|=a,On===Pe&&(On=0)),Ji(i)}function Hg(i,s){s===0&&(s=M_()),i=xs(i,s),i!==null&&(aa(i,s),Ji(i))}function Tw(i){var s=i.memoizedState,a=0;s!==null&&(a=s.retryLane),Hg(i,a)}function Rw(i,s){var a=0;switch(i.tag){case 31:case 13:var o=i.stateNode,h=i.memoizedState;h!==null&&(a=h.retryLane);break;case 19:o=i.stateNode;break;case 22:o=i.stateNode._retryCache;break;default:throw Error(n(314))}o!==null&&o.delete(s),Hg(i,a)}function Dw(i,s){return Ae(i,s)}var Oo=null,zn=null,Uh=!1,Mo=!1,jh=!1,es=0;function Ji(i){i!==zn&&i.next===null&&(zn===null?Oo=zn=i:zn=zn.next=i),Mo=!0,Uh||(Uh=!0,Ow())}function Ua(i,s){if(!jh&&Mo){jh=!0;do for(var a=!1,o=Oo;o!==null;){if(i!==0){var h=o.pendingLanes;if(h===0)var p=0;else{var g=o.suspendedLanes,w=o.pingedLanes;p=(1<<31-pi(42|i)+1)-1,p&=h&~(g&~w),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(a=!0,$g(o,p))}else p=Pe,p=zl(o,o===Qe?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(p&3)===0||na(o,p)||(a=!0,$g(o,p));o=o.next}while(a);jh=!1}}function Lw(){Ug()}function Ug(){Mo=Uh=!1;var i=0;es!==0&&Vw()&&(i=es);for(var s=fi(),a=null,o=Oo;o!==null;){var h=o.next,p=jg(o,s);p===0?(o.next=null,a===null?Oo=h:a.next=h,h===null&&(zn=a)):(a=o,(i!==0||(p&3)!==0)&&(Mo=!0)),o=h}Et!==0&&Et!==5||Ua(i),es!==0&&(es=0)}function jg(i,s){for(var a=i.suspendedLanes,o=i.pingedLanes,h=i.expirationTimes,p=i.pendingLanes&-62914561;0<p;){var g=31-pi(p),w=1<<g,A=h[g];A===-1?((w&a)===0||(w&o)!==0)&&(h[g]=s1(w,s)):A<=s&&(i.expiredLanes|=w),p&=~w}if(s=Qe,a=Pe,a=zl(i,i===s?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),o=i.callbackNode,a===0||i===s&&(qe===2||qe===9)||i.cancelPendingCommit!==null)return o!==null&&o!==null&&Ge(o),i.callbackNode=null,i.callbackPriority=0;if((a&3)===0||na(i,a)){if(s=a&-a,s===i.callbackPriority)return s;switch(o!==null&&Ge(o),iu(a)){case 2:case 8:a=L_;break;case 32:a=Ol;break;case 268435456:a=O_;break;default:a=Ol}return o=Vg.bind(null,i),a=Ae(a,o),i.callbackPriority=s,i.callbackNode=a,s}return o!==null&&o!==null&&Ge(o),i.callbackPriority=2,i.callbackNode=null,2}function Vg(i,s){if(Et!==0&&Et!==5)return i.callbackNode=null,i.callbackPriority=0,null;var a=i.callbackNode;if(Lo()&&i.callbackNode!==a)return null;var o=Pe;return o=zl(i,i===Qe?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),o===0?null:(Cg(i,o,s),jg(i,fi()),i.callbackNode!=null&&i.callbackNode===a?Vg.bind(null,i):null)}function $g(i,s){if(Lo())return null;Cg(i,s,!0)}function Ow(){Gw(function(){(Ve&6)!==0?Ae(D_,Lw):Ug()})}function Vh(){if(es===0){var i=bn;i===0&&(i=Ml,Ml<<=1,(Ml&261888)===0&&(Ml=256)),es=i}return es}function Gg(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ul(""+i)}function qg(i,s){var a=s.ownerDocument.createElement("input");return a.name=s.name,a.value=s.value,i.id&&a.setAttribute("form",i.id),s.parentNode.insertBefore(a,s),i=new FormData(i),a.parentNode.removeChild(a),i}function Mw(i,s,a,o,h){if(s==="submit"&&a&&a.stateNode===h){var p=Gg((h[ri]||null).action),g=o.submitter;g&&(s=(s=g[ri]||null)?Gg(s.formAction):g.getAttribute("formAction"),s!==null&&(p=s,g=null));var w=new Gl("action","action",null,o,h);i.push({event:w,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(es!==0){var A=g?qg(h,g):new FormData(h);oh(a,{pending:!0,data:A,method:h.method,action:p},null,A)}}else typeof p=="function"&&(w.preventDefault(),A=g?qg(h,g):new FormData(h),oh(a,{pending:!0,data:A,method:h.method,action:p},p,A))},currentTarget:h}]})}}for(var $h=0;$h<xu.length;$h++){var Gh=xu[$h],Nw=Gh.toLowerCase(),Bw=Gh[0].toUpperCase()+Gh.slice(1);Gi(Nw,"on"+Bw)}Gi(wp,"onAnimationEnd"),Gi(Cp,"onAnimationIteration"),Gi(Ep,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi(Z1,"onTransitionRun"),Gi(Q1,"onTransitionStart"),Gi(J1,"onTransitionCancel"),Gi(xp,"onTransitionEnd"),ln("onMouseEnter",["mouseout","mouseover"]),ln("onMouseLeave",["mouseout","mouseover"]),ln("onPointerEnter",["pointerout","pointerover"]),ln("onPointerLeave",["pointerout","pointerover"]),bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),bs("onBeforeInput",["compositionend","keypress","textInput","paste"]),bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ja="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(" "),zw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ja));function Wg(i,s){s=(s&4)!==0;for(var a=0;a<i.length;a++){var o=i[a],h=o.event;o=o.listeners;e:{var p=void 0;if(s)for(var g=o.length-1;0<=g;g--){var w=o[g],A=w.instance,z=w.currentTarget;if(w=w.listener,A!==p&&h.isPropagationStopped())break e;p=w,h.currentTarget=z;try{p(h)}catch(V){Fl(V)}h.currentTarget=null,p=A}else for(g=0;g<o.length;g++){if(w=o[g],A=w.instance,z=w.currentTarget,w=w.listener,A!==p&&h.isPropagationStopped())break e;p=w,h.currentTarget=z;try{p(h)}catch(V){Fl(V)}h.currentTarget=null,p=A}}}}function Be(i,s){var a=s[ru];a===void 0&&(a=s[ru]=new Set);var o=i+"__bubble";a.has(o)||(Fg(s,i,2,!1),a.add(o))}function qh(i,s,a){var o=0;s&&(o|=4),Fg(a,i,o,s)}var No="_reactListening"+Math.random().toString(36).slice(2);function Wh(i){if(!i[No]){i[No]=!0,U_.forEach(function(a){a!=="selectionchange"&&(zw.has(a)||qh(a,!1,i),qh(a,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[No]||(s[No]=!0,qh("selectionchange",!1,s))}}function Fg(i,s,a,o){switch(wv(s)){case 2:var h=uC;break;case 8:h=hC;break;default:h=ld}a=h.bind(null,s,a,i),h=void 0,!du||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(h=!0),o?h!==void 0?i.addEventListener(s,a,{capture:!0,passive:h}):i.addEventListener(s,a,!0):h!==void 0?i.addEventListener(s,a,{passive:h}):i.addEventListener(s,a,!1)}function Fh(i,s,a,o,h){var p=o;if((s&1)===0&&(s&2)===0&&o!==null)e:for(;;){if(o===null)return;var g=o.tag;if(g===3||g===4){var w=o.stateNode.containerInfo;if(w===h)break;if(g===4)for(g=o.return;g!==null;){var A=g.tag;if((A===3||A===4)&&g.stateNode.containerInfo===h)return;g=g.return}for(;w!==null;){if(g=sn(w),g===null)return;if(A=g.tag,A===5||A===6||A===26||A===27){o=p=g;continue e}w=w.parentNode}}o=o.return}Q_(function(){var z=p,V=uu(a),Z=[];e:{var P=Ap.get(i);if(P!==void 0){var U=Gl,_e=i;switch(i){case"keypress":if(Vl(a)===0)break e;case"keydown":case"keyup":U=R1;break;case"focusin":_e="focus",U=mu;break;case"focusout":_e="blur",U=mu;break;case"beforeblur":case"afterblur":U=mu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":U=tp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=g1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=O1;break;case wp:case Cp:case Ep:U=S1;break;case xp:U=N1;break;case"scroll":case"scrollend":U=p1;break;case"wheel":U=z1;break;case"copy":case"cut":case"paste":U=w1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=rp;break;case"toggle":case"beforetoggle":U=I1}var be=(s&4)!==0,Xe=!be&&(i==="scroll"||i==="scrollend"),L=be?P!==null?P+"Capture":null:P;be=[];for(var R=z,N;R!==null;){var K=R;if(N=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||N===null||L===null||(K=ca(R,L),K!=null&&be.push(Va(R,K,N))),Xe)break;R=R.return}0<be.length&&(P=new U(P,_e,null,a,V),Z.push({event:P,listeners:be}))}}if((s&7)===0){e:{if(P=i==="mouseover"||i==="pointerover",U=i==="mouseout"||i==="pointerout",P&&a!==cu&&(_e=a.relatedTarget||a.fromElement)&&(sn(_e)||_e[rn]))break e;if((U||P)&&(P=V.window===V?V:(P=V.ownerDocument)?P.defaultView||P.parentWindow:window,U?(_e=a.relatedTarget||a.toElement,U=z,_e=_e?sn(_e):null,_e!==null&&(Xe=c(_e),be=_e.tag,_e!==Xe||be!==5&&be!==27&&be!==6)&&(_e=null)):(U=null,_e=z),U!==_e)){if(be=tp,K="onMouseLeave",L="onMouseEnter",R="mouse",(i==="pointerout"||i==="pointerover")&&(be=rp,K="onPointerLeave",L="onPointerEnter",R="pointer"),Xe=U==null?P:oa(U),N=_e==null?P:oa(_e),P=new be(K,R+"leave",U,a,V),P.target=Xe,P.relatedTarget=N,K=null,sn(V)===z&&(be=new be(L,R+"enter",_e,a,V),be.target=N,be.relatedTarget=Xe,K=be),Xe=K,U&&_e)t:{for(be=Pw,L=U,R=_e,N=0,K=L;K;K=be(K))N++;K=0;for(var ye=R;ye;ye=be(ye))K++;for(;0<N-K;)L=be(L),N--;for(;0<K-N;)R=be(R),K--;for(;N--;){if(L===R||R!==null&&L===R.alternate){be=L;break t}L=be(L),R=be(R)}be=null}else be=null;U!==null&&Yg(Z,P,U,be,!1),_e!==null&&Xe!==null&&Yg(Z,Xe,_e,be,!0)}}e:{if(P=z?oa(z):window,U=P.nodeName&&P.nodeName.toLowerCase(),U==="select"||U==="input"&&P.type==="file")var Ue=hp;else if(cp(P))if(dp)Ue=Y1;else{Ue=W1;var me=q1}else U=P.nodeName,!U||U.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?z&&ou(z.elementType)&&(Ue=hp):Ue=F1;if(Ue&&(Ue=Ue(i,z))){up(Z,Ue,a,V);break e}me&&me(i,P,z),i==="focusout"&&z&&P.type==="number"&&z.memoizedProps.value!=null&&lu(P,"number",P.value)}switch(me=z?oa(z):window,i){case"focusin":(cp(me)||me.contentEditable==="true")&&(fn=me,wu=z,ga=null);break;case"focusout":ga=wu=fn=null;break;case"mousedown":Cu=!0;break;case"contextmenu":case"mouseup":case"dragend":Cu=!1,Sp(Z,a,V);break;case"selectionchange":if(X1)break;case"keydown":case"keyup":Sp(Z,a,V)}var Re;if(vu)e:{switch(i){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else dn?lp(i,a)&&(Ie="onCompositionEnd"):i==="keydown"&&a.keyCode===229&&(Ie="onCompositionStart");Ie&&(sp&&a.locale!=="ko"&&(dn||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&dn&&(Re=J_()):(Ir=V,fu="value"in Ir?Ir.value:Ir.textContent,dn=!0)),me=Bo(z,Ie),0<me.length&&(Ie=new ip(Ie,i,null,a,V),Z.push({event:Ie,listeners:me}),Re?Ie.data=Re:(Re=op(a),Re!==null&&(Ie.data=Re)))),(Re=U1?j1(i,a):V1(i,a))&&(Ie=Bo(z,"onBeforeInput"),0<Ie.length&&(me=new ip("onBeforeInput","beforeinput",null,a,V),Z.push({event:me,listeners:Ie}),me.data=Re)),Mw(Z,i,z,a,V)}Wg(Z,s)})}function Va(i,s,a){return{instance:i,listener:s,currentTarget:a}}function Bo(i,s){for(var a=s+"Capture",o=[];i!==null;){var h=i,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=ca(i,a),h!=null&&o.unshift(Va(i,h,p)),h=ca(i,s),h!=null&&o.push(Va(i,h,p))),i.tag===3)return o;i=i.return}return[]}function Pw(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Yg(i,s,a,o,h){for(var p=s._reactName,g=[];a!==null&&a!==o;){var w=a,A=w.alternate,z=w.stateNode;if(w=w.tag,A!==null&&A===o)break;w!==5&&w!==26&&w!==27||z===null||(A=z,h?(z=ca(a,p),z!=null&&g.unshift(Va(a,z,A))):h||(z=ca(a,p),z!=null&&g.push(Va(a,z,A)))),a=a.return}g.length!==0&&i.push({event:s,listeners:g})}var Iw=/\r\n?/g,Hw=/\u0000|\uFFFD/g;function Kg(i){return(typeof i=="string"?i:""+i).replace(Iw,`
|
|
50
|
-
`).replace(Hw,"")}function Xg(i,s){return s=Kg(s),Kg(i)===s}function Ke(i,s,a,o,h,p){switch(a){case"children":typeof o=="string"?s==="body"||s==="textarea"&&o===""||cn(i,o):(typeof o=="number"||typeof o=="bigint")&&s!=="body"&&cn(i,""+o);break;case"className":Il(i,"class",o);break;case"tabIndex":Il(i,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Il(i,a,o);break;case"style":X_(i,o,p);break;case"data":if(s!=="object"){Il(i,"data",o);break}case"src":case"href":if(o===""&&(s!=="a"||a!=="href")){i.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){i.removeAttribute(a);break}o=Ul(""+o),i.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){i.setAttribute(a,"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 p=="function"&&(a==="formAction"?(s!=="input"&&Ke(i,s,"name",h.name,h,null),Ke(i,s,"formEncType",h.formEncType,h,null),Ke(i,s,"formMethod",h.formMethod,h,null),Ke(i,s,"formTarget",h.formTarget,h,null)):(Ke(i,s,"encType",h.encType,h,null),Ke(i,s,"method",h.method,h,null),Ke(i,s,"target",h.target,h,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){i.removeAttribute(a);break}o=Ul(""+o),i.setAttribute(a,o);break;case"onClick":o!=null&&(i.onclick=cr);break;case"onScroll":o!=null&&Be("scroll",i);break;case"onScrollEnd":o!=null&&Be("scrollend",i);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(n(61));if(a=o.__html,a!=null){if(h.children!=null)throw Error(n(60));i.innerHTML=a}}break;case"multiple":i.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":i.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){i.removeAttribute("xlink:href");break}a=Ul(""+o),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?i.setAttribute(a,""+o):i.removeAttribute(a);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":o&&typeof o!="function"&&typeof o!="symbol"?i.setAttribute(a,""):i.removeAttribute(a);break;case"capture":case"download":o===!0?i.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?i.setAttribute(a,o):i.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?i.setAttribute(a,o):i.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?i.removeAttribute(a):i.setAttribute(a,o);break;case"popover":Be("beforetoggle",i),Be("toggle",i),Pl(i,"popover",o);break;case"xlinkActuate":or(i,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":or(i,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":or(i,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":or(i,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":or(i,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":or(i,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":or(i,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":or(i,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":or(i,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Pl(i,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=f1.get(a)||a,Pl(i,a,o))}}function Yh(i,s,a,o,h,p){switch(a){case"style":X_(i,o,p);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(n(61));if(a=o.__html,a!=null){if(h.children!=null)throw Error(n(60));i.innerHTML=a}}break;case"children":typeof o=="string"?cn(i,o):(typeof o=="number"||typeof o=="bigint")&&cn(i,""+o);break;case"onScroll":o!=null&&Be("scroll",i);break;case"onScrollEnd":o!=null&&Be("scrollend",i);break;case"onClick":o!=null&&(i.onclick=cr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!j_.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(h=a.endsWith("Capture"),s=a.slice(2,h?a.length-7:void 0),p=i[ri]||null,p=p!=null?p[a]:null,typeof p=="function"&&i.removeEventListener(s,p,h),typeof o=="function")){typeof p!="function"&&p!==null&&(a in i?i[a]=null:i.hasAttribute(a)&&i.removeAttribute(a)),i.addEventListener(s,o,h);break e}a in i?i[a]=o:o===!0?i.setAttribute(a,""):Pl(i,a,o)}}}function Gt(i,s,a){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",i),Be("load",i);var o=!1,h=!1,p;for(p in a)if(a.hasOwnProperty(p)){var g=a[p];if(g!=null)switch(p){case"src":o=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,s));default:Ke(i,s,p,g,a,null)}}h&&Ke(i,s,"srcSet",a.srcSet,a,null),o&&Ke(i,s,"src",a.src,a,null);return;case"input":Be("invalid",i);var w=p=g=h=null,A=null,z=null;for(o in a)if(a.hasOwnProperty(o)){var V=a[o];if(V!=null)switch(o){case"name":h=V;break;case"type":g=V;break;case"checked":A=V;break;case"defaultChecked":z=V;break;case"value":p=V;break;case"defaultValue":w=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(n(137,s));break;default:Ke(i,s,o,V,a,null)}}W_(i,p,w,A,z,g,h,!1);return;case"select":Be("invalid",i),o=g=p=null;for(h in a)if(a.hasOwnProperty(h)&&(w=a[h],w!=null))switch(h){case"value":p=w;break;case"defaultValue":g=w;break;case"multiple":o=w;default:Ke(i,s,h,w,a,null)}s=p,a=g,i.multiple=!!o,s!=null?on(i,!!o,s,!1):a!=null&&on(i,!!o,a,!0);return;case"textarea":Be("invalid",i),p=h=o=null;for(g in a)if(a.hasOwnProperty(g)&&(w=a[g],w!=null))switch(g){case"value":o=w;break;case"defaultValue":h=w;break;case"children":p=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(n(91));break;default:Ke(i,s,g,w,a,null)}Y_(i,o,h,p);return;case"option":for(A in a)if(a.hasOwnProperty(A)&&(o=a[A],o!=null))switch(A){case"selected":i.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Ke(i,s,A,o,a,null)}return;case"dialog":Be("beforetoggle",i),Be("toggle",i),Be("cancel",i),Be("close",i);break;case"iframe":case"object":Be("load",i);break;case"video":case"audio":for(o=0;o<ja.length;o++)Be(ja[o],i);break;case"image":Be("error",i),Be("load",i);break;case"details":Be("toggle",i);break;case"embed":case"source":case"link":Be("error",i),Be("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in a)if(a.hasOwnProperty(z)&&(o=a[z],o!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,s));default:Ke(i,s,z,o,a,null)}return;default:if(ou(s)){for(V in a)a.hasOwnProperty(V)&&(o=a[V],o!==void 0&&Yh(i,s,V,o,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(o=a[w],o!=null&&Ke(i,s,w,o,a,null))}function Uw(i,s,a,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,g=null,w=null,A=null,z=null,V=null;for(U in a){var Z=a[U];if(a.hasOwnProperty(U)&&Z!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":A=Z;default:o.hasOwnProperty(U)||Ke(i,s,U,null,o,Z)}}for(var P in o){var U=o[P];if(Z=a[P],o.hasOwnProperty(P)&&(U!=null||Z!=null))switch(P){case"type":p=U;break;case"name":h=U;break;case"checked":z=U;break;case"defaultChecked":V=U;break;case"value":g=U;break;case"defaultValue":w=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(n(137,s));break;default:U!==Z&&Ke(i,s,P,U,o,Z)}}au(i,g,w,A,z,V,p,h);return;case"select":U=g=w=P=null;for(p in a)if(A=a[p],a.hasOwnProperty(p)&&A!=null)switch(p){case"value":break;case"multiple":U=A;default:o.hasOwnProperty(p)||Ke(i,s,p,null,o,A)}for(h in o)if(p=o[h],A=a[h],o.hasOwnProperty(h)&&(p!=null||A!=null))switch(h){case"value":P=p;break;case"defaultValue":w=p;break;case"multiple":g=p;default:p!==A&&Ke(i,s,h,p,o,A)}s=w,a=g,o=U,P!=null?on(i,!!a,P,!1):!!o!=!!a&&(s!=null?on(i,!!a,s,!0):on(i,!!a,a?[]:"",!1));return;case"textarea":U=P=null;for(w in a)if(h=a[w],a.hasOwnProperty(w)&&h!=null&&!o.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ke(i,s,w,null,o,h)}for(g in o)if(h=o[g],p=a[g],o.hasOwnProperty(g)&&(h!=null||p!=null))switch(g){case"value":P=h;break;case"defaultValue":U=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(n(91));break;default:h!==p&&Ke(i,s,g,h,o,p)}F_(i,P,U);return;case"option":for(var _e in a)if(P=a[_e],a.hasOwnProperty(_e)&&P!=null&&!o.hasOwnProperty(_e))switch(_e){case"selected":i.selected=!1;break;default:Ke(i,s,_e,null,o,P)}for(A in o)if(P=o[A],U=a[A],o.hasOwnProperty(A)&&P!==U&&(P!=null||U!=null))switch(A){case"selected":i.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:Ke(i,s,A,P,o,U)}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 be in a)P=a[be],a.hasOwnProperty(be)&&P!=null&&!o.hasOwnProperty(be)&&Ke(i,s,be,null,o,P);for(z in o)if(P=o[z],U=a[z],o.hasOwnProperty(z)&&P!==U&&(P!=null||U!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(n(137,s));break;default:Ke(i,s,z,P,o,U)}return;default:if(ou(s)){for(var Xe in a)P=a[Xe],a.hasOwnProperty(Xe)&&P!==void 0&&!o.hasOwnProperty(Xe)&&Yh(i,s,Xe,void 0,o,P);for(V in o)P=o[V],U=a[V],!o.hasOwnProperty(V)||P===U||P===void 0&&U===void 0||Yh(i,s,V,P,o,U);return}}for(var L in a)P=a[L],a.hasOwnProperty(L)&&P!=null&&!o.hasOwnProperty(L)&&Ke(i,s,L,null,o,P);for(Z in o)P=o[Z],U=a[Z],!o.hasOwnProperty(Z)||P===U||P==null&&U==null||Ke(i,s,Z,P,o,U)}function Zg(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function jw(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var h=a[o],p=h.transferSize,g=h.initiatorType,w=h.duration;if(p&&w&&Zg(g)){for(g=0,w=h.responseEnd,o+=1;o<a.length;o++){var A=a[o],z=A.startTime;if(z>w)break;var V=A.transferSize,Z=A.initiatorType;V&&Zg(Z)&&(A=A.responseEnd,g+=V*(A<w?1:(w-z)/(A-z)))}if(--o,s+=8*(p+g)/(h.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Kh=null,Xh=null;function zo(i){return i.nodeType===9?i:i.ownerDocument}function Qg(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Jg(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function Zh(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Qh=null;function Vw(){var i=window.event;return i&&i.type==="popstate"?i===Qh?!1:(Qh=i,!0):(Qh=null,!1)}var ev=typeof setTimeout=="function"?setTimeout:void 0,$w=typeof clearTimeout=="function"?clearTimeout:void 0,tv=typeof Promise=="function"?Promise:void 0,Gw=typeof queueMicrotask=="function"?queueMicrotask:typeof tv<"u"?function(i){return tv.resolve(null).then(i).catch(qw)}:ev;function qw(i){setTimeout(function(){throw i})}function ts(i){return i==="head"}function iv(i,s){var a=s,o=0;do{var h=a.nextSibling;if(i.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"||a==="/&"){if(o===0){i.removeChild(h),Un(s);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")$a(i.ownerDocument.documentElement);else if(a==="head"){a=i.ownerDocument.head,$a(a);for(var p=a.firstChild;p;){var g=p.nextSibling,w=p.nodeName;p[la]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&p.rel.toLowerCase()==="stylesheet"||a.removeChild(p),p=g}}else a==="body"&&$a(i.ownerDocument.body);a=h}while(a);Un(s)}function rv(i,s){var a=i;i=0;do{var o=a.nextSibling;if(a.nodeType===1?s?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(s?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(i===0)break;i--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||i++;a=o}while(a)}function Jh(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var a=s;switch(s=s.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Jh(a),su(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}i.removeChild(a)}}function Ww(i,s,a,o){for(;i.nodeType===1;){var h=a;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!o&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(o){if(!i[la])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(p=i.getAttribute("rel"),p==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(p!==h.rel||i.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||i.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||i.getAttribute("title")!==(h.title==null?null:h.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(p=i.getAttribute("src"),(p!==(h.src==null?null:h.src)||i.getAttribute("type")!==(h.type==null?null:h.type)||i.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&i.getAttribute("name")===p)return i}else return i;if(i=Ni(i.nextSibling),i===null)break}return null}function Fw(i,s,a){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=Ni(i.nextSibling),i===null))return null;return i}function sv(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Ni(i.nextSibling),i===null))return null;return i}function ed(i){return i.data==="$?"||i.data==="$~"}function td(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function Yw(i,s){var a=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||a.readyState!=="loading")s();else{var o=function(){s(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),i._reactRetry=o}}function Ni(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var id=null;function nv(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var a=i.data;if(a==="/$"||a==="/&"){if(s===0)return Ni(i.nextSibling);s--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||s++}i=i.nextSibling}return null}function av(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var a=i.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(s===0)return i;s--}else a!=="/$"&&a!=="/&"||s++}i=i.previousSibling}return null}function lv(i,s,a){switch(s=zo(a),i){case"html":if(i=s.documentElement,!i)throw Error(n(452));return i;case"head":if(i=s.head,!i)throw Error(n(453));return i;case"body":if(i=s.body,!i)throw Error(n(454));return i;default:throw Error(n(451))}}function $a(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);su(i)}var Bi=new Map,ov=new Set;function Po(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var xr=W.d;W.d={f:Kw,r:Xw,D:Zw,C:Qw,L:Jw,m:eC,X:iC,S:tC,M:rC};function Kw(){var i=xr.f(),s=To();return i||s}function Xw(i){var s=nn(i);s!==null&&s.tag===5&&s.type==="form"?xm(s):xr.r(i)}var Pn=typeof document>"u"?null:document;function cv(i,s,a){var o=Pn;if(o&&typeof s=="string"&&s){var h=ki(s);h='link[rel="'+i+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),ov.has(h)||(ov.add(h),i={rel:i,crossOrigin:a,href:s},o.querySelector(h)===null&&(s=o.createElement("link"),Gt(s,"link",i),Lt(s),o.head.appendChild(s)))}}function Zw(i){xr.D(i),cv("dns-prefetch",i,null)}function Qw(i,s){xr.C(i,s),cv("preconnect",i,s)}function Jw(i,s,a){xr.L(i,s,a);var o=Pn;if(o&&i&&s){var h='link[rel="preload"][as="'+ki(s)+'"]';s==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+ki(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+ki(a.imageSizes)+'"]')):h+='[href="'+ki(i)+'"]';var p=h;switch(s){case"style":p=In(i);break;case"script":p=Hn(i)}Bi.has(p)||(i=m({rel:"preload",href:s==="image"&&a&&a.imageSrcSet?void 0:i,as:s},a),Bi.set(p,i),o.querySelector(h)!==null||s==="style"&&o.querySelector(Ga(p))||s==="script"&&o.querySelector(qa(p))||(s=o.createElement("link"),Gt(s,"link",i),Lt(s),o.head.appendChild(s)))}}function eC(i,s){xr.m(i,s);var a=Pn;if(a&&i){var o=s&&typeof s.as=="string"?s.as:"script",h='link[rel="modulepreload"][as="'+ki(o)+'"][href="'+ki(i)+'"]',p=h;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Hn(i)}if(!Bi.has(p)&&(i=m({rel:"modulepreload",href:i},s),Bi.set(p,i),a.querySelector(h)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(qa(p)))return}o=a.createElement("link"),Gt(o,"link",i),Lt(o),a.head.appendChild(o)}}}function tC(i,s,a){xr.S(i,s,a);var o=Pn;if(o&&i){var h=an(o).hoistableStyles,p=In(i);s=s||"default";var g=h.get(p);if(!g){var w={loading:0,preload:null};if(g=o.querySelector(Ga(p)))w.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":s},a),(a=Bi.get(p))&&rd(i,a);var A=g=o.createElement("link");Lt(A),Gt(A,"link",i),A._p=new Promise(function(z,V){A.onload=z,A.onerror=V}),A.addEventListener("load",function(){w.loading|=1}),A.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Io(g,s,o)}g={type:"stylesheet",instance:g,count:1,state:w},h.set(p,g)}}}function iC(i,s){xr.X(i,s);var a=Pn;if(a&&i){var o=an(a).hoistableScripts,h=Hn(i),p=o.get(h);p||(p=a.querySelector(qa(h)),p||(i=m({src:i,async:!0},s),(s=Bi.get(h))&&sd(i,s),p=a.createElement("script"),Lt(p),Gt(p,"link",i),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(h,p))}}function rC(i,s){xr.M(i,s);var a=Pn;if(a&&i){var o=an(a).hoistableScripts,h=Hn(i),p=o.get(h);p||(p=a.querySelector(qa(h)),p||(i=m({src:i,async:!0,type:"module"},s),(s=Bi.get(h))&&sd(i,s),p=a.createElement("script"),Lt(p),Gt(p,"link",i),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(h,p))}}function uv(i,s,a,o){var h=(h=pe.current)?Po(h):null;if(!h)throw Error(n(446));switch(i){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(s=In(a.href),a=an(h).hoistableStyles,o=a.get(s),o||(o={type:"style",instance:null,count:0,state:null},a.set(s,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){i=In(a.href);var p=an(h).hoistableStyles,g=p.get(i);if(g||(h=h.ownerDocument||h,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(i,g),(p=h.querySelector(Ga(i)))&&!p._p&&(g.instance=p,g.state.loading=5),Bi.has(i)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Bi.set(i,a),p||sC(h,i,a,g.state))),s&&o===null)throw Error(n(528,""));return g}if(s&&o!==null)throw Error(n(529,""));return null;case"script":return s=a.async,a=a.src,typeof a=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Hn(a),a=an(h).hoistableScripts,o=a.get(s),o||(o={type:"script",instance:null,count:0,state:null},a.set(s,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,i))}}function In(i){return'href="'+ki(i)+'"'}function Ga(i){return'link[rel="stylesheet"]['+i+"]"}function hv(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function sC(i,s,a,o){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?o.loading=1:(s=i.createElement("link"),o.preload=s,s.addEventListener("load",function(){return o.loading|=1}),s.addEventListener("error",function(){return o.loading|=2}),Gt(s,"link",a),Lt(s),i.head.appendChild(s))}function Hn(i){return'[src="'+ki(i)+'"]'}function qa(i){return"script[async]"+i}function dv(i,s,a){if(s.count++,s.instance===null)switch(s.type){case"style":var o=i.querySelector('style[data-href~="'+ki(a.href)+'"]');if(o)return s.instance=o,Lt(o),o;var h=m({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(i.ownerDocument||i).createElement("style"),Lt(o),Gt(o,"style",h),Io(o,a.precedence,i),s.instance=o;case"stylesheet":h=In(a.href);var p=i.querySelector(Ga(h));if(p)return s.state.loading|=4,s.instance=p,Lt(p),p;o=hv(a),(h=Bi.get(h))&&rd(o,h),p=(i.ownerDocument||i).createElement("link"),Lt(p);var g=p;return g._p=new Promise(function(w,A){g.onload=w,g.onerror=A}),Gt(p,"link",o),s.state.loading|=4,Io(p,a.precedence,i),s.instance=p;case"script":return p=Hn(a.src),(h=i.querySelector(qa(p)))?(s.instance=h,Lt(h),h):(o=a,(h=Bi.get(p))&&(o=m({},a),sd(o,h)),i=i.ownerDocument||i,h=i.createElement("script"),Lt(h),Gt(h,"link",o),i.head.appendChild(h),s.instance=h);case"void":return null;default:throw Error(n(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(o=s.instance,s.state.loading|=4,Io(o,a.precedence,i));return s.instance}function Io(i,s,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=o.length?o[o.length-1]:null,p=h,g=0;g<o.length;g++){var w=o[g];if(w.dataset.precedence===s)p=w;else if(p!==h)break}p?p.parentNode.insertBefore(i,p.nextSibling):(s=a.nodeType===9?a.head:a,s.insertBefore(i,s.firstChild))}function rd(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function sd(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Ho=null;function fv(i,s,a){if(Ho===null){var o=new Map,h=Ho=new Map;h.set(a,o)}else h=Ho,o=h.get(a),o||(o=new Map,h.set(a,o));if(o.has(i))return o;for(o.set(i,null),a=a.getElementsByTagName(i),h=0;h<a.length;h++){var p=a[h];if(!(p[la]||p[Ut]||i==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var g=p.getAttribute(s)||"";g=i+g;var w=o.get(g);w?w.push(p):o.set(g,[p])}}return o}function _v(i,s,a){i=i.ownerDocument||i,i.head.insertBefore(a,s==="title"?i.querySelector("head > title"):null)}function nC(i,s,a){if(a===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function pv(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function aC(i,s,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var h=In(o.href),p=s.querySelector(Ga(h));if(p){s=p._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Uo.bind(i),s.then(i,i)),a.state.loading|=4,a.instance=p,Lt(p);return}p=s.ownerDocument||s,o=hv(o),(h=Bi.get(h))&&rd(o,h),p=p.createElement("link"),Lt(p);var g=p;g._p=new Promise(function(w,A){g.onload=w,g.onerror=A}),Gt(p,"link",o),a.instance=p}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(a,s),(s=a.state.preload)&&(a.state.loading&3)===0&&(i.count++,a=Uo.bind(i),s.addEventListener("load",a),s.addEventListener("error",a))}}var nd=0;function lC(i,s){return i.stylesheets&&i.count===0&&Vo(i,i.stylesheets),0<i.count||0<i.imgCount?function(a){var o=setTimeout(function(){if(i.stylesheets&&Vo(i,i.stylesheets),i.unsuspend){var p=i.unsuspend;i.unsuspend=null,p()}},6e4+s);0<i.imgBytes&&nd===0&&(nd=62500*jw());var h=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Vo(i,i.stylesheets),i.unsuspend)){var p=i.unsuspend;i.unsuspend=null,p()}},(i.imgBytes>nd?50:800)+s);return i.unsuspend=a,function(){i.unsuspend=null,clearTimeout(o),clearTimeout(h)}}:null}function Uo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vo(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var jo=null;function Vo(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,jo=new Map,s.forEach(oC,i),jo=null,Uo.call(i))}function oC(i,s){if(!(s.state.loading&4)){var a=jo.get(i);if(a)var o=a.get(null);else{a=new Map,jo.set(i,a);for(var h=i.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var g=h[p];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(a.set(g.dataset.precedence,g),o=g)}o&&a.set(null,o)}h=s.instance,g=h.getAttribute("data-precedence"),p=a.get(g)||o,p===o&&a.set(null,h),a.set(g,h),this.count++,o=Uo.bind(this),h.addEventListener("load",o),h.addEventListener("error",o),p?p.parentNode.insertBefore(h,p.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(h,i.firstChild)),s.state.loading|=4}}var Wa={$$typeof:B,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function cC(i,s,a,o,h,p,g,w,A){this.tag=1,this.containerInfo=i,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=eu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=eu(0),this.hiddenUpdates=eu(null),this.identifierPrefix=o,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function mv(i,s,a,o,h,p,g,w,A,z,V,Z){return i=new cC(i,s,a,g,A,z,V,Z,w),s=1,p===!0&&(s|=24),p=gi(3,null,null,s),i.current=p,p.stateNode=i,s=Iu(),s.refCount++,i.pooledCache=s,s.refCount++,p.memoizedState={element:o,isDehydrated:a,cache:s},Vu(p),i}function gv(i){return i?(i=mn,i):mn}function vv(i,s,a,o,h,p){h=gv(h),o.context===null?o.context=h:o.pendingContext=h,o=Gr(s),o.payload={element:a},p=p===void 0?null:p,p!==null&&(o.callback=p),a=qr(i,o,s),a!==null&&(ci(a,i,s),Ea(a,i,s))}function yv(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var a=i.retryLane;i.retryLane=a!==0&&a<s?a:s}}function ad(i,s){yv(i,s),(i=i.alternate)&&yv(i,s)}function Sv(i){if(i.tag===13||i.tag===31){var s=xs(i,67108864);s!==null&&ci(s,i,67108864),ad(i,67108864)}}function bv(i){if(i.tag===13||i.tag===31){var s=wi();s=tu(s);var a=xs(i,s);a!==null&&ci(a,i,s),ad(i,s)}}var $o=!0;function uC(i,s,a,o){var h=D.T;D.T=null;var p=W.p;try{W.p=2,ld(i,s,a,o)}finally{W.p=p,D.T=h}}function hC(i,s,a,o){var h=D.T;D.T=null;var p=W.p;try{W.p=8,ld(i,s,a,o)}finally{W.p=p,D.T=h}}function ld(i,s,a,o){if($o){var h=od(o);if(h===null)Fh(i,s,o,Go,a),Cv(i,o);else if(fC(h,i,s,a,o))o.stopPropagation();else if(Cv(i,o),s&4&&-1<dC.indexOf(i)){for(;h!==null;){var p=nn(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var g=Ss(p.pendingLanes);if(g!==0){var w=p;for(w.pendingLanes|=2,w.entangledLanes|=2;g;){var A=1<<31-pi(g);w.entanglements[1]|=A,g&=~A}Ji(p),(Ve&6)===0&&(Ao=fi()+500,Ua(0))}}break;case 31:case 13:w=xs(p,2),w!==null&&ci(w,p,2),To(),ad(p,2)}if(p=od(o),p===null&&Fh(i,s,o,Go,a),p===h)break;h=p}h!==null&&o.stopPropagation()}else Fh(i,s,o,null,a)}}function od(i){return i=uu(i),cd(i)}var Go=null;function cd(i){if(Go=null,i=sn(i),i!==null){var s=c(i);if(s===null)i=null;else{var a=s.tag;if(a===13){if(i=u(s),i!==null)return i;i=null}else if(a===31){if(i=d(s),i!==null)return i;i=null}else if(a===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Go=i,null}function wv(i){switch(i){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(Zb()){case D_:return 2;case L_:return 8;case Ol:case Qb:return 32;case O_:return 268435456;default:return 32}default:return 32}}var ud=!1,is=null,rs=null,ss=null,Fa=new Map,Ya=new Map,ns=[],dC="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 Cv(i,s){switch(i){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":rs=null;break;case"mouseover":case"mouseout":ss=null;break;case"pointerover":case"pointerout":Fa.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ya.delete(s.pointerId)}}function Ka(i,s,a,o,h,p){return i===null||i.nativeEvent!==p?(i={blockedOn:s,domEventName:a,eventSystemFlags:o,nativeEvent:p,targetContainers:[h]},s!==null&&(s=nn(s),s!==null&&Sv(s)),i):(i.eventSystemFlags|=o,s=i.targetContainers,h!==null&&s.indexOf(h)===-1&&s.push(h),i)}function fC(i,s,a,o,h){switch(s){case"focusin":return is=Ka(is,i,s,a,o,h),!0;case"dragenter":return rs=Ka(rs,i,s,a,o,h),!0;case"mouseover":return ss=Ka(ss,i,s,a,o,h),!0;case"pointerover":var p=h.pointerId;return Fa.set(p,Ka(Fa.get(p)||null,i,s,a,o,h)),!0;case"gotpointercapture":return p=h.pointerId,Ya.set(p,Ka(Ya.get(p)||null,i,s,a,o,h)),!0}return!1}function Ev(i){var s=sn(i.target);if(s!==null){var a=c(s);if(a!==null){if(s=a.tag,s===13){if(s=u(a),s!==null){i.blockedOn=s,I_(i.priority,function(){bv(a)});return}}else if(s===31){if(s=d(a),s!==null){i.blockedOn=s,I_(i.priority,function(){bv(a)});return}}else if(s===3&&a.stateNode.current.memoizedState.isDehydrated){i.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}i.blockedOn=null}function qo(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var a=od(i.nativeEvent);if(a===null){a=i.nativeEvent;var o=new a.constructor(a.type,a);cu=o,a.target.dispatchEvent(o),cu=null}else return s=nn(a),s!==null&&Sv(s),i.blockedOn=a,!1;s.shift()}return!0}function xv(i,s,a){qo(i)&&a.delete(s)}function _C(){ud=!1,is!==null&&qo(is)&&(is=null),rs!==null&&qo(rs)&&(rs=null),ss!==null&&qo(ss)&&(ss=null),Fa.forEach(xv),Ya.forEach(xv)}function Wo(i,s){i.blockedOn===s&&(i.blockedOn=null,ud||(ud=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,_C)))}var Fo=null;function Av(i){Fo!==i&&(Fo=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fo===i&&(Fo=null);for(var s=0;s<i.length;s+=3){var a=i[s],o=i[s+1],h=i[s+2];if(typeof o!="function"){if(cd(o||a)===null)continue;break}var p=nn(a);p!==null&&(i.splice(s,3),s-=3,oh(p,{pending:!0,data:h,method:a.method,action:o},o,h))}}))}function Un(i){function s(A){return Wo(A,i)}is!==null&&Wo(is,i),rs!==null&&Wo(rs,i),ss!==null&&Wo(ss,i),Fa.forEach(s),Ya.forEach(s);for(var a=0;a<ns.length;a++){var o=ns[a];o.blockedOn===i&&(o.blockedOn=null)}for(;0<ns.length&&(a=ns[0],a.blockedOn===null);)Ev(a),a.blockedOn===null&&ns.shift();if(a=(i.ownerDocument||i).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var h=a[o],p=a[o+1],g=h[ri]||null;if(typeof p=="function")g||Av(a);else if(g){var w=null;if(p&&p.hasAttribute("formAction")){if(h=p,g=p[ri]||null)w=g.formAction;else if(cd(h)!==null)continue}else w=g.action;typeof w=="function"?a[o+1]=w:(a.splice(o,3),o-=3),Av(a)}}}function kv(){function i(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(g){return h=g})},focusReset:"manual",scroll:"manual"})}function s(){h!==null&&(h(),h=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,h=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),h!==null&&(h(),h=null)}}}function hd(i){this._internalRoot=i}Yo.prototype.render=hd.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(n(409));var a=s.current,o=wi();vv(a,o,i,s,null,null)},Yo.prototype.unmount=hd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;vv(i.current,2,null,i,null,null),To(),s[rn]=null}};function Yo(i){this._internalRoot=i}Yo.prototype.unstable_scheduleHydration=function(i){if(i){var s=P_();i={blockedOn:null,target:i,priority:s};for(var a=0;a<ns.length&&s!==0&&s<ns[a].priority;a++);ns.splice(a,0,i),a===0&&Ev(i)}};var Tv=t.version;if(Tv!=="19.2.4")throw Error(n(527,Tv,"19.2.4"));W.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=f(s),i=i!==null?v(i):null,i=i===null?null:i.stateNode,i};var pC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ko=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ko.isDisabled&&Ko.supportsFiber)try{sa=Ko.inject(pC),_i=Ko}catch{}}return Za.createRoot=function(i,s){if(!l(i))throw Error(n(299));var a=!1,o="",h=Bm,p=zm,g=Pm;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(o=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(p=s.onCaughtError),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=mv(i,1,!1,null,null,a,o,null,h,p,g,kv),i[rn]=s.current,Wh(i),new hd(s)},Za.hydrateRoot=function(i,s,a){if(!l(i))throw Error(n(299));var o=!1,h="",p=Bm,g=zm,w=Pm,A=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.formState!==void 0&&(A=a.formState)),s=mv(i,1,!0,s,a??null,o,h,A,p,g,w,kv),s.context=gv(null),a=s.current,o=wi(),o=tu(o),h=Gr(o),h.callback=null,qr(a,h,o),a=o,s.current.lanes=a,aa(s,a),Ji(s),i[rn]=s.current,Wh(i),new Yo(s)},Za.version="19.2.4",Za}var Uv;function RC(){if(Uv)return md.exports;Uv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),md.exports=TC(),md.exports}var DC=RC();class LC{constructor(t){F(this,"ws");F(this,"onopen",null);F(this,"onmessage",null);F(this,"onclose",null);this.ws=new WebSocket(t),this.ws.onopen=()=>{var r;return(r=this.onopen)==null?void 0:r.call(this)},this.ws.onmessage=r=>{var n;try{(n=this.onmessage)==null||n.call(this,JSON.parse(r.data))}catch{}},this.ws.onclose=()=>{var r;return(r=this.onclose)==null?void 0:r.call(this)},this.ws.onerror=()=>{}}get readyState(){return this.ws.readyState}send(t){this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(t))}close(){this.ws.close()}}function OC(e){const t=location.protocol==="https:"?"wss:":"ws:";return new LC(`${t}//${location.host}/?sessionId=${e}`)}function MC({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),k.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),k.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),k.jsx("line",{x1:"8",y1:"22",x2:"16",y2:"22"})]})}function NC({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"}),k.jsx("line",{x1:"6",y1:"9",x2:"6",y2:"9"}),k.jsx("line",{x1:"10",y1:"9",x2:"10",y2:"9"}),k.jsx("line",{x1:"14",y1:"9",x2:"14",y2:"9"}),k.jsx("line",{x1:"18",y1:"9",x2:"18",y2:"9"}),k.jsx("line",{x1:"6",y1:"13",x2:"6",y2:"13"}),k.jsx("line",{x1:"18",y1:"13",x2:"18",y2:"13"}),k.jsx("line",{x1:"9",y1:"13",x2:"15",y2:"13"})]})}function BC({size:e=14,color:t="currentColor"}){return k.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:t,stroke:"none",children:k.jsx("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})})}function zC({size:e=14,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.5",strokeLinecap:"round",children:[k.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),k.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]})}function R0({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),k.jsx("polygon",{points:"10 8 16 12 10 16"})]})}function PC({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),k.jsx("line",{x1:"7",y1:"8",x2:"17",y2:"8"}),k.jsx("line",{x1:"7",y1:"12",x2:"14",y2:"12"}),k.jsx("line",{x1:"7",y1:"16",x2:"17",y2:"16"})]})}function D0({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),k.jsx("path",{d:"M12 8v8"}),k.jsx("path",{d:"M8 12h8"})]})}function L0({size:e=14,color:t="currentColor"}){return k.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:k.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function IC({size:e=10,color:t="currentColor"}){return k.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:k.jsx("polyline",{points:"9 6 15 12 9 18"})})}function _l({size:e=14,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),k.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function HC({size:e=14,color:t="currentColor"}){return k.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:k.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function O0({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),k.jsx("polyline",{points:"7 9 10 12 7 15"}),k.jsx("line",{x1:"13",y1:"15",x2:"17",y2:"15"})]})}function UC({size:e=14,color:t="currentColor"}){return k.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:t,stroke:"none",children:k.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function jC({activeTab:e,onTabChange:t,changeCount:r}){return k.jsxs("nav",{className:"tab-bar",children:[k.jsx("div",{className:"tab-spacer"}),k.jsxs("button",{className:`tab-item ${e==="preview"?"active":""}`,onClick:()=>t("preview"),children:[k.jsx("span",{className:"tab-icon",children:k.jsx(R0,{})}),k.jsx("span",{className:"tab-label",children:"预览"})]}),k.jsxs("button",{className:`tab-item ${e==="terminal"?"active":""}`,onClick:()=>t("terminal"),children:[k.jsx("span",{className:"tab-icon",children:k.jsx(O0,{})}),k.jsx("span",{className:"tab-label",children:"终端"})]}),k.jsxs("button",{className:`tab-item ${e==="files"?"active":""}`,onClick:()=>t("files"),children:[k.jsx("span",{className:"tab-icon",children:k.jsx(PC,{})}),k.jsx("span",{className:"tab-label",children:"文件"})]}),k.jsxs("button",{className:`tab-item ${e==="changes"?"active":""}`,onClick:()=>t("changes"),children:[k.jsxs("span",{className:"tab-icon",children:[k.jsx(D0,{}),r!==void 0&&r>0&&k.jsx("span",{className:"tab-badge",children:r})]}),k.jsx("span",{className:"tab-label",children:"变更"})]})]})}var Xd=Object.defineProperty,VC=Object.getOwnPropertyDescriptor,$C=Object.getOwnPropertyNames,GC=Object.prototype.hasOwnProperty,e_=(e,t)=>{let r={};for(var n in e)Xd(r,n,{get:e[n],enumerable:!0});return Xd(r,Symbol.toStringTag,{value:"Module"}),r},qC=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var l=$C(t),c=0,u=l.length,d;c<u;c++)d=l[c],!GC.call(e,d)&&d!==r&&Xd(e,d,{get:(_=>t[_]).bind(null,d),enumerable:!(n=VC(t,d))||n.enumerable});return e},M0=(e,t,r)=>(qC(e,t,"default"),r);const WC="modulepreload",FC=function(e){return"/"+e},jv={},C=function(t,r,n){let l=Promise.resolve();if(r&&r.length>0){let u=function(f){return Promise.all(f.map(v=>Promise.resolve(v).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),_=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));l=u(r.map(f=>{if(f=FC(f),f in jv)return;jv[f]=!0;const v=f.endsWith(".css"),m=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":WC,v||(y.as="script"),y.crossOrigin="",y.href=f,_&&y.setAttribute("nonce",_),document.head.appendChild(y),v)return new Promise((S,b)=>{y.addEventListener("load",S),y.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function c(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return l.then(u=>{for(const d of u||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})},Ic=[{id:"abap",name:"ABAP",import:(()=>C(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>C(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>C(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>C(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>C(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>C(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>C(()=>import("./apex-D8_7TLub.js"),[]))},{id:"apl",name:"APL",import:(()=>C(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>C(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>C(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>C(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>C(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>C(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>C(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>C(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>C(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>C(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>C(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>C(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>C(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>C(()=>import("./bird2-BIv1doCn.js"),[]))},{id:"blade",name:"Blade",import:(()=>C(()=>import("./blade-BjGOyj-B.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>C(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>C(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>C(()=>import("./c3-eo99z4R2.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>C(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>C(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>C(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>C(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>C(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>C(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>C(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>C(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>C(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>C(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>C(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>C(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>C(()=>import("./crystal-DNxU26gB.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>C(()=>import("./csharp-COcwbKMJ.js"),[]))},{id:"css",name:"CSS",import:(()=>C(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>C(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>C(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>C(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>C(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>C(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>C(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>C(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>C(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>C(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>C(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>C(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>C(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>C(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>C(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>C(()=>import("./emacs-lisp-CXvaQtF9.js"),[]))},{id:"erb",name:"ERB",import:(()=>C(()=>import("./erb-BYCe7drp.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>C(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>C(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>C(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>C(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>C(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>C(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>C(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>C(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>C(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>C(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>C(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>C(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>C(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>C(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>C(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>C(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>C(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>C(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>C(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>C(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>C(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>C(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>C(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>C(()=>import("./hack-i7_Ulhet.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>C(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>C(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>C(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>C(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>C(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>C(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>C(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>C(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>C(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>C(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>C(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>C(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>C(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>C(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>C(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>C(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>C(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>C(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>C(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>C(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>C(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>C(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>C(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>C(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>C(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>C(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>C(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>C(()=>import("./just-VxiPbLrw.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>C(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>C(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>C(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>C(()=>import("./latex-CWtU0Tv5.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>C(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>C(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>C(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>C(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>C(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>C(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>C(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>C(()=>import("./luau-C-HG3fhB.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>C(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>C(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>C(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>C(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>C(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>C(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>C(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>C(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>C(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>C(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>C(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>C(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>C(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>C(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>C(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>C(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>C(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>C(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>C(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>C(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>C(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>C(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>C(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>C(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>C(()=>import("./perl-NvoQZIq0.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>C(()=>import("./php-R6g_5hLQ.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>C(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>C(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>C(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>C(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>C(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>C(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>C(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>C(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>C(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>C(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>C(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>C(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>C(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>C(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>C(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>C(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>C(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>C(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>C(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>C(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>C(()=>import("./razor-BDqjjVU7.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>C(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>C(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>C(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>C(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>C(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>C(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>C(()=>import("./rst-CRjBmOyv.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>C(()=>import("./ruby-Wjq7vjNf.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>C(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>C(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>C(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>C(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>C(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>C(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>C(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>C(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>C(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>C(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>C(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>C(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>C(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>C(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>C(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>C(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>C(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>C(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>C(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>C(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>C(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>C(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>C(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>C(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>C(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>C(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>C(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>C(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>C(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>C(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>C(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>C(()=>import("./ts-tags-DQrlYJgV.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>C(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>C(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>C(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>C(()=>import("./twig-xg9kU7Mw.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>C(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>C(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>C(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>C(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>C(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>C(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>C(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>C(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>C(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>C(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>C(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>C(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>C(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>C(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>C(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>C(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>C(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>C(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>C(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>C(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>C(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>C(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>C(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>C(()=>import("./zig-VOosw3JB.js"),[]))}],t_=Object.fromEntries(Ic.map(e=>[e.id,e.import])),i_=Object.fromEntries(Ic.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(r=>[r,e.import]))||[]})),r_={...t_,...i_},s_=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>C(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>C(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>C(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>C(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>C(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>C(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>C(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>C(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>C(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>C(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>C(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>C(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>C(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>C(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>C(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>C(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>C(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>C(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>C(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>C(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>C(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>C(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>C(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>C(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>C(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>C(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>C(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>C(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>C(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>C(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>C(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>C(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>C(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>C(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>C(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>C(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>C(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>C(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>C(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>C(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>C(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>C(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>C(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>C(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>C(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>C(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>C(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>C(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>C(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>C(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>C(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>C(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>C(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>C(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>C(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>C(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>C(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>C(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>C(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>C(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>C(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>C(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],n_=Object.fromEntries(s_.map(e=>[e.id,e.import]));var a_=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function YC(){return 2147483648}function KC(){return typeof performance<"u"?performance.now():Date.now()}const XC=(e,t)=>e+(t-e%t)%t;async function ZC(e){let t,r;const n={};function l(S){r=S,n.HEAPU8=new Uint8Array(S),n.HEAPU32=new Uint32Array(S)}function c(S,b,E){n.HEAPU8.copyWithin(S,b,b+E)}function u(S){try{return t.grow(S-r.byteLength+65535>>>16),l(t.buffer),1}catch{}}function d(S){const b=n.HEAPU8.length;S=S>>>0;const E=YC();if(S>E)return!1;for(let T=1;T<=4;T*=2){let O=b*(1+.2/T);O=Math.min(O,S+100663296);const H=Math.min(E,XC(Math.max(S,O),65536));if(u(H))return!0}return!1}const _=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function f(S,b,E=1024){const T=b+E;let O=b;for(;S[O]&&!(O>=T);)++O;if(O-b>16&&S.buffer&&_)return _.decode(S.subarray(b,O));let H="";for(;b<O;){let B=S[b++];if(!(B&128)){H+=String.fromCharCode(B);continue}const I=S[b++]&63;if((B&224)===192){H+=String.fromCharCode((B&31)<<6|I);continue}const j=S[b++]&63;if((B&240)===224?B=(B&15)<<12|I<<6|j:B=(B&7)<<18|I<<12|j<<6|S[b++]&63,B<65536)H+=String.fromCharCode(B);else{const Y=B-65536;H+=String.fromCharCode(55296|Y>>10,56320|Y&1023)}}return H}function v(S,b){return S?f(n.HEAPU8,S,b):""}const m={emscripten_get_now:KC,emscripten_memcpy_big:c,emscripten_resize_heap:d,fd_write:()=>0};async function y(){const b=await e({env:m,wasi_snapshot_preview1:m});t=b.memory,l(t.buffer),Object.assign(n,b),n.UTF8ToString=v}return await y(),n}var QC=Object.defineProperty,JC=(e,t,r)=>t in e?QC(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kt=(e,t,r)=>JC(e,typeof t!="symbol"?t+"":t,r);let Mt=null;function eE(e){throw new a_(e.UTF8ToString(e.getLastOnigError()))}class Hc{constructor(t){kt(this,"utf16Length"),kt(this,"utf8Length"),kt(this,"utf16Value"),kt(this,"utf8Value"),kt(this,"utf16OffsetToUtf8"),kt(this,"utf8OffsetToUtf16");const r=t.length,n=Hc._utf8ByteLength(t),l=n!==r,c=l?new Uint32Array(r+1):null;l&&(c[r]=n);const u=l?new Uint32Array(n+1):null;l&&(u[n]=r);const d=new Uint8Array(n);let _=0;for(let f=0;f<r;f++){const v=t.charCodeAt(f);let m=v,y=!1;if(v>=55296&&v<=56319&&f+1<r){const S=t.charCodeAt(f+1);S>=56320&&S<=57343&&(m=(v-55296<<10)+65536|S-56320,y=!0)}l&&(c[f]=_,y&&(c[f+1]=_),m<=127?u[_+0]=f:m<=2047?(u[_+0]=f,u[_+1]=f):m<=65535?(u[_+0]=f,u[_+1]=f,u[_+2]=f):(u[_+0]=f,u[_+1]=f,u[_+2]=f,u[_+3]=f)),m<=127?d[_++]=m:m<=2047?(d[_++]=192|(m&1984)>>>6,d[_++]=128|(m&63)>>>0):m<=65535?(d[_++]=224|(m&61440)>>>12,d[_++]=128|(m&4032)>>>6,d[_++]=128|(m&63)>>>0):(d[_++]=240|(m&1835008)>>>18,d[_++]=128|(m&258048)>>>12,d[_++]=128|(m&4032)>>>6,d[_++]=128|(m&63)>>>0),y&&f++}this.utf16Length=r,this.utf8Length=n,this.utf16Value=t,this.utf8Value=d,this.utf16OffsetToUtf8=c,this.utf8OffsetToUtf16=u}static _utf8ByteLength(t){let r=0;for(let n=0,l=t.length;n<l;n++){const c=t.charCodeAt(n);let u=c,d=!1;if(c>=55296&&c<=56319&&n+1<l){const _=t.charCodeAt(n+1);_>=56320&&_<=57343&&(u=(c-55296<<10)+65536|_-56320,d=!0)}u<=127?r+=1:u<=2047?r+=2:u<=65535?r+=3:r+=4,d&&n++}return r}createString(t){const r=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,r),r}}const Uc=class ir{constructor(t){if(kt(this,"id",++ir.LAST_ID),kt(this,"_onigBinding"),kt(this,"content"),kt(this,"utf16Length"),kt(this,"utf8Length"),kt(this,"utf16OffsetToUtf8"),kt(this,"utf8OffsetToUtf16"),kt(this,"ptr"),!Mt)throw new a_("Must invoke loadWasm first.");this._onigBinding=Mt,this.content=t;const r=new Hc(t);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!ir._sharedPtrInUse?(ir._sharedPtr||(ir._sharedPtr=Mt.omalloc(1e4)),ir._sharedPtrInUse=!0,Mt.HEAPU8.set(r.utf8Value,ir._sharedPtr),this.ptr=ir._sharedPtr):this.ptr=r.createString(Mt)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===ir._sharedPtr?ir._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};kt(Uc,"LAST_ID",0);kt(Uc,"_sharedPtr",0);kt(Uc,"_sharedPtrInUse",!1);let N0=Uc;class tE{constructor(t){if(kt(this,"_onigBinding"),kt(this,"_ptr"),!Mt)throw new a_("Must invoke loadWasm first.");const r=[],n=[];for(let d=0,_=t.length;d<_;d++){const f=new Hc(t[d]);r[d]=f.createString(Mt),n[d]=f.utf8Length}const l=Mt.omalloc(4*t.length);Mt.HEAPU32.set(r,l/4);const c=Mt.omalloc(4*t.length);Mt.HEAPU32.set(n,c/4);const u=Mt.createOnigScanner(l,c,t.length);for(let d=0,_=t.length;d<_;d++)Mt.ofree(r[d]);Mt.ofree(c),Mt.ofree(l),u===0&&eE(Mt),this._onigBinding=Mt,this._ptr=u}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,r,n){let l=0;if(typeof n=="number"&&(l=n),typeof t=="string"){t=new N0(t);const c=this._findNextMatchSync(t,r,!1,l);return t.dispose(),c}return this._findNextMatchSync(t,r,!1,l)}_findNextMatchSync(t,r,n,l){const c=this._onigBinding,u=c.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(r),l);if(u===0)return null;const d=c.HEAPU32;let _=u/4;const f=d[_++],v=d[_++],m=[];for(let y=0;y<v;y++){const S=t.convertUtf8OffsetToUtf16(d[_++]),b=t.convertUtf8OffsetToUtf16(d[_++]);m[y]={start:S,end:b,length:b-S}}return{index:f,captureIndices:m}}}function iE(e){return typeof e.instantiator=="function"}function rE(e){return typeof e.default=="function"}function sE(e){return typeof e.data<"u"}function nE(e){return typeof Response<"u"&&e instanceof Response}function aE(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Xo;function l_(e){if(Xo)return Xo;async function t(){Mt=await ZC(async r=>{let n=e;return n=await n,typeof n=="function"&&(n=await n(r)),typeof n=="function"&&(n=await n(r)),iE(n)?n=await n.instantiator(r):rE(n)?n=await n.default(r):(sE(n)&&(n=n.data),nE(n)?typeof WebAssembly.instantiateStreaming=="function"?n=await lE(n)(r):n=await oE(n)(r):aE(n)?n=await Sd(n)(r):n instanceof WebAssembly.Module?n=await Sd(n)(r):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await Sd(n.default)(r))),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}return Xo=t(),Xo}function Sd(e){return t=>WebAssembly.instantiate(e,t)}function lE(e){return t=>WebAssembly.instantiateStreaming(e,t)}function oE(e){return async t=>{const r=await e.arrayBuffer();return WebAssembly.instantiate(r,t)}}let B0;function cE(e){B0=e}function uE(){return B0}async function z0(e){return e&&await l_(e),{createScanner(t){return new tE(t.map(r=>typeof r=="string"?r:r.source))},createString(t){return new N0(t)}}}const hE=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:z0,getDefaultWasmLoader:uE,loadWasm:l_,setDefaultWasmLoader:cE},Symbol.toStringTag,{value:"Module"}));var P0=e_({});M0(P0,hE);var et=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function dE(e){return o_(e)}function o_(e){return Array.isArray(e)?fE(e):e instanceof RegExp?e:typeof e=="object"?_E(e):e}function fE(e){let t=[];for(let r=0,n=e.length;r<n;r++)t[r]=o_(e[r]);return t}function _E(e){let t={};for(let r in e)t[r]=o_(e[r]);return t}function I0(e,...t){return t.forEach(r=>{for(let n in r)e[n]=r[n]}),e}function H0(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?H0(e.substring(0,e.length-1)):e.substr(~t+1)}var bd=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Zo=class{static hasCaptures(e){return e===null?!1:(bd.lastIndex=0,bd.test(e))}static replaceCaptures(e,t,r){return e.replace(bd,(n,l,c,u)=>{let d=r[parseInt(l||c,10)];if(d){let _=t.substring(d.start,d.end);for(;_[0]===".";)_=_.substring(1);switch(u){case"downcase":return _.toLowerCase();case"upcase":return _.toUpperCase();default:return _}}else return n})}};function U0(e,t){return e<t?-1:e>t?1:0}function j0(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let r=e.length,n=t.length;if(r===n){for(let l=0;l<r;l++){let c=U0(e[l],t[l]);if(c!==0)return c}return 0}return r-n}function Vv(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function V0(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var $0=class{constructor(e){F(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},bc=class{constructor(e,t,r){F(this,"_cachedMatchRoot",new $0(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(gE(e),t)}static createFromParsedTheme(e,t){return yE(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(l=>pE(e.parent,l.parentScopes));return n?new G0(n.fontStyle,n.foreground,n.background):null}},wd=class uc{constructor(t,r){this.parent=t,this.scopeName=r}static push(t,r){for(const n of r)t=new uc(t,n);return t}static from(...t){let r=null;for(let n=0;n<t.length;n++)r=new uc(r,t[n]);return r}push(t){return new uc(this,t)}getSegments(){let t=this;const r=[];for(;t;)r.push(t.scopeName),t=t.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const r=[];let n=this;for(;n&&n!==t;)r.push(n.scopeName),n=n.parent;return n===t?r.reverse():void 0}};function pE(e,t){if(t.length===0)return!0;for(let r=0;r<t.length;r++){let n=t[r],l=!1;if(n===">"){if(r===t.length-1)return!1;n=t[++r],l=!0}for(;e&&!mE(e.scopeName,n);){if(l)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function mE(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var G0=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}};function gE(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],n=0;for(let l=0,c=t.length;l<c;l++){let u=t[l];if(!u.settings)continue;let d;if(typeof u.scope=="string"){let m=u.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),d=m.split(",")}else Array.isArray(u.scope)?d=u.scope:d=[""];let _=-1;if(typeof u.settings.fontStyle=="string"){_=0;let m=u.settings.fontStyle.split(" ");for(let y=0,S=m.length;y<S;y++)switch(m[y]){case"italic":_=_|1;break;case"bold":_=_|2;break;case"underline":_=_|4;break;case"strikethrough":_=_|8;break}}let f=null;typeof u.settings.foreground=="string"&&Vv(u.settings.foreground)&&(f=u.settings.foreground);let v=null;typeof u.settings.background=="string"&&Vv(u.settings.background)&&(v=u.settings.background);for(let m=0,y=d.length;m<y;m++){let b=d[m].trim().split(" "),E=b[b.length-1],T=null;b.length>1&&(T=b.slice(0,b.length-1),T.reverse()),r[n++]=new vE(E,T,l,_,f,v)}}return r}var vE=class{constructor(e,t,r,n,l,c){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=n,this.foreground=l,this.background=c}},Zt=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Zt||{});function yE(e,t){e.sort((_,f)=>{let v=U0(_.scope,f.scope);return v!==0||(v=j0(_.parentScopes,f.parentScopes),v!==0)?v:_.index-f.index});let r=0,n="#000000",l="#ffffff";for(;e.length>=1&&e[0].scope==="";){let _=e.shift();_.fontStyle!==-1&&(r=_.fontStyle),_.foreground!==null&&(n=_.foreground),_.background!==null&&(l=_.background)}let c=new SE(t),u=new G0(r,c.getId(n),c.getId(l)),d=new wE(new Zd(0,null,-1,0,0),[]);for(let _=0,f=e.length;_<f;_++){let v=e[_];d.insert(0,v.scope,v.parentScopes,v.fontStyle,c.getId(v.foreground),c.getId(v.background))}return new bc(c,u,d)}var SE=class{constructor(e){F(this,"_isFrozen");F(this,"_lastColorId");F(this,"_id2color");F(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,r=e.length;t<r;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},bE=Object.freeze([]),Zd=class q0{constructor(t,r,n,l,c){F(this,"scopeDepth");F(this,"parentScopes");F(this,"fontStyle");F(this,"foreground");F(this,"background");this.scopeDepth=t,this.parentScopes=r||bE,this.fontStyle=n,this.foreground=l,this.background=c}clone(){return new q0(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let r=[];for(let n=0,l=t.length;n<l;n++)r[n]=t[n].clone();return r}acceptOverwrite(t,r,n,l){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),l!==0&&(this.background=l)}},wE=class Qd{constructor(t,r=[],n={}){F(this,"_rulesWithParentScopes");this._mainRule=t,this._children=n,this._rulesWithParentScopes=r}static _cmpBySpecificity(t,r){if(t.scopeDepth!==r.scopeDepth)return r.scopeDepth-t.scopeDepth;let n=0,l=0;for(;t.parentScopes[n]===">"&&n++,r.parentScopes[l]===">"&&l++,!(n>=t.parentScopes.length||l>=r.parentScopes.length);){const c=r.parentScopes[l].length-t.parentScopes[n].length;if(c!==0)return c;n++,l++}return r.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let n=t.indexOf("."),l,c;if(n===-1?(l=t,c=""):(l=t.substring(0,n),c=t.substring(n+1)),this._children.hasOwnProperty(l))return this._children[l].match(c)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Qd._cmpBySpecificity),r}insert(t,r,n,l,c,u){if(r===""){this._doInsertHere(t,n,l,c,u);return}let d=r.indexOf("."),_,f;d===-1?(_=r,f=""):(_=r.substring(0,d),f=r.substring(d+1));let v;this._children.hasOwnProperty(_)?v=this._children[_]:(v=new Qd(this._mainRule.clone(),Zd.cloneArr(this._rulesWithParentScopes)),this._children[_]=v),v.insert(t+1,f,n,l,c,u)}_doInsertHere(t,r,n,l,c){if(r===null){this._mainRule.acceptOverwrite(t,n,l,c);return}for(let u=0,d=this._rulesWithParentScopes.length;u<d;u++){let _=this._rulesWithParentScopes[u];if(j0(_.parentScopes,r)===0){_.acceptOverwrite(t,n,l,c);return}}n===-1&&(n=this._mainRule.fontStyle),l===0&&(l=this._mainRule.foreground),c===0&&(c=this._mainRule.background),this._rulesWithParentScopes.push(new Zd(t,r,n,l,c))}},Xn=class Pi{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const r=Pi.getLanguageId(t),n=Pi.getTokenType(t),l=Pi.getFontStyle(t),c=Pi.getForeground(t),u=Pi.getBackground(t);console.log({languageId:r,tokenType:n,fontStyle:l,foreground:c,background:u})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,r,n,l,c,u,d){let _=Pi.getLanguageId(t),f=Pi.getTokenType(t),v=Pi.containsBalancedBrackets(t)?1:0,m=Pi.getFontStyle(t),y=Pi.getForeground(t),S=Pi.getBackground(t);return r!==0&&(_=r),n!==8&&(f=n),l!==null&&(v=l?1:0),c!==-1&&(m=c),u!==0&&(y=u),d!==0&&(S=d),(_<<0|f<<8|v<<10|m<<11|y<<15|S<<24)>>>0}};function wc(e,t){const r=[],n=CE(e);let l=n.next();for(;l!==null;){let _=0;if(l.length===2&&l.charAt(1)===":"){switch(l.charAt(0)){case"R":_=1;break;case"L":_=-1;break;default:console.log(`Unknown priority ${l} in scope selector`)}l=n.next()}let f=u();if(r.push({matcher:f,priority:_}),l!==",")break;l=n.next()}return r;function c(){if(l==="-"){l=n.next();const _=c();return f=>!!_&&!_(f)}if(l==="("){l=n.next();const _=d();return l===")"&&(l=n.next()),_}if($v(l)){const _=[];do _.push(l),l=n.next();while($v(l));return f=>t(_,f)}return null}function u(){const _=[];let f=c();for(;f;)_.push(f),f=c();return v=>_.every(m=>m(v))}function d(){const _=[];let f=u();for(;f&&(_.push(f),l==="|"||l===",");){do l=n.next();while(l==="|"||l===",");f=u()}return v=>_.some(m=>m(v))}}function $v(e){return!!e&&!!e.match(/[\w\.:]+/)}function CE(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=t.exec(e);return{next:()=>{if(!r)return null;const n=r[0];return r=t.exec(e),n}}}function W0(e){typeof e.dispose=="function"&&e.dispose()}var pl=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},EE=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},xE=class{constructor(){F(this,"_references",[]);F(this,"_seenReferenceKeys",new Set);F(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},AE=class{constructor(e,t){F(this,"seenFullScopeRequests",new Set);F(this,"seenPartialScopeRequests",new Set);F(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new pl(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new xE;for(const r of e)kE(r,this.initialScopeName,this.repo,t);for(const r of t.references)if(r instanceof pl){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function kE(e,t,r,n){const l=r.lookup(e.scopeName);if(!l){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const c=r.lookup(t);e instanceof pl?hc({baseGrammar:c,selfGrammar:l},n):Jd(e.ruleName,{baseGrammar:c,selfGrammar:l,repository:l.repository},n);const u=r.injections(e.scopeName);if(u)for(const d of u)n.add(new pl(d))}function Jd(e,t,r){if(t.repository&&t.repository[e]){const n=t.repository[e];Cc([n],t,r)}}function hc(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Cc(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Cc(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Cc(e,t,r){for(const n of e){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);const l=n.repository?I0({},t.repository,n.repository):t.repository;Array.isArray(n.patterns)&&Cc(n.patterns,{...t,repository:l},r);const c=n.include;if(!c)continue;const u=F0(c);switch(u.kind){case 0:hc({...t,selfGrammar:t.baseGrammar},r);break;case 1:hc(t,r);break;case 2:Jd(u.ruleName,{...t,repository:l},r);break;case 3:case 4:const d=u.scopeName===t.selfGrammar.scopeName?t.selfGrammar:u.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(d){const _={baseGrammar:t.baseGrammar,selfGrammar:d,repository:l};u.kind===4?Jd(u.ruleName,_,r):hc(_,r)}else u.kind===4?r.add(new EE(u.scopeName,u.ruleName)):r.add(new pl(u.scopeName));break}}}var TE=class{constructor(){F(this,"kind",0)}},RE=class{constructor(){F(this,"kind",1)}},DE=class{constructor(e){F(this,"kind",2);this.ruleName=e}},LE=class{constructor(e){F(this,"kind",3);this.scopeName=e}},OE=class{constructor(e,t){F(this,"kind",4);this.scopeName=e,this.ruleName=t}};function F0(e){if(e==="$base")return new TE;if(e==="$self")return new RE;const t=e.indexOf("#");if(t===-1)return new LE(e);if(t===0)return new DE(e.substring(1));{const r=e.substring(0,t),n=e.substring(t+1);return new OE(r,n)}}var ME=/\\(\d+)/,Gv=/\\(\d+)/g,NE=-1,Y0=-2;var El=class{constructor(e,t,r,n){F(this,"$location");F(this,"id");F(this,"_nameIsCapturing");F(this,"_name");F(this,"_contentNameIsCapturing");F(this,"_contentName");this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=Zo.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Zo.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${H0(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Zo.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Zo.replaceCaptures(this._contentName,e,t)}},BE=class extends El{constructor(t,r,n,l,c){super(t,r,n,l);F(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=c}dispose(){}collectPatterns(t,r){throw new Error("Not supported!")}compile(t,r){throw new Error("Not supported!")}compileAG(t,r,n,l){throw new Error("Not supported!")}},zE=class extends El{constructor(t,r,n,l,c){super(t,r,n,null);F(this,"_match");F(this,"captures");F(this,"_cachedCompiledPatterns");this._match=new ml(l,this.id),this.captures=c,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,r){r.push(this._match)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,l){return this._getCachedCompiledPatterns(t).compileAG(t,n,l)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new gl,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qv=class extends El{constructor(t,r,n,l,c){super(t,r,n,l);F(this,"hasMissingPatterns");F(this,"patterns");F(this,"_cachedCompiledPatterns");this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,r){for(const n of this.patterns)t.getRule(n).collectPatterns(t,r)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,l){return this._getCachedCompiledPatterns(t).compileAG(t,n,l)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new gl,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},ef=class extends El{constructor(t,r,n,l,c,u,d,_,f,v){super(t,r,n,l);F(this,"_begin");F(this,"beginCaptures");F(this,"_end");F(this,"endHasBackReferences");F(this,"endCaptures");F(this,"applyEndPatternLast");F(this,"hasMissingPatterns");F(this,"patterns");F(this,"_cachedCompiledPatterns");this._begin=new ml(c,this.id),this.beginCaptures=u,this._end=new ml(d||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=_,this.applyEndPatternLast=f||!1,this.patterns=v.patterns,this.hasMissingPatterns=v.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,r){return this._end.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t,r).compile(t)}compileAG(t,r,n,l){return this._getCachedCompiledPatterns(t,r).compileAG(t,n,l)}_getCachedCompiledPatterns(t,r){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new gl;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,r):this._cachedCompiledPatterns.setSource(0,r)),this._cachedCompiledPatterns}},Ec=class extends El{constructor(t,r,n,l,c,u,d,_,f){super(t,r,n,l);F(this,"_begin");F(this,"beginCaptures");F(this,"whileCaptures");F(this,"_while");F(this,"whileHasBackReferences");F(this,"hasMissingPatterns");F(this,"patterns");F(this,"_cachedCompiledPatterns");F(this,"_cachedCompiledWhilePatterns");this._begin=new ml(c,this.id),this.beginCaptures=u,this.whileCaptures=_,this._while=new ml(d,Y0),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=f.patterns,this.hasMissingPatterns=f.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,r){return this._while.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,l){return this._getCachedCompiledPatterns(t).compileAG(t,n,l)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new gl;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,r){return this._getCachedCompiledWhilePatterns(t,r).compile(t)}compileWhileAG(t,r,n,l){return this._getCachedCompiledWhilePatterns(t,r).compileAG(t,n,l)}_getCachedCompiledWhilePatterns(t,r){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new gl,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,r||""),this._cachedCompiledWhilePatterns}},K0=class Kt{static createCaptureRule(t,r,n,l,c){return t.registerRule(u=>new BE(r,u,n,l,c))}static getCompiledRuleId(t,r,n){return t.id||r.registerRule(l=>{if(t.id=l,t.match)return new zE(t.$vscodeTextmateLocation,t.id,t.name,t.match,Kt._compileCaptures(t.captures,r,n));if(typeof t.begin>"u"){t.repository&&(n=I0({},n,t.repository));let c=t.patterns;return typeof c>"u"&&t.include&&(c=[{include:t.include}]),new qv(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Kt._compilePatterns(c,r,n))}return t.while?new Ec(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Kt._compileCaptures(t.beginCaptures||t.captures,r,n),t.while,Kt._compileCaptures(t.whileCaptures||t.captures,r,n),Kt._compilePatterns(t.patterns,r,n)):new ef(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Kt._compileCaptures(t.beginCaptures||t.captures,r,n),t.end,Kt._compileCaptures(t.endCaptures||t.captures,r,n),t.applyEndPatternLast,Kt._compilePatterns(t.patterns,r,n))}),t.id}static _compileCaptures(t,r,n){let l=[];if(t){let c=0;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const d=parseInt(u,10);d>c&&(c=d)}for(let u=0;u<=c;u++)l[u]=null;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const d=parseInt(u,10);let _=0;t[u].patterns&&(_=Kt.getCompiledRuleId(t[u],r,n)),l[d]=Kt.createCaptureRule(r,t[u].$vscodeTextmateLocation,t[u].name,t[u].contentName,_)}}return l}static _compilePatterns(t,r,n){let l=[];if(t)for(let c=0,u=t.length;c<u;c++){const d=t[c];let _=-1;if(d.include){const f=F0(d.include);switch(f.kind){case 0:case 1:_=Kt.getCompiledRuleId(n[d.include],r,n);break;case 2:let v=n[f.ruleName];v&&(_=Kt.getCompiledRuleId(v,r,n));break;case 3:case 4:const m=f.scopeName,y=f.kind===4?f.ruleName:null,S=r.getExternalGrammar(m,n);if(S)if(y){let b=S.repository[y];b&&(_=Kt.getCompiledRuleId(b,r,S.repository))}else _=Kt.getCompiledRuleId(S.repository.$self,r,S.repository);break}}else _=Kt.getCompiledRuleId(d,r,n);if(_!==-1){const f=r.getRule(_);let v=!1;if((f instanceof qv||f instanceof ef||f instanceof Ec)&&f.hasMissingPatterns&&f.patterns.length===0&&(v=!0),v)continue;l.push(_)}}return{patterns:l,hasMissingPatterns:(t?t.length:0)!==l.length}}},ml=class X0{constructor(t,r){F(this,"source");F(this,"ruleId");F(this,"hasAnchor");F(this,"hasBackReferences");F(this,"_anchorCache");if(t&&typeof t=="string"){const n=t.length;let l=0,c=[],u=!1;for(let d=0;d<n;d++)if(t.charAt(d)==="\\"&&d+1<n){const f=t.charAt(d+1);f==="z"?(c.push(t.substring(l,d)),c.push("$(?!\\n)(?<!\\n)"),l=d+2):(f==="A"||f==="G")&&(u=!0),d++}this.hasAnchor=u,l===0?this.source=t:(c.push(t.substring(l,n)),this.source=c.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=ME.test(this.source):this.hasBackReferences=!1}clone(){return new X0(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=r.map(l=>t.substring(l.start,l.end));return Gv.lastIndex=0,this.source.replace(Gv,(l,c)=>V0(n[parseInt(c,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],r=[],n=[],l=[],c,u,d,_;for(c=0,u=this.source.length;c<u;c++)d=this.source.charAt(c),t[c]=d,r[c]=d,n[c]=d,l[c]=d,d==="\\"&&c+1<u&&(_=this.source.charAt(c+1),_==="A"?(t[c+1]="",r[c+1]="",n[c+1]="A",l[c+1]="A"):_==="G"?(t[c+1]="",r[c+1]="G",n[c+1]="",l[c+1]="G"):(t[c+1]=_,r[c+1]=_,n[c+1]=_,l[c+1]=_),c++);return{A0_G0:t.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:l.join("")}}resolveAnchors(t,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},gl=class{constructor(){F(this,"_items");F(this,"_hasAnchors");F(this,"_cached");F(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(r=>r.source);this._cached=new Wv(e,t,this._items.map(r=>r.ruleId))}return this._cached}compileAG(e,t,r){return this._hasAnchors?t?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,r){let n=this._items.map(l=>l.resolveAnchors(t,r));return new Wv(e,n,this._items.map(l=>l.ruleId))}},Wv=class{constructor(e,t,r){F(this,"scanner");this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
51
|
-
`)}findNextMatchSync(e,t,r){const n=this.scanner.findNextMatchSync(e,t,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},
|
|
52
|
-
`;const c=this.createOnigString(e),u=c.content.length,d=new KE(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),_=Z0(this,c,l,0,t,d,!0,n);return W0(c),{lineLength:u,lineTokens:d,ruleStack:_.stack,stoppedEarly:_.stoppedEarly}}};function Kv(e,t){return e=dE(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var hl=class rr{constructor(t,r,n){this.parent=t,this.scopePath=r,this.tokenAttributes=n}static fromExtension(t,r){let n=t,l=(t==null?void 0:t.scopePath)??null;for(const c of r)l=wd.push(l,c.scopeNames),n=new rr(n,l,c.encodedTokenAttributes);return n}static createRoot(t,r){return new rr(null,new wd(null,t),r)}static createRootAndLookUpScopeName(t,r,n){const l=n.getMetadataForScope(t),c=new wd(null,t),u=n.themeProvider.themeMatch(c),d=rr.mergeAttributes(r,l,u);return new rr(null,c,d)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return rr.equals(this,t)}static equals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.scopeName!==r.scopeName||t.tokenAttributes!==r.tokenAttributes)return!1;t=t.parent,r=r.parent}while(!0)}static mergeAttributes(t,r,n){let l=-1,c=0,u=0;return n!==null&&(l=n.fontStyle,c=n.foregroundId,u=n.backgroundId),Xn.set(t,r.languageId,r.tokenType,null,l,c,u)}pushAttributed(t,r){if(t===null)return this;if(t.indexOf(" ")===-1)return rr._pushAttributed(this,t,r);const n=t.split(/ /g);let l=this;for(const c of n)l=rr._pushAttributed(l,c,r);return l}static _pushAttributed(t,r,n){const l=n.getMetadataForScope(r),c=t.scopePath.push(r),u=n.themeProvider.themeMatch(c),d=rr.mergeAttributes(t.tokenAttributes,l,u);return new rr(t,c,d)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var l;const r=[];let n=this;for(;n&&n!==t;)r.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(((l=n.parent)==null?void 0:l.scopePath)??null)}),n=n.parent;return n===t?r.reverse():void 0}},Ui,tf=(Ui=class{constructor(t,r,n,l,c,u,d,_){F(this,"_stackElementBrand");F(this,"_enterPos");F(this,"_anchorPos");F(this,"depth");this.parent=t,this.ruleId=r,this.beginRuleCapturedEOL=c,this.endRule=u,this.nameScopesList=d,this.contentNameScopesList=_,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=l}equals(t){return t===null?!1:Ui._equals(this,t)}static _equals(t,r){return t===r?!0:this._structuralEquals(t,r)?hl.equals(t.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.depth!==r.depth||t.ruleId!==r.ruleId||t.endRule!==r.endRule)return!1;t=t.parent,r=r.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Ui._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,n,l,c,u,d){return new Ui(this,t,r,n,l,c,u,d)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,r){var n,l;return this.parent&&(r=this.parent._writeString(t,r)),t[r++]=`(${this.ruleId}, ${(n=this.nameScopesList)==null?void 0:n.toString()}, ${(l=this.contentNameScopesList)==null?void 0:l.toString()})`,r}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Ui(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let r=this;for(;r&&r._enterPos===t._enterPos;){if(r.ruleId===t.ruleId)return!0;r=r.parent}return!1}toStateStackFrame(){var t,r,n;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((r=this.nameScopesList)==null?void 0:r.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((n=this.contentNameScopesList)==null?void 0:n.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,r){const n=hl.fromExtension((t==null?void 0:t.nameScopesList)??null,r.nameScopesList);return new Ui(t,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,hl.fromExtension(n,r.contentNameScopesList))}},F(Ui,"NULL",new Ui(null,0,0,0,!1,null,null,null)),Ui),YE=class{constructor(e,t){F(this,"balancedBracketScopes");F(this,"unbalancedBracketScopes");F(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(r=>r==="*"?(this.allowAny=!0,[]):wc(r,xc).map(n=>n.matcher)),this.unbalancedBracketScopes=t.flatMap(r=>wc(r,xc).map(n=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},KE=class{constructor(e,t,r,n){F(this,"_emitBinaryTokens");F(this,"_lineText");F(this,"_tokens");F(this,"_binaryTokens");F(this,"_lastTokenEndIndex");F(this,"_tokenTypeOverrides");this.balancedBracketSelectors=n,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var n;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let l=(e==null?void 0:e.tokenAttributes)??0,c=!1;if((n=this.balancedBracketSelectors)!=null&&n.matchesAlways&&(c=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const u=(e==null?void 0:e.getScopeNames())??[];for(const d of this._tokenTypeOverrides)d.matcher(u)&&(l=Xn.set(l,0,d.type,null,-1,0,0));this.balancedBracketSelectors&&(c=this.balancedBracketSelectors.match(u))}if(c&&(l=Xn.set(l,0,8,c,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===l){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(l),this._lastTokenEndIndex=t;return}const r=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const r=new Uint32Array(this._binaryTokens.length);for(let n=0,l=this._binaryTokens.length;n<l;n++)r[n]=this._binaryTokens[n];return r}},XE=class{constructor(e,t){F(this,"_grammars",new Map);F(this,"_rawGrammars",new Map);F(this,"_injectionGrammars",new Map);F(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,r,n,l){if(!this._grammars.has(e)){let c=this._rawGrammars.get(e);if(!c)return null;this._grammars.set(e,qE(e,c,t,r,n,l,this,this._onigLib))}return this._grammars.get(e)}},ZE=class{constructor(t){F(this,"_options");F(this,"_syncRegistry");F(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new XE(bc.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,r){this._syncRegistry.setTheme(bc.createFromRawTheme(t,r))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,r,n){return this.loadGrammarWithConfiguration(t,r,{embeddedLanguages:n})}loadGrammarWithConfiguration(t,r,n){return this._loadGrammar(t,r,n.embeddedLanguages,n.tokenTypes,new YE(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,r,n,l,c){const u=new AE(this._syncRegistry,t);for(;u.Q.length>0;)u.Q.map(d=>this._loadSingleGrammar(d.scopeName)),u.processQueue();return this._grammarForScopeName(t,r,n,l,c)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const r=this._options.loadGrammar(t);if(r){const n=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(r,n)}}addGrammar(t,r=[],n=0,l=null){return this._syncRegistry.addGrammar(t,r),this._grammarForScopeName(t.scopeName,n,l)}_grammarForScopeName(t,r=0,n=null,l=null,c=null){return this._syncRegistry.grammarForScopeName(t,r,n,l,c)}},rf=tf.NULL;function Ac(e,t){const r=typeof e=="string"?{}:{...e.colorReplacements},n=typeof e=="string"?e:e.name;for(const[l,c]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof c=="string"?r[l]=c:l===n&&Object.assign(r,c);return r}function gs(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function QE(e){return Array.isArray(e)?e:[e]}async function J0(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function jc(e){return!e||["plaintext","txt","text","plain"].includes(e)}function eS(e){return e==="ansi"||jc(e)}function Vc(e){return e==="none"}function tS(e){return Vc(e)}function $c(e,t=!1){var c;if(e.length===0)return[["",0]];const r=e.split(/(\r?\n)/g);let n=0;const l=[];for(let u=0;u<r.length;u+=2){const d=t?r[u]+(r[u+1]||""):r[u];l.push([d,n]),n+=r[u].length,n+=((c=r[u+1])==null?void 0:c.length)||0}return l}const Xv={light:"#333333",dark:"#bbbbbb"},Zv={light:"#fffffe",dark:"#1e1e1e"},Qv="__shiki_resolved";function c_(e){var d,_,f,v,m;if(e!=null&&e[Qv])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:r,fg:n}=t;if(!r||!n){const y=t.settings?t.settings.find(S=>!S.name&&!S.scope):void 0;(d=y==null?void 0:y.settings)!=null&&d.foreground&&(n=y.settings.foreground),(_=y==null?void 0:y.settings)!=null&&_.background&&(r=y.settings.background),!n&&((f=t==null?void 0:t.colors)!=null&&f["editor.foreground"])&&(n=t.colors["editor.foreground"]),!r&&((v=t==null?void 0:t.colors)!=null&&v["editor.background"])&&(r=t.colors["editor.background"]),n||(n=t.type==="light"?Xv.light:Xv.dark),r||(r=t.type==="light"?Zv.light:Zv.dark),t.fg=n,t.bg=r}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let l=0;const c=new Map;function u(y){var b;if(c.has(y))return c.get(y);l+=1;const S=`#${l.toString(16).padStart(8,"0").toLowerCase()}`;return(b=t.colorReplacements)!=null&&b[`#${S}`]?u(y):(c.set(y,S),S)}t.settings=t.settings.map(y=>{var T,O;const S=((T=y.settings)==null?void 0:T.foreground)&&!y.settings.foreground.startsWith("#"),b=((O=y.settings)==null?void 0:O.background)&&!y.settings.background.startsWith("#");if(!S&&!b)return y;const E={...y,settings:{...y.settings}};if(S){const H=u(y.settings.foreground);t.colorReplacements[H]=y.settings.foreground,E.settings.foreground=H}if(b){const H=u(y.settings.background);t.colorReplacements[H]=y.settings.background,E.settings.background=H}return E});for(const y of Object.keys(t.colors||{}))if((y==="editor.foreground"||y==="editor.background"||y.startsWith("terminal.ansi"))&&!((m=t.colors[y])!=null&&m.startsWith("#"))){const S=u(t.colors[y]);t.colorReplacements[S]=t.colors[y],t.colors[y]=S}return Object.defineProperty(t,Qv,{enumerable:!1,writable:!1,value:!0}),t}async function iS(e){return Array.from(new Set((await Promise.all(e.filter(t=>!eS(t)).map(async t=>await J0(t).then(r=>Array.isArray(r)?r:[r])))).flat()))}async function rS(e){return(await Promise.all(e.map(async t=>tS(t)?null:c_(await J0(t))))).filter(t=>!!t)}function sS(e,t){if(!t)return e;if(t[e]){const r=new Set([e]);for(;t[e];){if(e=t[e],r.has(e))throw new et(`Circular alias \`${Array.from(r).join(" -> ")} -> ${e}\``);r.add(e)}}return e}var JE=class extends ZE{constructor(t,r,n,l={}){super(t);F(this,"_resolvedThemes",new Map);F(this,"_resolvedGrammars",new Map);F(this,"_langMap",new Map);F(this,"_langGraph",new Map);F(this,"_textmateThemeCache",new WeakMap);F(this,"_loadedThemesCache",null);F(this,"_loadedLanguagesCache",null);this._resolver=t,this._themes=r,this._langs=n,this._alias=l,this._themes.map(c=>this.loadTheme(c)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const r=c_(t);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let r=this._textmateThemeCache.get(t);r||(r=bc.createFromRawTheme(t),this._textmateThemeCache.set(t,r)),this._syncRegistry.setTheme(r)}getGrammar(t){return t=sS(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){var c,u,d,_;if(this.getGrammar(t.name))return;const r=new Set([...this._langMap.values()].filter(f=>{var v;return(v=f.embeddedLangsLazy)==null?void 0:v.includes(t.name)}));this._resolver.addLanguage(t);const n={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const l=this.loadGrammarWithConfiguration(t.scopeName,1,n);if(l.name=t.name,this._resolvedGrammars.set(t.name,l),t.aliases&&t.aliases.forEach(f=>{this._alias[f]=t.name}),this._loadedLanguagesCache=null,r.size)for(const f of r)this._resolvedGrammars.delete(f.name),this._loadedLanguagesCache=null,(u=(c=this._syncRegistry)==null?void 0:c._injectionGrammars)==null||u.delete(f.scopeName),(_=(d=this._syncRegistry)==null?void 0:d._grammars)==null||_.delete(f.scopeName),this.loadLanguage(this._langMap.get(f.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const l of t)this.resolveEmbeddedLanguages(l);const r=Array.from(this._langGraph.entries()),n=r.filter(([l,c])=>!c);if(n.length){const l=r.filter(([c,u])=>{var d;return u?(d=u.embeddedLanguages||u.embeddedLangs)==null?void 0:d.some(_=>n.map(([f])=>f).includes(_)):!1}).filter(c=>!n.includes(c));throw new et(`Missing languages ${n.map(([c])=>`\`${c}\``).join(", ")}, required by ${l.map(([c])=>`\`${c}\``).join(", ")}`)}for(const[l,c]of r)this._resolver.addLanguage(c);for(const[l,c]of r)this.loadLanguage(c)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const r=t.embeddedLanguages??t.embeddedLangs;if(r)for(const n of r)this._langGraph.set(n,this._langMap.get(n))}},ex=class{constructor(e,t){F(this,"_langs",new Map);F(this,"_scopeToLang",new Map);F(this,"_injections",new Map);F(this,"_onigLib");this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},t.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let r=[];for(let n=1;n<=t.length;n++){const l=t.slice(0,n).join(".");r=[...r,...this._injections.get(l)||[]]}return r}};let Qa=0;function tx(e){Qa+=1,e.warnings!==!1&&Qa>=10&&Qa%10===0&&console.warn(`[Shiki] ${Qa} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new et("`engine` option is required for synchronous mode");const r=(e.langs||[]).flat(1),n=(e.themes||[]).flat(1).map(c_),l=new JE(new ex(e.engine,r),n,r,e.langAlias);let c;function u(H){return sS(H,e.langAlias)}function d(H){T();const B=l.getGrammar(typeof H=="string"?H:H.name);if(!B)throw new et(`Language \`${H}\` not found, you may need to load it first`);return B}function _(H){if(H==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};T();const B=l.getTheme(H);if(!B)throw new et(`Theme \`${H}\` not found, you may need to load it first`);return B}function f(H){T();const B=_(H);return c!==H&&(l.setTheme(B),c=H),{theme:B,colorMap:l.getColorMap()}}function v(){return T(),l.getLoadedThemes()}function m(){return T(),l.getLoadedLanguages()}function y(...H){T(),l.loadLanguages(H.flat(1))}async function S(...H){return y(await iS(H))}function b(...H){T();for(const B of H.flat(1))l.loadTheme(B)}async function E(...H){return T(),b(await rS(H))}function T(){if(t)throw new et("Shiki instance has been disposed")}function O(){t||(t=!0,l.dispose(),Qa-=1)}return{setTheme:f,getTheme:_,getLanguage:d,getLoadedThemes:v,getLoadedLanguages:m,resolveLangAlias:u,loadLanguage:S,loadLanguageSync:y,loadTheme:E,loadThemeSync:b,dispose:O,[Symbol.dispose]:O}}async function ix(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,r,n]=await Promise.all([rS(e.themes||[]),iS(e.langs||[]),e.engine]);return tx({...e,themes:t,langs:r,engine:n})}const nS=new WeakMap;function Gc(e,t){nS.set(e,t)}function vl(e){return nS.get(e)}var qc=class aS{constructor(...t){F(this,"_stacks",{});F(this,"lang");if(t.length===2){const[r,n]=t;this.lang=n,this._stacks=r}else{const[r,n,l]=t;this.lang=n,this._stacks={[l]:r}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,r){return new aS(Object.fromEntries(QE(r).map(n=>[n,rf])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return rx(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function rx(e){const t=[],r=new Set;function n(l){var u;if(r.has(l))return;r.add(l);const c=(u=l==null?void 0:l.nameScopesList)==null?void 0:u.scopeName;c&&t.push(c),l.parent&&n(l.parent)}return n(e),t}function sx(e,t){if(!(e instanceof qc))throw new et("Invalid grammar state");return e.getInternalStack(t)}function lS(e,t,r={}){const{theme:n=e.getLoadedThemes()[0]}=r;if(jc(e.resolveLangAlias(r.lang||"text"))||Vc(n))return $c(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:l,colorMap:c}=e.setTheme(n),u=e.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==u.name)throw new et(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${u.name}"`);if(!r.grammarState.themes.includes(l.name))throw new et(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${l.name}"`)}return ax(t,u,l,c,r)}function nx(...e){if(e.length===2)return vl(e[1]);const[t,r,n={}]=e,{lang:l="text",theme:c=t.getLoadedThemes()[0]}=n;if(jc(l)||Vc(c))throw new et("Plain language does not have grammar state");if(l==="ansi")throw new et("ANSI language does not have grammar state");const{theme:u,colorMap:d}=t.setTheme(c),_=t.getLanguage(l);return new qc(u_(r,_,u,d,n).stateStack,_.name,u.name)}function ax(e,t,r,n,l){const c=u_(e,t,r,n,l),u=new qc(c.stateStack,t.name,r.name);return Gc(c.tokens,u),c.tokens}function u_(e,t,r,n,l){const c=Ac(r,l),{tokenizeMaxLineLength:u=0,tokenizeTimeLimit:d=500}=l,_=$c(e);let f=l.grammarState?sx(l.grammarState,r.name)??rf:l.grammarContextCode!=null?u_(l.grammarContextCode,t,r,n,{...l,grammarState:void 0,grammarContextCode:void 0}).stateStack:rf,v=[];const m=[];for(let y=0,S=_.length;y<S;y++){const[b,E]=_[y];if(b===""){v=[],m.push([]);continue}if(u>0&&b.length>=u){v=[],m.push([{content:b,offset:E,color:"",fontStyle:0}]);continue}let T,O,H;l.includeExplanation&&(T=t.tokenizeLine(b,f,d),O=T.tokens,H=0);const B=t.tokenizeLine2(b,f,d),I=B.tokens.length/2;for(let j=0;j<I;j++){const Y=B.tokens[2*j],te=j+1<I?B.tokens[2*j+2]:b.length;if(Y===te)continue;const ge=B.tokens[2*j+1],ve=gs(n[Xn.getForeground(ge)],c),fe=Xn.getFontStyle(ge),he={content:b.substring(Y,te),offset:E+Y,color:ve,fontStyle:fe};if(l.includeExplanation){const J=[];if(l.includeExplanation!=="scopeName")for(const re of r.settings){let se;switch(typeof re.scope){case"string":se=re.scope.split(/,/).map(D=>D.trim());break;case"object":se=re.scope;break;default:continue}J.push({settings:re,selectors:se.map(D=>D.split(/ /))})}he.explanation=[];let G=0;for(;Y+G<te;){const re=O[H],se=b.substring(re.startIndex,re.endIndex);G+=se.length,he.explanation.push({content:se,scopes:l.includeExplanation==="scopeName"?lx(re.scopes):ox(J,re.scopes)}),H+=1}}v.push(he)}m.push(v),v=[],f=B.ruleStack}return{tokens:m,stateStack:f}}function lx(e){return e.map(t=>({scopeName:t}))}function ox(e,t){const r=[];for(let n=0,l=t.length;n<l;n++){const c=t[n];r[n]={scopeName:c,themeMatches:ux(e,c,t.slice(0,n))}}return r}function Jv(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function cx(e,t,r){if(!Jv(e[e.length-1],t))return!1;let n=e.length-2,l=r.length-1;for(;n>=0&&l>=0;)Jv(e[n],r[l])&&(n-=1),l-=1;return n===-1}function ux(e,t,r){const n=[];for(const{selectors:l,settings:c}of e)for(const u of l)if(cx(u,t,r)){n.push(c);break}return n}function oS(e,t,r,n=lS){const l=Object.entries(r.themes).filter(f=>f[1]).map(f=>({color:f[0],theme:f[1]})),c=l.map(f=>{const v=n(e,t,{...r,theme:f.theme});return{tokens:v,state:vl(v),theme:typeof f.theme=="string"?f.theme:f.theme.name}}),u=hx(...c.map(f=>f.tokens)),d=u[0].map((f,v)=>f.map((m,y)=>{const S={content:m.content,variants:{},offset:m.offset};return"includeExplanation"in r&&r.includeExplanation&&(S.explanation=m.explanation),u.forEach((b,E)=>{const{content:T,explanation:O,offset:H,...B}=b[v][y];S.variants[l[E].color]=B}),S})),_=c[0].state?new qc(Object.fromEntries(c.map(f=>{var v;return[f.theme,(v=f.state)==null?void 0:v.getInternalStack(f.theme)]})),c[0].state.lang):void 0;return _&&Gc(d,_),d}function hx(...e){const t=e.map(()=>[]),r=e.length;for(let n=0;n<e[0].length;n++){const l=e.map(_=>_[n]),c=t.map(()=>[]);t.forEach((_,f)=>_.push(c[f]));const u=l.map(()=>0),d=l.map(_=>_[0]);for(;d.every(_=>_);){const _=Math.min(...d.map(f=>f.content.length));for(let f=0;f<r;f++){const v=d[f];v.content.length===_?(c[f].push(v),u[f]+=1,d[f]=l[f][u[f]]):(c[f].push({...v,content:v.content.slice(0,_)}),d[f]={...v,content:v.content.slice(_),offset:v.offset+_})}}}return t}const dx=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class xl{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}xl.prototype.normal={};xl.prototype.property={};xl.prototype.space=void 0;function cS(e,t){const r={},n={};for(const l of e)Object.assign(r,l.property),Object.assign(n,l.normal);return new xl(r,n,t)}function sf(e){return e.toLowerCase()}class hi{constructor(t,r){this.attribute=r,this.property=t}}hi.prototype.attribute="";hi.prototype.booleanish=!1;hi.prototype.boolean=!1;hi.prototype.commaOrSpaceSeparated=!1;hi.prototype.commaSeparated=!1;hi.prototype.defined=!1;hi.prototype.mustUseProperty=!1;hi.prototype.number=!1;hi.prototype.overloadedBoolean=!1;hi.prototype.property="";hi.prototype.spaceSeparated=!1;hi.prototype.space=void 0;let fx=0;const De=en(),bt=en(),nf=en(),ae=en(),Je=en(),Yn=en(),xi=en();function en(){return 2**++fx}const af=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:bt,commaOrSpaceSeparated:xi,commaSeparated:Yn,number:ae,overloadedBoolean:nf,spaceSeparated:Je},Symbol.toStringTag,{value:"Module"})),Ed=Object.keys(af);class h_ extends hi{constructor(t,r,n,l){let c=-1;if(super(t,r),ey(this,"space",l),typeof n=="number")for(;++c<Ed.length;){const u=Ed[c];ey(this,Ed[c],(n&af[u])===af[u])}}}h_.prototype.defined=!0;function ey(e,t,r){r&&(e[t]=r)}function Qn(e){const t={},r={};for(const[n,l]of Object.entries(e.properties)){const c=new h_(n,e.transform(e.attributes||{},n),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(c.mustUseProperty=!0),t[n]=c,r[sf(n)]=n,r[sf(c.attribute)]=n}return new xl(t,r,e.space)}const uS=Qn({properties:{ariaActiveDescendant:null,ariaAtomic:bt,ariaAutoComplete:null,ariaBusy:bt,ariaChecked:bt,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:Je,ariaCurrent:null,ariaDescribedBy:Je,ariaDetails:null,ariaDisabled:bt,ariaDropEffect:Je,ariaErrorMessage:null,ariaExpanded:bt,ariaFlowTo:Je,ariaGrabbed:bt,ariaHasPopup:null,ariaHidden:bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Je,ariaLevel:ae,ariaLive:null,ariaModal:bt,ariaMultiLine:bt,ariaMultiSelectable:bt,ariaOrientation:null,ariaOwns:Je,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:bt,ariaReadOnly:bt,ariaRelevant:null,ariaRequired:bt,ariaRoleDescription:Je,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:bt,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function hS(e,t){return t in e?e[t]:t}function dS(e,t){return hS(e,t.toLowerCase())}const _x=Qn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Yn,acceptCharset:Je,accessKey:Je,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:Je,autoFocus:De,autoPlay:De,blocking:Je,capture:null,charSet:null,checked:De,cite:null,className:Je,cols:ae,colSpan:null,content:null,contentEditable:bt,controls:De,controlsList:Je,coords:ae|Yn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:nf,draggable:bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:Je,height:ae,hidden:nf,high:ae,href:null,hrefLang:null,htmlFor:Je,httpEquiv:Je,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:Je,itemRef:Je,itemScope:De,itemType:Je,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:ae,pattern:null,ping:Je,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:Je,required:De,reversed:De,rows:ae,rowSpan:ae,sandbox:Je,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:bt,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Je,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:bt,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:dS}),px=Qn({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:xi,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:Je,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Yn,g2:Yn,glyphName:Yn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:xi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Je,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xi,rev:xi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xi,requiredFeatures:xi,requiredFonts:xi,requiredFormats:xi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:xi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xi,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:hS}),fS=Qn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),_S=Qn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:dS}),pS=Qn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),mx=/[A-Z]/g,ty=/-[a-z]/g,gx=/^data[-\w.:]+$/i;function vx(e,t){const r=sf(t);let n=t,l=hi;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&gx.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(ty,Sx);n="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!ty.test(c)){let u=c.replace(mx,yx);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=h_}return new l(n,t)}function yx(e){return"-"+e.toLowerCase()}function Sx(e){return e.charAt(1).toUpperCase()}const bx=cS([uS,_x,fS,_S,pS],"html"),mS=cS([uS,px,fS,_S,pS],"svg"),iy={}.hasOwnProperty;function wx(e,t){const r=t||{};function n(l,...c){let u=n.invalid;const d=n.handlers;if(l&&iy.call(l,e)){const _=String(l[e]);u=iy.call(d,_)?d[_]:n.unknown}if(u)return u.call(this,l,...c)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}const Cx=/["&'<>`]/g,Ex=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,xx=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Ax=/[|\\{}()[\]^$+*?.]/g,ry=new WeakMap;function kx(e,t){if(e=e.replace(t.subset?Tx(t.subset):Cx,n),t.subset||t.escapeOnly)return e;return e.replace(Ex,r).replace(xx,n);function r(l,c,u){return t.format((l.charCodeAt(0)-55296)*1024+l.charCodeAt(1)-56320+65536,u.charCodeAt(c+2),t)}function n(l,c,u){return t.format(l.charCodeAt(0),u.charCodeAt(c+1),t)}}function Tx(e){let t=ry.get(e);return t||(t=Rx(e),ry.set(e,t)),t}function Rx(e){const t=[];let r=-1;for(;++r<e.length;)t.push(e[r].replace(Ax,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Dx=/[\dA-Fa-f]/;function Lx(e,t,r){const n="&#x"+e.toString(16).toUpperCase();return r&&t&&!Dx.test(String.fromCharCode(t))?n:n+";"}const Ox=/\d/;function Mx(e,t,r){const n="&#"+String(e);return r&&t&&!Ox.test(String.fromCharCode(t))?n:n+";"}const Nx=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],xd={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Bx=["cent","copy","divide","gt","lt","not","para","times"],gS={}.hasOwnProperty,lf={};let Qo;for(Qo in xd)gS.call(xd,Qo)&&(lf[xd[Qo]]=Qo);const zx=/[^\dA-Za-z]/;function Px(e,t,r,n){const l=String.fromCharCode(e);if(gS.call(lf,l)){const c=lf[l],u="&"+c;return r&&Nx.includes(c)&&!Bx.includes(c)&&(!n||t&&t!==61&&zx.test(String.fromCharCode(t)))?u:u+";"}return""}function Ix(e,t,r){let n=Lx(e,t,r.omitOptionalSemicolons),l;if((r.useNamedReferences||r.useShortestReferences)&&(l=Px(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!l)&&r.useShortestReferences){const c=Mx(e,t,r.omitOptionalSemicolons);c.length<n.length&&(n=c)}return l&&(!r.useShortestReferences||l.length<n.length)?l:n}function Kn(e,t){return kx(e,Object.assign({format:Ix},t))}const Hx=/^>|^->|<!--|-->|--!>|<!-$/g,Ux=[">"],jx=["<",">"];function Vx(e,t,r,n){return n.settings.bogusComments?"<?"+Kn(e.value,Object.assign({},n.settings.characterReferences,{subset:Ux}))+">":"<!--"+e.value.replace(Hx,l)+"-->";function l(c){return Kn(c,Object.assign({},n.settings.characterReferences,{subset:jx}))}}function $x(e,t,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}function sy(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,l=r.indexOf(t);for(;l!==-1;)n++,l=r.indexOf(t,l+t.length);return n}function Gx(e,t){const r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}function qx(e){return e.join(" ").trim()}const Wx=/[ \t\n\f\r]/g;function d_(e){return typeof e=="object"?e.type==="text"?ny(e.value):!1:ny(e)}function ny(e){return e.replace(Wx,"")===""}const Dt=yS(1),vS=yS(-1),Fx=[];function yS(e){return t;function t(r,n,l){const c=r?r.children:Fx;let u=(n||0)+e,d=c[u];if(!l)for(;d&&d_(d);)u+=e,d=c[u];return d}}const Yx={}.hasOwnProperty;function SS(e){return t;function t(r,n,l){return Yx.call(e,r.tagName)&&e[r.tagName](r,n,l)}}const f_=SS({body:Xx,caption:Ad,colgroup:Ad,dd:e2,dt:Jx,head:Ad,html:Kx,li:Qx,optgroup:t2,option:i2,p:Zx,rp:ay,rt:ay,tbody:s2,td:ly,tfoot:n2,th:ly,thead:r2,tr:a2});function Ad(e,t,r){const n=Dt(r,t,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&d_(n.value.charAt(0)))}function Kx(e,t,r){const n=Dt(r,t);return!n||n.type!=="comment"}function Xx(e,t,r){const n=Dt(r,t);return!n||n.type!=="comment"}function Zx(e,t,r){const n=Dt(r,t);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function Qx(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&n.tagName==="li"}function Jx(e,t,r){const n=Dt(r,t);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function e2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function ay(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function t2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&n.tagName==="optgroup"}function i2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function r2(e,t,r){const n=Dt(r,t);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function s2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function n2(e,t,r){return!Dt(r,t)}function a2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&n.tagName==="tr"}function ly(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const l2=SS({body:u2,colgroup:h2,head:c2,html:o2,tbody:d2});function o2(e){const t=Dt(e,-1);return!t||t.type!=="comment"}function c2(e){const t=new Set;for(const n of e.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(t.has(n.tagName))return!1;t.add(n.tagName)}const r=e.children[0];return!r||r.type==="element"}function u2(e){const t=Dt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&d_(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function h2(e,t,r){const n=vS(r,t),l=Dt(e,-1,!0);return r&&n&&n.type==="element"&&n.tagName==="colgroup"&&f_(n,r.children.indexOf(n),r)?!1:!!(l&&l.type==="element"&&l.tagName==="col")}function d2(e,t,r){const n=vS(r,t),l=Dt(e,-1);return r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&f_(n,r.children.indexOf(n),r)?!1:!!(l&&l.type==="element"&&l.tagName==="tr")}const Jo={name:[[`
|
|
49
|
+
`+o.stack}}var ce=Object.prototype.hasOwnProperty,ve=e.unstable_scheduleCallback,Ee=e.unstable_cancelCallback,Re=e.unstable_shouldYield,Ze=e.unstable_requestPaint,Yt=e.unstable_now,e1=e.unstable_getCurrentPriorityLevel,L_=e.unstable_ImmediatePriority,O_=e.unstable_UserBlockingPriority,Ol=e.unstable_NormalPriority,t1=e.unstable_LowPriority,M_=e.unstable_IdlePriority,i1=e.log,r1=e.unstable_setDisableYieldValue,na=null,_i=null;function zr(i){if(typeof i1=="function"&&r1(i),_i&&typeof _i.setStrictMode=="function")try{_i.setStrictMode(na,i)}catch{}}var pi=Math.clz32?Math.clz32:a1,s1=Math.log,n1=Math.LN2;function a1(i){return i>>>=0,i===0?32:31-(s1(i)/n1|0)|0}var Ml=256,Nl=262144,Bl=4194304;function Ss(i){var s=i&42;if(s!==0)return s;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function zl(i,s,a){var o=i.pendingLanes;if(o===0)return 0;var h=0,p=i.suspendedLanes,g=i.pingedLanes;i=i.warmLanes;var w=o&134217727;return w!==0?(o=w&~p,o!==0?h=Ss(o):(g&=w,g!==0?h=Ss(g):a||(a=w&~i,a!==0&&(h=Ss(a))))):(w=o&~p,w!==0?h=Ss(w):g!==0?h=Ss(g):a||(a=o&~i,a!==0&&(h=Ss(a)))),h===0?0:s!==0&&s!==h&&(s&p)===0&&(p=h&-h,a=s&-s,p>=a||p===32&&(a&4194048)!==0)?s:h}function aa(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function l1(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 N_(){var i=Bl;return Bl<<=1,(Bl&62914560)===0&&(Bl=4194304),i}function tu(i){for(var s=[],a=0;31>a;a++)s.push(i);return s}function la(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function o1(i,s,a,o,h,p){var g=i.pendingLanes;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=a,i.entangledLanes&=a,i.errorRecoveryDisabledLanes&=a,i.shellSuspendCounter=0;var w=i.entanglements,A=i.expirationTimes,z=i.hiddenUpdates;for(a=g&~a;0<a;){var G=31-pi(a),Z=1<<G;w[G]=0,A[G]=-1;var P=z[G];if(P!==null)for(z[G]=null,G=0;G<P.length;G++){var U=P[G];U!==null&&(U.lane&=-536870913)}a&=~Z}o!==0&&B_(i,o,0),p!==0&&h===0&&i.tag!==0&&(i.suspendedLanes|=p&~(g&~s))}function B_(i,s,a){i.pendingLanes|=s,i.suspendedLanes&=~s;var o=31-pi(s);i.entangledLanes|=s,i.entanglements[o]=i.entanglements[o]|1073741824|a&261930}function z_(i,s){var a=i.entangledLanes|=s;for(i=i.entanglements;a;){var o=31-pi(a),h=1<<o;h&s|i[o]&s&&(i[o]|=s),a&=~h}}function P_(i,s){var a=s&-s;return a=(a&42)!==0?1:iu(a),(a&(i.suspendedLanes|s))!==0?0:a}function iu(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function ru(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function I_(){var i=q.p;return i!==0?i:(i=window.event,i===void 0?32:Cv(i.type))}function H_(i,s){var a=q.p;try{return q.p=i,s()}finally{q.p=a}}var Pr=Math.random().toString(36).slice(2),Ut="__reactFiber$"+Pr,ni="__reactProps$"+Pr,rn="__reactContainer$"+Pr,su="__reactEvents$"+Pr,c1="__reactListeners$"+Pr,u1="__reactHandles$"+Pr,U_="__reactResources$"+Pr,oa="__reactMarker$"+Pr;function nu(i){delete i[Ut],delete i[ni],delete i[su],delete i[c1],delete i[u1]}function sn(i){var s=i[Ut];if(s)return s;for(var a=i.parentNode;a;){if(s=a[rn]||a[Ut]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(i=lv(i);i!==null;){if(a=i[Ut])return a;i=lv(i)}return s}i=a,a=i.parentNode}return null}function nn(i){if(i=i[Ut]||i[rn]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function ca(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(n(33))}function an(i){var s=i[U_];return s||(s=i[U_]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function Lt(i){i[oa]=!0}var j_=new Set,V_={};function bs(i,s){ln(i,s),ln(i+"Capture",s)}function ln(i,s){for(V_[i]=s,i=0;i<s.length;i++)j_.add(s[i])}var h1=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]*$"),$_={},G_={};function d1(i){return ce.call(G_,i)?!0:ce.call($_,i)?!1:h1.test(i)?G_[i]=!0:($_[i]=!0,!1)}function Pl(i,s,a){if(d1(s))if(a===null)i.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var o=s.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+a)}}function Il(i,s,a){if(a===null)i.removeAttribute(s);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+a)}}function or(i,s,a,o){if(o===null)i.removeAttribute(a);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttributeNS(s,a,""+o)}}function Ai(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function q_(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function f1(i,s,a){var o=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,p=o.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return h.call(this)},set:function(g){a=""+g,p.call(this,g)}}),Object.defineProperty(i,s,{enumerable:o.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function au(i){if(!i._valueTracker){var s=q_(i)?"checked":"value";i._valueTracker=f1(i,s,""+i[s])}}function W_(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var a=s.getValue(),o="";return i&&(o=q_(i)?i.checked?"true":"false":i.value),i=o,i!==a?(s.setValue(i),!0):!1}function Hl(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var _1=/[\n"\\]/g;function ki(i){return i.replace(_1,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function lu(i,s,a,o,h,p,g,w){i.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?i.type=g:i.removeAttribute("type"),s!=null?g==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+Ai(s)):i.value!==""+Ai(s)&&(i.value=""+Ai(s)):g!=="submit"&&g!=="reset"||i.removeAttribute("value"),s!=null?ou(i,g,Ai(s)):a!=null?ou(i,g,Ai(a)):o!=null&&i.removeAttribute("value"),h==null&&p!=null&&(i.defaultChecked=!!p),h!=null&&(i.checked=h&&typeof h!="function"&&typeof h!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.name=""+Ai(w):i.removeAttribute("name")}function F_(i,s,a,o,h,p,g,w){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(i.type=p),s!=null||a!=null){if(!(p!=="submit"&&p!=="reset"||s!=null)){au(i);return}a=a!=null?""+Ai(a):"",s=s!=null?""+Ai(s):a,w||s===i.value||(i.value=s),i.defaultValue=s}o=o??h,o=typeof o!="function"&&typeof o!="symbol"&&!!o,i.checked=w?i.checked:!!o,i.defaultChecked=!!o,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(i.name=g),au(i)}function ou(i,s,a){s==="number"&&Hl(i.ownerDocument)===i||i.defaultValue===""+a||(i.defaultValue=""+a)}function on(i,s,a,o){if(i=i.options,s){s={};for(var h=0;h<a.length;h++)s["$"+a[h]]=!0;for(a=0;a<i.length;a++)h=s.hasOwnProperty("$"+i[a].value),i[a].selected!==h&&(i[a].selected=h),h&&o&&(i[a].defaultSelected=!0)}else{for(a=""+Ai(a),s=null,h=0;h<i.length;h++){if(i[h].value===a){i[h].selected=!0,o&&(i[h].defaultSelected=!0);return}s!==null||i[h].disabled||(s=i[h])}s!==null&&(s.selected=!0)}}function Y_(i,s,a){if(s!=null&&(s=""+Ai(s),s!==i.value&&(i.value=s),a==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=a!=null?""+Ai(a):""}function K_(i,s,a,o){if(s==null){if(o!=null){if(a!=null)throw Error(n(92));if(se(o)){if(1<o.length)throw Error(n(93));o=o[0]}a=o}a==null&&(a=""),s=a}a=Ai(s),i.defaultValue=a,o=i.textContent,o===a&&o!==""&&o!==null&&(i.value=o),au(i)}function cn(i,s){if(s){var a=i.firstChild;if(a&&a===i.lastChild&&a.nodeType===3){a.nodeValue=s;return}}i.textContent=s}var p1=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 X_(i,s,a){var o=s.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?o?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":o?i.setProperty(s,a):typeof a!="number"||a===0||p1.has(s)?s==="float"?i.cssFloat=a:i[s]=(""+a).trim():i[s]=a+"px"}function Z_(i,s,a){if(s!=null&&typeof s!="object")throw Error(n(62));if(i=i.style,a!=null){for(var o in a)!a.hasOwnProperty(o)||s!=null&&s.hasOwnProperty(o)||(o.indexOf("--")===0?i.setProperty(o,""):o==="float"?i.cssFloat="":i[o]="");for(var h in s)o=s[h],s.hasOwnProperty(h)&&a[h]!==o&&X_(i,h,o)}else for(var p in s)s.hasOwnProperty(p)&&X_(i,p,s[p])}function cu(i){if(i.indexOf("-")===-1)return!1;switch(i){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 m1=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"]]),g1=/^[\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 Ul(i){return g1.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function cr(){}var uu=null;function hu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var un=null,hn=null;function Q_(i){var s=nn(i);if(s&&(i=s.stateNode)){var a=i[ni]||null;e:switch(i=s.stateNode,s.type){case"input":if(lu(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),s=a.name,a.type==="radio"&&s!=null){for(a=i;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+ki(""+s)+'"][type="radio"]'),s=0;s<a.length;s++){var o=a[s];if(o!==i&&o.form===i.form){var h=o[ni]||null;if(!h)throw Error(n(90));lu(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(s=0;s<a.length;s++)o=a[s],o.form===i.form&&W_(o)}break e;case"textarea":Y_(i,a.value,a.defaultValue);break e;case"select":s=a.value,s!=null&&on(i,!!a.multiple,s,!1)}}}var du=!1;function J_(i,s,a){if(du)return i(s,a);du=!0;try{var o=i(s);return o}finally{if(du=!1,(un!==null||hn!==null)&&(To(),un&&(s=un,i=hn,hn=un=null,Q_(s),i)))for(s=0;s<i.length;s++)Q_(i[s])}}function ua(i,s){var a=i.stateNode;if(a===null)return null;var o=a[ni]||null;if(o===null)return null;a=o[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(i=i.type,o=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!o;break e;default:i=!1}if(i)return null;if(a&&typeof a!="function")throw Error(n(231,s,typeof a));return a}var ur=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fu=!1;if(ur)try{var ha={};Object.defineProperty(ha,"passive",{get:function(){fu=!0}}),window.addEventListener("test",ha,ha),window.removeEventListener("test",ha,ha)}catch{fu=!1}var Ir=null,_u=null,jl=null;function ep(){if(jl)return jl;var i,s=_u,a=s.length,o,h="value"in Ir?Ir.value:Ir.textContent,p=h.length;for(i=0;i<a&&s[i]===h[i];i++);var g=a-i;for(o=1;o<=g&&s[a-o]===h[p-o];o++);return jl=h.slice(i,1<o?1-o:void 0)}function Vl(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function $l(){return!0}function tp(){return!1}function ai(i){function s(a,o,h,p,g){this._reactName=a,this._targetInst=h,this.type=o,this.nativeEvent=p,this.target=g,this.currentTarget=null;for(var w in i)i.hasOwnProperty(w)&&(a=i[w],this[w]=a?a(p):p[w]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?$l:tp,this.isPropagationStopped=tp,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=$l)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=$l)},persist:function(){},isPersistent:$l}),s}var ws={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gl=ai(ws),da=m({},ws,{view:0,detail:0}),v1=ai(da),pu,mu,fa,ql=m({},da,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:vu,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==fa&&(fa&&i.type==="mousemove"?(pu=i.screenX-fa.screenX,mu=i.screenY-fa.screenY):mu=pu=0,fa=i),pu)},movementY:function(i){return"movementY"in i?i.movementY:mu}}),ip=ai(ql),y1=m({},ql,{dataTransfer:0}),S1=ai(y1),b1=m({},da,{relatedTarget:0}),gu=ai(b1),w1=m({},ws,{animationName:0,elapsedTime:0,pseudoElement:0}),C1=ai(w1),E1=m({},ws,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),x1=ai(E1),A1=m({},ws,{data:0}),rp=ai(A1),k1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},T1={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"},R1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function D1(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=R1[i])?!!s[i]:!1}function vu(){return D1}var L1=m({},da,{key:function(i){if(i.key){var s=k1[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=Vl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?T1[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:vu,charCode:function(i){return i.type==="keypress"?Vl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Vl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),O1=ai(L1),M1=m({},ql,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sp=ai(M1),N1=m({},da,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:vu}),B1=ai(N1),z1=m({},ws,{propertyName:0,elapsedTime:0,pseudoElement:0}),P1=ai(z1),I1=m({},ql,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),H1=ai(I1),U1=m({},ws,{newState:0,oldState:0}),j1=ai(U1),V1=[9,13,27,32],yu=ur&&"CompositionEvent"in window,_a=null;ur&&"documentMode"in document&&(_a=document.documentMode);var $1=ur&&"TextEvent"in window&&!_a,np=ur&&(!yu||_a&&8<_a&&11>=_a),ap=" ",lp=!1;function op(i,s){switch(i){case"keyup":return V1.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cp(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var dn=!1;function G1(i,s){switch(i){case"compositionend":return cp(s);case"keypress":return s.which!==32?null:(lp=!0,ap);case"textInput":return i=s.data,i===ap&&lp?null:i;default:return null}}function q1(i,s){if(dn)return i==="compositionend"||!yu&&op(i,s)?(i=ep(),jl=_u=Ir=null,dn=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return np&&s.locale!=="ko"?null:s.data;default:return null}}var W1={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 up(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!W1[i.type]:s==="textarea"}function hp(i,s,a,o){un?hn?hn.push(o):hn=[o]:un=o,s=Bo(s,"onChange"),0<s.length&&(a=new Gl("onChange","change",null,a,o),i.push({event:a,listeners:s}))}var pa=null,ma=null;function F1(i){Fg(i,0)}function Wl(i){var s=ca(i);if(W_(s))return i}function dp(i,s){if(i==="change")return s}var fp=!1;if(ur){var Su;if(ur){var bu="oninput"in document;if(!bu){var _p=document.createElement("div");_p.setAttribute("oninput","return;"),bu=typeof _p.oninput=="function"}Su=bu}else Su=!1;fp=Su&&(!document.documentMode||9<document.documentMode)}function pp(){pa&&(pa.detachEvent("onpropertychange",mp),ma=pa=null)}function mp(i){if(i.propertyName==="value"&&Wl(ma)){var s=[];hp(s,ma,i,hu(i)),J_(F1,s)}}function Y1(i,s,a){i==="focusin"?(pp(),pa=s,ma=a,pa.attachEvent("onpropertychange",mp)):i==="focusout"&&pp()}function K1(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Wl(ma)}function X1(i,s){if(i==="click")return Wl(s)}function Z1(i,s){if(i==="input"||i==="change")return Wl(s)}function Q1(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var mi=typeof Object.is=="function"?Object.is:Q1;function ga(i,s){if(mi(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var a=Object.keys(i),o=Object.keys(s);if(a.length!==o.length)return!1;for(o=0;o<a.length;o++){var h=a[o];if(!ce.call(s,h)||!mi(i[h],s[h]))return!1}return!0}function gp(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function vp(i,s){var a=gp(i);i=0;for(var o;a;){if(a.nodeType===3){if(o=i+a.textContent.length,i<=s&&o>=s)return{node:a,offset:s-i};i=o}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=gp(a)}}function yp(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?yp(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function Sp(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Hl(i.document);s instanceof i.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)i=s.contentWindow;else break;s=Hl(i.document)}return s}function wu(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var J1=ur&&"documentMode"in document&&11>=document.documentMode,fn=null,Cu=null,va=null,Eu=!1;function bp(i,s,a){var o=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Eu||fn==null||fn!==Hl(o)||(o=fn,"selectionStart"in o&&wu(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),va&&ga(va,o)||(va=o,o=Bo(Cu,"onSelect"),0<o.length&&(s=new Gl("onSelect","select",null,s,a),i.push({event:s,listeners:o}),s.target=fn)))}function Cs(i,s){var a={};return a[i.toLowerCase()]=s.toLowerCase(),a["Webkit"+i]="webkit"+s,a["Moz"+i]="moz"+s,a}var _n={animationend:Cs("Animation","AnimationEnd"),animationiteration:Cs("Animation","AnimationIteration"),animationstart:Cs("Animation","AnimationStart"),transitionrun:Cs("Transition","TransitionRun"),transitionstart:Cs("Transition","TransitionStart"),transitioncancel:Cs("Transition","TransitionCancel"),transitionend:Cs("Transition","TransitionEnd")},xu={},wp={};ur&&(wp=document.createElement("div").style,"AnimationEvent"in window||(delete _n.animationend.animation,delete _n.animationiteration.animation,delete _n.animationstart.animation),"TransitionEvent"in window||delete _n.transitionend.transition);function Es(i){if(xu[i])return xu[i];if(!_n[i])return i;var s=_n[i],a;for(a in s)if(s.hasOwnProperty(a)&&a in wp)return xu[i]=s[a];return i}var Cp=Es("animationend"),Ep=Es("animationiteration"),xp=Es("animationstart"),ew=Es("transitionrun"),tw=Es("transitionstart"),iw=Es("transitioncancel"),Ap=Es("transitionend"),kp=new Map,Au="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(" ");Au.push("scrollEnd");function Gi(i,s){kp.set(i,s),bs(s,[i])}var Fl=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=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(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Ti=[],pn=0,ku=0;function Yl(){for(var i=pn,s=ku=pn=0;s<i;){var a=Ti[s];Ti[s++]=null;var o=Ti[s];Ti[s++]=null;var h=Ti[s];Ti[s++]=null;var p=Ti[s];if(Ti[s++]=null,o!==null&&h!==null){var g=o.pending;g===null?h.next=h:(h.next=g.next,g.next=h),o.pending=h}p!==0&&Tp(a,h,p)}}function Kl(i,s,a,o){Ti[pn++]=i,Ti[pn++]=s,Ti[pn++]=a,Ti[pn++]=o,ku|=o,i.lanes|=o,i=i.alternate,i!==null&&(i.lanes|=o)}function Tu(i,s,a,o){return Kl(i,s,a,o),Xl(i)}function xs(i,s){return Kl(i,null,null,s),Xl(i)}function Tp(i,s,a){i.lanes|=a;var o=i.alternate;o!==null&&(o.lanes|=a);for(var h=!1,p=i.return;p!==null;)p.childLanes|=a,o=p.alternate,o!==null&&(o.childLanes|=a),p.tag===22&&(i=p.stateNode,i===null||i._visibility&1||(h=!0)),i=p,p=p.return;return i.tag===3?(p=i.stateNode,h&&s!==null&&(h=31-pi(a),i=p.hiddenUpdates,o=i[h],o===null?i[h]=[s]:o.push(s),s.lane=a|536870912),p):null}function Xl(i){if(50<Ua)throw Ua=0,Ph=null,Error(n(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var mn={};function rw(i,s,a,o){this.tag=i,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function gi(i,s,a,o){return new rw(i,s,a,o)}function Ru(i){return i=i.prototype,!(!i||!i.isReactComponent)}function hr(i,s){var a=i.alternate;return a===null?(a=gi(i.tag,s,i.key,i.mode),a.elementType=i.elementType,a.type=i.type,a.stateNode=i.stateNode,a.alternate=i,i.alternate=a):(a.pendingProps=s,a.type=i.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=i.flags&65011712,a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,s=i.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=i.sibling,a.index=i.index,a.ref=i.ref,a.refCleanup=i.refCleanup,a}function Rp(i,s){i.flags&=65011714;var a=i.alternate;return a===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,s=a.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function Zl(i,s,a,o,h,p){var g=0;if(o=i,typeof i=="function")Ru(i)&&(g=1);else if(typeof i=="string")g=oC(i,a,te.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case Se:return i=gi(31,a,s,h),i.elementType=Se,i.lanes=p,i;case x:return As(a.children,h,p,s);case T:g=8,h|=24;break;case O:return i=gi(12,a,s,h|2),i.elementType=O,i.lanes=p,i;case j:return i=gi(13,a,s,h),i.elementType=j,i.lanes=p,i;case $:return i=gi(19,a,s,h),i.elementType=$,i.lanes=p,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case B:g=10;break e;case H:g=9;break e;case I:g=11;break e;case ee:g=14;break e;case ge:g=16,o=null;break e}g=29,a=Error(n(130,i===null?"null":typeof i,"")),o=null}return s=gi(g,a,s,h),s.elementType=i,s.type=o,s.lanes=p,s}function As(i,s,a,o){return i=gi(7,i,o,s),i.lanes=a,i}function Du(i,s,a){return i=gi(6,i,null,s),i.lanes=a,i}function Dp(i){var s=gi(18,null,null,0);return s.stateNode=i,s}function Lu(i,s,a){return s=gi(4,i.children!==null?i.children:[],i.key,s),s.lanes=a,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Lp=new WeakMap;function Ri(i,s){if(typeof i=="object"&&i!==null){var a=Lp.get(i);return a!==void 0?a:(s={value:i,source:s,stack:ie(s)},Lp.set(i,s),s)}return{value:i,source:s,stack:ie(s)}}var gn=[],vn=0,Ql=null,ya=0,Di=[],Li=0,Hr=null,Xi=1,Zi="";function dr(i,s){gn[vn++]=ya,gn[vn++]=Ql,Ql=i,ya=s}function Op(i,s,a){Di[Li++]=Xi,Di[Li++]=Zi,Di[Li++]=Hr,Hr=i;var o=Xi;i=Zi;var h=32-pi(o)-1;o&=~(1<<h),a+=1;var p=32-pi(s)+h;if(30<p){var g=h-h%5;p=(o&(1<<g)-1).toString(32),o>>=g,h-=g,Xi=1<<32-pi(s)+h|a<<h|o,Zi=p+i}else Xi=1<<p|a<<h|o,Zi=i}function Ou(i){i.return!==null&&(dr(i,1),Op(i,1,0))}function Mu(i){for(;i===Ql;)Ql=gn[--vn],gn[vn]=null,ya=gn[--vn],gn[vn]=null;for(;i===Hr;)Hr=Di[--Li],Di[Li]=null,Zi=Di[--Li],Di[Li]=null,Xi=Di[--Li],Di[Li]=null}function Mp(i,s){Di[Li++]=Xi,Di[Li++]=Zi,Di[Li++]=Hr,Xi=s.id,Zi=s.overflow,Hr=i}var jt=null,tt=null,He=!1,Ur=null,Oi=!1,Nu=Error(n(519));function jr(i){var s=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Sa(Ri(s,i)),Nu}function Np(i){var s=i.stateNode,a=i.type,o=i.memoizedProps;switch(s[Ut]=i,s[ni]=o,a){case"dialog":Be("cancel",s),Be("close",s);break;case"iframe":case"object":case"embed":Be("load",s);break;case"video":case"audio":for(a=0;a<Va.length;a++)Be(Va[a],s);break;case"source":Be("error",s);break;case"img":case"image":case"link":Be("error",s),Be("load",s);break;case"details":Be("toggle",s);break;case"input":Be("invalid",s),F_(s,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Be("invalid",s);break;case"textarea":Be("invalid",s),K_(s,o.value,o.defaultValue,o.children)}a=o.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||s.textContent===""+a||o.suppressHydrationWarning===!0||Zg(s.textContent,a)?(o.popover!=null&&(Be("beforetoggle",s),Be("toggle",s)),o.onScroll!=null&&Be("scroll",s),o.onScrollEnd!=null&&Be("scrollend",s),o.onClick!=null&&(s.onclick=cr),s=!0):s=!1,s||jr(i,!0)}function Bp(i){for(jt=i.return;jt;)switch(jt.tag){case 5:case 31:case 13:Oi=!1;return;case 27:case 3:Oi=!0;return;default:jt=jt.return}}function yn(i){if(i!==jt)return!1;if(!He)return Bp(i),He=!0,!1;var s=i.tag,a;if((a=s!==3&&s!==27)&&((a=s===5)&&(a=i.type,a=!(a!=="form"&&a!=="button")||Qh(i.type,i.memoizedProps)),a=!a),a&&tt&&jr(i),Bp(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));tt=av(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));tt=av(i)}else s===27?(s=tt,ts(i.type)?(i=rd,rd=null,tt=i):tt=s):tt=jt?Ni(i.stateNode.nextSibling):null;return!0}function ks(){tt=jt=null,He=!1}function Bu(){var i=Ur;return i!==null&&(ui===null?ui=i:ui.push.apply(ui,i),Ur=null),i}function Sa(i){Ur===null?Ur=[i]:Ur.push(i)}var zu=E(null),Ts=null,fr=null;function Vr(i,s,a){X(zu,s._currentValue),s._currentValue=a}function _r(i){i._currentValue=zu.current,M(zu)}function Pu(i,s,a){for(;i!==null;){var o=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,o!==null&&(o.childLanes|=s)):o!==null&&(o.childLanes&s)!==s&&(o.childLanes|=s),i===a)break;i=i.return}}function Iu(i,s,a,o){var h=i.child;for(h!==null&&(h.return=i);h!==null;){var p=h.dependencies;if(p!==null){var g=h.child;p=p.firstContext;e:for(;p!==null;){var w=p;p=h;for(var A=0;A<s.length;A++)if(w.context===s[A]){p.lanes|=a,w=p.alternate,w!==null&&(w.lanes|=a),Pu(p.return,a,i),o||(g=null);break e}p=w.next}}else if(h.tag===18){if(g=h.return,g===null)throw Error(n(341));g.lanes|=a,p=g.alternate,p!==null&&(p.lanes|=a),Pu(g,a,i),g=null}else g=h.child;if(g!==null)g.return=h;else for(g=h;g!==null;){if(g===i){g=null;break}if(h=g.sibling,h!==null){h.return=g.return,g=h;break}g=g.return}h=g}}function Sn(i,s,a,o){i=null;for(var h=s,p=!1;h!==null;){if(!p){if((h.flags&524288)!==0)p=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var g=h.alternate;if(g===null)throw Error(n(387));if(g=g.memoizedProps,g!==null){var w=h.type;mi(h.pendingProps.value,g.value)||(i!==null?i.push(w):i=[w])}}else if(h===we.current){if(g=h.alternate,g===null)throw Error(n(387));g.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(i!==null?i.push(Fa):i=[Fa])}h=h.return}i!==null&&Iu(s,i,a,o),s.flags|=262144}function Jl(i){for(i=i.firstContext;i!==null;){if(!mi(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Rs(i){Ts=i,fr=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Vt(i){return zp(Ts,i)}function eo(i,s){return Ts===null&&Rs(i),zp(i,s)}function zp(i,s){var a=s._currentValue;if(s={context:s,memoizedValue:a,next:null},fr===null){if(i===null)throw Error(n(308));fr=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else fr=fr.next=s;return a}var sw=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(a,o){i.push(o)}};this.abort=function(){s.aborted=!0,i.forEach(function(a){return a()})}},nw=e.unstable_scheduleCallback,aw=e.unstable_NormalPriority,gt={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hu(){return{controller:new sw,data:new Map,refCount:0}}function ba(i){i.refCount--,i.refCount===0&&nw(aw,function(){i.controller.abort()})}var wa=null,Uu=0,bn=0,wn=null;function lw(i,s){if(wa===null){var a=wa=[];Uu=0,bn=$h(),wn={status:"pending",value:void 0,then:function(o){a.push(o)}}}return Uu++,s.then(Pp,Pp),s}function Pp(){if(--Uu===0&&wa!==null){wn!==null&&(wn.status="fulfilled");var i=wa;wa=null,bn=0,wn=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function ow(i,s){var a=[],o={status:"pending",value:null,reason:null,then:function(h){a.push(h)}};return i.then(function(){o.status="fulfilled",o.value=s;for(var h=0;h<a.length;h++)(0,a[h])(s)},function(h){for(o.status="rejected",o.reason=h,h=0;h<a.length;h++)(0,a[h])(void 0)}),o}var Ip=D.S;D.S=function(i,s){bg=Yt(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&lw(i,s),Ip!==null&&Ip(i,s)};var Ds=E(null);function ju(){var i=Ds.current;return i!==null?i:Qe.pooledCache}function to(i,s){s===null?X(Ds,Ds.current):X(Ds,s.pool)}function Hp(){var i=ju();return i===null?null:{parent:gt._currentValue,pool:i}}var Cn=Error(n(460)),Vu=Error(n(474)),io=Error(n(542)),ro={then:function(){}};function Up(i){return i=i.status,i==="fulfilled"||i==="rejected"}function jp(i,s,a){switch(a=i[a],a===void 0?i.push(s):a!==s&&(s.then(cr,cr),s=a),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,$p(i),i;default:if(typeof s.status=="string")s.then(cr,cr);else{if(i=Qe,i!==null&&100<i.shellSuspendCounter)throw Error(n(482));i=s,i.status="pending",i.then(function(o){if(s.status==="pending"){var h=s;h.status="fulfilled",h.value=o}},function(o){if(s.status==="pending"){var h=s;h.status="rejected",h.reason=o}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,$p(i),i}throw Os=s,Cn}}function Ls(i){try{var s=i._init;return s(i._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Os=a,Cn):a}}var Os=null;function Vp(){if(Os===null)throw Error(n(459));var i=Os;return Os=null,i}function $p(i){if(i===Cn||i===io)throw Error(n(483))}var En=null,Ca=0;function so(i){var s=Ca;return Ca+=1,En===null&&(En=[]),jp(En,i,s)}function Ea(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function no(i,s){throw s.$$typeof===y?Error(n(525)):(i=Object.prototype.toString.call(s),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function Gp(i){function s(L,R){if(i){var N=L.deletions;N===null?(L.deletions=[R],L.flags|=16):N.push(R)}}function a(L,R){if(!i)return null;for(;R!==null;)s(L,R),R=R.sibling;return null}function o(L){for(var R=new Map;L!==null;)L.key!==null?R.set(L.key,L):R.set(L.index,L),L=L.sibling;return R}function h(L,R){return L=hr(L,R),L.index=0,L.sibling=null,L}function p(L,R,N){return L.index=N,i?(N=L.alternate,N!==null?(N=N.index,N<R?(L.flags|=67108866,R):N):(L.flags|=67108866,R)):(L.flags|=1048576,R)}function g(L){return i&&L.alternate===null&&(L.flags|=67108866),L}function w(L,R,N,K){return R===null||R.tag!==6?(R=Du(N,L.mode,K),R.return=L,R):(R=h(R,N),R.return=L,R)}function A(L,R,N,K){var ye=N.type;return ye===x?G(L,R,N.props.children,K,N.key):R!==null&&(R.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===ge&&Ls(ye)===R.type)?(R=h(R,N.props),Ea(R,N),R.return=L,R):(R=Zl(N.type,N.key,N.props,null,L.mode,K),Ea(R,N),R.return=L,R)}function z(L,R,N,K){return R===null||R.tag!==4||R.stateNode.containerInfo!==N.containerInfo||R.stateNode.implementation!==N.implementation?(R=Lu(N,L.mode,K),R.return=L,R):(R=h(R,N.children||[]),R.return=L,R)}function G(L,R,N,K,ye){return R===null||R.tag!==7?(R=As(N,L.mode,K,ye),R.return=L,R):(R=h(R,N),R.return=L,R)}function Z(L,R,N){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=Du(""+R,L.mode,N),R.return=L,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case S:return N=Zl(R.type,R.key,R.props,null,L.mode,N),Ea(N,R),N.return=L,N;case b:return R=Lu(R,L.mode,N),R.return=L,R;case ge:return R=Ls(R),Z(L,R,N)}if(se(R)||J(R))return R=As(R,L.mode,N,null),R.return=L,R;if(typeof R.then=="function")return Z(L,so(R),N);if(R.$$typeof===B)return Z(L,eo(L,R),N);no(L,R)}return null}function P(L,R,N,K){var ye=R!==null?R.key:null;if(typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint")return ye!==null?null:w(L,R,""+N,K);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case S:return N.key===ye?A(L,R,N,K):null;case b:return N.key===ye?z(L,R,N,K):null;case ge:return N=Ls(N),P(L,R,N,K)}if(se(N)||J(N))return ye!==null?null:G(L,R,N,K,null);if(typeof N.then=="function")return P(L,R,so(N),K);if(N.$$typeof===B)return P(L,R,eo(L,N),K);no(L,N)}return null}function U(L,R,N,K,ye){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return L=L.get(N)||null,w(R,L,""+K,ye);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case S:return L=L.get(K.key===null?N:K.key)||null,A(R,L,K,ye);case b:return L=L.get(K.key===null?N:K.key)||null,z(R,L,K,ye);case ge:return K=Ls(K),U(L,R,N,K,ye)}if(se(K)||J(K))return L=L.get(N)||null,G(R,L,K,ye,null);if(typeof K.then=="function")return U(L,R,N,so(K),ye);if(K.$$typeof===B)return U(L,R,N,eo(R,K),ye);no(R,K)}return null}function fe(L,R,N,K){for(var ye=null,Ue=null,me=R,De=R=0,Ie=null;me!==null&&De<N.length;De++){me.index>De?(Ie=me,me=null):Ie=me.sibling;var je=P(L,me,N[De],K);if(je===null){me===null&&(me=Ie);break}i&&me&&je.alternate===null&&s(L,me),R=p(je,R,De),Ue===null?ye=je:Ue.sibling=je,Ue=je,me=Ie}if(De===N.length)return a(L,me),He&&dr(L,De),ye;if(me===null){for(;De<N.length;De++)me=Z(L,N[De],K),me!==null&&(R=p(me,R,De),Ue===null?ye=me:Ue.sibling=me,Ue=me);return He&&dr(L,De),ye}for(me=o(me);De<N.length;De++)Ie=U(me,L,De,N[De],K),Ie!==null&&(i&&Ie.alternate!==null&&me.delete(Ie.key===null?De:Ie.key),R=p(Ie,R,De),Ue===null?ye=Ie:Ue.sibling=Ie,Ue=Ie);return i&&me.forEach(function(as){return s(L,as)}),He&&dr(L,De),ye}function be(L,R,N,K){if(N==null)throw Error(n(151));for(var ye=null,Ue=null,me=R,De=R=0,Ie=null,je=N.next();me!==null&&!je.done;De++,je=N.next()){me.index>De?(Ie=me,me=null):Ie=me.sibling;var as=P(L,me,je.value,K);if(as===null){me===null&&(me=Ie);break}i&&me&&as.alternate===null&&s(L,me),R=p(as,R,De),Ue===null?ye=as:Ue.sibling=as,Ue=as,me=Ie}if(je.done)return a(L,me),He&&dr(L,De),ye;if(me===null){for(;!je.done;De++,je=N.next())je=Z(L,je.value,K),je!==null&&(R=p(je,R,De),Ue===null?ye=je:Ue.sibling=je,Ue=je);return He&&dr(L,De),ye}for(me=o(me);!je.done;De++,je=N.next())je=U(me,L,De,je.value,K),je!==null&&(i&&je.alternate!==null&&me.delete(je.key===null?De:je.key),R=p(je,R,De),Ue===null?ye=je:Ue.sibling=je,Ue=je);return i&&me.forEach(function(yC){return s(L,yC)}),He&&dr(L,De),ye}function Ke(L,R,N,K){if(typeof N=="object"&&N!==null&&N.type===x&&N.key===null&&(N=N.props.children),typeof N=="object"&&N!==null){switch(N.$$typeof){case S:e:{for(var ye=N.key;R!==null;){if(R.key===ye){if(ye=N.type,ye===x){if(R.tag===7){a(L,R.sibling),K=h(R,N.props.children),K.return=L,L=K;break e}}else if(R.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===ge&&Ls(ye)===R.type){a(L,R.sibling),K=h(R,N.props),Ea(K,N),K.return=L,L=K;break e}a(L,R);break}else s(L,R);R=R.sibling}N.type===x?(K=As(N.props.children,L.mode,K,N.key),K.return=L,L=K):(K=Zl(N.type,N.key,N.props,null,L.mode,K),Ea(K,N),K.return=L,L=K)}return g(L);case b:e:{for(ye=N.key;R!==null;){if(R.key===ye)if(R.tag===4&&R.stateNode.containerInfo===N.containerInfo&&R.stateNode.implementation===N.implementation){a(L,R.sibling),K=h(R,N.children||[]),K.return=L,L=K;break e}else{a(L,R);break}else s(L,R);R=R.sibling}K=Lu(N,L.mode,K),K.return=L,L=K}return g(L);case ge:return N=Ls(N),Ke(L,R,N,K)}if(se(N))return fe(L,R,N,K);if(J(N)){if(ye=J(N),typeof ye!="function")throw Error(n(150));return N=ye.call(N),be(L,R,N,K)}if(typeof N.then=="function")return Ke(L,R,so(N),K);if(N.$$typeof===B)return Ke(L,R,eo(L,N),K);no(L,N)}return typeof N=="string"&&N!==""||typeof N=="number"||typeof N=="bigint"?(N=""+N,R!==null&&R.tag===6?(a(L,R.sibling),K=h(R,N),K.return=L,L=K):(a(L,R),K=Du(N,L.mode,K),K.return=L,L=K),g(L)):a(L,R)}return function(L,R,N,K){try{Ca=0;var ye=Ke(L,R,N,K);return En=null,ye}catch(me){if(me===Cn||me===io)throw me;var Ue=gi(29,me,null,L.mode);return Ue.lanes=K,Ue.return=L,Ue}finally{}}}var Ms=Gp(!0),qp=Gp(!1),$r=!1;function $u(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gu(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Gr(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function qr(i,s,a){var o=i.updateQueue;if(o===null)return null;if(o=o.shared,(Ve&2)!==0){var h=o.pending;return h===null?s.next=s:(s.next=h.next,h.next=s),o.pending=s,s=Xl(i),Tp(i,null,a),s}return Kl(i,o,s,a),Xl(i)}function xa(i,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194048)!==0)){var o=s.lanes;o&=i.pendingLanes,a|=o,s.lanes=a,z_(i,a)}}function qu(i,s){var a=i.updateQueue,o=i.alternate;if(o!==null&&(o=o.updateQueue,a===o)){var h=null,p=null;if(a=a.firstBaseUpdate,a!==null){do{var g={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};p===null?h=p=g:p=p.next=g,a=a.next}while(a!==null);p===null?h=p=s:p=p.next=s}else h=p=s;a={baseState:o.baseState,firstBaseUpdate:h,lastBaseUpdate:p,shared:o.shared,callbacks:o.callbacks},i.updateQueue=a;return}i=a.lastBaseUpdate,i===null?a.firstBaseUpdate=s:i.next=s,a.lastBaseUpdate=s}var Wu=!1;function Aa(){if(Wu){var i=wn;if(i!==null)throw i}}function ka(i,s,a,o){Wu=!1;var h=i.updateQueue;$r=!1;var p=h.firstBaseUpdate,g=h.lastBaseUpdate,w=h.shared.pending;if(w!==null){h.shared.pending=null;var A=w,z=A.next;A.next=null,g===null?p=z:g.next=z,g=A;var G=i.alternate;G!==null&&(G=G.updateQueue,w=G.lastBaseUpdate,w!==g&&(w===null?G.firstBaseUpdate=z:w.next=z,G.lastBaseUpdate=A))}if(p!==null){var Z=h.baseState;g=0,G=z=A=null,w=p;do{var P=w.lane&-536870913,U=P!==w.lane;if(U?(Pe&P)===P:(o&P)===P){P!==0&&P===bn&&(Wu=!0),G!==null&&(G=G.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var fe=i,be=w;P=s;var Ke=a;switch(be.tag){case 1:if(fe=be.payload,typeof fe=="function"){Z=fe.call(Ke,Z,P);break e}Z=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=be.payload,P=typeof fe=="function"?fe.call(Ke,Z,P):fe,P==null)break e;Z=m({},Z,P);break e;case 2:$r=!0}}P=w.callback,P!==null&&(i.flags|=64,U&&(i.flags|=8192),U=h.callbacks,U===null?h.callbacks=[P]:U.push(P))}else U={lane:P,tag:w.tag,payload:w.payload,callback:w.callback,next:null},G===null?(z=G=U,A=Z):G=G.next=U,g|=P;if(w=w.next,w===null){if(w=h.shared.pending,w===null)break;U=w,w=U.next,U.next=null,h.lastBaseUpdate=U,h.shared.pending=null}}while(!0);G===null&&(A=Z),h.baseState=A,h.firstBaseUpdate=z,h.lastBaseUpdate=G,p===null&&(h.shared.lanes=0),Xr|=g,i.lanes=g,i.memoizedState=Z}}function Wp(i,s){if(typeof i!="function")throw Error(n(191,i));i.call(s)}function Fp(i,s){var a=i.callbacks;if(a!==null)for(i.callbacks=null,i=0;i<a.length;i++)Wp(a[i],s)}var xn=E(null),ao=E(0);function Yp(i,s){i=Cr,X(ao,i),X(xn,s),Cr=i|s.baseLanes}function Fu(){X(ao,Cr),X(xn,xn.current)}function Yu(){Cr=ao.current,M(xn),M(ao)}var vi=E(null),Mi=null;function Wr(i){var s=i.alternate;X(ft,ft.current&1),X(vi,i),Mi===null&&(s===null||xn.current!==null||s.memoizedState!==null)&&(Mi=i)}function Ku(i){X(ft,ft.current),X(vi,i),Mi===null&&(Mi=i)}function Kp(i){i.tag===22?(X(ft,ft.current),X(vi,i),Mi===null&&(Mi=i)):Fr()}function Fr(){X(ft,ft.current),X(vi,vi.current)}function yi(i){M(vi),Mi===i&&(Mi=null),M(ft)}var ft=E(0);function lo(i){for(var s=i;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||td(a)||id(a)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var pr=0,ke=null,Fe=null,vt=null,oo=!1,An=!1,Ns=!1,co=0,Ta=0,kn=null,cw=0;function ct(){throw Error(n(321))}function Xu(i,s){if(s===null)return!1;for(var a=0;a<s.length&&a<i.length;a++)if(!mi(i[a],s[a]))return!1;return!0}function Zu(i,s,a,o,h,p){return pr=p,ke=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,D.H=i===null||i.memoizedState===null?Om:dh,Ns=!1,p=a(o,h),Ns=!1,An&&(p=Zp(s,a,o,h)),Xp(i),p}function Xp(i){D.H=La;var s=Fe!==null&&Fe.next!==null;if(pr=0,vt=Fe=ke=null,oo=!1,Ta=0,kn=null,s)throw Error(n(300));i===null||yt||(i=i.dependencies,i!==null&&Jl(i)&&(yt=!0))}function Zp(i,s,a,o){ke=i;var h=0;do{if(An&&(kn=null),Ta=0,An=!1,25<=h)throw Error(n(301));if(h+=1,vt=Fe=null,i.updateQueue!=null){var p=i.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}D.H=Mm,p=s(a,o)}while(An);return p}function uw(){var i=D.H,s=i.useState()[0];return s=typeof s.then=="function"?Ra(s):s,i=i.useState()[0],(Fe!==null?Fe.memoizedState:null)!==i&&(ke.flags|=1024),s}function Qu(){var i=co!==0;return co=0,i}function Ju(i,s,a){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~a}function eh(i){if(oo){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}oo=!1}pr=0,vt=Fe=ke=null,An=!1,Ta=co=0,kn=null}function Jt(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vt===null?ke.memoizedState=vt=i:vt=vt.next=i,vt}function _t(){if(Fe===null){var i=ke.alternate;i=i!==null?i.memoizedState:null}else i=Fe.next;var s=vt===null?ke.memoizedState:vt.next;if(s!==null)vt=s,Fe=i;else{if(i===null)throw ke.alternate===null?Error(n(467)):Error(n(310));Fe=i,i={memoizedState:Fe.memoizedState,baseState:Fe.baseState,baseQueue:Fe.baseQueue,queue:Fe.queue,next:null},vt===null?ke.memoizedState=vt=i:vt=vt.next=i}return vt}function uo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ra(i){var s=Ta;return Ta+=1,kn===null&&(kn=[]),i=jp(kn,i,s),s=ke,(vt===null?s.memoizedState:vt.next)===null&&(s=s.alternate,D.H=s===null||s.memoizedState===null?Om:dh),i}function ho(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ra(i);if(i.$$typeof===B)return Vt(i)}throw Error(n(438,String(i)))}function th(i){var s=null,a=ke.updateQueue;if(a!==null&&(s=a.memoCache),s==null){var o=ke.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(s={data:o.data.map(function(h){return h.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),a===null&&(a=uo(),ke.updateQueue=a),a.memoCache=s,a=s.data[s.index],a===void 0)for(a=s.data[s.index]=Array(i),o=0;o<i;o++)a[o]=_e;return s.index++,a}function mr(i,s){return typeof s=="function"?s(i):s}function fo(i){var s=_t();return ih(s,Fe,i)}function ih(i,s,a){var o=i.queue;if(o===null)throw Error(n(311));o.lastRenderedReducer=a;var h=i.baseQueue,p=o.pending;if(p!==null){if(h!==null){var g=h.next;h.next=p.next,p.next=g}s.baseQueue=h=p,o.pending=null}if(p=i.baseState,h===null)i.memoizedState=p;else{s=h.next;var w=g=null,A=null,z=s,G=!1;do{var Z=z.lane&-536870913;if(Z!==z.lane?(Pe&Z)===Z:(pr&Z)===Z){var P=z.revertLane;if(P===0)A!==null&&(A=A.next={lane:0,revertLane:0,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null}),Z===bn&&(G=!0);else if((pr&P)===P){z=z.next,P===bn&&(G=!0);continue}else Z={lane:0,revertLane:z.revertLane,gesture:null,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},A===null?(w=A=Z,g=p):A=A.next=Z,ke.lanes|=P,Xr|=P;Z=z.action,Ns&&a(p,Z),p=z.hasEagerState?z.eagerState:a(p,Z)}else P={lane:Z,revertLane:z.revertLane,gesture:z.gesture,action:z.action,hasEagerState:z.hasEagerState,eagerState:z.eagerState,next:null},A===null?(w=A=P,g=p):A=A.next=P,ke.lanes|=Z,Xr|=Z;z=z.next}while(z!==null&&z!==s);if(A===null?g=p:A.next=w,!mi(p,i.memoizedState)&&(yt=!0,G&&(a=wn,a!==null)))throw a;i.memoizedState=p,i.baseState=g,i.baseQueue=A,o.lastRenderedState=p}return h===null&&(o.lanes=0),[i.memoizedState,o.dispatch]}function rh(i){var s=_t(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=i;var o=a.dispatch,h=a.pending,p=s.memoizedState;if(h!==null){a.pending=null;var g=h=h.next;do p=i(p,g.action),g=g.next;while(g!==h);mi(p,s.memoizedState)||(yt=!0),s.memoizedState=p,s.baseQueue===null&&(s.baseState=p),a.lastRenderedState=p}return[p,o]}function Qp(i,s,a){var o=ke,h=_t(),p=He;if(p){if(a===void 0)throw Error(n(407));a=a()}else a=s();var g=!mi((Fe||h).memoizedState,a);if(g&&(h.memoizedState=a,yt=!0),h=h.queue,ah(tm.bind(null,o,h,i),[i]),h.getSnapshot!==s||g||vt!==null&&vt.memoizedState.tag&1){if(o.flags|=2048,Tn(9,{destroy:void 0},em.bind(null,o,h,a,s),null),Qe===null)throw Error(n(349));p||(pr&127)!==0||Jp(o,s,a)}return a}function Jp(i,s,a){i.flags|=16384,i={getSnapshot:s,value:a},s=ke.updateQueue,s===null?(s=uo(),ke.updateQueue=s,s.stores=[i]):(a=s.stores,a===null?s.stores=[i]:a.push(i))}function em(i,s,a,o){s.value=a,s.getSnapshot=o,im(s)&&rm(i)}function tm(i,s,a){return a(function(){im(s)&&rm(i)})}function im(i){var s=i.getSnapshot;i=i.value;try{var a=s();return!mi(i,a)}catch{return!0}}function rm(i){var s=xs(i,2);s!==null&&hi(s,i,2)}function sh(i){var s=Jt();if(typeof i=="function"){var a=i;if(i=a(),Ns){zr(!0);try{a()}finally{zr(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mr,lastRenderedState:i},s}function sm(i,s,a,o){return i.baseState=a,ih(i,Fe,typeof o=="function"?o:mr)}function hw(i,s,a,o,h){if(mo(i))throw Error(n(485));if(i=s.action,i!==null){var p={payload:h,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){p.listeners.push(g)}};D.T!==null?a(!0):p.isTransition=!1,o(p),a=s.pending,a===null?(p.next=s.pending=p,nm(s,p)):(p.next=a.next,s.pending=a.next=p)}}function nm(i,s){var a=s.action,o=s.payload,h=i.state;if(s.isTransition){var p=D.T,g={};D.T=g;try{var w=a(h,o),A=D.S;A!==null&&A(g,w),am(i,s,w)}catch(z){nh(i,s,z)}finally{p!==null&&g.types!==null&&(p.types=g.types),D.T=p}}else try{p=a(h,o),am(i,s,p)}catch(z){nh(i,s,z)}}function am(i,s,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(o){lm(i,s,o)},function(o){return nh(i,s,o)}):lm(i,s,a)}function lm(i,s,a){s.status="fulfilled",s.value=a,om(s),i.state=a,s=i.pending,s!==null&&(a=s.next,a===s?i.pending=null:(a=a.next,s.next=a,nm(i,a)))}function nh(i,s,a){var o=i.pending;if(i.pending=null,o!==null){o=o.next;do s.status="rejected",s.reason=a,om(s),s=s.next;while(s!==o)}i.action=null}function om(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function cm(i,s){return s}function um(i,s){if(He){var a=Qe.formState;if(a!==null){e:{var o=ke;if(He){if(tt){t:{for(var h=tt,p=Oi;h.nodeType!==8;){if(!p){h=null;break t}if(h=Ni(h.nextSibling),h===null){h=null;break t}}p=h.data,h=p==="F!"||p==="F"?h:null}if(h){tt=Ni(h.nextSibling),o=h.data==="F!";break e}}jr(o)}o=!1}o&&(s=a[0])}}return a=Jt(),a.memoizedState=a.baseState=s,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cm,lastRenderedState:s},a.queue=o,a=Rm.bind(null,ke,o),o.dispatch=a,o=sh(!1),p=hh.bind(null,ke,!1,o.queue),o=Jt(),h={state:s,dispatch:null,action:i,pending:null},o.queue=h,a=hw.bind(null,ke,h,p,a),h.dispatch=a,o.memoizedState=i,[s,a,!1]}function hm(i){var s=_t();return dm(s,Fe,i)}function dm(i,s,a){if(s=ih(i,s,cm)[0],i=fo(mr)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var o=Ra(s)}catch(g){throw g===Cn?io:g}else o=s;s=_t();var h=s.queue,p=h.dispatch;return a!==s.memoizedState&&(ke.flags|=2048,Tn(9,{destroy:void 0},dw.bind(null,h,a),null)),[o,p,i]}function dw(i,s){i.action=s}function fm(i){var s=_t(),a=Fe;if(a!==null)return dm(s,a,i);_t(),s=s.memoizedState,a=_t();var o=a.queue.dispatch;return a.memoizedState=i,[s,o,!1]}function Tn(i,s,a,o){return i={tag:i,create:a,deps:o,inst:s,next:null},s=ke.updateQueue,s===null&&(s=uo(),ke.updateQueue=s),a=s.lastEffect,a===null?s.lastEffect=i.next=i:(o=a.next,a.next=i,i.next=o,s.lastEffect=i),i}function _m(){return _t().memoizedState}function _o(i,s,a,o){var h=Jt();ke.flags|=i,h.memoizedState=Tn(1|s,{destroy:void 0},a,o===void 0?null:o)}function po(i,s,a,o){var h=_t();o=o===void 0?null:o;var p=h.memoizedState.inst;Fe!==null&&o!==null&&Xu(o,Fe.memoizedState.deps)?h.memoizedState=Tn(s,p,a,o):(ke.flags|=i,h.memoizedState=Tn(1|s,p,a,o))}function pm(i,s){_o(8390656,8,i,s)}function ah(i,s){po(2048,8,i,s)}function fw(i){ke.flags|=4;var s=ke.updateQueue;if(s===null)s=uo(),ke.updateQueue=s,s.events=[i];else{var a=s.events;a===null?s.events=[i]:a.push(i)}}function mm(i){var s=_t().memoizedState;return fw({ref:s,nextImpl:i}),function(){if((Ve&2)!==0)throw Error(n(440));return s.impl.apply(void 0,arguments)}}function gm(i,s){return po(4,2,i,s)}function vm(i,s){return po(4,4,i,s)}function ym(i,s){if(typeof s=="function"){i=i();var a=s(i);return function(){typeof a=="function"?a():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function Sm(i,s,a){a=a!=null?a.concat([i]):null,po(4,4,ym.bind(null,s,i),a)}function lh(){}function bm(i,s){var a=_t();s=s===void 0?null:s;var o=a.memoizedState;return s!==null&&Xu(s,o[1])?o[0]:(a.memoizedState=[i,s],i)}function wm(i,s){var a=_t();s=s===void 0?null:s;var o=a.memoizedState;if(s!==null&&Xu(s,o[1]))return o[0];if(o=i(),Ns){zr(!0);try{i()}finally{zr(!1)}}return a.memoizedState=[o,s],o}function oh(i,s,a){return a===void 0||(pr&1073741824)!==0&&(Pe&261930)===0?i.memoizedState=s:(i.memoizedState=a,i=Cg(),ke.lanes|=i,Xr|=i,a)}function Cm(i,s,a,o){return mi(a,s)?a:xn.current!==null?(i=oh(i,a,o),mi(i,s)||(yt=!0),i):(pr&42)===0||(pr&1073741824)!==0&&(Pe&261930)===0?(yt=!0,i.memoizedState=a):(i=Cg(),ke.lanes|=i,Xr|=i,s)}function Em(i,s,a,o,h){var p=q.p;q.p=p!==0&&8>p?p:8;var g=D.T,w={};D.T=w,hh(i,!1,s,a);try{var A=h(),z=D.S;if(z!==null&&z(w,A),A!==null&&typeof A=="object"&&typeof A.then=="function"){var G=ow(A,o);Da(i,s,G,wi(i))}else Da(i,s,o,wi(i))}catch(Z){Da(i,s,{then:function(){},status:"rejected",reason:Z},wi())}finally{q.p=p,g!==null&&w.types!==null&&(g.types=w.types),D.T=g}}function _w(){}function ch(i,s,a,o){if(i.tag!==5)throw Error(n(476));var h=xm(i).queue;Em(i,h,s,F,a===null?_w:function(){return Am(i),a(o)})}function xm(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mr,lastRenderedState:F},next:null};var a={};return s.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mr,lastRenderedState:a},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function Am(i){var s=xm(i);s.next===null&&(s=i.alternate.memoizedState),Da(i,s.next.queue,{},wi())}function uh(){return Vt(Fa)}function km(){return _t().memoizedState}function Tm(){return _t().memoizedState}function pw(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var a=wi();i=Gr(a);var o=qr(s,i,a);o!==null&&(hi(o,s,a),xa(o,s,a)),s={cache:Hu()},i.payload=s;return}s=s.return}}function mw(i,s,a){var o=wi();a={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},mo(i)?Dm(s,a):(a=Tu(i,s,a,o),a!==null&&(hi(a,i,o),Lm(a,s,o)))}function Rm(i,s,a){var o=wi();Da(i,s,a,o)}function Da(i,s,a,o){var h={lane:o,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(mo(i))Dm(s,h);else{var p=i.alternate;if(i.lanes===0&&(p===null||p.lanes===0)&&(p=s.lastRenderedReducer,p!==null))try{var g=s.lastRenderedState,w=p(g,a);if(h.hasEagerState=!0,h.eagerState=w,mi(w,g))return Kl(i,s,h,0),Qe===null&&Yl(),!1}catch{}finally{}if(a=Tu(i,s,h,o),a!==null)return hi(a,i,o),Lm(a,s,o),!0}return!1}function hh(i,s,a,o){if(o={lane:2,revertLane:$h(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},mo(i)){if(s)throw Error(n(479))}else s=Tu(i,a,o,2),s!==null&&hi(s,i,2)}function mo(i){var s=i.alternate;return i===ke||s!==null&&s===ke}function Dm(i,s){An=oo=!0;var a=i.pending;a===null?s.next=s:(s.next=a.next,a.next=s),i.pending=s}function Lm(i,s,a){if((a&4194048)!==0){var o=s.lanes;o&=i.pendingLanes,a|=o,s.lanes=a,z_(i,a)}}var La={readContext:Vt,use:ho,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};La.useEffectEvent=ct;var Om={readContext:Vt,use:ho,useCallback:function(i,s){return Jt().memoizedState=[i,s===void 0?null:s],i},useContext:Vt,useEffect:pm,useImperativeHandle:function(i,s,a){a=a!=null?a.concat([i]):null,_o(4194308,4,ym.bind(null,s,i),a)},useLayoutEffect:function(i,s){return _o(4194308,4,i,s)},useInsertionEffect:function(i,s){_o(4,2,i,s)},useMemo:function(i,s){var a=Jt();s=s===void 0?null:s;var o=i();if(Ns){zr(!0);try{i()}finally{zr(!1)}}return a.memoizedState=[o,s],o},useReducer:function(i,s,a){var o=Jt();if(a!==void 0){var h=a(s);if(Ns){zr(!0);try{a(s)}finally{zr(!1)}}}else h=s;return o.memoizedState=o.baseState=h,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:h},o.queue=i,i=i.dispatch=mw.bind(null,ke,i),[o.memoizedState,i]},useRef:function(i){var s=Jt();return i={current:i},s.memoizedState=i},useState:function(i){i=sh(i);var s=i.queue,a=Rm.bind(null,ke,s);return s.dispatch=a,[i.memoizedState,a]},useDebugValue:lh,useDeferredValue:function(i,s){var a=Jt();return oh(a,i,s)},useTransition:function(){var i=sh(!1);return i=Em.bind(null,ke,i.queue,!0,!1),Jt().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,a){var o=ke,h=Jt();if(He){if(a===void 0)throw Error(n(407));a=a()}else{if(a=s(),Qe===null)throw Error(n(349));(Pe&127)!==0||Jp(o,s,a)}h.memoizedState=a;var p={value:a,getSnapshot:s};return h.queue=p,pm(tm.bind(null,o,p,i),[i]),o.flags|=2048,Tn(9,{destroy:void 0},em.bind(null,o,p,a,s),null),a},useId:function(){var i=Jt(),s=Qe.identifierPrefix;if(He){var a=Zi,o=Xi;a=(o&~(1<<32-pi(o)-1)).toString(32)+a,s="_"+s+"R_"+a,a=co++,0<a&&(s+="H"+a.toString(32)),s+="_"}else a=cw++,s="_"+s+"r_"+a.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:uh,useFormState:um,useActionState:um,useOptimistic:function(i){var s=Jt();s.memoizedState=s.baseState=i;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=a,s=hh.bind(null,ke,!0,a),a.dispatch=s,[i,s]},useMemoCache:th,useCacheRefresh:function(){return Jt().memoizedState=pw.bind(null,ke)},useEffectEvent:function(i){var s=Jt(),a={impl:i};return s.memoizedState=a,function(){if((Ve&2)!==0)throw Error(n(440));return a.impl.apply(void 0,arguments)}}},dh={readContext:Vt,use:ho,useCallback:bm,useContext:Vt,useEffect:ah,useImperativeHandle:Sm,useInsertionEffect:gm,useLayoutEffect:vm,useMemo:wm,useReducer:fo,useRef:_m,useState:function(){return fo(mr)},useDebugValue:lh,useDeferredValue:function(i,s){var a=_t();return Cm(a,Fe.memoizedState,i,s)},useTransition:function(){var i=fo(mr)[0],s=_t().memoizedState;return[typeof i=="boolean"?i:Ra(i),s]},useSyncExternalStore:Qp,useId:km,useHostTransitionStatus:uh,useFormState:hm,useActionState:hm,useOptimistic:function(i,s){var a=_t();return sm(a,Fe,i,s)},useMemoCache:th,useCacheRefresh:Tm};dh.useEffectEvent=mm;var Mm={readContext:Vt,use:ho,useCallback:bm,useContext:Vt,useEffect:ah,useImperativeHandle:Sm,useInsertionEffect:gm,useLayoutEffect:vm,useMemo:wm,useReducer:rh,useRef:_m,useState:function(){return rh(mr)},useDebugValue:lh,useDeferredValue:function(i,s){var a=_t();return Fe===null?oh(a,i,s):Cm(a,Fe.memoizedState,i,s)},useTransition:function(){var i=rh(mr)[0],s=_t().memoizedState;return[typeof i=="boolean"?i:Ra(i),s]},useSyncExternalStore:Qp,useId:km,useHostTransitionStatus:uh,useFormState:fm,useActionState:fm,useOptimistic:function(i,s){var a=_t();return Fe!==null?sm(a,Fe,i,s):(a.baseState=i,[i,a.queue.dispatch])},useMemoCache:th,useCacheRefresh:Tm};Mm.useEffectEvent=mm;function fh(i,s,a,o){s=i.memoizedState,a=a(o,s),a=a==null?s:m({},s,a),i.memoizedState=a,i.lanes===0&&(i.updateQueue.baseState=a)}var _h={enqueueSetState:function(i,s,a){i=i._reactInternals;var o=wi(),h=Gr(o);h.payload=s,a!=null&&(h.callback=a),s=qr(i,h,o),s!==null&&(hi(s,i,o),xa(s,i,o))},enqueueReplaceState:function(i,s,a){i=i._reactInternals;var o=wi(),h=Gr(o);h.tag=1,h.payload=s,a!=null&&(h.callback=a),s=qr(i,h,o),s!==null&&(hi(s,i,o),xa(s,i,o))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var a=wi(),o=Gr(a);o.tag=2,s!=null&&(o.callback=s),s=qr(i,o,a),s!==null&&(hi(s,i,a),xa(s,i,a))}};function Nm(i,s,a,o,h,p,g){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(o,p,g):s.prototype&&s.prototype.isPureReactComponent?!ga(a,o)||!ga(h,p):!0}function Bm(i,s,a,o){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,o),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,o),s.state!==i&&_h.enqueueReplaceState(s,s.state,null)}function Bs(i,s){var a=s;if("ref"in s){a={};for(var o in s)o!=="ref"&&(a[o]=s[o])}if(i=i.defaultProps){a===s&&(a=m({},a));for(var h in i)a[h]===void 0&&(a[h]=i[h])}return a}function zm(i){Fl(i)}function Pm(i){console.error(i)}function Im(i){Fl(i)}function go(i,s){try{var a=i.onUncaughtError;a(s.value,{componentStack:s.stack})}catch(o){setTimeout(function(){throw o})}}function Hm(i,s,a){try{var o=i.onCaughtError;o(a.value,{componentStack:a.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function ph(i,s,a){return a=Gr(a),a.tag=3,a.payload={element:null},a.callback=function(){go(i,s)},a}function Um(i){return i=Gr(i),i.tag=3,i}function jm(i,s,a,o){var h=a.type.getDerivedStateFromError;if(typeof h=="function"){var p=o.value;i.payload=function(){return h(p)},i.callback=function(){Hm(s,a,o)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(i.callback=function(){Hm(s,a,o),typeof h!="function"&&(Zr===null?Zr=new Set([this]):Zr.add(this));var w=o.stack;this.componentDidCatch(o.value,{componentStack:w!==null?w:""})})}function gw(i,s,a,o,h){if(a.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(s=a.alternate,s!==null&&Sn(s,a,h,!0),a=vi.current,a!==null){switch(a.tag){case 31:case 13:return Mi===null?Ro():a.alternate===null&&ut===0&&(ut=3),a.flags&=-257,a.flags|=65536,a.lanes=h,o===ro?a.flags|=16384:(s=a.updateQueue,s===null?a.updateQueue=new Set([o]):s.add(o),Uh(i,o,h)),!1;case 22:return a.flags|=65536,o===ro?a.flags|=16384:(s=a.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([o])},a.updateQueue=s):(a=s.retryQueue,a===null?s.retryQueue=new Set([o]):a.add(o)),Uh(i,o,h)),!1}throw Error(n(435,a.tag))}return Uh(i,o,h),Ro(),!1}if(He)return s=vi.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=h,o!==Nu&&(i=Error(n(422),{cause:o}),Sa(Ri(i,a)))):(o!==Nu&&(s=Error(n(423),{cause:o}),Sa(Ri(s,a))),i=i.current.alternate,i.flags|=65536,h&=-h,i.lanes|=h,o=Ri(o,a),h=ph(i.stateNode,o,h),qu(i,h),ut!==4&&(ut=2)),!1;var p=Error(n(520),{cause:o});if(p=Ri(p,a),Ha===null?Ha=[p]:Ha.push(p),ut!==4&&(ut=2),s===null)return!0;o=Ri(o,a),a=s;do{switch(a.tag){case 3:return a.flags|=65536,i=h&-h,a.lanes|=i,i=ph(a.stateNode,o,i),qu(a,i),!1;case 1:if(s=a.type,p=a.stateNode,(a.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&(Zr===null||!Zr.has(p))))return a.flags|=65536,h&=-h,a.lanes|=h,h=Um(h),jm(h,i,a,o),qu(a,h),!1}a=a.return}while(a!==null);return!1}var mh=Error(n(461)),yt=!1;function $t(i,s,a,o){s.child=i===null?qp(s,null,a,o):Ms(s,i.child,a,o)}function Vm(i,s,a,o,h){a=a.render;var p=s.ref;if("ref"in o){var g={};for(var w in o)w!=="ref"&&(g[w]=o[w])}else g=o;return Rs(s),o=Zu(i,s,a,g,p,h),w=Qu(),i!==null&&!yt?(Ju(i,s,h),gr(i,s,h)):(He&&w&&Ou(s),s.flags|=1,$t(i,s,o,h),s.child)}function $m(i,s,a,o,h){if(i===null){var p=a.type;return typeof p=="function"&&!Ru(p)&&p.defaultProps===void 0&&a.compare===null?(s.tag=15,s.type=p,Gm(i,s,p,o,h)):(i=Zl(a.type,null,o,s,s.mode,h),i.ref=s.ref,i.return=s,s.child=i)}if(p=i.child,!Eh(i,h)){var g=p.memoizedProps;if(a=a.compare,a=a!==null?a:ga,a(g,o)&&i.ref===s.ref)return gr(i,s,h)}return s.flags|=1,i=hr(p,o),i.ref=s.ref,i.return=s,s.child=i}function Gm(i,s,a,o,h){if(i!==null){var p=i.memoizedProps;if(ga(p,o)&&i.ref===s.ref)if(yt=!1,s.pendingProps=o=p,Eh(i,h))(i.flags&131072)!==0&&(yt=!0);else return s.lanes=i.lanes,gr(i,s,h)}return gh(i,s,a,o,h)}function qm(i,s,a,o){var h=o.children,p=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((s.flags&128)!==0){if(p=p!==null?p.baseLanes|a:a,i!==null){for(o=s.child=i.child,h=0;o!==null;)h=h|o.lanes|o.childLanes,o=o.sibling;o=h&~p}else o=0,s.child=null;return Wm(i,s,p,a,o)}if((a&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&to(s,p!==null?p.cachePool:null),p!==null?Yp(s,p):Fu(),Kp(s);else return o=s.lanes=536870912,Wm(i,s,p!==null?p.baseLanes|a:a,a,o)}else p!==null?(to(s,p.cachePool),Yp(s,p),Fr(),s.memoizedState=null):(i!==null&&to(s,null),Fu(),Fr());return $t(i,s,h,a),s.child}function Oa(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Wm(i,s,a,o,h){var p=ju();return p=p===null?null:{parent:gt._currentValue,pool:p},s.memoizedState={baseLanes:a,cachePool:p},i!==null&&to(s,null),Fu(),Kp(s),i!==null&&Sn(i,s,o,!0),s.childLanes=h,null}function vo(i,s){return s=So({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function Fm(i,s,a){return Ms(s,i.child,null,a),i=vo(s,s.pendingProps),i.flags|=2,yi(s),s.memoizedState=null,i}function vw(i,s,a){var o=s.pendingProps,h=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(He){if(o.mode==="hidden")return i=vo(s,o),s.lanes=536870912,Oa(null,i);if(Ku(s),(i=tt)?(i=nv(i,Oi),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Hr!==null?{id:Xi,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},a=Dp(i),a.return=s,s.child=a,jt=s,tt=null)):i=null,i===null)throw jr(s);return s.lanes=536870912,null}return vo(s,o)}var p=i.memoizedState;if(p!==null){var g=p.dehydrated;if(Ku(s),h)if(s.flags&256)s.flags&=-257,s=Fm(i,s,a);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(n(558));else if(yt||Sn(i,s,a,!1),h=(a&i.childLanes)!==0,yt||h){if(o=Qe,o!==null&&(g=P_(o,a),g!==0&&g!==p.retryLane))throw p.retryLane=g,xs(i,g),hi(o,i,g),mh;Ro(),s=Fm(i,s,a)}else i=p.treeContext,tt=Ni(g.nextSibling),jt=s,He=!0,Ur=null,Oi=!1,i!==null&&Mp(s,i),s=vo(s,o),s.flags|=4096;return s}return i=hr(i.child,{mode:o.mode,children:o.children}),i.ref=s.ref,s.child=i,i.return=s,i}function yo(i,s){var a=s.ref;if(a===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(n(284));(i===null||i.ref!==a)&&(s.flags|=4194816)}}function gh(i,s,a,o,h){return Rs(s),a=Zu(i,s,a,o,void 0,h),o=Qu(),i!==null&&!yt?(Ju(i,s,h),gr(i,s,h)):(He&&o&&Ou(s),s.flags|=1,$t(i,s,a,h),s.child)}function Ym(i,s,a,o,h,p){return Rs(s),s.updateQueue=null,a=Zp(s,o,a,h),Xp(i),o=Qu(),i!==null&&!yt?(Ju(i,s,p),gr(i,s,p)):(He&&o&&Ou(s),s.flags|=1,$t(i,s,a,p),s.child)}function Km(i,s,a,o,h){if(Rs(s),s.stateNode===null){var p=mn,g=a.contextType;typeof g=="object"&&g!==null&&(p=Vt(g)),p=new a(o,p),s.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=_h,s.stateNode=p,p._reactInternals=s,p=s.stateNode,p.props=o,p.state=s.memoizedState,p.refs={},$u(s),g=a.contextType,p.context=typeof g=="object"&&g!==null?Vt(g):mn,p.state=s.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(fh(s,a,g,o),p.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(g=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),g!==p.state&&_h.enqueueReplaceState(p,p.state,null),ka(s,o,p,h),Aa(),p.state=s.memoizedState),typeof p.componentDidMount=="function"&&(s.flags|=4194308),o=!0}else if(i===null){p=s.stateNode;var w=s.memoizedProps,A=Bs(a,w);p.props=A;var z=p.context,G=a.contextType;g=mn,typeof G=="object"&&G!==null&&(g=Vt(G));var Z=a.getDerivedStateFromProps;G=typeof Z=="function"||typeof p.getSnapshotBeforeUpdate=="function",w=s.pendingProps!==w,G||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(w||z!==g)&&Bm(s,p,o,g),$r=!1;var P=s.memoizedState;p.state=P,ka(s,o,p,h),Aa(),z=s.memoizedState,w||P!==z||$r?(typeof Z=="function"&&(fh(s,a,Z,o),z=s.memoizedState),(A=$r||Nm(s,a,A,o,P,z,g))?(G||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(s.flags|=4194308)):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=o,s.memoizedState=z),p.props=o,p.state=z,p.context=g,o=A):(typeof p.componentDidMount=="function"&&(s.flags|=4194308),o=!1)}else{p=s.stateNode,Gu(i,s),g=s.memoizedProps,G=Bs(a,g),p.props=G,Z=s.pendingProps,P=p.context,z=a.contextType,A=mn,typeof z=="object"&&z!==null&&(A=Vt(z)),w=a.getDerivedStateFromProps,(z=typeof w=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(g!==Z||P!==A)&&Bm(s,p,o,A),$r=!1,P=s.memoizedState,p.state=P,ka(s,o,p,h),Aa();var U=s.memoizedState;g!==Z||P!==U||$r||i!==null&&i.dependencies!==null&&Jl(i.dependencies)?(typeof w=="function"&&(fh(s,a,w,o),U=s.memoizedState),(G=$r||Nm(s,a,G,o,P,U,A)||i!==null&&i.dependencies!==null&&Jl(i.dependencies))?(z||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(o,U,A),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(o,U,A)),typeof p.componentDidUpdate=="function"&&(s.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof p.componentDidUpdate!="function"||g===i.memoizedProps&&P===i.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||g===i.memoizedProps&&P===i.memoizedState||(s.flags|=1024),s.memoizedProps=o,s.memoizedState=U),p.props=o,p.state=U,p.context=A,o=G):(typeof p.componentDidUpdate!="function"||g===i.memoizedProps&&P===i.memoizedState||(s.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||g===i.memoizedProps&&P===i.memoizedState||(s.flags|=1024),o=!1)}return p=o,yo(i,s),o=(s.flags&128)!==0,p||o?(p=s.stateNode,a=o&&typeof a.getDerivedStateFromError!="function"?null:p.render(),s.flags|=1,i!==null&&o?(s.child=Ms(s,i.child,null,h),s.child=Ms(s,null,a,h)):$t(i,s,a,h),s.memoizedState=p.state,i=s.child):i=gr(i,s,h),i}function Xm(i,s,a,o){return ks(),s.flags|=256,$t(i,s,a,o),s.child}var vh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yh(i){return{baseLanes:i,cachePool:Hp()}}function Sh(i,s,a){return i=i!==null?i.childLanes&~a:0,s&&(i|=bi),i}function Zm(i,s,a){var o=s.pendingProps,h=!1,p=(s.flags&128)!==0,g;if((g=p)||(g=i!==null&&i.memoizedState===null?!1:(ft.current&2)!==0),g&&(h=!0,s.flags&=-129),g=(s.flags&32)!==0,s.flags&=-33,i===null){if(He){if(h?Wr(s):Fr(),(i=tt)?(i=nv(i,Oi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Hr!==null?{id:Xi,overflow:Zi}:null,retryLane:536870912,hydrationErrors:null},a=Dp(i),a.return=s,s.child=a,jt=s,tt=null)):i=null,i===null)throw jr(s);return id(i)?s.lanes=32:s.lanes=536870912,null}var w=o.children;return o=o.fallback,h?(Fr(),h=s.mode,w=So({mode:"hidden",children:w},h),o=As(o,h,a,null),w.return=s,o.return=s,w.sibling=o,s.child=w,o=s.child,o.memoizedState=yh(a),o.childLanes=Sh(i,g,a),s.memoizedState=vh,Oa(null,o)):(Wr(s),bh(s,w))}var A=i.memoizedState;if(A!==null&&(w=A.dehydrated,w!==null)){if(p)s.flags&256?(Wr(s),s.flags&=-257,s=wh(i,s,a)):s.memoizedState!==null?(Fr(),s.child=i.child,s.flags|=128,s=null):(Fr(),w=o.fallback,h=s.mode,o=So({mode:"visible",children:o.children},h),w=As(w,h,a,null),w.flags|=2,o.return=s,w.return=s,o.sibling=w,s.child=o,Ms(s,i.child,null,a),o=s.child,o.memoizedState=yh(a),o.childLanes=Sh(i,g,a),s.memoizedState=vh,s=Oa(null,o));else if(Wr(s),id(w)){if(g=w.nextSibling&&w.nextSibling.dataset,g)var z=g.dgst;g=z,o=Error(n(419)),o.stack="",o.digest=g,Sa({value:o,source:null,stack:null}),s=wh(i,s,a)}else if(yt||Sn(i,s,a,!1),g=(a&i.childLanes)!==0,yt||g){if(g=Qe,g!==null&&(o=P_(g,a),o!==0&&o!==A.retryLane))throw A.retryLane=o,xs(i,o),hi(g,i,o),mh;td(w)||Ro(),s=wh(i,s,a)}else td(w)?(s.flags|=192,s.child=i.child,s=null):(i=A.treeContext,tt=Ni(w.nextSibling),jt=s,He=!0,Ur=null,Oi=!1,i!==null&&Mp(s,i),s=bh(s,o.children),s.flags|=4096);return s}return h?(Fr(),w=o.fallback,h=s.mode,A=i.child,z=A.sibling,o=hr(A,{mode:"hidden",children:o.children}),o.subtreeFlags=A.subtreeFlags&65011712,z!==null?w=hr(z,w):(w=As(w,h,a,null),w.flags|=2),w.return=s,o.return=s,o.sibling=w,s.child=o,Oa(null,o),o=s.child,w=i.child.memoizedState,w===null?w=yh(a):(h=w.cachePool,h!==null?(A=gt._currentValue,h=h.parent!==A?{parent:A,pool:A}:h):h=Hp(),w={baseLanes:w.baseLanes|a,cachePool:h}),o.memoizedState=w,o.childLanes=Sh(i,g,a),s.memoizedState=vh,Oa(i.child,o)):(Wr(s),a=i.child,i=a.sibling,a=hr(a,{mode:"visible",children:o.children}),a.return=s,a.sibling=null,i!==null&&(g=s.deletions,g===null?(s.deletions=[i],s.flags|=16):g.push(i)),s.child=a,s.memoizedState=null,a)}function bh(i,s){return s=So({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function So(i,s){return i=gi(22,i,null,s),i.lanes=0,i}function wh(i,s,a){return Ms(s,i.child,null,a),i=bh(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Qm(i,s,a){i.lanes|=s;var o=i.alternate;o!==null&&(o.lanes|=s),Pu(i.return,s,a)}function Ch(i,s,a,o,h,p){var g=i.memoizedState;g===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:o,tail:a,tailMode:h,treeForkCount:p}:(g.isBackwards=s,g.rendering=null,g.renderingStartTime=0,g.last=o,g.tail=a,g.tailMode=h,g.treeForkCount=p)}function Jm(i,s,a){var o=s.pendingProps,h=o.revealOrder,p=o.tail;o=o.children;var g=ft.current,w=(g&2)!==0;if(w?(g=g&1|2,s.flags|=128):g&=1,X(ft,g),$t(i,s,o,a),o=He?ya:0,!w&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Qm(i,a,s);else if(i.tag===19)Qm(i,a,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(h){case"forwards":for(a=s.child,h=null;a!==null;)i=a.alternate,i!==null&&lo(i)===null&&(h=a),a=a.sibling;a=h,a===null?(h=s.child,s.child=null):(h=a.sibling,a.sibling=null),Ch(s,!1,h,a,p,o);break;case"backwards":case"unstable_legacy-backwards":for(a=null,h=s.child,s.child=null;h!==null;){if(i=h.alternate,i!==null&&lo(i)===null){s.child=h;break}i=h.sibling,h.sibling=a,a=h,h=i}Ch(s,!0,a,null,p,o);break;case"together":Ch(s,!1,null,null,void 0,o);break;default:s.memoizedState=null}return s.child}function gr(i,s,a){if(i!==null&&(s.dependencies=i.dependencies),Xr|=s.lanes,(a&s.childLanes)===0)if(i!==null){if(Sn(i,s,a,!1),(a&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(n(153));if(s.child!==null){for(i=s.child,a=hr(i,i.pendingProps),s.child=a,a.return=s;i.sibling!==null;)i=i.sibling,a=a.sibling=hr(i,i.pendingProps),a.return=s;a.sibling=null}return s.child}function Eh(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Jl(i)))}function yw(i,s,a){switch(s.tag){case 3:We(s,s.stateNode.containerInfo),Vr(s,gt,i.memoizedState.cache),ks();break;case 27:case 5:Ft(s);break;case 4:We(s,s.stateNode.containerInfo);break;case 10:Vr(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Ku(s),null;break;case 13:var o=s.memoizedState;if(o!==null)return o.dehydrated!==null?(Wr(s),s.flags|=128,null):(a&s.child.childLanes)!==0?Zm(i,s,a):(Wr(s),i=gr(i,s,a),i!==null?i.sibling:null);Wr(s);break;case 19:var h=(i.flags&128)!==0;if(o=(a&s.childLanes)!==0,o||(Sn(i,s,a,!1),o=(a&s.childLanes)!==0),h){if(o)return Jm(i,s,a);s.flags|=128}if(h=s.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),X(ft,ft.current),o)break;return null;case 22:return s.lanes=0,qm(i,s,a,s.pendingProps);case 24:Vr(s,gt,i.memoizedState.cache)}return gr(i,s,a)}function eg(i,s,a){if(i!==null)if(i.memoizedProps!==s.pendingProps)yt=!0;else{if(!Eh(i,a)&&(s.flags&128)===0)return yt=!1,yw(i,s,a);yt=(i.flags&131072)!==0}else yt=!1,He&&(s.flags&1048576)!==0&&Op(s,ya,s.index);switch(s.lanes=0,s.tag){case 16:e:{var o=s.pendingProps;if(i=Ls(s.elementType),s.type=i,typeof i=="function")Ru(i)?(o=Bs(i,o),s.tag=1,s=Km(null,s,i,o,a)):(s.tag=0,s=gh(null,s,i,o,a));else{if(i!=null){var h=i.$$typeof;if(h===I){s.tag=11,s=Vm(null,s,i,o,a);break e}else if(h===ee){s.tag=14,s=$m(null,s,i,o,a);break e}}throw s=ne(i)||i,Error(n(306,s,""))}}return s;case 0:return gh(i,s,s.type,s.pendingProps,a);case 1:return o=s.type,h=Bs(o,s.pendingProps),Km(i,s,o,h,a);case 3:e:{if(We(s,s.stateNode.containerInfo),i===null)throw Error(n(387));o=s.pendingProps;var p=s.memoizedState;h=p.element,Gu(i,s),ka(s,o,null,a);var g=s.memoizedState;if(o=g.cache,Vr(s,gt,o),o!==p.cache&&Iu(s,[gt],a,!0),Aa(),o=g.element,p.isDehydrated)if(p={element:o,isDehydrated:!1,cache:g.cache},s.updateQueue.baseState=p,s.memoizedState=p,s.flags&256){s=Xm(i,s,o,a);break e}else if(o!==h){h=Ri(Error(n(424)),s),Sa(h),s=Xm(i,s,o,a);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(tt=Ni(i.firstChild),jt=s,He=!0,Ur=null,Oi=!0,a=qp(s,null,o,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(ks(),o===h){s=gr(i,s,a);break e}$t(i,s,o,a)}s=s.child}return s;case 26:return yo(i,s),i===null?(a=hv(s.type,null,s.pendingProps,null))?s.memoizedState=a:He||(a=s.type,i=s.pendingProps,o=zo(pe.current).createElement(a),o[Ut]=s,o[ni]=i,Gt(o,a,i),Lt(o),s.stateNode=o):s.memoizedState=hv(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Ft(s),i===null&&He&&(o=s.stateNode=ov(s.type,s.pendingProps,pe.current),jt=s,Oi=!0,h=tt,ts(s.type)?(rd=h,tt=Ni(o.firstChild)):tt=h),$t(i,s,s.pendingProps.children,a),yo(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&He&&((h=o=tt)&&(o=Kw(o,s.type,s.pendingProps,Oi),o!==null?(s.stateNode=o,jt=s,tt=Ni(o.firstChild),Oi=!1,h=!0):h=!1),h||jr(s)),Ft(s),h=s.type,p=s.pendingProps,g=i!==null?i.memoizedProps:null,o=p.children,Qh(h,p)?o=null:g!==null&&Qh(h,g)&&(s.flags|=32),s.memoizedState!==null&&(h=Zu(i,s,uw,null,null,a),Fa._currentValue=h),yo(i,s),$t(i,s,o,a),s.child;case 6:return i===null&&He&&((i=a=tt)&&(a=Xw(a,s.pendingProps,Oi),a!==null?(s.stateNode=a,jt=s,tt=null,i=!0):i=!1),i||jr(s)),null;case 13:return Zm(i,s,a);case 4:return We(s,s.stateNode.containerInfo),o=s.pendingProps,i===null?s.child=Ms(s,null,o,a):$t(i,s,o,a),s.child;case 11:return Vm(i,s,s.type,s.pendingProps,a);case 7:return $t(i,s,s.pendingProps,a),s.child;case 8:return $t(i,s,s.pendingProps.children,a),s.child;case 12:return $t(i,s,s.pendingProps.children,a),s.child;case 10:return o=s.pendingProps,Vr(s,s.type,o.value),$t(i,s,o.children,a),s.child;case 9:return h=s.type._context,o=s.pendingProps.children,Rs(s),h=Vt(h),o=o(h),s.flags|=1,$t(i,s,o,a),s.child;case 14:return $m(i,s,s.type,s.pendingProps,a);case 15:return Gm(i,s,s.type,s.pendingProps,a);case 19:return Jm(i,s,a);case 31:return vw(i,s,a);case 22:return qm(i,s,a,s.pendingProps);case 24:return Rs(s),o=Vt(gt),i===null?(h=ju(),h===null&&(h=Qe,p=Hu(),h.pooledCache=p,p.refCount++,p!==null&&(h.pooledCacheLanes|=a),h=p),s.memoizedState={parent:o,cache:h},$u(s),Vr(s,gt,h)):((i.lanes&a)!==0&&(Gu(i,s),ka(s,null,null,a),Aa()),h=i.memoizedState,p=s.memoizedState,h.parent!==o?(h={parent:o,cache:o},s.memoizedState=h,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=h),Vr(s,gt,o)):(o=p.cache,Vr(s,gt,o),o!==h.cache&&Iu(s,[gt],a,!0))),$t(i,s,s.pendingProps.children,a),s.child;case 29:throw s.pendingProps}throw Error(n(156,s.tag))}function vr(i){i.flags|=4}function xh(i,s,a,o,h){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(h&335544128)===h)if(i.stateNode.complete)i.flags|=8192;else if(kg())i.flags|=8192;else throw Os=ro,Vu}else i.flags&=-16777217}function tg(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!mv(s))if(kg())i.flags|=8192;else throw Os=ro,Vu}function bo(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?N_():536870912,i.lanes|=s,On|=s)}function Ma(i,s){if(!He)switch(i.tailMode){case"hidden":s=i.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?i.tail=null:a.sibling=null;break;case"collapsed":a=i.tail;for(var o=null;a!==null;)a.alternate!==null&&(o=a),a=a.sibling;o===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:o.sibling=null}}function it(i){var s=i.alternate!==null&&i.alternate.child===i.child,a=0,o=0;if(s)for(var h=i.child;h!==null;)a|=h.lanes|h.childLanes,o|=h.subtreeFlags&65011712,o|=h.flags&65011712,h.return=i,h=h.sibling;else for(h=i.child;h!==null;)a|=h.lanes|h.childLanes,o|=h.subtreeFlags,o|=h.flags,h.return=i,h=h.sibling;return i.subtreeFlags|=o,i.childLanes=a,s}function Sw(i,s,a){var o=s.pendingProps;switch(Mu(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(s),null;case 1:return it(s),null;case 3:return a=s.stateNode,o=null,i!==null&&(o=i.memoizedState.cache),s.memoizedState.cache!==o&&(s.flags|=2048),_r(gt),ze(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(i===null||i.child===null)&&(yn(s)?vr(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Bu())),it(s),null;case 26:var h=s.type,p=s.memoizedState;return i===null?(vr(s),p!==null?(it(s),tg(s,p)):(it(s),xh(s,h,null,o,a))):p?p!==i.memoizedState?(vr(s),it(s),tg(s,p)):(it(s),s.flags&=-16777217):(i=i.memoizedProps,i!==o&&vr(s),it(s),xh(s,h,i,o,a)),null;case 27:if($e(s),a=pe.current,h=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==o&&vr(s);else{if(!o){if(s.stateNode===null)throw Error(n(166));return it(s),null}i=te.current,yn(s)?Np(s):(i=ov(h,o,a),s.stateNode=i,vr(s))}return it(s),null;case 5:if($e(s),h=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==o&&vr(s);else{if(!o){if(s.stateNode===null)throw Error(n(166));return it(s),null}if(p=te.current,yn(s))Np(s);else{var g=zo(pe.current);switch(p){case 1:p=g.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:p=g.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":p=g.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":p=g.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":p=g.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof o.is=="string"?g.createElement("select",{is:o.is}):g.createElement("select"),o.multiple?p.multiple=!0:o.size&&(p.size=o.size);break;default:p=typeof o.is=="string"?g.createElement(h,{is:o.is}):g.createElement(h)}}p[Ut]=s,p[ni]=o;e:for(g=s.child;g!==null;){if(g.tag===5||g.tag===6)p.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===s)break e;for(;g.sibling===null;){if(g.return===null||g.return===s)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}s.stateNode=p;e:switch(Gt(p,h,o),h){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&vr(s)}}return it(s),xh(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,a),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==o&&vr(s);else{if(typeof o!="string"&&s.stateNode===null)throw Error(n(166));if(i=pe.current,yn(s)){if(i=s.stateNode,a=s.memoizedProps,o=null,h=jt,h!==null)switch(h.tag){case 27:case 5:o=h.memoizedProps}i[Ut]=s,i=!!(i.nodeValue===a||o!==null&&o.suppressHydrationWarning===!0||Zg(i.nodeValue,a)),i||jr(s,!0)}else i=zo(i).createTextNode(o),i[Ut]=s,s.stateNode=i}return it(s),null;case 31:if(a=s.memoizedState,i===null||i.memoizedState!==null){if(o=yn(s),a!==null){if(i===null){if(!o)throw Error(n(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(557));i[Ut]=s}else ks(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;it(s),i=!1}else a=Bu(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=a),i=!0;if(!i)return s.flags&256?(yi(s),s):(yi(s),null);if((s.flags&128)!==0)throw Error(n(558))}return it(s),null;case 13:if(o=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(h=yn(s),o!==null&&o.dehydrated!==null){if(i===null){if(!h)throw Error(n(318));if(h=s.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(n(317));h[Ut]=s}else ks(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;it(s),h=!1}else h=Bu(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=h),h=!0;if(!h)return s.flags&256?(yi(s),s):(yi(s),null)}return yi(s),(s.flags&128)!==0?(s.lanes=a,s):(a=o!==null,i=i!==null&&i.memoizedState!==null,a&&(o=s.child,h=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(h=o.alternate.memoizedState.cachePool.pool),p=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(p=o.memoizedState.cachePool.pool),p!==h&&(o.flags|=2048)),a!==i&&a&&(s.child.flags|=8192),bo(s,s.updateQueue),it(s),null);case 4:return ze(),i===null&&Fh(s.stateNode.containerInfo),it(s),null;case 10:return _r(s.type),it(s),null;case 19:if(M(ft),o=s.memoizedState,o===null)return it(s),null;if(h=(s.flags&128)!==0,p=o.rendering,p===null)if(h)Ma(o,!1);else{if(ut!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(p=lo(i),p!==null){for(s.flags|=128,Ma(o,!1),i=p.updateQueue,s.updateQueue=i,bo(s,i),s.subtreeFlags=0,i=a,a=s.child;a!==null;)Rp(a,i),a=a.sibling;return X(ft,ft.current&1|2),He&&dr(s,o.treeForkCount),s.child}i=i.sibling}o.tail!==null&&Yt()>Ao&&(s.flags|=128,h=!0,Ma(o,!1),s.lanes=4194304)}else{if(!h)if(i=lo(p),i!==null){if(s.flags|=128,h=!0,i=i.updateQueue,s.updateQueue=i,bo(s,i),Ma(o,!0),o.tail===null&&o.tailMode==="hidden"&&!p.alternate&&!He)return it(s),null}else 2*Yt()-o.renderingStartTime>Ao&&a!==536870912&&(s.flags|=128,h=!0,Ma(o,!1),s.lanes=4194304);o.isBackwards?(p.sibling=s.child,s.child=p):(i=o.last,i!==null?i.sibling=p:s.child=p,o.last=p)}return o.tail!==null?(i=o.tail,o.rendering=i,o.tail=i.sibling,o.renderingStartTime=Yt(),i.sibling=null,a=ft.current,X(ft,h?a&1|2:a&1),He&&dr(s,o.treeForkCount),i):(it(s),null);case 22:case 23:return yi(s),Yu(),o=s.memoizedState!==null,i!==null?i.memoizedState!==null!==o&&(s.flags|=8192):o&&(s.flags|=8192),o?(a&536870912)!==0&&(s.flags&128)===0&&(it(s),s.subtreeFlags&6&&(s.flags|=8192)):it(s),a=s.updateQueue,a!==null&&bo(s,a.retryQueue),a=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),o=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(o=s.memoizedState.cachePool.pool),o!==a&&(s.flags|=2048),i!==null&&M(Ds),null;case 24:return a=null,i!==null&&(a=i.memoizedState.cache),s.memoizedState.cache!==a&&(s.flags|=2048),_r(gt),it(s),null;case 25:return null;case 30:return null}throw Error(n(156,s.tag))}function bw(i,s){switch(Mu(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return _r(gt),ze(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return $e(s),null;case 31:if(s.memoizedState!==null){if(yi(s),s.alternate===null)throw Error(n(340));ks()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(yi(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(n(340));ks()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return M(ft),null;case 4:return ze(),null;case 10:return _r(s.type),null;case 22:case 23:return yi(s),Yu(),i!==null&&M(Ds),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return _r(gt),null;case 25:return null;default:return null}}function ig(i,s){switch(Mu(s),s.tag){case 3:_r(gt),ze();break;case 26:case 27:case 5:$e(s);break;case 4:ze();break;case 31:s.memoizedState!==null&&yi(s);break;case 13:yi(s);break;case 19:M(ft);break;case 10:_r(s.type);break;case 22:case 23:yi(s),Yu(),i!==null&&M(Ds);break;case 24:_r(gt)}}function Na(i,s){try{var a=s.updateQueue,o=a!==null?a.lastEffect:null;if(o!==null){var h=o.next;a=h;do{if((a.tag&i)===i){o=void 0;var p=a.create,g=a.inst;o=p(),g.destroy=o}a=a.next}while(a!==h)}}catch(w){qe(s,s.return,w)}}function Yr(i,s,a){try{var o=s.updateQueue,h=o!==null?o.lastEffect:null;if(h!==null){var p=h.next;o=p;do{if((o.tag&i)===i){var g=o.inst,w=g.destroy;if(w!==void 0){g.destroy=void 0,h=s;var A=a,z=w;try{z()}catch(G){qe(h,A,G)}}}o=o.next}while(o!==p)}}catch(G){qe(s,s.return,G)}}function rg(i){var s=i.updateQueue;if(s!==null){var a=i.stateNode;try{Fp(s,a)}catch(o){qe(i,i.return,o)}}}function sg(i,s,a){a.props=Bs(i.type,i.memoizedProps),a.state=i.memoizedState;try{a.componentWillUnmount()}catch(o){qe(i,s,o)}}function Ba(i,s){try{var a=i.ref;if(a!==null){switch(i.tag){case 26:case 27:case 5:var o=i.stateNode;break;case 30:o=i.stateNode;break;default:o=i.stateNode}typeof a=="function"?i.refCleanup=a(o):a.current=o}}catch(h){qe(i,s,h)}}function Qi(i,s){var a=i.ref,o=i.refCleanup;if(a!==null)if(typeof o=="function")try{o()}catch(h){qe(i,s,h)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(h){qe(i,s,h)}else a.current=null}function ng(i){var s=i.type,a=i.memoizedProps,o=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":a.autoFocus&&o.focus();break e;case"img":a.src?o.src=a.src:a.srcSet&&(o.srcset=a.srcSet)}}catch(h){qe(i,i.return,h)}}function Ah(i,s,a){try{var o=i.stateNode;$w(o,i.type,a,s),o[ni]=s}catch(h){qe(i,i.return,h)}}function ag(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&ts(i.type)||i.tag===4}function kh(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||ag(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&ts(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Th(i,s,a){var o=i.tag;if(o===5||o===6)i=i.stateNode,s?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,s):(s=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,s.appendChild(i),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=cr));else if(o!==4&&(o===27&&ts(i.type)&&(a=i.stateNode,s=null),i=i.child,i!==null))for(Th(i,s,a),i=i.sibling;i!==null;)Th(i,s,a),i=i.sibling}function wo(i,s,a){var o=i.tag;if(o===5||o===6)i=i.stateNode,s?a.insertBefore(i,s):a.appendChild(i);else if(o!==4&&(o===27&&ts(i.type)&&(a=i.stateNode),i=i.child,i!==null))for(wo(i,s,a),i=i.sibling;i!==null;)wo(i,s,a),i=i.sibling}function lg(i){var s=i.stateNode,a=i.memoizedProps;try{for(var o=i.type,h=s.attributes;h.length;)s.removeAttributeNode(h[0]);Gt(s,o,a),s[Ut]=i,s[ni]=a}catch(p){qe(i,i.return,p)}}var yr=!1,St=!1,Rh=!1,og=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function ww(i,s){if(i=i.containerInfo,Xh=$o,i=Sp(i),wu(i)){if("selectionStart"in i)var a={start:i.selectionStart,end:i.selectionEnd};else e:{a=(a=i.ownerDocument)&&a.defaultView||window;var o=a.getSelection&&a.getSelection();if(o&&o.rangeCount!==0){a=o.anchorNode;var h=o.anchorOffset,p=o.focusNode;o=o.focusOffset;try{a.nodeType,p.nodeType}catch{a=null;break e}var g=0,w=-1,A=-1,z=0,G=0,Z=i,P=null;t:for(;;){for(var U;Z!==a||h!==0&&Z.nodeType!==3||(w=g+h),Z!==p||o!==0&&Z.nodeType!==3||(A=g+o),Z.nodeType===3&&(g+=Z.nodeValue.length),(U=Z.firstChild)!==null;)P=Z,Z=U;for(;;){if(Z===i)break t;if(P===a&&++z===h&&(w=g),P===p&&++G===o&&(A=g),(U=Z.nextSibling)!==null)break;Z=P,P=Z.parentNode}Z=U}a=w===-1||A===-1?null:{start:w,end:A}}else a=null}a=a||{start:0,end:0}}else a=null;for(Zh={focusedElem:i,selectionRange:a},$o=!1,Ot=s;Ot!==null;)if(s=Ot,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Ot=i;else for(;Ot!==null;){switch(s=Ot,p=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(a=0;a<i.length;a++)h=i[a],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&p!==null){i=void 0,a=s,h=p.memoizedProps,p=p.memoizedState,o=a.stateNode;try{var fe=Bs(a.type,h);i=o.getSnapshotBeforeUpdate(fe,p),o.__reactInternalSnapshotBeforeUpdate=i}catch(be){qe(a,a.return,be)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,a=i.nodeType,a===9)ed(i);else if(a===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":ed(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(n(163))}if(i=s.sibling,i!==null){i.return=s.return,Ot=i;break}Ot=s.return}}function cg(i,s,a){var o=a.flags;switch(a.tag){case 0:case 11:case 15:br(i,a),o&4&&Na(5,a);break;case 1:if(br(i,a),o&4)if(i=a.stateNode,s===null)try{i.componentDidMount()}catch(g){qe(a,a.return,g)}else{var h=Bs(a.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(h,s,i.__reactInternalSnapshotBeforeUpdate)}catch(g){qe(a,a.return,g)}}o&64&&rg(a),o&512&&Ba(a,a.return);break;case 3:if(br(i,a),o&64&&(i=a.updateQueue,i!==null)){if(s=null,a.child!==null)switch(a.child.tag){case 27:case 5:s=a.child.stateNode;break;case 1:s=a.child.stateNode}try{Fp(i,s)}catch(g){qe(a,a.return,g)}}break;case 27:s===null&&o&4&&lg(a);case 26:case 5:br(i,a),s===null&&o&4&&ng(a),o&512&&Ba(a,a.return);break;case 12:br(i,a);break;case 31:br(i,a),o&4&&dg(i,a);break;case 13:br(i,a),o&4&&fg(i,a),o&64&&(i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(a=Lw.bind(null,a),Zw(i,a))));break;case 22:if(o=a.memoizedState!==null||yr,!o){s=s!==null&&s.memoizedState!==null||St,h=yr;var p=St;yr=o,(St=s)&&!p?wr(i,a,(a.subtreeFlags&8772)!==0):br(i,a),yr=h,St=p}break;case 30:break;default:br(i,a)}}function ug(i){var s=i.alternate;s!==null&&(i.alternate=null,ug(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&nu(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var st=null,li=!1;function Sr(i,s,a){for(a=a.child;a!==null;)hg(i,s,a),a=a.sibling}function hg(i,s,a){if(_i&&typeof _i.onCommitFiberUnmount=="function")try{_i.onCommitFiberUnmount(na,a)}catch{}switch(a.tag){case 26:St||Qi(a,s),Sr(i,s,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:St||Qi(a,s);var o=st,h=li;ts(a.type)&&(st=a.stateNode,li=!1),Sr(i,s,a),Ga(a.stateNode),st=o,li=h;break;case 5:St||Qi(a,s);case 6:if(o=st,h=li,st=null,Sr(i,s,a),st=o,li=h,st!==null)if(li)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(a.stateNode)}catch(p){qe(a,s,p)}else try{st.removeChild(a.stateNode)}catch(p){qe(a,s,p)}break;case 18:st!==null&&(li?(i=st,rv(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.stateNode),Un(i)):rv(st,a.stateNode));break;case 4:o=st,h=li,st=a.stateNode.containerInfo,li=!0,Sr(i,s,a),st=o,li=h;break;case 0:case 11:case 14:case 15:Yr(2,a,s),St||Yr(4,a,s),Sr(i,s,a);break;case 1:St||(Qi(a,s),o=a.stateNode,typeof o.componentWillUnmount=="function"&&sg(a,s,o)),Sr(i,s,a);break;case 21:Sr(i,s,a);break;case 22:St=(o=St)||a.memoizedState!==null,Sr(i,s,a),St=o;break;default:Sr(i,s,a)}}function dg(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{Un(i)}catch(a){qe(s,s.return,a)}}}function fg(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Un(i)}catch(a){qe(s,s.return,a)}}function Cw(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new og),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new og),s;default:throw Error(n(435,i.tag))}}function Co(i,s){var a=Cw(i);s.forEach(function(o){if(!a.has(o)){a.add(o);var h=Ow.bind(null,i,o);o.then(h,h)}})}function oi(i,s){var a=s.deletions;if(a!==null)for(var o=0;o<a.length;o++){var h=a[o],p=i,g=s,w=g;e:for(;w!==null;){switch(w.tag){case 27:if(ts(w.type)){st=w.stateNode,li=!1;break e}break;case 5:st=w.stateNode,li=!1;break e;case 3:case 4:st=w.stateNode.containerInfo,li=!0;break e}w=w.return}if(st===null)throw Error(n(160));hg(p,g,h),st=null,li=!1,p=h.alternate,p!==null&&(p.return=null),h.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)_g(s,i),s=s.sibling}var qi=null;function _g(i,s){var a=i.alternate,o=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:oi(s,i),ci(i),o&4&&(Yr(3,i,i.return),Na(3,i),Yr(5,i,i.return));break;case 1:oi(s,i),ci(i),o&512&&(St||a===null||Qi(a,a.return)),o&64&&yr&&(i=i.updateQueue,i!==null&&(o=i.callbacks,o!==null&&(a=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=a===null?o:a.concat(o))));break;case 26:var h=qi;if(oi(s,i),ci(i),o&512&&(St||a===null||Qi(a,a.return)),o&4){var p=a!==null?a.memoizedState:null;if(o=i.memoizedState,a===null)if(o===null)if(i.stateNode===null){e:{o=i.type,a=i.memoizedProps,h=h.ownerDocument||h;t:switch(o){case"title":p=h.getElementsByTagName("title")[0],(!p||p[oa]||p[Ut]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=h.createElement(o),h.head.insertBefore(p,h.querySelector("head > title"))),Gt(p,o,a),p[Ut]=i,Lt(p),o=p;break e;case"link":var g=_v("link","href",h).get(o+(a.href||""));if(g){for(var w=0;w<g.length;w++)if(p=g[w],p.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&p.getAttribute("rel")===(a.rel==null?null:a.rel)&&p.getAttribute("title")===(a.title==null?null:a.title)&&p.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){g.splice(w,1);break t}}p=h.createElement(o),Gt(p,o,a),h.head.appendChild(p);break;case"meta":if(g=_v("meta","content",h).get(o+(a.content||""))){for(w=0;w<g.length;w++)if(p=g[w],p.getAttribute("content")===(a.content==null?null:""+a.content)&&p.getAttribute("name")===(a.name==null?null:a.name)&&p.getAttribute("property")===(a.property==null?null:a.property)&&p.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&p.getAttribute("charset")===(a.charSet==null?null:a.charSet)){g.splice(w,1);break t}}p=h.createElement(o),Gt(p,o,a),h.head.appendChild(p);break;default:throw Error(n(468,o))}p[Ut]=i,Lt(p),o=p}i.stateNode=o}else pv(h,i.type,i.stateNode);else i.stateNode=fv(h,o,i.memoizedProps);else p!==o?(p===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):p.count--,o===null?pv(h,i.type,i.stateNode):fv(h,o,i.memoizedProps)):o===null&&i.stateNode!==null&&Ah(i,i.memoizedProps,a.memoizedProps)}break;case 27:oi(s,i),ci(i),o&512&&(St||a===null||Qi(a,a.return)),a!==null&&o&4&&Ah(i,i.memoizedProps,a.memoizedProps);break;case 5:if(oi(s,i),ci(i),o&512&&(St||a===null||Qi(a,a.return)),i.flags&32){h=i.stateNode;try{cn(h,"")}catch(fe){qe(i,i.return,fe)}}o&4&&i.stateNode!=null&&(h=i.memoizedProps,Ah(i,h,a!==null?a.memoizedProps:h)),o&1024&&(Rh=!0);break;case 6:if(oi(s,i),ci(i),o&4){if(i.stateNode===null)throw Error(n(162));o=i.memoizedProps,a=i.stateNode;try{a.nodeValue=o}catch(fe){qe(i,i.return,fe)}}break;case 3:if(Ho=null,h=qi,qi=Po(s.containerInfo),oi(s,i),qi=h,ci(i),o&4&&a!==null&&a.memoizedState.isDehydrated)try{Un(s.containerInfo)}catch(fe){qe(i,i.return,fe)}Rh&&(Rh=!1,pg(i));break;case 4:o=qi,qi=Po(i.stateNode.containerInfo),oi(s,i),ci(i),qi=o;break;case 12:oi(s,i),ci(i);break;case 31:oi(s,i),ci(i),o&4&&(o=i.updateQueue,o!==null&&(i.updateQueue=null,Co(i,o)));break;case 13:oi(s,i),ci(i),i.child.flags&8192&&i.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(xo=Yt()),o&4&&(o=i.updateQueue,o!==null&&(i.updateQueue=null,Co(i,o)));break;case 22:h=i.memoizedState!==null;var A=a!==null&&a.memoizedState!==null,z=yr,G=St;if(yr=z||h,St=G||A,oi(s,i),St=G,yr=z,ci(i),o&8192)e:for(s=i.stateNode,s._visibility=h?s._visibility&-2:s._visibility|1,h&&(a===null||A||yr||St||zs(i)),a=null,s=i;;){if(s.tag===5||s.tag===26){if(a===null){A=a=s;try{if(p=A.stateNode,h)g=p.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{w=A.stateNode;var Z=A.memoizedProps.style,P=Z!=null&&Z.hasOwnProperty("display")?Z.display:null;w.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(fe){qe(A,A.return,fe)}}}else if(s.tag===6){if(a===null){A=s;try{A.stateNode.nodeValue=h?"":A.memoizedProps}catch(fe){qe(A,A.return,fe)}}}else if(s.tag===18){if(a===null){A=s;try{var U=A.stateNode;h?sv(U,!0):sv(A.stateNode,!1)}catch(fe){qe(A,A.return,fe)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;a===s&&(a=null),s=s.return}a===s&&(a=null),s.sibling.return=s.return,s=s.sibling}o&4&&(o=i.updateQueue,o!==null&&(a=o.retryQueue,a!==null&&(o.retryQueue=null,Co(i,a))));break;case 19:oi(s,i),ci(i),o&4&&(o=i.updateQueue,o!==null&&(i.updateQueue=null,Co(i,o)));break;case 30:break;case 21:break;default:oi(s,i),ci(i)}}function ci(i){var s=i.flags;if(s&2){try{for(var a,o=i.return;o!==null;){if(ag(o)){a=o;break}o=o.return}if(a==null)throw Error(n(160));switch(a.tag){case 27:var h=a.stateNode,p=kh(i);wo(i,p,h);break;case 5:var g=a.stateNode;a.flags&32&&(cn(g,""),a.flags&=-33);var w=kh(i);wo(i,w,g);break;case 3:case 4:var A=a.stateNode.containerInfo,z=kh(i);Th(i,z,A);break;default:throw Error(n(161))}}catch(G){qe(i,i.return,G)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function pg(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;pg(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function br(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)cg(i,s.alternate,s),s=s.sibling}function zs(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:Yr(4,s,s.return),zs(s);break;case 1:Qi(s,s.return);var a=s.stateNode;typeof a.componentWillUnmount=="function"&&sg(s,s.return,a),zs(s);break;case 27:Ga(s.stateNode);case 26:case 5:Qi(s,s.return),zs(s);break;case 22:s.memoizedState===null&&zs(s);break;case 30:zs(s);break;default:zs(s)}i=i.sibling}}function wr(i,s,a){for(a=a&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var o=s.alternate,h=i,p=s,g=p.flags;switch(p.tag){case 0:case 11:case 15:wr(h,p,a),Na(4,p);break;case 1:if(wr(h,p,a),o=p,h=o.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(z){qe(o,o.return,z)}if(o=p,h=o.updateQueue,h!==null){var w=o.stateNode;try{var A=h.shared.hiddenCallbacks;if(A!==null)for(h.shared.hiddenCallbacks=null,h=0;h<A.length;h++)Wp(A[h],w)}catch(z){qe(o,o.return,z)}}a&&g&64&&rg(p),Ba(p,p.return);break;case 27:lg(p);case 26:case 5:wr(h,p,a),a&&o===null&&g&4&&ng(p),Ba(p,p.return);break;case 12:wr(h,p,a);break;case 31:wr(h,p,a),a&&g&4&&dg(h,p);break;case 13:wr(h,p,a),a&&g&4&&fg(h,p);break;case 22:p.memoizedState===null&&wr(h,p,a),Ba(p,p.return);break;case 30:break;default:wr(h,p,a)}s=s.sibling}}function Dh(i,s){var a=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==a&&(i!=null&&i.refCount++,a!=null&&ba(a))}function Lh(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ba(i))}function Wi(i,s,a,o){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)mg(i,s,a,o),s=s.sibling}function mg(i,s,a,o){var h=s.flags;switch(s.tag){case 0:case 11:case 15:Wi(i,s,a,o),h&2048&&Na(9,s);break;case 1:Wi(i,s,a,o);break;case 3:Wi(i,s,a,o),h&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&ba(i)));break;case 12:if(h&2048){Wi(i,s,a,o),i=s.stateNode;try{var p=s.memoizedProps,g=p.id,w=p.onPostCommit;typeof w=="function"&&w(g,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(A){qe(s,s.return,A)}}else Wi(i,s,a,o);break;case 31:Wi(i,s,a,o);break;case 13:Wi(i,s,a,o);break;case 23:break;case 22:p=s.stateNode,g=s.alternate,s.memoizedState!==null?p._visibility&2?Wi(i,s,a,o):za(i,s):p._visibility&2?Wi(i,s,a,o):(p._visibility|=2,Rn(i,s,a,o,(s.subtreeFlags&10256)!==0||!1)),h&2048&&Dh(g,s);break;case 24:Wi(i,s,a,o),h&2048&&Lh(s.alternate,s);break;default:Wi(i,s,a,o)}}function Rn(i,s,a,o,h){for(h=h&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var p=i,g=s,w=a,A=o,z=g.flags;switch(g.tag){case 0:case 11:case 15:Rn(p,g,w,A,h),Na(8,g);break;case 23:break;case 22:var G=g.stateNode;g.memoizedState!==null?G._visibility&2?Rn(p,g,w,A,h):za(p,g):(G._visibility|=2,Rn(p,g,w,A,h)),h&&z&2048&&Dh(g.alternate,g);break;case 24:Rn(p,g,w,A,h),h&&z&2048&&Lh(g.alternate,g);break;default:Rn(p,g,w,A,h)}s=s.sibling}}function za(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var a=i,o=s,h=o.flags;switch(o.tag){case 22:za(a,o),h&2048&&Dh(o.alternate,o);break;case 24:za(a,o),h&2048&&Lh(o.alternate,o);break;default:za(a,o)}s=s.sibling}}var Pa=8192;function Dn(i,s,a){if(i.subtreeFlags&Pa)for(i=i.child;i!==null;)gg(i,s,a),i=i.sibling}function gg(i,s,a){switch(i.tag){case 26:Dn(i,s,a),i.flags&Pa&&i.memoizedState!==null&&cC(a,qi,i.memoizedState,i.memoizedProps);break;case 5:Dn(i,s,a);break;case 3:case 4:var o=qi;qi=Po(i.stateNode.containerInfo),Dn(i,s,a),qi=o;break;case 22:i.memoizedState===null&&(o=i.alternate,o!==null&&o.memoizedState!==null?(o=Pa,Pa=16777216,Dn(i,s,a),Pa=o):Dn(i,s,a));break;default:Dn(i,s,a)}}function vg(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function Ia(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var o=s[a];Ot=o,Sg(o,i)}vg(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)yg(i),i=i.sibling}function yg(i){switch(i.tag){case 0:case 11:case 15:Ia(i),i.flags&2048&&Yr(9,i,i.return);break;case 3:Ia(i);break;case 12:Ia(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Eo(i)):Ia(i);break;default:Ia(i)}}function Eo(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var a=0;a<s.length;a++){var o=s[a];Ot=o,Sg(o,i)}vg(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:Yr(8,s,s.return),Eo(s);break;case 22:a=s.stateNode,a._visibility&2&&(a._visibility&=-3,Eo(s));break;default:Eo(s)}i=i.sibling}}function Sg(i,s){for(;Ot!==null;){var a=Ot;switch(a.tag){case 0:case 11:case 15:Yr(8,a,s);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var o=a.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ba(a.memoizedState.cache)}if(o=a.child,o!==null)o.return=a,Ot=o;else e:for(a=i;Ot!==null;){o=Ot;var h=o.sibling,p=o.return;if(ug(o),o===a){Ot=null;break e}if(h!==null){h.return=p,Ot=h;break e}Ot=p}}}var Ew={getCacheForType:function(i){var s=Vt(gt),a=s.data.get(i);return a===void 0&&(a=i(),s.data.set(i,a)),a},cacheSignal:function(){return Vt(gt).controller.signal}},xw=typeof WeakMap=="function"?WeakMap:Map,Ve=0,Qe=null,Ne=null,Pe=0,Ge=0,Si=null,Kr=!1,Ln=!1,Oh=!1,Cr=0,ut=0,Xr=0,Ps=0,Mh=0,bi=0,On=0,Ha=null,ui=null,Nh=!1,xo=0,bg=0,Ao=1/0,ko=null,Zr=null,Et=0,Qr=null,Mn=null,Er=0,Bh=0,zh=null,wg=null,Ua=0,Ph=null;function wi(){return(Ve&2)!==0&&Pe!==0?Pe&-Pe:D.T!==null?$h():I_()}function Cg(){if(bi===0)if((Pe&536870912)===0||He){var i=Nl;Nl<<=1,(Nl&3932160)===0&&(Nl=262144),bi=i}else bi=536870912;return i=vi.current,i!==null&&(i.flags|=32),bi}function hi(i,s,a){(i===Qe&&(Ge===2||Ge===9)||i.cancelPendingCommit!==null)&&(Nn(i,0),Jr(i,Pe,bi,!1)),la(i,a),((Ve&2)===0||i!==Qe)&&(i===Qe&&((Ve&2)===0&&(Ps|=a),ut===4&&Jr(i,Pe,bi,!1)),Ji(i))}function Eg(i,s,a){if((Ve&6)!==0)throw Error(n(327));var o=!a&&(s&127)===0&&(s&i.expiredLanes)===0||aa(i,s),h=o?Tw(i,s):Hh(i,s,!0),p=o;do{if(h===0){Ln&&!o&&Jr(i,s,0,!1);break}else{if(a=i.current.alternate,p&&!Aw(a)){h=Hh(i,s,!1),p=!1;continue}if(h===2){if(p=s,i.errorRecoveryDisabledLanes&p)var g=0;else g=i.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){s=g;e:{var w=i;h=Ha;var A=w.current.memoizedState.isDehydrated;if(A&&(Nn(w,g).flags|=256),g=Hh(w,g,!1),g!==2){if(Oh&&!A){w.errorRecoveryDisabledLanes|=p,Ps|=p,h=4;break e}p=ui,ui=h,p!==null&&(ui===null?ui=p:ui.push.apply(ui,p))}h=g}if(p=!1,h!==2)continue}}if(h===1){Nn(i,0),Jr(i,s,0,!0);break}e:{switch(o=i,p=h,p){case 0:case 1:throw Error(n(345));case 4:if((s&4194048)!==s)break;case 6:Jr(o,s,bi,!Kr);break e;case 2:ui=null;break;case 3:case 5:break;default:throw Error(n(329))}if((s&62914560)===s&&(h=xo+300-Yt(),10<h)){if(Jr(o,s,bi,!Kr),zl(o,0,!0)!==0)break e;Er=s,o.timeoutHandle=tv(xg.bind(null,o,a,ui,ko,Nh,s,bi,Ps,On,Kr,p,"Throttled",-0,0),h);break e}xg(o,a,ui,ko,Nh,s,bi,Ps,On,Kr,p,null,-0,0)}}break}while(!0);Ji(i)}function xg(i,s,a,o,h,p,g,w,A,z,G,Z,P,U){if(i.timeoutHandle=-1,Z=s.subtreeFlags,Z&8192||(Z&16785408)===16785408){Z={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cr},gg(s,p,Z);var fe=(p&62914560)===p?xo-Yt():(p&4194048)===p?bg-Yt():0;if(fe=uC(Z,fe),fe!==null){Er=p,i.cancelPendingCommit=fe(Mg.bind(null,i,s,p,a,o,h,g,w,A,G,Z,null,P,U)),Jr(i,p,g,!z);return}}Mg(i,s,p,a,o,h,g,w,A)}function Aw(i){for(var s=i;;){var a=s.tag;if((a===0||a===11||a===15)&&s.flags&16384&&(a=s.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var o=0;o<a.length;o++){var h=a[o],p=h.getSnapshot;h=h.value;try{if(!mi(p(),h))return!1}catch{return!1}}if(a=s.child,s.subtreeFlags&16384&&a!==null)a.return=s,s=a;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Jr(i,s,a,o){s&=~Mh,s&=~Ps,i.suspendedLanes|=s,i.pingedLanes&=~s,o&&(i.warmLanes|=s),o=i.expirationTimes;for(var h=s;0<h;){var p=31-pi(h),g=1<<p;o[p]=-1,h&=~g}a!==0&&B_(i,a,s)}function To(){return(Ve&6)===0?(ja(0),!1):!0}function Ih(){if(Ne!==null){if(Ge===0)var i=Ne.return;else i=Ne,fr=Ts=null,eh(i),En=null,Ca=0,i=Ne;for(;i!==null;)ig(i.alternate,i),i=i.return;Ne=null}}function Nn(i,s){var a=i.timeoutHandle;a!==-1&&(i.timeoutHandle=-1,Ww(a)),a=i.cancelPendingCommit,a!==null&&(i.cancelPendingCommit=null,a()),Er=0,Ih(),Qe=i,Ne=a=hr(i.current,null),Pe=s,Ge=0,Si=null,Kr=!1,Ln=aa(i,s),Oh=!1,On=bi=Mh=Ps=Xr=ut=0,ui=Ha=null,Nh=!1,(s&8)!==0&&(s|=s&32);var o=i.entangledLanes;if(o!==0)for(i=i.entanglements,o&=s;0<o;){var h=31-pi(o),p=1<<h;s|=i[h],o&=~p}return Cr=s,Yl(),a}function Ag(i,s){ke=null,D.H=La,s===Cn||s===io?(s=Vp(),Ge=3):s===Vu?(s=Vp(),Ge=4):Ge=s===mh?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Si=s,Ne===null&&(ut=1,go(i,Ri(s,i.current)))}function kg(){var i=vi.current;return i===null?!0:(Pe&4194048)===Pe?Mi===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?i===Mi:!1}function Tg(){var i=D.H;return D.H=La,i===null?La:i}function Rg(){var i=D.A;return D.A=Ew,i}function Ro(){ut=4,Kr||(Pe&4194048)!==Pe&&vi.current!==null||(Ln=!0),(Xr&134217727)===0&&(Ps&134217727)===0||Qe===null||Jr(Qe,Pe,bi,!1)}function Hh(i,s,a){var o=Ve;Ve|=2;var h=Tg(),p=Rg();(Qe!==i||Pe!==s)&&(ko=null,Nn(i,s)),s=!1;var g=ut;e:do try{if(Ge!==0&&Ne!==null){var w=Ne,A=Si;switch(Ge){case 8:Ih(),g=6;break e;case 3:case 2:case 9:case 6:vi.current===null&&(s=!0);var z=Ge;if(Ge=0,Si=null,Bn(i,w,A,z),a&&Ln){g=0;break e}break;default:z=Ge,Ge=0,Si=null,Bn(i,w,A,z)}}kw(),g=ut;break}catch(G){Ag(i,G)}while(!0);return s&&i.shellSuspendCounter++,fr=Ts=null,Ve=o,D.H=h,D.A=p,Ne===null&&(Qe=null,Pe=0,Yl()),g}function kw(){for(;Ne!==null;)Dg(Ne)}function Tw(i,s){var a=Ve;Ve|=2;var o=Tg(),h=Rg();Qe!==i||Pe!==s?(ko=null,Ao=Yt()+500,Nn(i,s)):Ln=aa(i,s);e:do try{if(Ge!==0&&Ne!==null){s=Ne;var p=Si;t:switch(Ge){case 1:Ge=0,Si=null,Bn(i,s,p,1);break;case 2:case 9:if(Up(p)){Ge=0,Si=null,Lg(s);break}s=function(){Ge!==2&&Ge!==9||Qe!==i||(Ge=7),Ji(i)},p.then(s,s);break e;case 3:Ge=7;break e;case 4:Ge=5;break e;case 7:Up(p)?(Ge=0,Si=null,Lg(s)):(Ge=0,Si=null,Bn(i,s,p,7));break;case 5:var g=null;switch(Ne.tag){case 26:g=Ne.memoizedState;case 5:case 27:var w=Ne;if(g?mv(g):w.stateNode.complete){Ge=0,Si=null;var A=w.sibling;if(A!==null)Ne=A;else{var z=w.return;z!==null?(Ne=z,Do(z)):Ne=null}break t}}Ge=0,Si=null,Bn(i,s,p,5);break;case 6:Ge=0,Si=null,Bn(i,s,p,6);break;case 8:Ih(),ut=6;break e;default:throw Error(n(462))}}Rw();break}catch(G){Ag(i,G)}while(!0);return fr=Ts=null,D.H=o,D.A=h,Ve=a,Ne!==null?0:(Qe=null,Pe=0,Yl(),ut)}function Rw(){for(;Ne!==null&&!Re();)Dg(Ne)}function Dg(i){var s=eg(i.alternate,i,Cr);i.memoizedProps=i.pendingProps,s===null?Do(i):Ne=s}function Lg(i){var s=i,a=s.alternate;switch(s.tag){case 15:case 0:s=Ym(a,s,s.pendingProps,s.type,void 0,Pe);break;case 11:s=Ym(a,s,s.pendingProps,s.type.render,s.ref,Pe);break;case 5:eh(s);default:ig(a,s),s=Ne=Rp(s,Cr),s=eg(a,s,Cr)}i.memoizedProps=i.pendingProps,s===null?Do(i):Ne=s}function Bn(i,s,a,o){fr=Ts=null,eh(s),En=null,Ca=0;var h=s.return;try{if(gw(i,h,s,a,Pe)){ut=1,go(i,Ri(a,i.current)),Ne=null;return}}catch(p){if(h!==null)throw Ne=h,p;ut=1,go(i,Ri(a,i.current)),Ne=null;return}s.flags&32768?(He||o===1?i=!0:Ln||(Pe&536870912)!==0?i=!1:(Kr=i=!0,(o===2||o===9||o===3||o===6)&&(o=vi.current,o!==null&&o.tag===13&&(o.flags|=16384))),Og(s,i)):Do(s)}function Do(i){var s=i;do{if((s.flags&32768)!==0){Og(s,Kr);return}i=s.return;var a=Sw(s.alternate,s,Cr);if(a!==null){Ne=a;return}if(s=s.sibling,s!==null){Ne=s;return}Ne=s=i}while(s!==null);ut===0&&(ut=5)}function Og(i,s){do{var a=bw(i.alternate,i);if(a!==null){a.flags&=32767,Ne=a;return}if(a=i.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!s&&(i=i.sibling,i!==null)){Ne=i;return}Ne=i=a}while(i!==null);ut=6,Ne=null}function Mg(i,s,a,o,h,p,g,w,A){i.cancelPendingCommit=null;do Lo();while(Et!==0);if((Ve&6)!==0)throw Error(n(327));if(s!==null){if(s===i.current)throw Error(n(177));if(p=s.lanes|s.childLanes,p|=ku,o1(i,a,p,g,w,A),i===Qe&&(Ne=Qe=null,Pe=0),Mn=s,Qr=i,Er=a,Bh=p,zh=h,wg=o,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,Mw(Ol,function(){return Ig(),null})):(i.callbackNode=null,i.callbackPriority=0),o=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||o){o=D.T,D.T=null,h=q.p,q.p=2,g=Ve,Ve|=4;try{ww(i,s,a)}finally{Ve=g,q.p=h,D.T=o}}Et=1,Ng(),Bg(),zg()}}function Ng(){if(Et===1){Et=0;var i=Qr,s=Mn,a=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||a){a=D.T,D.T=null;var o=q.p;q.p=2;var h=Ve;Ve|=4;try{_g(s,i);var p=Zh,g=Sp(i.containerInfo),w=p.focusedElem,A=p.selectionRange;if(g!==w&&w&&w.ownerDocument&&yp(w.ownerDocument.documentElement,w)){if(A!==null&&wu(w)){var z=A.start,G=A.end;if(G===void 0&&(G=z),"selectionStart"in w)w.selectionStart=z,w.selectionEnd=Math.min(G,w.value.length);else{var Z=w.ownerDocument||document,P=Z&&Z.defaultView||window;if(P.getSelection){var U=P.getSelection(),fe=w.textContent.length,be=Math.min(A.start,fe),Ke=A.end===void 0?be:Math.min(A.end,fe);!U.extend&&be>Ke&&(g=Ke,Ke=be,be=g);var L=vp(w,be),R=vp(w,Ke);if(L&&R&&(U.rangeCount!==1||U.anchorNode!==L.node||U.anchorOffset!==L.offset||U.focusNode!==R.node||U.focusOffset!==R.offset)){var N=Z.createRange();N.setStart(L.node,L.offset),U.removeAllRanges(),be>Ke?(U.addRange(N),U.extend(R.node,R.offset)):(N.setEnd(R.node,R.offset),U.addRange(N))}}}}for(Z=[],U=w;U=U.parentNode;)U.nodeType===1&&Z.push({element:U,left:U.scrollLeft,top:U.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<Z.length;w++){var K=Z[w];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}$o=!!Xh,Zh=Xh=null}finally{Ve=h,q.p=o,D.T=a}}i.current=s,Et=2}}function Bg(){if(Et===2){Et=0;var i=Qr,s=Mn,a=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||a){a=D.T,D.T=null;var o=q.p;q.p=2;var h=Ve;Ve|=4;try{cg(i,s.alternate,s)}finally{Ve=h,q.p=o,D.T=a}}Et=3}}function zg(){if(Et===4||Et===3){Et=0,Ze();var i=Qr,s=Mn,a=Er,o=wg;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Et=5:(Et=0,Mn=Qr=null,Pg(i,i.pendingLanes));var h=i.pendingLanes;if(h===0&&(Zr=null),ru(a),s=s.stateNode,_i&&typeof _i.onCommitFiberRoot=="function")try{_i.onCommitFiberRoot(na,s,void 0,(s.current.flags&128)===128)}catch{}if(o!==null){s=D.T,h=q.p,q.p=2,D.T=null;try{for(var p=i.onRecoverableError,g=0;g<o.length;g++){var w=o[g];p(w.value,{componentStack:w.stack})}}finally{D.T=s,q.p=h}}(Er&3)!==0&&Lo(),Ji(i),h=i.pendingLanes,(a&261930)!==0&&(h&42)!==0?i===Ph?Ua++:(Ua=0,Ph=i):Ua=0,ja(0)}}function Pg(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,ba(s)))}function Lo(){return Ng(),Bg(),zg(),Ig()}function Ig(){if(Et!==5)return!1;var i=Qr,s=Bh;Bh=0;var a=ru(Er),o=D.T,h=q.p;try{q.p=32>a?32:a,D.T=null,a=zh,zh=null;var p=Qr,g=Er;if(Et=0,Mn=Qr=null,Er=0,(Ve&6)!==0)throw Error(n(331));var w=Ve;if(Ve|=4,yg(p.current),mg(p,p.current,g,a),Ve=w,ja(0,!1),_i&&typeof _i.onPostCommitFiberRoot=="function")try{_i.onPostCommitFiberRoot(na,p)}catch{}return!0}finally{q.p=h,D.T=o,Pg(i,s)}}function Hg(i,s,a){s=Ri(a,s),s=ph(i.stateNode,s,2),i=qr(i,s,2),i!==null&&(la(i,2),Ji(i))}function qe(i,s,a){if(i.tag===3)Hg(i,i,a);else for(;s!==null;){if(s.tag===3){Hg(s,i,a);break}else if(s.tag===1){var o=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Zr===null||!Zr.has(o))){i=Ri(a,i),a=Um(2),o=qr(s,a,2),o!==null&&(jm(a,o,s,i),la(o,2),Ji(o));break}}s=s.return}}function Uh(i,s,a){var o=i.pingCache;if(o===null){o=i.pingCache=new xw;var h=new Set;o.set(s,h)}else h=o.get(s),h===void 0&&(h=new Set,o.set(s,h));h.has(a)||(Oh=!0,h.add(a),i=Dw.bind(null,i,s,a),s.then(i,i))}function Dw(i,s,a){var o=i.pingCache;o!==null&&o.delete(s),i.pingedLanes|=i.suspendedLanes&a,i.warmLanes&=~a,Qe===i&&(Pe&a)===a&&(ut===4||ut===3&&(Pe&62914560)===Pe&&300>Yt()-xo?(Ve&2)===0&&Nn(i,0):Mh|=a,On===Pe&&(On=0)),Ji(i)}function Ug(i,s){s===0&&(s=N_()),i=xs(i,s),i!==null&&(la(i,s),Ji(i))}function Lw(i){var s=i.memoizedState,a=0;s!==null&&(a=s.retryLane),Ug(i,a)}function Ow(i,s){var a=0;switch(i.tag){case 31:case 13:var o=i.stateNode,h=i.memoizedState;h!==null&&(a=h.retryLane);break;case 19:o=i.stateNode;break;case 22:o=i.stateNode._retryCache;break;default:throw Error(n(314))}o!==null&&o.delete(s),Ug(i,a)}function Mw(i,s){return ve(i,s)}var Oo=null,zn=null,jh=!1,Mo=!1,Vh=!1,es=0;function Ji(i){i!==zn&&i.next===null&&(zn===null?Oo=zn=i:zn=zn.next=i),Mo=!0,jh||(jh=!0,Bw())}function ja(i,s){if(!Vh&&Mo){Vh=!0;do for(var a=!1,o=Oo;o!==null;){if(i!==0){var h=o.pendingLanes;if(h===0)var p=0;else{var g=o.suspendedLanes,w=o.pingedLanes;p=(1<<31-pi(42|i)+1)-1,p&=h&~(g&~w),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(a=!0,Gg(o,p))}else p=Pe,p=zl(o,o===Qe?p:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(p&3)===0||aa(o,p)||(a=!0,Gg(o,p));o=o.next}while(a);Vh=!1}}function Nw(){jg()}function jg(){Mo=jh=!1;var i=0;es!==0&&qw()&&(i=es);for(var s=Yt(),a=null,o=Oo;o!==null;){var h=o.next,p=Vg(o,s);p===0?(o.next=null,a===null?Oo=h:a.next=h,h===null&&(zn=a)):(a=o,(i!==0||(p&3)!==0)&&(Mo=!0)),o=h}Et!==0&&Et!==5||ja(i),es!==0&&(es=0)}function Vg(i,s){for(var a=i.suspendedLanes,o=i.pingedLanes,h=i.expirationTimes,p=i.pendingLanes&-62914561;0<p;){var g=31-pi(p),w=1<<g,A=h[g];A===-1?((w&a)===0||(w&o)!==0)&&(h[g]=l1(w,s)):A<=s&&(i.expiredLanes|=w),p&=~w}if(s=Qe,a=Pe,a=zl(i,i===s?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),o=i.callbackNode,a===0||i===s&&(Ge===2||Ge===9)||i.cancelPendingCommit!==null)return o!==null&&o!==null&&Ee(o),i.callbackNode=null,i.callbackPriority=0;if((a&3)===0||aa(i,a)){if(s=a&-a,s===i.callbackPriority)return s;switch(o!==null&&Ee(o),ru(a)){case 2:case 8:a=O_;break;case 32:a=Ol;break;case 268435456:a=M_;break;default:a=Ol}return o=$g.bind(null,i),a=ve(a,o),i.callbackPriority=s,i.callbackNode=a,s}return o!==null&&o!==null&&Ee(o),i.callbackPriority=2,i.callbackNode=null,2}function $g(i,s){if(Et!==0&&Et!==5)return i.callbackNode=null,i.callbackPriority=0,null;var a=i.callbackNode;if(Lo()&&i.callbackNode!==a)return null;var o=Pe;return o=zl(i,i===Qe?o:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),o===0?null:(Eg(i,o,s),Vg(i,Yt()),i.callbackNode!=null&&i.callbackNode===a?$g.bind(null,i):null)}function Gg(i,s){if(Lo())return null;Eg(i,s,!0)}function Bw(){Fw(function(){(Ve&6)!==0?ve(L_,Nw):jg()})}function $h(){if(es===0){var i=bn;i===0&&(i=Ml,Ml<<=1,(Ml&261888)===0&&(Ml=256)),es=i}return es}function qg(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ul(""+i)}function Wg(i,s){var a=s.ownerDocument.createElement("input");return a.name=s.name,a.value=s.value,i.id&&a.setAttribute("form",i.id),s.parentNode.insertBefore(a,s),i=new FormData(i),a.parentNode.removeChild(a),i}function zw(i,s,a,o,h){if(s==="submit"&&a&&a.stateNode===h){var p=qg((h[ni]||null).action),g=o.submitter;g&&(s=(s=g[ni]||null)?qg(s.formAction):g.getAttribute("formAction"),s!==null&&(p=s,g=null));var w=new Gl("action","action",null,o,h);i.push({event:w,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(es!==0){var A=g?Wg(h,g):new FormData(h);ch(a,{pending:!0,data:A,method:h.method,action:p},null,A)}}else typeof p=="function"&&(w.preventDefault(),A=g?Wg(h,g):new FormData(h),ch(a,{pending:!0,data:A,method:h.method,action:p},p,A))},currentTarget:h}]})}}for(var Gh=0;Gh<Au.length;Gh++){var qh=Au[Gh],Pw=qh.toLowerCase(),Iw=qh[0].toUpperCase()+qh.slice(1);Gi(Pw,"on"+Iw)}Gi(Cp,"onAnimationEnd"),Gi(Ep,"onAnimationIteration"),Gi(xp,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi(ew,"onTransitionRun"),Gi(tw,"onTransitionStart"),Gi(iw,"onTransitionCancel"),Gi(Ap,"onTransitionEnd"),ln("onMouseEnter",["mouseout","mouseover"]),ln("onMouseLeave",["mouseout","mouseover"]),ln("onPointerEnter",["pointerout","pointerover"]),ln("onPointerLeave",["pointerout","pointerover"]),bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),bs("onBeforeInput",["compositionend","keypress","textInput","paste"]),bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Va="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(" "),Hw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Va));function Fg(i,s){s=(s&4)!==0;for(var a=0;a<i.length;a++){var o=i[a],h=o.event;o=o.listeners;e:{var p=void 0;if(s)for(var g=o.length-1;0<=g;g--){var w=o[g],A=w.instance,z=w.currentTarget;if(w=w.listener,A!==p&&h.isPropagationStopped())break e;p=w,h.currentTarget=z;try{p(h)}catch(G){Fl(G)}h.currentTarget=null,p=A}else for(g=0;g<o.length;g++){if(w=o[g],A=w.instance,z=w.currentTarget,w=w.listener,A!==p&&h.isPropagationStopped())break e;p=w,h.currentTarget=z;try{p(h)}catch(G){Fl(G)}h.currentTarget=null,p=A}}}}function Be(i,s){var a=s[su];a===void 0&&(a=s[su]=new Set);var o=i+"__bubble";a.has(o)||(Yg(s,i,2,!1),a.add(o))}function Wh(i,s,a){var o=0;s&&(o|=4),Yg(a,i,o,s)}var No="_reactListening"+Math.random().toString(36).slice(2);function Fh(i){if(!i[No]){i[No]=!0,j_.forEach(function(a){a!=="selectionchange"&&(Hw.has(a)||Wh(a,!1,i),Wh(a,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[No]||(s[No]=!0,Wh("selectionchange",!1,s))}}function Yg(i,s,a,o){switch(Cv(s)){case 2:var h=fC;break;case 8:h=_C;break;default:h=od}a=h.bind(null,s,a,i),h=void 0,!fu||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(h=!0),o?h!==void 0?i.addEventListener(s,a,{capture:!0,passive:h}):i.addEventListener(s,a,!0):h!==void 0?i.addEventListener(s,a,{passive:h}):i.addEventListener(s,a,!1)}function Yh(i,s,a,o,h){var p=o;if((s&1)===0&&(s&2)===0&&o!==null)e:for(;;){if(o===null)return;var g=o.tag;if(g===3||g===4){var w=o.stateNode.containerInfo;if(w===h)break;if(g===4)for(g=o.return;g!==null;){var A=g.tag;if((A===3||A===4)&&g.stateNode.containerInfo===h)return;g=g.return}for(;w!==null;){if(g=sn(w),g===null)return;if(A=g.tag,A===5||A===6||A===26||A===27){o=p=g;continue e}w=w.parentNode}}o=o.return}J_(function(){var z=p,G=hu(a),Z=[];e:{var P=kp.get(i);if(P!==void 0){var U=Gl,fe=i;switch(i){case"keypress":if(Vl(a)===0)break e;case"keydown":case"keyup":U=O1;break;case"focusin":fe="focus",U=gu;break;case"focusout":fe="blur",U=gu;break;case"beforeblur":case"afterblur":U=gu;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":U=ip;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":U=S1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":U=B1;break;case Cp:case Ep:case xp:U=C1;break;case Ap:U=P1;break;case"scroll":case"scrollend":U=v1;break;case"wheel":U=H1;break;case"copy":case"cut":case"paste":U=x1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":U=sp;break;case"toggle":case"beforetoggle":U=j1}var be=(s&4)!==0,Ke=!be&&(i==="scroll"||i==="scrollend"),L=be?P!==null?P+"Capture":null:P;be=[];for(var R=z,N;R!==null;){var K=R;if(N=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||N===null||L===null||(K=ua(R,L),K!=null&&be.push($a(R,K,N))),Ke)break;R=R.return}0<be.length&&(P=new U(P,fe,null,a,G),Z.push({event:P,listeners:be}))}}if((s&7)===0){e:{if(P=i==="mouseover"||i==="pointerover",U=i==="mouseout"||i==="pointerout",P&&a!==uu&&(fe=a.relatedTarget||a.fromElement)&&(sn(fe)||fe[rn]))break e;if((U||P)&&(P=G.window===G?G:(P=G.ownerDocument)?P.defaultView||P.parentWindow:window,U?(fe=a.relatedTarget||a.toElement,U=z,fe=fe?sn(fe):null,fe!==null&&(Ke=c(fe),be=fe.tag,fe!==Ke||be!==5&&be!==27&&be!==6)&&(fe=null)):(U=null,fe=z),U!==fe)){if(be=ip,K="onMouseLeave",L="onMouseEnter",R="mouse",(i==="pointerout"||i==="pointerover")&&(be=sp,K="onPointerLeave",L="onPointerEnter",R="pointer"),Ke=U==null?P:ca(U),N=fe==null?P:ca(fe),P=new be(K,R+"leave",U,a,G),P.target=Ke,P.relatedTarget=N,K=null,sn(G)===z&&(be=new be(L,R+"enter",fe,a,G),be.target=N,be.relatedTarget=Ke,K=be),Ke=K,U&&fe)t:{for(be=Uw,L=U,R=fe,N=0,K=L;K;K=be(K))N++;K=0;for(var ye=R;ye;ye=be(ye))K++;for(;0<N-K;)L=be(L),N--;for(;0<K-N;)R=be(R),K--;for(;N--;){if(L===R||R!==null&&L===R.alternate){be=L;break t}L=be(L),R=be(R)}be=null}else be=null;U!==null&&Kg(Z,P,U,be,!1),fe!==null&&Ke!==null&&Kg(Z,Ke,fe,be,!0)}}e:{if(P=z?ca(z):window,U=P.nodeName&&P.nodeName.toLowerCase(),U==="select"||U==="input"&&P.type==="file")var Ue=dp;else if(up(P))if(fp)Ue=Z1;else{Ue=K1;var me=Y1}else U=P.nodeName,!U||U.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?z&&cu(z.elementType)&&(Ue=dp):Ue=X1;if(Ue&&(Ue=Ue(i,z))){hp(Z,Ue,a,G);break e}me&&me(i,P,z),i==="focusout"&&z&&P.type==="number"&&z.memoizedProps.value!=null&&ou(P,"number",P.value)}switch(me=z?ca(z):window,i){case"focusin":(up(me)||me.contentEditable==="true")&&(fn=me,Cu=z,va=null);break;case"focusout":va=Cu=fn=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,bp(Z,a,G);break;case"selectionchange":if(J1)break;case"keydown":case"keyup":bp(Z,a,G)}var De;if(yu)e:{switch(i){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else dn?op(i,a)&&(Ie="onCompositionEnd"):i==="keydown"&&a.keyCode===229&&(Ie="onCompositionStart");Ie&&(np&&a.locale!=="ko"&&(dn||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&dn&&(De=ep()):(Ir=G,_u="value"in Ir?Ir.value:Ir.textContent,dn=!0)),me=Bo(z,Ie),0<me.length&&(Ie=new rp(Ie,i,null,a,G),Z.push({event:Ie,listeners:me}),De?Ie.data=De:(De=cp(a),De!==null&&(Ie.data=De)))),(De=$1?G1(i,a):q1(i,a))&&(Ie=Bo(z,"onBeforeInput"),0<Ie.length&&(me=new rp("onBeforeInput","beforeinput",null,a,G),Z.push({event:me,listeners:Ie}),me.data=De)),zw(Z,i,z,a,G)}Fg(Z,s)})}function $a(i,s,a){return{instance:i,listener:s,currentTarget:a}}function Bo(i,s){for(var a=s+"Capture",o=[];i!==null;){var h=i,p=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||p===null||(h=ua(i,a),h!=null&&o.unshift($a(i,h,p)),h=ua(i,s),h!=null&&o.push($a(i,h,p))),i.tag===3)return o;i=i.return}return[]}function Uw(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Kg(i,s,a,o,h){for(var p=s._reactName,g=[];a!==null&&a!==o;){var w=a,A=w.alternate,z=w.stateNode;if(w=w.tag,A!==null&&A===o)break;w!==5&&w!==26&&w!==27||z===null||(A=z,h?(z=ua(a,p),z!=null&&g.unshift($a(a,z,A))):h||(z=ua(a,p),z!=null&&g.push($a(a,z,A)))),a=a.return}g.length!==0&&i.push({event:s,listeners:g})}var jw=/\r\n?/g,Vw=/\u0000|\uFFFD/g;function Xg(i){return(typeof i=="string"?i:""+i).replace(jw,`
|
|
50
|
+
`).replace(Vw,"")}function Zg(i,s){return s=Xg(s),Xg(i)===s}function Ye(i,s,a,o,h,p){switch(a){case"children":typeof o=="string"?s==="body"||s==="textarea"&&o===""||cn(i,o):(typeof o=="number"||typeof o=="bigint")&&s!=="body"&&cn(i,""+o);break;case"className":Il(i,"class",o);break;case"tabIndex":Il(i,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Il(i,a,o);break;case"style":Z_(i,o,p);break;case"data":if(s!=="object"){Il(i,"data",o);break}case"src":case"href":if(o===""&&(s!=="a"||a!=="href")){i.removeAttribute(a);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){i.removeAttribute(a);break}o=Ul(""+o),i.setAttribute(a,o);break;case"action":case"formAction":if(typeof o=="function"){i.setAttribute(a,"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 p=="function"&&(a==="formAction"?(s!=="input"&&Ye(i,s,"name",h.name,h,null),Ye(i,s,"formEncType",h.formEncType,h,null),Ye(i,s,"formMethod",h.formMethod,h,null),Ye(i,s,"formTarget",h.formTarget,h,null)):(Ye(i,s,"encType",h.encType,h,null),Ye(i,s,"method",h.method,h,null),Ye(i,s,"target",h.target,h,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){i.removeAttribute(a);break}o=Ul(""+o),i.setAttribute(a,o);break;case"onClick":o!=null&&(i.onclick=cr);break;case"onScroll":o!=null&&Be("scroll",i);break;case"onScrollEnd":o!=null&&Be("scrollend",i);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(n(61));if(a=o.__html,a!=null){if(h.children!=null)throw Error(n(60));i.innerHTML=a}}break;case"multiple":i.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":i.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){i.removeAttribute("xlink:href");break}a=Ul(""+o),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?i.setAttribute(a,""+o):i.removeAttribute(a);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":o&&typeof o!="function"&&typeof o!="symbol"?i.setAttribute(a,""):i.removeAttribute(a);break;case"capture":case"download":o===!0?i.setAttribute(a,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?i.setAttribute(a,o):i.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?i.setAttribute(a,o):i.removeAttribute(a);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?i.removeAttribute(a):i.setAttribute(a,o);break;case"popover":Be("beforetoggle",i),Be("toggle",i),Pl(i,"popover",o);break;case"xlinkActuate":or(i,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":or(i,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":or(i,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":or(i,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":or(i,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":or(i,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":or(i,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":or(i,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":or(i,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Pl(i,"is",o);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=m1.get(a)||a,Pl(i,a,o))}}function Kh(i,s,a,o,h,p){switch(a){case"style":Z_(i,o,p);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(n(61));if(a=o.__html,a!=null){if(h.children!=null)throw Error(n(60));i.innerHTML=a}}break;case"children":typeof o=="string"?cn(i,o):(typeof o=="number"||typeof o=="bigint")&&cn(i,""+o);break;case"onScroll":o!=null&&Be("scroll",i);break;case"onScrollEnd":o!=null&&Be("scrollend",i);break;case"onClick":o!=null&&(i.onclick=cr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!V_.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(h=a.endsWith("Capture"),s=a.slice(2,h?a.length-7:void 0),p=i[ni]||null,p=p!=null?p[a]:null,typeof p=="function"&&i.removeEventListener(s,p,h),typeof o=="function")){typeof p!="function"&&p!==null&&(a in i?i[a]=null:i.hasAttribute(a)&&i.removeAttribute(a)),i.addEventListener(s,o,h);break e}a in i?i[a]=o:o===!0?i.setAttribute(a,""):Pl(i,a,o)}}}function Gt(i,s,a){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",i),Be("load",i);var o=!1,h=!1,p;for(p in a)if(a.hasOwnProperty(p)){var g=a[p];if(g!=null)switch(p){case"src":o=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,s));default:Ye(i,s,p,g,a,null)}}h&&Ye(i,s,"srcSet",a.srcSet,a,null),o&&Ye(i,s,"src",a.src,a,null);return;case"input":Be("invalid",i);var w=p=g=h=null,A=null,z=null;for(o in a)if(a.hasOwnProperty(o)){var G=a[o];if(G!=null)switch(o){case"name":h=G;break;case"type":g=G;break;case"checked":A=G;break;case"defaultChecked":z=G;break;case"value":p=G;break;case"defaultValue":w=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(n(137,s));break;default:Ye(i,s,o,G,a,null)}}F_(i,p,w,A,z,g,h,!1);return;case"select":Be("invalid",i),o=g=p=null;for(h in a)if(a.hasOwnProperty(h)&&(w=a[h],w!=null))switch(h){case"value":p=w;break;case"defaultValue":g=w;break;case"multiple":o=w;default:Ye(i,s,h,w,a,null)}s=p,a=g,i.multiple=!!o,s!=null?on(i,!!o,s,!1):a!=null&&on(i,!!o,a,!0);return;case"textarea":Be("invalid",i),p=h=o=null;for(g in a)if(a.hasOwnProperty(g)&&(w=a[g],w!=null))switch(g){case"value":o=w;break;case"defaultValue":h=w;break;case"children":p=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(n(91));break;default:Ye(i,s,g,w,a,null)}K_(i,o,h,p);return;case"option":for(A in a)if(a.hasOwnProperty(A)&&(o=a[A],o!=null))switch(A){case"selected":i.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:Ye(i,s,A,o,a,null)}return;case"dialog":Be("beforetoggle",i),Be("toggle",i),Be("cancel",i),Be("close",i);break;case"iframe":case"object":Be("load",i);break;case"video":case"audio":for(o=0;o<Va.length;o++)Be(Va[o],i);break;case"image":Be("error",i),Be("load",i);break;case"details":Be("toggle",i);break;case"embed":case"source":case"link":Be("error",i),Be("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(z in a)if(a.hasOwnProperty(z)&&(o=a[z],o!=null))switch(z){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,s));default:Ye(i,s,z,o,a,null)}return;default:if(cu(s)){for(G in a)a.hasOwnProperty(G)&&(o=a[G],o!==void 0&&Kh(i,s,G,o,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(o=a[w],o!=null&&Ye(i,s,w,o,a,null))}function $w(i,s,a,o){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,p=null,g=null,w=null,A=null,z=null,G=null;for(U in a){var Z=a[U];if(a.hasOwnProperty(U)&&Z!=null)switch(U){case"checked":break;case"value":break;case"defaultValue":A=Z;default:o.hasOwnProperty(U)||Ye(i,s,U,null,o,Z)}}for(var P in o){var U=o[P];if(Z=a[P],o.hasOwnProperty(P)&&(U!=null||Z!=null))switch(P){case"type":p=U;break;case"name":h=U;break;case"checked":z=U;break;case"defaultChecked":G=U;break;case"value":g=U;break;case"defaultValue":w=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(n(137,s));break;default:U!==Z&&Ye(i,s,P,U,o,Z)}}lu(i,g,w,A,z,G,p,h);return;case"select":U=g=w=P=null;for(p in a)if(A=a[p],a.hasOwnProperty(p)&&A!=null)switch(p){case"value":break;case"multiple":U=A;default:o.hasOwnProperty(p)||Ye(i,s,p,null,o,A)}for(h in o)if(p=o[h],A=a[h],o.hasOwnProperty(h)&&(p!=null||A!=null))switch(h){case"value":P=p;break;case"defaultValue":w=p;break;case"multiple":g=p;default:p!==A&&Ye(i,s,h,p,o,A)}s=w,a=g,o=U,P!=null?on(i,!!a,P,!1):!!o!=!!a&&(s!=null?on(i,!!a,s,!0):on(i,!!a,a?[]:"",!1));return;case"textarea":U=P=null;for(w in a)if(h=a[w],a.hasOwnProperty(w)&&h!=null&&!o.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ye(i,s,w,null,o,h)}for(g in o)if(h=o[g],p=a[g],o.hasOwnProperty(g)&&(h!=null||p!=null))switch(g){case"value":P=h;break;case"defaultValue":U=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(n(91));break;default:h!==p&&Ye(i,s,g,h,o,p)}Y_(i,P,U);return;case"option":for(var fe in a)if(P=a[fe],a.hasOwnProperty(fe)&&P!=null&&!o.hasOwnProperty(fe))switch(fe){case"selected":i.selected=!1;break;default:Ye(i,s,fe,null,o,P)}for(A in o)if(P=o[A],U=a[A],o.hasOwnProperty(A)&&P!==U&&(P!=null||U!=null))switch(A){case"selected":i.selected=P&&typeof P!="function"&&typeof P!="symbol";break;default:Ye(i,s,A,P,o,U)}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 be in a)P=a[be],a.hasOwnProperty(be)&&P!=null&&!o.hasOwnProperty(be)&&Ye(i,s,be,null,o,P);for(z in o)if(P=o[z],U=a[z],o.hasOwnProperty(z)&&P!==U&&(P!=null||U!=null))switch(z){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(n(137,s));break;default:Ye(i,s,z,P,o,U)}return;default:if(cu(s)){for(var Ke in a)P=a[Ke],a.hasOwnProperty(Ke)&&P!==void 0&&!o.hasOwnProperty(Ke)&&Kh(i,s,Ke,void 0,o,P);for(G in o)P=o[G],U=a[G],!o.hasOwnProperty(G)||P===U||P===void 0&&U===void 0||Kh(i,s,G,P,o,U);return}}for(var L in a)P=a[L],a.hasOwnProperty(L)&&P!=null&&!o.hasOwnProperty(L)&&Ye(i,s,L,null,o,P);for(Z in o)P=o[Z],U=a[Z],!o.hasOwnProperty(Z)||P===U||P==null&&U==null||Ye(i,s,Z,P,o,U)}function Qg(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Gw(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,a=performance.getEntriesByType("resource"),o=0;o<a.length;o++){var h=a[o],p=h.transferSize,g=h.initiatorType,w=h.duration;if(p&&w&&Qg(g)){for(g=0,w=h.responseEnd,o+=1;o<a.length;o++){var A=a[o],z=A.startTime;if(z>w)break;var G=A.transferSize,Z=A.initiatorType;G&&Qg(Z)&&(A=A.responseEnd,g+=G*(A<w?1:(w-z)/(A-z)))}if(--o,s+=8*(p+g)/(h.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Xh=null,Zh=null;function zo(i){return i.nodeType===9?i:i.ownerDocument}function Jg(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ev(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function Qh(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Jh=null;function qw(){var i=window.event;return i&&i.type==="popstate"?i===Jh?!1:(Jh=i,!0):(Jh=null,!1)}var tv=typeof setTimeout=="function"?setTimeout:void 0,Ww=typeof clearTimeout=="function"?clearTimeout:void 0,iv=typeof Promise=="function"?Promise:void 0,Fw=typeof queueMicrotask=="function"?queueMicrotask:typeof iv<"u"?function(i){return iv.resolve(null).then(i).catch(Yw)}:tv;function Yw(i){setTimeout(function(){throw i})}function ts(i){return i==="head"}function rv(i,s){var a=s,o=0;do{var h=a.nextSibling;if(i.removeChild(a),h&&h.nodeType===8)if(a=h.data,a==="/$"||a==="/&"){if(o===0){i.removeChild(h),Un(s);return}o--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")o++;else if(a==="html")Ga(i.ownerDocument.documentElement);else if(a==="head"){a=i.ownerDocument.head,Ga(a);for(var p=a.firstChild;p;){var g=p.nextSibling,w=p.nodeName;p[oa]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&p.rel.toLowerCase()==="stylesheet"||a.removeChild(p),p=g}}else a==="body"&&Ga(i.ownerDocument.body);a=h}while(a);Un(s)}function sv(i,s){var a=i;i=0;do{var o=a.nextSibling;if(a.nodeType===1?s?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(s?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),o&&o.nodeType===8)if(a=o.data,a==="/$"){if(i===0)break;i--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||i++;a=o}while(a)}function ed(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var a=s;switch(s=s.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ed(a),nu(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}i.removeChild(a)}}function Kw(i,s,a,o){for(;i.nodeType===1;){var h=a;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!o&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(o){if(!i[oa])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(p=i.getAttribute("rel"),p==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(p!==h.rel||i.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||i.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||i.getAttribute("title")!==(h.title==null?null:h.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(p=i.getAttribute("src"),(p!==(h.src==null?null:h.src)||i.getAttribute("type")!==(h.type==null?null:h.type)||i.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&p&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var p=h.name==null?null:""+h.name;if(h.type==="hidden"&&i.getAttribute("name")===p)return i}else return i;if(i=Ni(i.nextSibling),i===null)break}return null}function Xw(i,s,a){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=Ni(i.nextSibling),i===null))return null;return i}function nv(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Ni(i.nextSibling),i===null))return null;return i}function td(i){return i.data==="$?"||i.data==="$~"}function id(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function Zw(i,s){var a=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||a.readyState!=="loading")s();else{var o=function(){s(),a.removeEventListener("DOMContentLoaded",o)};a.addEventListener("DOMContentLoaded",o),i._reactRetry=o}}function Ni(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var rd=null;function av(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var a=i.data;if(a==="/$"||a==="/&"){if(s===0)return Ni(i.nextSibling);s--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||s++}i=i.nextSibling}return null}function lv(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var a=i.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(s===0)return i;s--}else a!=="/$"&&a!=="/&"||s++}i=i.previousSibling}return null}function ov(i,s,a){switch(s=zo(a),i){case"html":if(i=s.documentElement,!i)throw Error(n(452));return i;case"head":if(i=s.head,!i)throw Error(n(453));return i;case"body":if(i=s.body,!i)throw Error(n(454));return i;default:throw Error(n(451))}}function Ga(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);nu(i)}var Bi=new Map,cv=new Set;function Po(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var xr=q.d;q.d={f:Qw,r:Jw,D:eC,C:tC,L:iC,m:rC,X:nC,S:sC,M:aC};function Qw(){var i=xr.f(),s=To();return i||s}function Jw(i){var s=nn(i);s!==null&&s.tag===5&&s.type==="form"?Am(s):xr.r(i)}var Pn=typeof document>"u"?null:document;function uv(i,s,a){var o=Pn;if(o&&typeof s=="string"&&s){var h=ki(s);h='link[rel="'+i+'"][href="'+h+'"]',typeof a=="string"&&(h+='[crossorigin="'+a+'"]'),cv.has(h)||(cv.add(h),i={rel:i,crossOrigin:a,href:s},o.querySelector(h)===null&&(s=o.createElement("link"),Gt(s,"link",i),Lt(s),o.head.appendChild(s)))}}function eC(i){xr.D(i),uv("dns-prefetch",i,null)}function tC(i,s){xr.C(i,s),uv("preconnect",i,s)}function iC(i,s,a){xr.L(i,s,a);var o=Pn;if(o&&i&&s){var h='link[rel="preload"][as="'+ki(s)+'"]';s==="image"&&a&&a.imageSrcSet?(h+='[imagesrcset="'+ki(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(h+='[imagesizes="'+ki(a.imageSizes)+'"]')):h+='[href="'+ki(i)+'"]';var p=h;switch(s){case"style":p=In(i);break;case"script":p=Hn(i)}Bi.has(p)||(i=m({rel:"preload",href:s==="image"&&a&&a.imageSrcSet?void 0:i,as:s},a),Bi.set(p,i),o.querySelector(h)!==null||s==="style"&&o.querySelector(qa(p))||s==="script"&&o.querySelector(Wa(p))||(s=o.createElement("link"),Gt(s,"link",i),Lt(s),o.head.appendChild(s)))}}function rC(i,s){xr.m(i,s);var a=Pn;if(a&&i){var o=s&&typeof s.as=="string"?s.as:"script",h='link[rel="modulepreload"][as="'+ki(o)+'"][href="'+ki(i)+'"]',p=h;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Hn(i)}if(!Bi.has(p)&&(i=m({rel:"modulepreload",href:i},s),Bi.set(p,i),a.querySelector(h)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Wa(p)))return}o=a.createElement("link"),Gt(o,"link",i),Lt(o),a.head.appendChild(o)}}}function sC(i,s,a){xr.S(i,s,a);var o=Pn;if(o&&i){var h=an(o).hoistableStyles,p=In(i);s=s||"default";var g=h.get(p);if(!g){var w={loading:0,preload:null};if(g=o.querySelector(qa(p)))w.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":s},a),(a=Bi.get(p))&&sd(i,a);var A=g=o.createElement("link");Lt(A),Gt(A,"link",i),A._p=new Promise(function(z,G){A.onload=z,A.onerror=G}),A.addEventListener("load",function(){w.loading|=1}),A.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Io(g,s,o)}g={type:"stylesheet",instance:g,count:1,state:w},h.set(p,g)}}}function nC(i,s){xr.X(i,s);var a=Pn;if(a&&i){var o=an(a).hoistableScripts,h=Hn(i),p=o.get(h);p||(p=a.querySelector(Wa(h)),p||(i=m({src:i,async:!0},s),(s=Bi.get(h))&&nd(i,s),p=a.createElement("script"),Lt(p),Gt(p,"link",i),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(h,p))}}function aC(i,s){xr.M(i,s);var a=Pn;if(a&&i){var o=an(a).hoistableScripts,h=Hn(i),p=o.get(h);p||(p=a.querySelector(Wa(h)),p||(i=m({src:i,async:!0,type:"module"},s),(s=Bi.get(h))&&nd(i,s),p=a.createElement("script"),Lt(p),Gt(p,"link",i),a.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},o.set(h,p))}}function hv(i,s,a,o){var h=(h=pe.current)?Po(h):null;if(!h)throw Error(n(446));switch(i){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(s=In(a.href),a=an(h).hoistableStyles,o=a.get(s),o||(o={type:"style",instance:null,count:0,state:null},a.set(s,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){i=In(a.href);var p=an(h).hoistableStyles,g=p.get(i);if(g||(h=h.ownerDocument||h,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(i,g),(p=h.querySelector(qa(i)))&&!p._p&&(g.instance=p,g.state.loading=5),Bi.has(i)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Bi.set(i,a),p||lC(h,i,a,g.state))),s&&o===null)throw Error(n(528,""));return g}if(s&&o!==null)throw Error(n(529,""));return null;case"script":return s=a.async,a=a.src,typeof a=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=Hn(a),a=an(h).hoistableScripts,o=a.get(s),o||(o={type:"script",instance:null,count:0,state:null},a.set(s,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,i))}}function In(i){return'href="'+ki(i)+'"'}function qa(i){return'link[rel="stylesheet"]['+i+"]"}function dv(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function lC(i,s,a,o){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?o.loading=1:(s=i.createElement("link"),o.preload=s,s.addEventListener("load",function(){return o.loading|=1}),s.addEventListener("error",function(){return o.loading|=2}),Gt(s,"link",a),Lt(s),i.head.appendChild(s))}function Hn(i){return'[src="'+ki(i)+'"]'}function Wa(i){return"script[async]"+i}function fv(i,s,a){if(s.count++,s.instance===null)switch(s.type){case"style":var o=i.querySelector('style[data-href~="'+ki(a.href)+'"]');if(o)return s.instance=o,Lt(o),o;var h=m({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return o=(i.ownerDocument||i).createElement("style"),Lt(o),Gt(o,"style",h),Io(o,a.precedence,i),s.instance=o;case"stylesheet":h=In(a.href);var p=i.querySelector(qa(h));if(p)return s.state.loading|=4,s.instance=p,Lt(p),p;o=dv(a),(h=Bi.get(h))&&sd(o,h),p=(i.ownerDocument||i).createElement("link"),Lt(p);var g=p;return g._p=new Promise(function(w,A){g.onload=w,g.onerror=A}),Gt(p,"link",o),s.state.loading|=4,Io(p,a.precedence,i),s.instance=p;case"script":return p=Hn(a.src),(h=i.querySelector(Wa(p)))?(s.instance=h,Lt(h),h):(o=a,(h=Bi.get(p))&&(o=m({},a),nd(o,h)),i=i.ownerDocument||i,h=i.createElement("script"),Lt(h),Gt(h,"link",o),i.head.appendChild(h),s.instance=h);case"void":return null;default:throw Error(n(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(o=s.instance,s.state.loading|=4,Io(o,a.precedence,i));return s.instance}function Io(i,s,a){for(var o=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=o.length?o[o.length-1]:null,p=h,g=0;g<o.length;g++){var w=o[g];if(w.dataset.precedence===s)p=w;else if(p!==h)break}p?p.parentNode.insertBefore(i,p.nextSibling):(s=a.nodeType===9?a.head:a,s.insertBefore(i,s.firstChild))}function sd(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function nd(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var Ho=null;function _v(i,s,a){if(Ho===null){var o=new Map,h=Ho=new Map;h.set(a,o)}else h=Ho,o=h.get(a),o||(o=new Map,h.set(a,o));if(o.has(i))return o;for(o.set(i,null),a=a.getElementsByTagName(i),h=0;h<a.length;h++){var p=a[h];if(!(p[oa]||p[Ut]||i==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var g=p.getAttribute(s)||"";g=i+g;var w=o.get(g);w?w.push(p):o.set(g,[p])}}return o}function pv(i,s,a){i=i.ownerDocument||i,i.head.insertBefore(a,s==="title"?i.querySelector("head > title"):null)}function oC(i,s,a){if(a===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function mv(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function cC(i,s,a,o){if(a.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var h=In(o.href),p=s.querySelector(qa(h));if(p){s=p._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Uo.bind(i),s.then(i,i)),a.state.loading|=4,a.instance=p,Lt(p);return}p=s.ownerDocument||s,o=dv(o),(h=Bi.get(h))&&sd(o,h),p=p.createElement("link"),Lt(p);var g=p;g._p=new Promise(function(w,A){g.onload=w,g.onerror=A}),Gt(p,"link",o),a.instance=p}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(a,s),(s=a.state.preload)&&(a.state.loading&3)===0&&(i.count++,a=Uo.bind(i),s.addEventListener("load",a),s.addEventListener("error",a))}}var ad=0;function uC(i,s){return i.stylesheets&&i.count===0&&Vo(i,i.stylesheets),0<i.count||0<i.imgCount?function(a){var o=setTimeout(function(){if(i.stylesheets&&Vo(i,i.stylesheets),i.unsuspend){var p=i.unsuspend;i.unsuspend=null,p()}},6e4+s);0<i.imgBytes&&ad===0&&(ad=62500*Gw());var h=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&Vo(i,i.stylesheets),i.unsuspend)){var p=i.unsuspend;i.unsuspend=null,p()}},(i.imgBytes>ad?50:800)+s);return i.unsuspend=a,function(){i.unsuspend=null,clearTimeout(o),clearTimeout(h)}}:null}function Uo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vo(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var jo=null;function Vo(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,jo=new Map,s.forEach(hC,i),jo=null,Uo.call(i))}function hC(i,s){if(!(s.state.loading&4)){var a=jo.get(i);if(a)var o=a.get(null);else{a=new Map,jo.set(i,a);for(var h=i.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<h.length;p++){var g=h[p];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(a.set(g.dataset.precedence,g),o=g)}o&&a.set(null,o)}h=s.instance,g=h.getAttribute("data-precedence"),p=a.get(g)||o,p===o&&a.set(null,h),a.set(g,h),this.count++,o=Uo.bind(this),h.addEventListener("load",o),h.addEventListener("error",o),p?p.parentNode.insertBefore(h,p.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(h,i.firstChild)),s.state.loading|=4}}var Fa={$$typeof:B,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function dC(i,s,a,o,h,p,g,w,A){this.tag=1,this.containerInfo=i,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=tu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tu(0),this.hiddenUpdates=tu(null),this.identifierPrefix=o,this.onUncaughtError=h,this.onCaughtError=p,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=A,this.incompleteTransitions=new Map}function gv(i,s,a,o,h,p,g,w,A,z,G,Z){return i=new dC(i,s,a,g,A,z,G,Z,w),s=1,p===!0&&(s|=24),p=gi(3,null,null,s),i.current=p,p.stateNode=i,s=Hu(),s.refCount++,i.pooledCache=s,s.refCount++,p.memoizedState={element:o,isDehydrated:a,cache:s},$u(p),i}function vv(i){return i?(i=mn,i):mn}function yv(i,s,a,o,h,p){h=vv(h),o.context===null?o.context=h:o.pendingContext=h,o=Gr(s),o.payload={element:a},p=p===void 0?null:p,p!==null&&(o.callback=p),a=qr(i,o,s),a!==null&&(hi(a,i,s),xa(a,i,s))}function Sv(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var a=i.retryLane;i.retryLane=a!==0&&a<s?a:s}}function ld(i,s){Sv(i,s),(i=i.alternate)&&Sv(i,s)}function bv(i){if(i.tag===13||i.tag===31){var s=xs(i,67108864);s!==null&&hi(s,i,67108864),ld(i,67108864)}}function wv(i){if(i.tag===13||i.tag===31){var s=wi();s=iu(s);var a=xs(i,s);a!==null&&hi(a,i,s),ld(i,s)}}var $o=!0;function fC(i,s,a,o){var h=D.T;D.T=null;var p=q.p;try{q.p=2,od(i,s,a,o)}finally{q.p=p,D.T=h}}function _C(i,s,a,o){var h=D.T;D.T=null;var p=q.p;try{q.p=8,od(i,s,a,o)}finally{q.p=p,D.T=h}}function od(i,s,a,o){if($o){var h=cd(o);if(h===null)Yh(i,s,o,Go,a),Ev(i,o);else if(mC(h,i,s,a,o))o.stopPropagation();else if(Ev(i,o),s&4&&-1<pC.indexOf(i)){for(;h!==null;){var p=nn(h);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var g=Ss(p.pendingLanes);if(g!==0){var w=p;for(w.pendingLanes|=2,w.entangledLanes|=2;g;){var A=1<<31-pi(g);w.entanglements[1]|=A,g&=~A}Ji(p),(Ve&6)===0&&(Ao=Yt()+500,ja(0))}}break;case 31:case 13:w=xs(p,2),w!==null&&hi(w,p,2),To(),ld(p,2)}if(p=cd(o),p===null&&Yh(i,s,o,Go,a),p===h)break;h=p}h!==null&&o.stopPropagation()}else Yh(i,s,o,null,a)}}function cd(i){return i=hu(i),ud(i)}var Go=null;function ud(i){if(Go=null,i=sn(i),i!==null){var s=c(i);if(s===null)i=null;else{var a=s.tag;if(a===13){if(i=u(s),i!==null)return i;i=null}else if(a===31){if(i=d(s),i!==null)return i;i=null}else if(a===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return Go=i,null}function Cv(i){switch(i){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(e1()){case L_:return 2;case O_:return 8;case Ol:case t1:return 32;case M_:return 268435456;default:return 32}default:return 32}}var hd=!1,is=null,rs=null,ss=null,Ya=new Map,Ka=new Map,ns=[],pC="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 Ev(i,s){switch(i){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":rs=null;break;case"mouseover":case"mouseout":ss=null;break;case"pointerover":case"pointerout":Ya.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ka.delete(s.pointerId)}}function Xa(i,s,a,o,h,p){return i===null||i.nativeEvent!==p?(i={blockedOn:s,domEventName:a,eventSystemFlags:o,nativeEvent:p,targetContainers:[h]},s!==null&&(s=nn(s),s!==null&&bv(s)),i):(i.eventSystemFlags|=o,s=i.targetContainers,h!==null&&s.indexOf(h)===-1&&s.push(h),i)}function mC(i,s,a,o,h){switch(s){case"focusin":return is=Xa(is,i,s,a,o,h),!0;case"dragenter":return rs=Xa(rs,i,s,a,o,h),!0;case"mouseover":return ss=Xa(ss,i,s,a,o,h),!0;case"pointerover":var p=h.pointerId;return Ya.set(p,Xa(Ya.get(p)||null,i,s,a,o,h)),!0;case"gotpointercapture":return p=h.pointerId,Ka.set(p,Xa(Ka.get(p)||null,i,s,a,o,h)),!0}return!1}function xv(i){var s=sn(i.target);if(s!==null){var a=c(s);if(a!==null){if(s=a.tag,s===13){if(s=u(a),s!==null){i.blockedOn=s,H_(i.priority,function(){wv(a)});return}}else if(s===31){if(s=d(a),s!==null){i.blockedOn=s,H_(i.priority,function(){wv(a)});return}}else if(s===3&&a.stateNode.current.memoizedState.isDehydrated){i.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}i.blockedOn=null}function qo(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var a=cd(i.nativeEvent);if(a===null){a=i.nativeEvent;var o=new a.constructor(a.type,a);uu=o,a.target.dispatchEvent(o),uu=null}else return s=nn(a),s!==null&&bv(s),i.blockedOn=a,!1;s.shift()}return!0}function Av(i,s,a){qo(i)&&a.delete(s)}function gC(){hd=!1,is!==null&&qo(is)&&(is=null),rs!==null&&qo(rs)&&(rs=null),ss!==null&&qo(ss)&&(ss=null),Ya.forEach(Av),Ka.forEach(Av)}function Wo(i,s){i.blockedOn===s&&(i.blockedOn=null,hd||(hd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,gC)))}var Fo=null;function kv(i){Fo!==i&&(Fo=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Fo===i&&(Fo=null);for(var s=0;s<i.length;s+=3){var a=i[s],o=i[s+1],h=i[s+2];if(typeof o!="function"){if(ud(o||a)===null)continue;break}var p=nn(a);p!==null&&(i.splice(s,3),s-=3,ch(p,{pending:!0,data:h,method:a.method,action:o},o,h))}}))}function Un(i){function s(A){return Wo(A,i)}is!==null&&Wo(is,i),rs!==null&&Wo(rs,i),ss!==null&&Wo(ss,i),Ya.forEach(s),Ka.forEach(s);for(var a=0;a<ns.length;a++){var o=ns[a];o.blockedOn===i&&(o.blockedOn=null)}for(;0<ns.length&&(a=ns[0],a.blockedOn===null);)xv(a),a.blockedOn===null&&ns.shift();if(a=(i.ownerDocument||i).$$reactFormReplay,a!=null)for(o=0;o<a.length;o+=3){var h=a[o],p=a[o+1],g=h[ni]||null;if(typeof p=="function")g||kv(a);else if(g){var w=null;if(p&&p.hasAttribute("formAction")){if(h=p,g=p[ni]||null)w=g.formAction;else if(ud(h)!==null)continue}else w=g.action;typeof w=="function"?a[o+1]=w:(a.splice(o,3),o-=3),kv(a)}}}function Tv(){function i(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(g){return h=g})},focusReset:"manual",scroll:"manual"})}function s(){h!==null&&(h(),h=null),o||setTimeout(a,20)}function a(){if(!o&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,h=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(a,100),function(){o=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),h!==null&&(h(),h=null)}}}function dd(i){this._internalRoot=i}Yo.prototype.render=dd.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(n(409));var a=s.current,o=wi();yv(a,o,i,s,null,null)},Yo.prototype.unmount=dd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;yv(i.current,2,null,i,null,null),To(),s[rn]=null}};function Yo(i){this._internalRoot=i}Yo.prototype.unstable_scheduleHydration=function(i){if(i){var s=I_();i={blockedOn:null,target:i,priority:s};for(var a=0;a<ns.length&&s!==0&&s<ns[a].priority;a++);ns.splice(a,0,i),a===0&&xv(i)}};var Rv=t.version;if(Rv!=="19.2.4")throw Error(n(527,Rv,"19.2.4"));q.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=f(s),i=i!==null?v(i):null,i=i===null?null:i.stateNode,i};var vC={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ko=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ko.isDisabled&&Ko.supportsFiber)try{na=Ko.inject(vC),_i=Ko}catch{}}return Qa.createRoot=function(i,s){if(!l(i))throw Error(n(299));var a=!1,o="",h=zm,p=Pm,g=Im;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(o=s.identifierPrefix),s.onUncaughtError!==void 0&&(h=s.onUncaughtError),s.onCaughtError!==void 0&&(p=s.onCaughtError),s.onRecoverableError!==void 0&&(g=s.onRecoverableError)),s=gv(i,1,!1,null,null,a,o,null,h,p,g,Tv),i[rn]=s.current,Fh(i),new dd(s)},Qa.hydrateRoot=function(i,s,a){if(!l(i))throw Error(n(299));var o=!1,h="",p=zm,g=Pm,w=Im,A=null;return a!=null&&(a.unstable_strictMode===!0&&(o=!0),a.identifierPrefix!==void 0&&(h=a.identifierPrefix),a.onUncaughtError!==void 0&&(p=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.formState!==void 0&&(A=a.formState)),s=gv(i,1,!0,s,a??null,o,h,A,p,g,w,Tv),s.context=vv(null),a=s.current,o=wi(),o=iu(o),h=Gr(o),h.callback=null,qr(a,h,o),a=o,s.current.lanes=a,la(s,a),Ji(s),i[rn]=s.current,Fh(i),new Yo(s)},Qa.version="19.2.4",Qa}var jv;function OC(){if(jv)return gd.exports;jv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),gd.exports=LC(),gd.exports}var MC=OC();class NC{constructor(t){Y(this,"ws");Y(this,"onopen",null);Y(this,"onmessage",null);Y(this,"onclose",null);this.ws=new WebSocket(t),this.ws.onopen=()=>{var r;return(r=this.onopen)==null?void 0:r.call(this)},this.ws.onmessage=r=>{var n;try{(n=this.onmessage)==null||n.call(this,JSON.parse(r.data))}catch{}},this.ws.onclose=()=>{var r;return(r=this.onclose)==null?void 0:r.call(this)},this.ws.onerror=()=>{}}get readyState(){return this.ws.readyState}send(t){this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify(t))}close(){this.ws.close()}}function BC(e){const t=location.protocol==="https:"?"wss:":"ws:";return new NC(`${t}//${location.host}/?sessionId=${e}`)}function zC({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"9",y:"2",width:"6",height:"12",rx:"3"}),k.jsx("path",{d:"M5 10a7 7 0 0 0 14 0"}),k.jsx("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),k.jsx("line",{x1:"8",y1:"22",x2:"16",y2:"22"})]})}function PC({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"}),k.jsx("line",{x1:"6",y1:"9",x2:"6",y2:"9"}),k.jsx("line",{x1:"10",y1:"9",x2:"10",y2:"9"}),k.jsx("line",{x1:"14",y1:"9",x2:"14",y2:"9"}),k.jsx("line",{x1:"18",y1:"9",x2:"18",y2:"9"}),k.jsx("line",{x1:"6",y1:"13",x2:"6",y2:"13"}),k.jsx("line",{x1:"18",y1:"13",x2:"18",y2:"13"}),k.jsx("line",{x1:"9",y1:"13",x2:"15",y2:"13"})]})}function IC({size:e=14,color:t="currentColor"}){return k.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:t,stroke:"none",children:k.jsx("path",{d:"M2.01 21L23 12 2.01 3 2 10l15 2-15 2z"})})}function HC({size:e=14,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2.5",strokeLinecap:"round",children:[k.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"}),k.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"})]})}function M0({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),k.jsx("polygon",{points:"10 8 16 12 10 16"})]})}function UC({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),k.jsx("line",{x1:"7",y1:"8",x2:"17",y2:"8"}),k.jsx("line",{x1:"7",y1:"12",x2:"14",y2:"12"}),k.jsx("line",{x1:"7",y1:"16",x2:"17",y2:"16"})]})}function N0({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),k.jsx("path",{d:"M12 8v8"}),k.jsx("path",{d:"M8 12h8"})]})}function B0({size:e=14,color:t="currentColor"}){return k.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:k.jsx("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"})})}function jC({size:e=10,color:t="currentColor"}){return k.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:k.jsx("polyline",{points:"9 6 15 12 9 18"})})}function pl({size:e=14,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),k.jsx("polyline",{points:"14 2 14 8 20 8"})]})}function Vv({size:e=14,color:t="currentColor"}){return k.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:k.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})}function z0({size:e=18,color:t="currentColor"}){return k.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[k.jsx("rect",{x:"2",y:"2",width:"20",height:"20",rx:"3"}),k.jsx("polyline",{points:"7 9 10 12 7 15"}),k.jsx("line",{x1:"13",y1:"15",x2:"17",y2:"15"})]})}function VC({size:e=14,color:t="currentColor"}){return k.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:t,stroke:"none",children:k.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}function $C({activeTab:e,onTabChange:t,changeCount:r}){return k.jsxs("nav",{className:"tab-bar",children:[k.jsx("div",{className:"tab-spacer"}),k.jsxs("button",{className:`tab-item ${e==="preview"?"active":""}`,onClick:()=>t("preview"),children:[k.jsx("span",{className:"tab-icon",children:k.jsx(M0,{})}),k.jsx("span",{className:"tab-label",children:"预览"})]}),k.jsxs("button",{className:`tab-item ${e==="terminal"?"active":""}`,onClick:()=>t("terminal"),children:[k.jsx("span",{className:"tab-icon",children:k.jsx(z0,{})}),k.jsx("span",{className:"tab-label",children:"终端"})]}),k.jsxs("button",{className:`tab-item ${e==="files"?"active":""}`,onClick:()=>t("files"),children:[k.jsx("span",{className:"tab-icon",children:k.jsx(UC,{})}),k.jsx("span",{className:"tab-label",children:"文件"})]}),k.jsxs("button",{className:`tab-item ${e==="changes"?"active":""}`,onClick:()=>t("changes"),children:[k.jsxs("span",{className:"tab-icon",children:[k.jsx(N0,{}),r!==void 0&&r>0&&k.jsx("span",{className:"tab-badge",children:r})]}),k.jsx("span",{className:"tab-label",children:"变更"})]})]})}var Zd=Object.defineProperty,GC=Object.getOwnPropertyDescriptor,qC=Object.getOwnPropertyNames,WC=Object.prototype.hasOwnProperty,t_=(e,t)=>{let r={};for(var n in e)Zd(r,n,{get:e[n],enumerable:!0});return Zd(r,Symbol.toStringTag,{value:"Module"}),r},FC=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var l=qC(t),c=0,u=l.length,d;c<u;c++)d=l[c],!WC.call(e,d)&&d!==r&&Zd(e,d,{get:(_=>t[_]).bind(null,d),enumerable:!(n=GC(t,d))||n.enumerable});return e},P0=(e,t,r)=>(FC(e,t,"default"),r);const YC="modulepreload",KC=function(e){return"/"+e},$v={},C=function(t,r,n){let l=Promise.resolve();if(r&&r.length>0){let u=function(f){return Promise.all(f.map(v=>Promise.resolve(v).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),_=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));l=u(r.map(f=>{if(f=KC(f),f in $v)return;$v[f]=!0;const v=f.endsWith(".css"),m=v?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${m}`))return;const y=document.createElement("link");if(y.rel=v?"stylesheet":YC,v||(y.as="script"),y.crossOrigin="",y.href=f,_&&y.setAttribute("nonce",_),document.head.appendChild(y),v)return new Promise((S,b)=>{y.addEventListener("load",S),y.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${f}`)))})}))}function c(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return l.then(u=>{for(const d of u||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})},Ic=[{id:"abap",name:"ABAP",import:(()=>C(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>C(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>C(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>C(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>C(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>C(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>C(()=>import("./apex-D8_7TLub.js"),[]))},{id:"apl",name:"APL",import:(()=>C(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>C(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>C(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>C(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>C(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>C(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>C(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>C(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>C(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>C(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>C(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>C(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>C(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>C(()=>import("./bird2-BIv1doCn.js"),[]))},{id:"blade",name:"Blade",import:(()=>C(()=>import("./blade-BjGOyj-B.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>C(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>C(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>C(()=>import("./c3-eo99z4R2.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>C(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>C(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>C(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>C(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>C(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>C(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>C(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>C(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>C(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>C(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>C(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>C(()=>import("./cpp-CofmeUqb.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>C(()=>import("./crystal-DNxU26gB.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>C(()=>import("./csharp-COcwbKMJ.js"),[]))},{id:"css",name:"CSS",import:(()=>C(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>C(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>C(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>C(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>C(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>C(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>C(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>C(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>C(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>C(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>C(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>C(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>C(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>C(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>C(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>C(()=>import("./emacs-lisp-CXvaQtF9.js"),[]))},{id:"erb",name:"ERB",import:(()=>C(()=>import("./erb-BYCe7drp.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>C(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>C(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>C(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>C(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>C(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>C(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>C(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>C(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>C(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>C(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>C(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>C(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>C(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>C(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>C(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>C(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>C(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>C(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>C(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>C(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>C(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>C(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>C(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>C(()=>import("./hack-i7_Ulhet.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>C(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>C(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>C(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>C(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>C(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>C(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>C(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>C(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>C(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>C(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>C(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>C(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>C(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>C(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>C(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>C(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>C(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>C(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>C(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>C(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>C(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>C(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>C(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>C(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>C(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>C(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>C(()=>import("./julia-CxzCAyBv.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>C(()=>import("./just-VxiPbLrw.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>C(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>C(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>C(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>C(()=>import("./latex-CWtU0Tv5.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>C(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>C(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>C(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>C(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>C(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>C(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>C(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>C(()=>import("./luau-C-HG3fhB.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>C(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>C(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>C(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>C(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>C(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>C(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>C(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>C(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>C(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>C(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>C(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>C(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>C(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>C(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>C(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>C(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>C(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>C(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>C(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>C(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>C(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>C(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>C(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>C(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>C(()=>import("./perl-NvoQZIq0.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>C(()=>import("./php-R6g_5hLQ.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>C(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>C(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>C(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>C(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>C(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>C(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>C(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>C(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>C(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>C(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>C(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>C(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>C(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>C(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>C(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>C(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>C(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>C(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>C(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>C(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>C(()=>import("./razor-BDqjjVU7.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>C(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>C(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>C(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>C(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>C(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>C(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>C(()=>import("./rst-CRjBmOyv.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>C(()=>import("./ruby-Wjq7vjNf.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>C(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>C(()=>import("./sas-cz2c8ADy.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>C(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>C(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>C(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>C(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>C(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>C(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>C(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>C(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>C(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>C(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>C(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>C(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>C(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>C(()=>import("./sql-BLtJtn59.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>C(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>C(()=>import("./stata-BH5u7GGu.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>C(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>C(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>C(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>C(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>C(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>C(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>C(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>C(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>C(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>C(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>C(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>C(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>C(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>C(()=>import("./ts-tags-DQrlYJgV.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>C(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>C(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>C(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>C(()=>import("./twig-xg9kU7Mw.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>C(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>C(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>C(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>C(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>C(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>C(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>C(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>C(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>C(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>C(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>C(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>C(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>C(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>C(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>C(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>C(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>C(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>C(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>C(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>C(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>C(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>C(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>C(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>C(()=>import("./zig-VOosw3JB.js"),[]))}],i_=Object.fromEntries(Ic.map(e=>[e.id,e.import])),r_=Object.fromEntries(Ic.flatMap(e=>{var t;return((t=e.aliases)==null?void 0:t.map(r=>[r,e.import]))||[]})),s_={...i_,...r_},n_=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>C(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>C(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>C(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>C(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>C(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>C(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>C(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>C(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>C(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>C(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>C(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>C(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>C(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>C(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>C(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>C(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>C(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>C(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>C(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>C(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>C(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>C(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>C(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>C(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>C(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>C(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>C(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>C(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>C(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>C(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>C(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>C(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>C(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>C(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>C(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>C(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>C(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>C(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>C(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>C(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>C(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>C(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>C(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>C(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>C(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>C(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>C(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>C(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>C(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>C(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>C(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>C(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>C(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>C(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>C(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>C(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>C(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>C(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>C(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>C(()=>import("./vesper-DU1UobuO.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>C(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>C(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>C(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],a_=Object.fromEntries(n_.map(e=>[e.id,e.import]));var l_=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function XC(){return 2147483648}function ZC(){return typeof performance<"u"?performance.now():Date.now()}const QC=(e,t)=>e+(t-e%t)%t;async function JC(e){let t,r;const n={};function l(S){r=S,n.HEAPU8=new Uint8Array(S),n.HEAPU32=new Uint32Array(S)}function c(S,b,x){n.HEAPU8.copyWithin(S,b,b+x)}function u(S){try{return t.grow(S-r.byteLength+65535>>>16),l(t.buffer),1}catch{}}function d(S){const b=n.HEAPU8.length;S=S>>>0;const x=XC();if(S>x)return!1;for(let T=1;T<=4;T*=2){let O=b*(1+.2/T);O=Math.min(O,S+100663296);const H=Math.min(x,QC(Math.max(S,O),65536));if(u(H))return!0}return!1}const _=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function f(S,b,x=1024){const T=b+x;let O=b;for(;S[O]&&!(O>=T);)++O;if(O-b>16&&S.buffer&&_)return _.decode(S.subarray(b,O));let H="";for(;b<O;){let B=S[b++];if(!(B&128)){H+=String.fromCharCode(B);continue}const I=S[b++]&63;if((B&224)===192){H+=String.fromCharCode((B&31)<<6|I);continue}const j=S[b++]&63;if((B&240)===224?B=(B&15)<<12|I<<6|j:B=(B&7)<<18|I<<12|j<<6|S[b++]&63,B<65536)H+=String.fromCharCode(B);else{const $=B-65536;H+=String.fromCharCode(55296|$>>10,56320|$&1023)}}return H}function v(S,b){return S?f(n.HEAPU8,S,b):""}const m={emscripten_get_now:ZC,emscripten_memcpy_big:c,emscripten_resize_heap:d,fd_write:()=>0};async function y(){const b=await e({env:m,wasi_snapshot_preview1:m});t=b.memory,l(t.buffer),Object.assign(n,b),n.UTF8ToString=v}return await y(),n}var eE=Object.defineProperty,tE=(e,t,r)=>t in e?eE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kt=(e,t,r)=>tE(e,typeof t!="symbol"?t+"":t,r);let Mt=null;function iE(e){throw new l_(e.UTF8ToString(e.getLastOnigError()))}class Hc{constructor(t){kt(this,"utf16Length"),kt(this,"utf8Length"),kt(this,"utf16Value"),kt(this,"utf8Value"),kt(this,"utf16OffsetToUtf8"),kt(this,"utf8OffsetToUtf16");const r=t.length,n=Hc._utf8ByteLength(t),l=n!==r,c=l?new Uint32Array(r+1):null;l&&(c[r]=n);const u=l?new Uint32Array(n+1):null;l&&(u[n]=r);const d=new Uint8Array(n);let _=0;for(let f=0;f<r;f++){const v=t.charCodeAt(f);let m=v,y=!1;if(v>=55296&&v<=56319&&f+1<r){const S=t.charCodeAt(f+1);S>=56320&&S<=57343&&(m=(v-55296<<10)+65536|S-56320,y=!0)}l&&(c[f]=_,y&&(c[f+1]=_),m<=127?u[_+0]=f:m<=2047?(u[_+0]=f,u[_+1]=f):m<=65535?(u[_+0]=f,u[_+1]=f,u[_+2]=f):(u[_+0]=f,u[_+1]=f,u[_+2]=f,u[_+3]=f)),m<=127?d[_++]=m:m<=2047?(d[_++]=192|(m&1984)>>>6,d[_++]=128|(m&63)>>>0):m<=65535?(d[_++]=224|(m&61440)>>>12,d[_++]=128|(m&4032)>>>6,d[_++]=128|(m&63)>>>0):(d[_++]=240|(m&1835008)>>>18,d[_++]=128|(m&258048)>>>12,d[_++]=128|(m&4032)>>>6,d[_++]=128|(m&63)>>>0),y&&f++}this.utf16Length=r,this.utf8Length=n,this.utf16Value=t,this.utf8Value=d,this.utf16OffsetToUtf8=c,this.utf8OffsetToUtf16=u}static _utf8ByteLength(t){let r=0;for(let n=0,l=t.length;n<l;n++){const c=t.charCodeAt(n);let u=c,d=!1;if(c>=55296&&c<=56319&&n+1<l){const _=t.charCodeAt(n+1);_>=56320&&_<=57343&&(u=(c-55296<<10)+65536|_-56320,d=!0)}u<=127?r+=1:u<=2047?r+=2:u<=65535?r+=3:r+=4,d&&n++}return r}createString(t){const r=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,r),r}}const Uc=class ir{constructor(t){if(kt(this,"id",++ir.LAST_ID),kt(this,"_onigBinding"),kt(this,"content"),kt(this,"utf16Length"),kt(this,"utf8Length"),kt(this,"utf16OffsetToUtf8"),kt(this,"utf8OffsetToUtf16"),kt(this,"ptr"),!Mt)throw new l_("Must invoke loadWasm first.");this._onigBinding=Mt,this.content=t;const r=new Hc(t);this.utf16Length=r.utf16Length,this.utf8Length=r.utf8Length,this.utf16OffsetToUtf8=r.utf16OffsetToUtf8,this.utf8OffsetToUtf16=r.utf8OffsetToUtf16,this.utf8Length<1e4&&!ir._sharedPtrInUse?(ir._sharedPtr||(ir._sharedPtr=Mt.omalloc(1e4)),ir._sharedPtrInUse=!0,Mt.HEAPU8.set(r.utf8Value,ir._sharedPtr),this.ptr=ir._sharedPtr):this.ptr=r.createString(Mt)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===ir._sharedPtr?ir._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};kt(Uc,"LAST_ID",0);kt(Uc,"_sharedPtr",0);kt(Uc,"_sharedPtrInUse",!1);let I0=Uc;class rE{constructor(t){if(kt(this,"_onigBinding"),kt(this,"_ptr"),!Mt)throw new l_("Must invoke loadWasm first.");const r=[],n=[];for(let d=0,_=t.length;d<_;d++){const f=new Hc(t[d]);r[d]=f.createString(Mt),n[d]=f.utf8Length}const l=Mt.omalloc(4*t.length);Mt.HEAPU32.set(r,l/4);const c=Mt.omalloc(4*t.length);Mt.HEAPU32.set(n,c/4);const u=Mt.createOnigScanner(l,c,t.length);for(let d=0,_=t.length;d<_;d++)Mt.ofree(r[d]);Mt.ofree(c),Mt.ofree(l),u===0&&iE(Mt),this._onigBinding=Mt,this._ptr=u}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,r,n){let l=0;if(typeof n=="number"&&(l=n),typeof t=="string"){t=new I0(t);const c=this._findNextMatchSync(t,r,!1,l);return t.dispose(),c}return this._findNextMatchSync(t,r,!1,l)}_findNextMatchSync(t,r,n,l){const c=this._onigBinding,u=c.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(r),l);if(u===0)return null;const d=c.HEAPU32;let _=u/4;const f=d[_++],v=d[_++],m=[];for(let y=0;y<v;y++){const S=t.convertUtf8OffsetToUtf16(d[_++]),b=t.convertUtf8OffsetToUtf16(d[_++]);m[y]={start:S,end:b,length:b-S}}return{index:f,captureIndices:m}}}function sE(e){return typeof e.instantiator=="function"}function nE(e){return typeof e.default=="function"}function aE(e){return typeof e.data<"u"}function lE(e){return typeof Response<"u"&&e instanceof Response}function oE(e){var t;return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&((t=Buffer.isBuffer)==null?void 0:t.call(Buffer,e))||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Xo;function o_(e){if(Xo)return Xo;async function t(){Mt=await JC(async r=>{let n=e;return n=await n,typeof n=="function"&&(n=await n(r)),typeof n=="function"&&(n=await n(r)),sE(n)?n=await n.instantiator(r):nE(n)?n=await n.default(r):(aE(n)&&(n=n.data),lE(n)?typeof WebAssembly.instantiateStreaming=="function"?n=await cE(n)(r):n=await uE(n)(r):oE(n)?n=await bd(n)(r):n instanceof WebAssembly.Module?n=await bd(n)(r):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await bd(n.default)(r))),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}return Xo=t(),Xo}function bd(e){return t=>WebAssembly.instantiate(e,t)}function cE(e){return t=>WebAssembly.instantiateStreaming(e,t)}function uE(e){return async t=>{const r=await e.arrayBuffer();return WebAssembly.instantiate(r,t)}}let H0;function hE(e){H0=e}function dE(){return H0}async function U0(e){return e&&await o_(e),{createScanner(t){return new rE(t.map(r=>typeof r=="string"?r:r.source))},createString(t){return new I0(t)}}}const fE=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:U0,getDefaultWasmLoader:dE,loadWasm:o_,setDefaultWasmLoader:hE},Symbol.toStringTag,{value:"Module"}));var j0=t_({});P0(j0,fE);var et=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function _E(e){return c_(e)}function c_(e){return Array.isArray(e)?pE(e):e instanceof RegExp?e:typeof e=="object"?mE(e):e}function pE(e){let t=[];for(let r=0,n=e.length;r<n;r++)t[r]=c_(e[r]);return t}function mE(e){let t={};for(let r in e)t[r]=c_(e[r]);return t}function V0(e,...t){return t.forEach(r=>{for(let n in r)e[n]=r[n]}),e}function $0(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?$0(e.substring(0,e.length-1)):e.substr(~t+1)}var wd=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Zo=class{static hasCaptures(e){return e===null?!1:(wd.lastIndex=0,wd.test(e))}static replaceCaptures(e,t,r){return e.replace(wd,(n,l,c,u)=>{let d=r[parseInt(l||c,10)];if(d){let _=t.substring(d.start,d.end);for(;_[0]===".";)_=_.substring(1);switch(u){case"downcase":return _.toLowerCase();case"upcase":return _.toUpperCase();default:return _}}else return n})}};function G0(e,t){return e<t?-1:e>t?1:0}function q0(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let r=e.length,n=t.length;if(r===n){for(let l=0;l<r;l++){let c=G0(e[l],t[l]);if(c!==0)return c}return 0}return r-n}function Gv(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function W0(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var F0=class{constructor(e){Y(this,"cache",new Map);this.fn=e}get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},bc=class{constructor(e,t,r){Y(this,"_cachedMatchRoot",new F0(e=>this._root.match(e)));this._colorMap=e,this._defaults=t,this._root=r}static createFromRawTheme(e,t){return this.createFromParsedTheme(yE(e),t)}static createFromParsedTheme(e,t){return bE(e,t)}getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,n=this._cachedMatchRoot.get(t).find(l=>gE(e.parent,l.parentScopes));return n?new Y0(n.fontStyle,n.foreground,n.background):null}},Cd=class uc{constructor(t,r){this.parent=t,this.scopeName=r}static push(t,r){for(const n of r)t=new uc(t,n);return t}static from(...t){let r=null;for(let n=0;n<t.length;n++)r=new uc(r,t[n]);return r}push(t){return new uc(this,t)}getSegments(){let t=this;const r=[];for(;t;)r.push(t.scopeName),t=t.parent;return r.reverse(),r}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const r=[];let n=this;for(;n&&n!==t;)r.push(n.scopeName),n=n.parent;return n===t?r.reverse():void 0}};function gE(e,t){if(t.length===0)return!0;for(let r=0;r<t.length;r++){let n=t[r],l=!1;if(n===">"){if(r===t.length-1)return!1;n=t[++r],l=!0}for(;e&&!vE(e.scopeName,n);){if(l)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function vE(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Y0=class{constructor(e,t,r){this.fontStyle=e,this.foregroundId=t,this.backgroundId=r}};function yE(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,r=[],n=0;for(let l=0,c=t.length;l<c;l++){let u=t[l];if(!u.settings)continue;let d;if(typeof u.scope=="string"){let m=u.scope;m=m.replace(/^[,]+/,""),m=m.replace(/[,]+$/,""),d=m.split(",")}else Array.isArray(u.scope)?d=u.scope:d=[""];let _=-1;if(typeof u.settings.fontStyle=="string"){_=0;let m=u.settings.fontStyle.split(" ");for(let y=0,S=m.length;y<S;y++)switch(m[y]){case"italic":_=_|1;break;case"bold":_=_|2;break;case"underline":_=_|4;break;case"strikethrough":_=_|8;break}}let f=null;typeof u.settings.foreground=="string"&&Gv(u.settings.foreground)&&(f=u.settings.foreground);let v=null;typeof u.settings.background=="string"&&Gv(u.settings.background)&&(v=u.settings.background);for(let m=0,y=d.length;m<y;m++){let b=d[m].trim().split(" "),x=b[b.length-1],T=null;b.length>1&&(T=b.slice(0,b.length-1),T.reverse()),r[n++]=new SE(x,T,l,_,f,v)}}return r}var SE=class{constructor(e,t,r,n,l,c){this.scope=e,this.parentScopes=t,this.index=r,this.fontStyle=n,this.foreground=l,this.background=c}},Qt=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(Qt||{});function bE(e,t){e.sort((_,f)=>{let v=G0(_.scope,f.scope);return v!==0||(v=q0(_.parentScopes,f.parentScopes),v!==0)?v:_.index-f.index});let r=0,n="#000000",l="#ffffff";for(;e.length>=1&&e[0].scope==="";){let _=e.shift();_.fontStyle!==-1&&(r=_.fontStyle),_.foreground!==null&&(n=_.foreground),_.background!==null&&(l=_.background)}let c=new wE(t),u=new Y0(r,c.getId(n),c.getId(l)),d=new EE(new Qd(0,null,-1,0,0),[]);for(let _=0,f=e.length;_<f;_++){let v=e[_];d.insert(0,v.scope,v.parentScopes,v.fontStyle,c.getId(v.foreground),c.getId(v.background))}return new bc(c,u,d)}var wE=class{constructor(e){Y(this,"_isFrozen");Y(this,"_lastColorId");Y(this,"_id2color");Y(this,"_color2id");if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,r=e.length;t<r;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},CE=Object.freeze([]),Qd=class K0{constructor(t,r,n,l,c){Y(this,"scopeDepth");Y(this,"parentScopes");Y(this,"fontStyle");Y(this,"foreground");Y(this,"background");this.scopeDepth=t,this.parentScopes=r||CE,this.fontStyle=n,this.foreground=l,this.background=c}clone(){return new K0(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let r=[];for(let n=0,l=t.length;n<l;n++)r[n]=t[n].clone();return r}acceptOverwrite(t,r,n,l){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,r!==-1&&(this.fontStyle=r),n!==0&&(this.foreground=n),l!==0&&(this.background=l)}},EE=class Jd{constructor(t,r=[],n={}){Y(this,"_rulesWithParentScopes");this._mainRule=t,this._children=n,this._rulesWithParentScopes=r}static _cmpBySpecificity(t,r){if(t.scopeDepth!==r.scopeDepth)return r.scopeDepth-t.scopeDepth;let n=0,l=0;for(;t.parentScopes[n]===">"&&n++,r.parentScopes[l]===">"&&l++,!(n>=t.parentScopes.length||l>=r.parentScopes.length);){const c=r.parentScopes[l].length-t.parentScopes[n].length;if(c!==0)return c;n++,l++}return r.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let n=t.indexOf("."),l,c;if(n===-1?(l=t,c=""):(l=t.substring(0,n),c=t.substring(n+1)),this._children.hasOwnProperty(l))return this._children[l].match(c)}const r=this._rulesWithParentScopes.concat(this._mainRule);return r.sort(Jd._cmpBySpecificity),r}insert(t,r,n,l,c,u){if(r===""){this._doInsertHere(t,n,l,c,u);return}let d=r.indexOf("."),_,f;d===-1?(_=r,f=""):(_=r.substring(0,d),f=r.substring(d+1));let v;this._children.hasOwnProperty(_)?v=this._children[_]:(v=new Jd(this._mainRule.clone(),Qd.cloneArr(this._rulesWithParentScopes)),this._children[_]=v),v.insert(t+1,f,n,l,c,u)}_doInsertHere(t,r,n,l,c){if(r===null){this._mainRule.acceptOverwrite(t,n,l,c);return}for(let u=0,d=this._rulesWithParentScopes.length;u<d;u++){let _=this._rulesWithParentScopes[u];if(q0(_.parentScopes,r)===0){_.acceptOverwrite(t,n,l,c);return}}n===-1&&(n=this._mainRule.fontStyle),l===0&&(l=this._mainRule.foreground),c===0&&(c=this._mainRule.background),this._rulesWithParentScopes.push(new Qd(t,r,n,l,c))}},Xn=class Pi{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const r=Pi.getLanguageId(t),n=Pi.getTokenType(t),l=Pi.getFontStyle(t),c=Pi.getForeground(t),u=Pi.getBackground(t);console.log({languageId:r,tokenType:n,fontStyle:l,foreground:c,background:u})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,r,n,l,c,u,d){let _=Pi.getLanguageId(t),f=Pi.getTokenType(t),v=Pi.containsBalancedBrackets(t)?1:0,m=Pi.getFontStyle(t),y=Pi.getForeground(t),S=Pi.getBackground(t);return r!==0&&(_=r),n!==8&&(f=n),l!==null&&(v=l?1:0),c!==-1&&(m=c),u!==0&&(y=u),d!==0&&(S=d),(_<<0|f<<8|v<<10|m<<11|y<<15|S<<24)>>>0}};function wc(e,t){const r=[],n=xE(e);let l=n.next();for(;l!==null;){let _=0;if(l.length===2&&l.charAt(1)===":"){switch(l.charAt(0)){case"R":_=1;break;case"L":_=-1;break;default:console.log(`Unknown priority ${l} in scope selector`)}l=n.next()}let f=u();if(r.push({matcher:f,priority:_}),l!==",")break;l=n.next()}return r;function c(){if(l==="-"){l=n.next();const _=c();return f=>!!_&&!_(f)}if(l==="("){l=n.next();const _=d();return l===")"&&(l=n.next()),_}if(qv(l)){const _=[];do _.push(l),l=n.next();while(qv(l));return f=>t(_,f)}return null}function u(){const _=[];let f=c();for(;f;)_.push(f),f=c();return v=>_.every(m=>m(v))}function d(){const _=[];let f=u();for(;f&&(_.push(f),l==="|"||l===",");){do l=n.next();while(l==="|"||l===",");f=u()}return v=>_.some(m=>m(v))}}function qv(e){return!!e&&!!e.match(/[\w\.:]+/)}function xE(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,r=t.exec(e);return{next:()=>{if(!r)return null;const n=r[0];return r=t.exec(e),n}}}function X0(e){typeof e.dispose=="function"&&e.dispose()}var ml=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},AE=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},kE=class{constructor(){Y(this,"_references",[]);Y(this,"_seenReferenceKeys",new Set);Y(this,"visitedRule",new Set)}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},TE=class{constructor(e,t){Y(this,"seenFullScopeRequests",new Set);Y(this,"seenPartialScopeRequests",new Set);Y(this,"Q");this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new ml(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new kE;for(const r of e)RE(r,this.initialScopeName,this.repo,t);for(const r of t.references)if(r instanceof ml){if(this.seenFullScopeRequests.has(r.scopeName))continue;this.seenFullScopeRequests.add(r.scopeName),this.Q.push(r)}else{if(this.seenFullScopeRequests.has(r.scopeName)||this.seenPartialScopeRequests.has(r.toKey()))continue;this.seenPartialScopeRequests.add(r.toKey()),this.Q.push(r)}}};function RE(e,t,r,n){const l=r.lookup(e.scopeName);if(!l){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const c=r.lookup(t);e instanceof ml?hc({baseGrammar:c,selfGrammar:l},n):ef(e.ruleName,{baseGrammar:c,selfGrammar:l,repository:l.repository},n);const u=r.injections(e.scopeName);if(u)for(const d of u)n.add(new ml(d))}function ef(e,t,r){if(t.repository&&t.repository[e]){const n=t.repository[e];Cc([n],t,r)}}function hc(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Cc(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Cc(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Cc(e,t,r){for(const n of e){if(r.visitedRule.has(n))continue;r.visitedRule.add(n);const l=n.repository?V0({},t.repository,n.repository):t.repository;Array.isArray(n.patterns)&&Cc(n.patterns,{...t,repository:l},r);const c=n.include;if(!c)continue;const u=Z0(c);switch(u.kind){case 0:hc({...t,selfGrammar:t.baseGrammar},r);break;case 1:hc(t,r);break;case 2:ef(u.ruleName,{...t,repository:l},r);break;case 3:case 4:const d=u.scopeName===t.selfGrammar.scopeName?t.selfGrammar:u.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(d){const _={baseGrammar:t.baseGrammar,selfGrammar:d,repository:l};u.kind===4?ef(u.ruleName,_,r):hc(_,r)}else u.kind===4?r.add(new AE(u.scopeName,u.ruleName)):r.add(new ml(u.scopeName));break}}}var DE=class{constructor(){Y(this,"kind",0)}},LE=class{constructor(){Y(this,"kind",1)}},OE=class{constructor(e){Y(this,"kind",2);this.ruleName=e}},ME=class{constructor(e){Y(this,"kind",3);this.scopeName=e}},NE=class{constructor(e,t){Y(this,"kind",4);this.scopeName=e,this.ruleName=t}};function Z0(e){if(e==="$base")return new DE;if(e==="$self")return new LE;const t=e.indexOf("#");if(t===-1)return new ME(e);if(t===0)return new OE(e.substring(1));{const r=e.substring(0,t),n=e.substring(t+1);return new NE(r,n)}}var BE=/\\(\d+)/,Wv=/\\(\d+)/g,zE=-1,Q0=-2;var xl=class{constructor(e,t,r,n){Y(this,"$location");Y(this,"id");Y(this,"_nameIsCapturing");Y(this,"_name");Y(this,"_contentNameIsCapturing");Y(this,"_contentName");this.$location=e,this.id=t,this._name=r||null,this._nameIsCapturing=Zo.hasCaptures(this._name),this._contentName=n||null,this._contentNameIsCapturing=Zo.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${$0(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Zo.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Zo.replaceCaptures(this._contentName,e,t)}},PE=class extends xl{constructor(t,r,n,l,c){super(t,r,n,l);Y(this,"retokenizeCapturedWithRuleId");this.retokenizeCapturedWithRuleId=c}dispose(){}collectPatterns(t,r){throw new Error("Not supported!")}compile(t,r){throw new Error("Not supported!")}compileAG(t,r,n,l){throw new Error("Not supported!")}},IE=class extends xl{constructor(t,r,n,l,c){super(t,r,n,null);Y(this,"_match");Y(this,"captures");Y(this,"_cachedCompiledPatterns");this._match=new gl(l,this.id),this.captures=c,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,r){r.push(this._match)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,l){return this._getCachedCompiledPatterns(t).compileAG(t,n,l)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new vl,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Fv=class extends xl{constructor(t,r,n,l,c){super(t,r,n,l);Y(this,"hasMissingPatterns");Y(this,"patterns");Y(this,"_cachedCompiledPatterns");this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,r){for(const n of this.patterns)t.getRule(n).collectPatterns(t,r)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,l){return this._getCachedCompiledPatterns(t).compileAG(t,n,l)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new vl,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},tf=class extends xl{constructor(t,r,n,l,c,u,d,_,f,v){super(t,r,n,l);Y(this,"_begin");Y(this,"beginCaptures");Y(this,"_end");Y(this,"endHasBackReferences");Y(this,"endCaptures");Y(this,"applyEndPatternLast");Y(this,"hasMissingPatterns");Y(this,"patterns");Y(this,"_cachedCompiledPatterns");this._begin=new gl(c,this.id),this.beginCaptures=u,this._end=new gl(d||"",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=_,this.applyEndPatternLast=f||!1,this.patterns=v.patterns,this.hasMissingPatterns=v.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,r){return this._end.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t,r).compile(t)}compileAG(t,r,n,l){return this._getCachedCompiledPatterns(t,r).compileAG(t,n,l)}_getCachedCompiledPatterns(t,r){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new vl;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,r):this._cachedCompiledPatterns.setSource(0,r)),this._cachedCompiledPatterns}},Ec=class extends xl{constructor(t,r,n,l,c,u,d,_,f){super(t,r,n,l);Y(this,"_begin");Y(this,"beginCaptures");Y(this,"whileCaptures");Y(this,"_while");Y(this,"whileHasBackReferences");Y(this,"hasMissingPatterns");Y(this,"patterns");Y(this,"_cachedCompiledPatterns");Y(this,"_cachedCompiledWhilePatterns");this._begin=new gl(c,this.id),this.beginCaptures=u,this.whileCaptures=_,this._while=new gl(d,Q0),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=f.patterns,this.hasMissingPatterns=f.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,r){return this._while.resolveBackReferences(t,r)}collectPatterns(t,r){r.push(this._begin)}compile(t,r){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,r,n,l){return this._getCachedCompiledPatterns(t).compileAG(t,n,l)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new vl;for(const r of this.patterns)t.getRule(r).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,r){return this._getCachedCompiledWhilePatterns(t,r).compile(t)}compileWhileAG(t,r,n,l){return this._getCachedCompiledWhilePatterns(t,r).compileAG(t,n,l)}_getCachedCompiledWhilePatterns(t,r){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new vl,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,r||""),this._cachedCompiledWhilePatterns}},J0=class Xt{static createCaptureRule(t,r,n,l,c){return t.registerRule(u=>new PE(r,u,n,l,c))}static getCompiledRuleId(t,r,n){return t.id||r.registerRule(l=>{if(t.id=l,t.match)return new IE(t.$vscodeTextmateLocation,t.id,t.name,t.match,Xt._compileCaptures(t.captures,r,n));if(typeof t.begin>"u"){t.repository&&(n=V0({},n,t.repository));let c=t.patterns;return typeof c>"u"&&t.include&&(c=[{include:t.include}]),new Fv(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,Xt._compilePatterns(c,r,n))}return t.while?new Ec(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Xt._compileCaptures(t.beginCaptures||t.captures,r,n),t.while,Xt._compileCaptures(t.whileCaptures||t.captures,r,n),Xt._compilePatterns(t.patterns,r,n)):new tf(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,Xt._compileCaptures(t.beginCaptures||t.captures,r,n),t.end,Xt._compileCaptures(t.endCaptures||t.captures,r,n),t.applyEndPatternLast,Xt._compilePatterns(t.patterns,r,n))}),t.id}static _compileCaptures(t,r,n){let l=[];if(t){let c=0;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const d=parseInt(u,10);d>c&&(c=d)}for(let u=0;u<=c;u++)l[u]=null;for(const u in t){if(u==="$vscodeTextmateLocation")continue;const d=parseInt(u,10);let _=0;t[u].patterns&&(_=Xt.getCompiledRuleId(t[u],r,n)),l[d]=Xt.createCaptureRule(r,t[u].$vscodeTextmateLocation,t[u].name,t[u].contentName,_)}}return l}static _compilePatterns(t,r,n){let l=[];if(t)for(let c=0,u=t.length;c<u;c++){const d=t[c];let _=-1;if(d.include){const f=Z0(d.include);switch(f.kind){case 0:case 1:_=Xt.getCompiledRuleId(n[d.include],r,n);break;case 2:let v=n[f.ruleName];v&&(_=Xt.getCompiledRuleId(v,r,n));break;case 3:case 4:const m=f.scopeName,y=f.kind===4?f.ruleName:null,S=r.getExternalGrammar(m,n);if(S)if(y){let b=S.repository[y];b&&(_=Xt.getCompiledRuleId(b,r,S.repository))}else _=Xt.getCompiledRuleId(S.repository.$self,r,S.repository);break}}else _=Xt.getCompiledRuleId(d,r,n);if(_!==-1){const f=r.getRule(_);let v=!1;if((f instanceof Fv||f instanceof tf||f instanceof Ec)&&f.hasMissingPatterns&&f.patterns.length===0&&(v=!0),v)continue;l.push(_)}}return{patterns:l,hasMissingPatterns:(t?t.length:0)!==l.length}}},gl=class eS{constructor(t,r){Y(this,"source");Y(this,"ruleId");Y(this,"hasAnchor");Y(this,"hasBackReferences");Y(this,"_anchorCache");if(t&&typeof t=="string"){const n=t.length;let l=0,c=[],u=!1;for(let d=0;d<n;d++)if(t.charAt(d)==="\\"&&d+1<n){const f=t.charAt(d+1);f==="z"?(c.push(t.substring(l,d)),c.push("$(?!\\n)(?<!\\n)"),l=d+2):(f==="A"||f==="G")&&(u=!0),d++}this.hasAnchor=u,l===0?this.source=t:(c.push(t.substring(l,n)),this.source=c.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=r,typeof this.source=="string"?this.hasBackReferences=BE.test(this.source):this.hasBackReferences=!1}clone(){return new eS(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,r){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let n=r.map(l=>t.substring(l.start,l.end));return Wv.lastIndex=0,this.source.replace(Wv,(l,c)=>W0(n[parseInt(c,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],r=[],n=[],l=[],c,u,d,_;for(c=0,u=this.source.length;c<u;c++)d=this.source.charAt(c),t[c]=d,r[c]=d,n[c]=d,l[c]=d,d==="\\"&&c+1<u&&(_=this.source.charAt(c+1),_==="A"?(t[c+1]="",r[c+1]="",n[c+1]="A",l[c+1]="A"):_==="G"?(t[c+1]="",r[c+1]="G",n[c+1]="",l[c+1]="G"):(t[c+1]=_,r[c+1]=_,n[c+1]=_,l[c+1]=_),c++);return{A0_G0:t.join(""),A0_G1:r.join(""),A1_G0:n.join(""),A1_G1:l.join("")}}resolveAnchors(t,r){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?r?this._anchorCache.A1_G1:this._anchorCache.A1_G0:r?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},vl=class{constructor(){Y(this,"_items");Y(this,"_hasAnchors");Y(this,"_cached");Y(this,"_anchorCache");this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(r=>r.source);this._cached=new Yv(e,t,this._items.map(r=>r.ruleId))}return this._cached}compileAG(e,t,r){return this._hasAnchors?t?r?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A1_G0):r?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,r)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,r){let n=this._items.map(l=>l.resolveAnchors(t,r));return new Yv(e,n,this._items.map(l=>l.ruleId))}},Yv=class{constructor(e,t,r){Y(this,"scanner");this.regExps=t,this.rules=r,this.scanner=e.createOnigScanner(t)}dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,r=this.rules.length;t<r;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
|
|
51
|
+
`)}findNextMatchSync(e,t,r){const n=this.scanner.findNextMatchSync(e,t,r);return n?{ruleId:this.rules[n.index],captureIndices:n.captureIndices}:null}},Ed=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Dr,HE=(Dr=class{constructor(t,r){Y(this,"_defaultAttributes");Y(this,"_embeddedLanguagesMatcher");Y(this,"_getBasicScopeAttributes",new F0(t=>{const r=this._scopeToLanguage(t),n=this._toStandardTokenType(t);return new Ed(r,n)}));this._defaultAttributes=new Ed(t,8),this._embeddedLanguagesMatcher=new UE(Object.entries(r||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Dr._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const r=t.match(Dr.STANDARD_TOKEN_TYPE_REGEXP);if(!r)return 8;switch(r[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}},Y(Dr,"_NULL_SCOPE_METADATA",new Ed(0,0)),Y(Dr,"STANDARD_TOKEN_TYPE_REGEXP",/\b(comment|string|regex|meta\.embedded)\b/),Dr),UE=class{constructor(e){Y(this,"values");Y(this,"scopesRegExp");if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([r,n])=>W0(r));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Kv=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function tS(e,t,r,n,l,c,u,d){const _=t.content.length;let f=!1,v=-1;if(u){const S=jE(e,t,r,n,l,c);l=S.stack,n=S.linePos,r=S.isFirstLine,v=S.anchorPosition}const m=Date.now();for(;!f;){if(d!==0&&Date.now()-m>d)return new Kv(l,!0);y()}return new Kv(l,!1);function y(){const S=VE(e,t,r,n,l,v);if(!S){c.produce(l,_),f=!0;return}const b=S.captureIndices,x=S.matchedRuleId,T=b&&b.length>0?b[0].end>n:!1;if(x===zE){const O=l.getRule(e);c.produce(l,b[0].start),l=l.withContentNameScopesList(l.nameScopesList),al(e,t,r,l,c,O.endCaptures,b),c.produce(l,b[0].end);const H=l;if(l=l.parent,v=H.getAnchorPos(),!T&&H.getEnterPos()===n){l=H,c.produce(l,_),f=!0;return}}else{const O=e.getRule(x);c.produce(l,b[0].start);const H=l,B=O.getName(t.content,b),I=l.contentNameScopesList.pushAttributed(B,e);if(l=l.push(x,n,v,b[0].end===_,null,I,I),O instanceof tf){const j=O;al(e,t,r,l,c,j.beginCaptures,b),c.produce(l,b[0].end),v=b[0].end;const $=j.getContentName(t.content,b),ee=I.pushAttributed($,e);if(l=l.withContentNameScopesList(ee),j.endHasBackReferences&&(l=l.withEndRule(j.getEndWithResolvedBackReferences(t.content,b))),!T&&H.hasSameRuleAs(l)){l=l.pop(),c.produce(l,_),f=!0;return}}else if(O instanceof Ec){const j=O;al(e,t,r,l,c,j.beginCaptures,b),c.produce(l,b[0].end),v=b[0].end;const $=j.getContentName(t.content,b),ee=I.pushAttributed($,e);if(l=l.withContentNameScopesList(ee),j.whileHasBackReferences&&(l=l.withEndRule(j.getWhileWithResolvedBackReferences(t.content,b))),!T&&H.hasSameRuleAs(l)){l=l.pop(),c.produce(l,_),f=!0;return}}else if(al(e,t,r,l,c,O.captures,b),c.produce(l,b[0].end),l=l.pop(),!T){l=l.safePop(),c.produce(l,_),f=!0;return}}b[0].end>n&&(n=b[0].end,r=!1)}}function jE(e,t,r,n,l,c){let u=l.beginRuleCapturedEOL?0:-1;const d=[];for(let _=l;_;_=_.pop()){const f=_.getRule(e);f instanceof Ec&&d.push({rule:f,stack:_})}for(let _=d.pop();_;_=d.pop()){const{ruleScanner:f,findOptions:v}=qE(_.rule,e,_.stack.endRule,r,n===u),m=f.findNextMatchSync(t,n,v);if(m){if(m.ruleId!==Q0){l=_.stack.pop();break}m.captureIndices&&m.captureIndices.length&&(c.produce(_.stack,m.captureIndices[0].start),al(e,t,r,_.stack,c,_.rule.whileCaptures,m.captureIndices),c.produce(_.stack,m.captureIndices[0].end),u=m.captureIndices[0].end,m.captureIndices[0].end>n&&(n=m.captureIndices[0].end,r=!1))}else{l=_.stack.pop();break}}return{stack:l,linePos:n,anchorPosition:u,isFirstLine:r}}function VE(e,t,r,n,l,c){const u=$E(e,t,r,n,l,c),d=e.getInjections();if(d.length===0)return u;const _=GE(d,e,t,r,n,l,c);if(!_)return u;if(!u)return _;const f=u.captureIndices[0].start,v=_.captureIndices[0].start;return v<f||_.priorityMatch&&v===f?_:u}function $E(e,t,r,n,l,c){const u=l.getRule(e),{ruleScanner:d,findOptions:_}=iS(u,e,l.endRule,r,n===c),f=d.findNextMatchSync(t,n,_);return f?{captureIndices:f.captureIndices,matchedRuleId:f.ruleId}:null}function GE(e,t,r,n,l,c,u){let d=Number.MAX_VALUE,_=null,f,v=0;const m=c.contentNameScopesList.getScopeNames();for(let y=0,S=e.length;y<S;y++){const b=e[y];if(!b.matcher(m))continue;const x=t.getRule(b.ruleId),{ruleScanner:T,findOptions:O}=iS(x,t,null,n,l===u),H=T.findNextMatchSync(r,l,O);if(!H)continue;const B=H.captureIndices[0].start;if(!(B>=d)&&(d=B,_=H.captureIndices,f=H.ruleId,v=b.priority,d===l))break}return _?{priorityMatch:v===-1,captureIndices:_,matchedRuleId:f}:null}function iS(e,t,r,n,l){return{ruleScanner:e.compileAG(t,r,n,l),findOptions:0}}function qE(e,t,r,n,l){return{ruleScanner:e.compileWhileAG(t,r,n,l),findOptions:0}}function al(e,t,r,n,l,c,u){if(c.length===0)return;const d=t.content,_=Math.min(c.length,u.length),f=[],v=u[0].end;for(let m=0;m<_;m++){const y=c[m];if(y===null)continue;const S=u[m];if(S.length===0)continue;if(S.start>v)break;for(;f.length>0&&f[f.length-1].endPos<=S.start;)l.produceFromScopes(f[f.length-1].scopes,f[f.length-1].endPos),f.pop();if(f.length>0?l.produceFromScopes(f[f.length-1].scopes,S.start):l.produce(n,S.start),y.retokenizeCapturedWithRuleId){const x=y.getName(d,u),T=n.contentNameScopesList.pushAttributed(x,e),O=y.getContentName(d,u),H=T.pushAttributed(O,e),B=n.push(y.retokenizeCapturedWithRuleId,S.start,-1,!1,null,T,H),I=e.createOnigString(d.substring(0,S.end));tS(e,I,r&&S.start===0,S.start,B,l,!1,0),X0(I);continue}const b=y.getName(d,u);if(b!==null){const T=(f.length>0?f[f.length-1].scopes:n.contentNameScopesList).pushAttributed(b,e);f.push(new WE(T,S.end))}}for(;f.length>0;)l.produceFromScopes(f[f.length-1].scopes,f[f.length-1].endPos),f.pop()}var WE=class{constructor(e,t){Y(this,"scopes");Y(this,"endPos");this.scopes=e,this.endPos=t}};function FE(e,t,r,n,l,c,u,d){return new KE(e,t,r,n,l,c,u,d)}function Xv(e,t,r,n,l){const c=wc(t,xc),u=J0.getCompiledRuleId(r,n,l.repository);for(const d of c)e.push({debugSelector:t,matcher:d.matcher,ruleId:u,grammar:l,priority:d.priority})}function xc(e,t){if(t.length<e.length)return!1;let r=0;return e.every(n=>{for(let l=r;l<t.length;l++)if(YE(t[l],n))return r=l+1,!0;return!1})}function YE(e,t){if(!e)return!1;if(e===t)return!0;const r=t.length;return e.length>r&&e.substr(0,r)===t&&e[r]==="."}var KE=class{constructor(e,t,r,n,l,c,u,d){Y(this,"_rootId");Y(this,"_lastRuleId");Y(this,"_ruleId2desc");Y(this,"_includedGrammars");Y(this,"_grammarRepository");Y(this,"_grammar");Y(this,"_injections");Y(this,"_basicScopeAttributesProvider");Y(this,"_tokenTypeMatchers");if(this._rootScopeName=e,this.balancedBracketSelectors=c,this._onigLib=d,this._basicScopeAttributesProvider=new HE(r,n),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=u,this._grammar=Zv(t,null),this._injections=null,this._tokenTypeMatchers=[],l)for(const _ of Object.keys(l)){const f=wc(_,xc);for(const v of f)this._tokenTypeMatchers.push({matcher:v.matcher,type:l[_]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:l=>l===this._rootScopeName?this._grammar:this.getExternalGrammar(l),injections:l=>this._grammarRepository.injections(l)},t=[],r=this._rootScopeName,n=e.lookup(r);if(n){const l=n.injections;if(l)for(let u in l)Xv(t,u,l[u],this,n);const c=this._grammarRepository.injections(r);c&&c.forEach(u=>{const d=this.getExternalGrammar(u);if(d){const _=d.injectionSelector;_&&Xv(t,_,d,this,d)}})}return t.sort((l,c)=>l.priority-c.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,r=e(t);return this._ruleId2desc[t]=r,r}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const r=this._grammarRepository.lookup(e);if(r)return this._includedGrammars[e]=Zv(r,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,r=0){const n=this._tokenize(e,t,!1,r);return{tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}tokenizeLine2(e,t,r=0){const n=this._tokenize(e,t,!0,r);return{tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack,stoppedEarly:n.stoppedEarly}}_tokenize(e,t,r,n){this._rootId===-1&&(this._rootId=J0.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let l;if(!t||t===rf.NULL){l=!0;const f=this._basicScopeAttributesProvider.getDefaultAttributes(),v=this.themeProvider.getDefaults(),m=Xn.set(0,f.languageId,f.tokenType,null,v.fontStyle,v.foregroundId,v.backgroundId),y=this.getRule(this._rootId).getName(null,null);let S;y?S=dl.createRootAndLookUpScopeName(y,m,this):S=dl.createRoot("unknown",m),t=new rf(null,this._rootId,-1,-1,!1,null,S,S)}else l=!1,t.reset();e=e+`
|
|
52
|
+
`;const c=this.createOnigString(e),u=c.content.length,d=new ZE(r,e,this._tokenTypeMatchers,this.balancedBracketSelectors),_=tS(this,c,l,0,t,d,!0,n);return X0(c),{lineLength:u,lineTokens:d,ruleStack:_.stack,stoppedEarly:_.stoppedEarly}}};function Zv(e,t){return e=_E(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var dl=class rr{constructor(t,r,n){this.parent=t,this.scopePath=r,this.tokenAttributes=n}static fromExtension(t,r){let n=t,l=(t==null?void 0:t.scopePath)??null;for(const c of r)l=Cd.push(l,c.scopeNames),n=new rr(n,l,c.encodedTokenAttributes);return n}static createRoot(t,r){return new rr(null,new Cd(null,t),r)}static createRootAndLookUpScopeName(t,r,n){const l=n.getMetadataForScope(t),c=new Cd(null,t),u=n.themeProvider.themeMatch(c),d=rr.mergeAttributes(r,l,u);return new rr(null,c,d)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return rr.equals(this,t)}static equals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.scopeName!==r.scopeName||t.tokenAttributes!==r.tokenAttributes)return!1;t=t.parent,r=r.parent}while(!0)}static mergeAttributes(t,r,n){let l=-1,c=0,u=0;return n!==null&&(l=n.fontStyle,c=n.foregroundId,u=n.backgroundId),Xn.set(t,r.languageId,r.tokenType,null,l,c,u)}pushAttributed(t,r){if(t===null)return this;if(t.indexOf(" ")===-1)return rr._pushAttributed(this,t,r);const n=t.split(/ /g);let l=this;for(const c of n)l=rr._pushAttributed(l,c,r);return l}static _pushAttributed(t,r,n){const l=n.getMetadataForScope(r),c=t.scopePath.push(r),u=n.themeProvider.themeMatch(c),d=rr.mergeAttributes(t.tokenAttributes,l,u);return new rr(t,c,d)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){var l;const r=[];let n=this;for(;n&&n!==t;)r.push({encodedTokenAttributes:n.tokenAttributes,scopeNames:n.scopePath.getExtensionIfDefined(((l=n.parent)==null?void 0:l.scopePath)??null)}),n=n.parent;return n===t?r.reverse():void 0}},Ui,rf=(Ui=class{constructor(t,r,n,l,c,u,d,_){Y(this,"_stackElementBrand");Y(this,"_enterPos");Y(this,"_anchorPos");Y(this,"depth");this.parent=t,this.ruleId=r,this.beginRuleCapturedEOL=c,this.endRule=u,this.nameScopesList=d,this.contentNameScopesList=_,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=l}equals(t){return t===null?!1:Ui._equals(this,t)}static _equals(t,r){return t===r?!0:this._structuralEquals(t,r)?dl.equals(t.contentNameScopesList,r.contentNameScopesList):!1}static _structuralEquals(t,r){do{if(t===r||!t&&!r)return!0;if(!t||!r||t.depth!==r.depth||t.ruleId!==r.ruleId||t.endRule!==r.endRule)return!1;t=t.parent,r=r.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){Ui._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,r,n,l,c,u,d){return new Ui(this,t,r,n,l,c,u,d)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,r){var n,l;return this.parent&&(r=this.parent._writeString(t,r)),t[r++]=`(${this.ruleId}, ${(n=this.nameScopesList)==null?void 0:n.toString()}, ${(l=this.contentNameScopesList)==null?void 0:l.toString()})`,r}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new Ui(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let r=this;for(;r&&r._enterPos===t._enterPos;){if(r.ruleId===t.ruleId)return!0;r=r.parent}return!1}toStateStackFrame(){var t,r,n;return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:((r=this.nameScopesList)==null?void 0:r.getExtensionIfDefined(((t=this.parent)==null?void 0:t.nameScopesList)??null))??[],contentNameScopesList:((n=this.contentNameScopesList)==null?void 0:n.getExtensionIfDefined(this.nameScopesList))??[]}}static pushFrame(t,r){const n=dl.fromExtension((t==null?void 0:t.nameScopesList)??null,r.nameScopesList);return new Ui(t,r.ruleId,r.enterPos??-1,r.anchorPos??-1,r.beginRuleCapturedEOL,r.endRule,n,dl.fromExtension(n,r.contentNameScopesList))}},Y(Ui,"NULL",new Ui(null,0,0,0,!1,null,null,null)),Ui),XE=class{constructor(e,t){Y(this,"balancedBracketScopes");Y(this,"unbalancedBracketScopes");Y(this,"allowAny",!1);this.balancedBracketScopes=e.flatMap(r=>r==="*"?(this.allowAny=!0,[]):wc(r,xc).map(n=>n.matcher)),this.unbalancedBracketScopes=t.flatMap(r=>wc(r,xc).map(n=>n.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},ZE=class{constructor(e,t,r,n){Y(this,"_emitBinaryTokens");Y(this,"_lineText");Y(this,"_tokens");Y(this,"_binaryTokens");Y(this,"_lastTokenEndIndex");Y(this,"_tokenTypeOverrides");this.balancedBracketSelectors=n,this._emitBinaryTokens=e,this._tokenTypeOverrides=r,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var n;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let l=(e==null?void 0:e.tokenAttributes)??0,c=!1;if((n=this.balancedBracketSelectors)!=null&&n.matchesAlways&&(c=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const u=(e==null?void 0:e.getScopeNames())??[];for(const d of this._tokenTypeOverrides)d.matcher(u)&&(l=Xn.set(l,0,d.type,null,-1,0,0));this.balancedBracketSelectors&&(c=this.balancedBracketSelectors.match(u))}if(c&&(l=Xn.set(l,0,8,c,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===l){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(l),this._lastTokenEndIndex=t;return}const r=(e==null?void 0:e.getScopeNames())??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:r}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const r=new Uint32Array(this._binaryTokens.length);for(let n=0,l=this._binaryTokens.length;n<l;n++)r[n]=this._binaryTokens[n];return r}},QE=class{constructor(e,t){Y(this,"_grammars",new Map);Y(this,"_rawGrammars",new Map);Y(this,"_injectionGrammars",new Map);Y(this,"_theme");this._onigLib=t,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,r,n,l){if(!this._grammars.has(e)){let c=this._rawGrammars.get(e);if(!c)return null;this._grammars.set(e,FE(e,c,t,r,n,l,this,this._onigLib))}return this._grammars.get(e)}},JE=class{constructor(t){Y(this,"_options");Y(this,"_syncRegistry");Y(this,"_ensureGrammarCache");this._options=t,this._syncRegistry=new QE(bc.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,r){this._syncRegistry.setTheme(bc.createFromRawTheme(t,r))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,r,n){return this.loadGrammarWithConfiguration(t,r,{embeddedLanguages:n})}loadGrammarWithConfiguration(t,r,n){return this._loadGrammar(t,r,n.embeddedLanguages,n.tokenTypes,new XE(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,r,n,l,c){const u=new TE(this._syncRegistry,t);for(;u.Q.length>0;)u.Q.map(d=>this._loadSingleGrammar(d.scopeName)),u.processQueue();return this._grammarForScopeName(t,r,n,l,c)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const r=this._options.loadGrammar(t);if(r){const n=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(r,n)}}addGrammar(t,r=[],n=0,l=null){return this._syncRegistry.addGrammar(t,r),this._grammarForScopeName(t.scopeName,n,l)}_grammarForScopeName(t,r=0,n=null,l=null,c=null){return this._syncRegistry.grammarForScopeName(t,r,n,l,c)}},sf=rf.NULL;function Ac(e,t){const r=typeof e=="string"?{}:{...e.colorReplacements},n=typeof e=="string"?e:e.name;for(const[l,c]of Object.entries((t==null?void 0:t.colorReplacements)||{}))typeof c=="string"?r[l]=c:l===n&&Object.assign(r,c);return r}function gs(e,t){return e&&((t==null?void 0:t[e==null?void 0:e.toLowerCase()])||e)}function ex(e){return Array.isArray(e)?e:[e]}async function rS(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function jc(e){return!e||["plaintext","txt","text","plain"].includes(e)}function sS(e){return e==="ansi"||jc(e)}function Vc(e){return e==="none"}function nS(e){return Vc(e)}function $c(e,t=!1){var c;if(e.length===0)return[["",0]];const r=e.split(/(\r?\n)/g);let n=0;const l=[];for(let u=0;u<r.length;u+=2){const d=t?r[u]+(r[u+1]||""):r[u];l.push([d,n]),n+=r[u].length,n+=((c=r[u+1])==null?void 0:c.length)||0}return l}const Qv={light:"#333333",dark:"#bbbbbb"},Jv={light:"#fffffe",dark:"#1e1e1e"},ey="__shiki_resolved";function u_(e){var d,_,f,v,m;if(e!=null&&e[ey])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||(t.type="dark"),t.colorReplacements={...t.colorReplacements},t.settings||(t.settings=[]);let{bg:r,fg:n}=t;if(!r||!n){const y=t.settings?t.settings.find(S=>!S.name&&!S.scope):void 0;(d=y==null?void 0:y.settings)!=null&&d.foreground&&(n=y.settings.foreground),(_=y==null?void 0:y.settings)!=null&&_.background&&(r=y.settings.background),!n&&((f=t==null?void 0:t.colors)!=null&&f["editor.foreground"])&&(n=t.colors["editor.foreground"]),!r&&((v=t==null?void 0:t.colors)!=null&&v["editor.background"])&&(r=t.colors["editor.background"]),n||(n=t.type==="light"?Qv.light:Qv.dark),r||(r=t.type==="light"?Jv.light:Jv.dark),t.fg=n,t.bg=r}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let l=0;const c=new Map;function u(y){var b;if(c.has(y))return c.get(y);l+=1;const S=`#${l.toString(16).padStart(8,"0").toLowerCase()}`;return(b=t.colorReplacements)!=null&&b[`#${S}`]?u(y):(c.set(y,S),S)}t.settings=t.settings.map(y=>{var T,O;const S=((T=y.settings)==null?void 0:T.foreground)&&!y.settings.foreground.startsWith("#"),b=((O=y.settings)==null?void 0:O.background)&&!y.settings.background.startsWith("#");if(!S&&!b)return y;const x={...y,settings:{...y.settings}};if(S){const H=u(y.settings.foreground);t.colorReplacements[H]=y.settings.foreground,x.settings.foreground=H}if(b){const H=u(y.settings.background);t.colorReplacements[H]=y.settings.background,x.settings.background=H}return x});for(const y of Object.keys(t.colors||{}))if((y==="editor.foreground"||y==="editor.background"||y.startsWith("terminal.ansi"))&&!((m=t.colors[y])!=null&&m.startsWith("#"))){const S=u(t.colors[y]);t.colorReplacements[S]=t.colors[y],t.colors[y]=S}return Object.defineProperty(t,ey,{enumerable:!1,writable:!1,value:!0}),t}async function aS(e){return Array.from(new Set((await Promise.all(e.filter(t=>!sS(t)).map(async t=>await rS(t).then(r=>Array.isArray(r)?r:[r])))).flat()))}async function lS(e){return(await Promise.all(e.map(async t=>nS(t)?null:u_(await rS(t))))).filter(t=>!!t)}function oS(e,t){if(!t)return e;if(t[e]){const r=new Set([e]);for(;t[e];){if(e=t[e],r.has(e))throw new et(`Circular alias \`${Array.from(r).join(" -> ")} -> ${e}\``);r.add(e)}}return e}var tx=class extends JE{constructor(t,r,n,l={}){super(t);Y(this,"_resolvedThemes",new Map);Y(this,"_resolvedGrammars",new Map);Y(this,"_langMap",new Map);Y(this,"_langGraph",new Map);Y(this,"_textmateThemeCache",new WeakMap);Y(this,"_loadedThemesCache",null);Y(this,"_loadedLanguagesCache",null);this._resolver=t,this._themes=r,this._langs=n,this._alias=l,this._themes.map(c=>this.loadTheme(c)),this.loadLanguages(this._langs)}getTheme(t){return typeof t=="string"?this._resolvedThemes.get(t):this.loadTheme(t)}loadTheme(t){const r=u_(t);return r.name&&(this._resolvedThemes.set(r.name,r),this._loadedThemesCache=null),r}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(t){let r=this._textmateThemeCache.get(t);r||(r=bc.createFromRawTheme(t),this._textmateThemeCache.set(t,r)),this._syncRegistry.setTheme(r)}getGrammar(t){return t=oS(t,this._alias),this._resolvedGrammars.get(t)}loadLanguage(t){var c,u,d,_;if(this.getGrammar(t.name))return;const r=new Set([...this._langMap.values()].filter(f=>{var v;return(v=f.embeddedLangsLazy)==null?void 0:v.includes(t.name)}));this._resolver.addLanguage(t);const n={balancedBracketSelectors:t.balancedBracketSelectors||["*"],unbalancedBracketSelectors:t.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(t.scopeName,t);const l=this.loadGrammarWithConfiguration(t.scopeName,1,n);if(l.name=t.name,this._resolvedGrammars.set(t.name,l),t.aliases&&t.aliases.forEach(f=>{this._alias[f]=t.name}),this._loadedLanguagesCache=null,r.size)for(const f of r)this._resolvedGrammars.delete(f.name),this._loadedLanguagesCache=null,(u=(c=this._syncRegistry)==null?void 0:c._injectionGrammars)==null||u.delete(f.scopeName),(_=(d=this._syncRegistry)==null?void 0:d._grammars)==null||_.delete(f.scopeName),this.loadLanguage(this._langMap.get(f.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(t){for(const l of t)this.resolveEmbeddedLanguages(l);const r=Array.from(this._langGraph.entries()),n=r.filter(([l,c])=>!c);if(n.length){const l=r.filter(([c,u])=>{var d;return u?(d=u.embeddedLanguages||u.embeddedLangs)==null?void 0:d.some(_=>n.map(([f])=>f).includes(_)):!1}).filter(c=>!n.includes(c));throw new et(`Missing languages ${n.map(([c])=>`\`${c}\``).join(", ")}, required by ${l.map(([c])=>`\`${c}\``).join(", ")}`)}for(const[l,c]of r)this._resolver.addLanguage(c);for(const[l,c]of r)this.loadLanguage(c)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(t){this._langMap.set(t.name,t),this._langGraph.set(t.name,t);const r=t.embeddedLanguages??t.embeddedLangs;if(r)for(const n of r)this._langGraph.set(n,this._langMap.get(n))}},ix=class{constructor(e,t){Y(this,"_langs",new Map);Y(this,"_scopeToLang",new Map);Y(this,"_injections",new Map);Y(this,"_onigLib");this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},t.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let r=[];for(let n=1;n<=t.length;n++){const l=t.slice(0,n).join(".");r=[...r,...this._injections.get(l)||[]]}return r}};let Ja=0;function rx(e){Ja+=1,e.warnings!==!1&&Ja>=10&&Ja%10===0&&console.warn(`[Shiki] ${Ja} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);let t=!1;if(!e.engine)throw new et("`engine` option is required for synchronous mode");const r=(e.langs||[]).flat(1),n=(e.themes||[]).flat(1).map(u_),l=new tx(new ix(e.engine,r),n,r,e.langAlias);let c;function u(H){return oS(H,e.langAlias)}function d(H){T();const B=l.getGrammar(typeof H=="string"?H:H.name);if(!B)throw new et(`Language \`${H}\` not found, you may need to load it first`);return B}function _(H){if(H==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};T();const B=l.getTheme(H);if(!B)throw new et(`Theme \`${H}\` not found, you may need to load it first`);return B}function f(H){T();const B=_(H);return c!==H&&(l.setTheme(B),c=H),{theme:B,colorMap:l.getColorMap()}}function v(){return T(),l.getLoadedThemes()}function m(){return T(),l.getLoadedLanguages()}function y(...H){T(),l.loadLanguages(H.flat(1))}async function S(...H){return y(await aS(H))}function b(...H){T();for(const B of H.flat(1))l.loadTheme(B)}async function x(...H){return T(),b(await lS(H))}function T(){if(t)throw new et("Shiki instance has been disposed")}function O(){t||(t=!0,l.dispose(),Ja-=1)}return{setTheme:f,getTheme:_,getLanguage:d,getLoadedThemes:v,getLoadedLanguages:m,resolveLangAlias:u,loadLanguage:S,loadLanguageSync:y,loadTheme:x,loadThemeSync:b,dispose:O,[Symbol.dispose]:O}}async function sx(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,r,n]=await Promise.all([lS(e.themes||[]),aS(e.langs||[]),e.engine]);return rx({...e,themes:t,langs:r,engine:n})}const cS=new WeakMap;function Gc(e,t){cS.set(e,t)}function yl(e){return cS.get(e)}var qc=class uS{constructor(...t){Y(this,"_stacks",{});Y(this,"lang");if(t.length===2){const[r,n]=t;this.lang=n,this._stacks=r}else{const[r,n,l]=t;this.lang=n,this._stacks={[l]:r}}}get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,r){return new uS(Object.fromEntries(ex(r).map(n=>[n,sf])),t)}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return nx(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function nx(e){const t=[],r=new Set;function n(l){var u;if(r.has(l))return;r.add(l);const c=(u=l==null?void 0:l.nameScopesList)==null?void 0:u.scopeName;c&&t.push(c),l.parent&&n(l.parent)}return n(e),t}function ax(e,t){if(!(e instanceof qc))throw new et("Invalid grammar state");return e.getInternalStack(t)}function hS(e,t,r={}){const{theme:n=e.getLoadedThemes()[0]}=r;if(jc(e.resolveLangAlias(r.lang||"text"))||Vc(n))return $c(t).map(d=>[{content:d[0],offset:d[1]}]);const{theme:l,colorMap:c}=e.setTheme(n),u=e.getLanguage(r.lang||"text");if(r.grammarState){if(r.grammarState.lang!==u.name)throw new et(`Grammar state language "${r.grammarState.lang}" does not match highlight language "${u.name}"`);if(!r.grammarState.themes.includes(l.name))throw new et(`Grammar state themes "${r.grammarState.themes}" do not contain highlight theme "${l.name}"`)}return ox(t,u,l,c,r)}function lx(...e){if(e.length===2)return yl(e[1]);const[t,r,n={}]=e,{lang:l="text",theme:c=t.getLoadedThemes()[0]}=n;if(jc(l)||Vc(c))throw new et("Plain language does not have grammar state");if(l==="ansi")throw new et("ANSI language does not have grammar state");const{theme:u,colorMap:d}=t.setTheme(c),_=t.getLanguage(l);return new qc(h_(r,_,u,d,n).stateStack,_.name,u.name)}function ox(e,t,r,n,l){const c=h_(e,t,r,n,l),u=new qc(c.stateStack,t.name,r.name);return Gc(c.tokens,u),c.tokens}function h_(e,t,r,n,l){const c=Ac(r,l),{tokenizeMaxLineLength:u=0,tokenizeTimeLimit:d=500}=l,_=$c(e);let f=l.grammarState?ax(l.grammarState,r.name)??sf:l.grammarContextCode!=null?h_(l.grammarContextCode,t,r,n,{...l,grammarState:void 0,grammarContextCode:void 0}).stateStack:sf,v=[];const m=[];for(let y=0,S=_.length;y<S;y++){const[b,x]=_[y];if(b===""){v=[],m.push([]);continue}if(u>0&&b.length>=u){v=[],m.push([{content:b,offset:x,color:"",fontStyle:0}]);continue}let T,O,H;l.includeExplanation&&(T=t.tokenizeLine(b,f,d),O=T.tokens,H=0);const B=t.tokenizeLine2(b,f,d),I=B.tokens.length/2;for(let j=0;j<I;j++){const $=B.tokens[2*j],ee=j+1<I?B.tokens[2*j+2]:b.length;if($===ee)continue;const ge=B.tokens[2*j+1],Se=gs(n[Xn.getForeground(ge)],c),_e=Xn.getFontStyle(ge),he={content:b.substring($,ee),offset:x+$,color:Se,fontStyle:_e};if(l.includeExplanation){const J=[];if(l.includeExplanation!=="scopeName")for(const ne of r.settings){let se;switch(typeof ne.scope){case"string":se=ne.scope.split(/,/).map(D=>D.trim());break;case"object":se=ne.scope;break;default:continue}J.push({settings:ne,selectors:se.map(D=>D.split(/ /))})}he.explanation=[];let W=0;for(;$+W<ee;){const ne=O[H],se=b.substring(ne.startIndex,ne.endIndex);W+=se.length,he.explanation.push({content:se,scopes:l.includeExplanation==="scopeName"?cx(ne.scopes):ux(J,ne.scopes)}),H+=1}}v.push(he)}m.push(v),v=[],f=B.ruleStack}return{tokens:m,stateStack:f}}function cx(e){return e.map(t=>({scopeName:t}))}function ux(e,t){const r=[];for(let n=0,l=t.length;n<l;n++){const c=t[n];r[n]={scopeName:c,themeMatches:dx(e,c,t.slice(0,n))}}return r}function ty(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function hx(e,t,r){if(!ty(e[e.length-1],t))return!1;let n=e.length-2,l=r.length-1;for(;n>=0&&l>=0;)ty(e[n],r[l])&&(n-=1),l-=1;return n===-1}function dx(e,t,r){const n=[];for(const{selectors:l,settings:c}of e)for(const u of l)if(hx(u,t,r)){n.push(c);break}return n}function dS(e,t,r,n=hS){const l=Object.entries(r.themes).filter(f=>f[1]).map(f=>({color:f[0],theme:f[1]})),c=l.map(f=>{const v=n(e,t,{...r,theme:f.theme});return{tokens:v,state:yl(v),theme:typeof f.theme=="string"?f.theme:f.theme.name}}),u=fx(...c.map(f=>f.tokens)),d=u[0].map((f,v)=>f.map((m,y)=>{const S={content:m.content,variants:{},offset:m.offset};return"includeExplanation"in r&&r.includeExplanation&&(S.explanation=m.explanation),u.forEach((b,x)=>{const{content:T,explanation:O,offset:H,...B}=b[v][y];S.variants[l[x].color]=B}),S})),_=c[0].state?new qc(Object.fromEntries(c.map(f=>{var v;return[f.theme,(v=f.state)==null?void 0:v.getInternalStack(f.theme)]})),c[0].state.lang):void 0;return _&&Gc(d,_),d}function fx(...e){const t=e.map(()=>[]),r=e.length;for(let n=0;n<e[0].length;n++){const l=e.map(_=>_[n]),c=t.map(()=>[]);t.forEach((_,f)=>_.push(c[f]));const u=l.map(()=>0),d=l.map(_=>_[0]);for(;d.every(_=>_);){const _=Math.min(...d.map(f=>f.content.length));for(let f=0;f<r;f++){const v=d[f];v.content.length===_?(c[f].push(v),u[f]+=1,d[f]=l[f][u[f]]):(c[f].push({...v,content:v.content.slice(0,_)}),d[f]={...v,content:v.content.slice(_),offset:v.offset+_})}}}return t}const _x=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Al{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}}Al.prototype.normal={};Al.prototype.property={};Al.prototype.space=void 0;function fS(e,t){const r={},n={};for(const l of e)Object.assign(r,l.property),Object.assign(n,l.normal);return new Al(r,n,t)}function nf(e){return e.toLowerCase()}class fi{constructor(t,r){this.attribute=r,this.property=t}}fi.prototype.attribute="";fi.prototype.booleanish=!1;fi.prototype.boolean=!1;fi.prototype.commaOrSpaceSeparated=!1;fi.prototype.commaSeparated=!1;fi.prototype.defined=!1;fi.prototype.mustUseProperty=!1;fi.prototype.number=!1;fi.prototype.overloadedBoolean=!1;fi.prototype.property="";fi.prototype.spaceSeparated=!1;fi.prototype.space=void 0;let px=0;const Le=en(),bt=en(),af=en(),ae=en(),Je=en(),Yn=en(),xi=en();function en(){return 2**++px}const lf=Object.freeze(Object.defineProperty({__proto__:null,boolean:Le,booleanish:bt,commaOrSpaceSeparated:xi,commaSeparated:Yn,number:ae,overloadedBoolean:af,spaceSeparated:Je},Symbol.toStringTag,{value:"Module"})),xd=Object.keys(lf);class d_ extends fi{constructor(t,r,n,l){let c=-1;if(super(t,r),iy(this,"space",l),typeof n=="number")for(;++c<xd.length;){const u=xd[c];iy(this,xd[c],(n&lf[u])===lf[u])}}}d_.prototype.defined=!0;function iy(e,t,r){r&&(e[t]=r)}function Qn(e){const t={},r={};for(const[n,l]of Object.entries(e.properties)){const c=new d_(n,e.transform(e.attributes||{},n),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(c.mustUseProperty=!0),t[n]=c,r[nf(n)]=n,r[nf(c.attribute)]=n}return new Al(t,r,e.space)}const _S=Qn({properties:{ariaActiveDescendant:null,ariaAtomic:bt,ariaAutoComplete:null,ariaBusy:bt,ariaChecked:bt,ariaColCount:ae,ariaColIndex:ae,ariaColSpan:ae,ariaControls:Je,ariaCurrent:null,ariaDescribedBy:Je,ariaDetails:null,ariaDisabled:bt,ariaDropEffect:Je,ariaErrorMessage:null,ariaExpanded:bt,ariaFlowTo:Je,ariaGrabbed:bt,ariaHasPopup:null,ariaHidden:bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Je,ariaLevel:ae,ariaLive:null,ariaModal:bt,ariaMultiLine:bt,ariaMultiSelectable:bt,ariaOrientation:null,ariaOwns:Je,ariaPlaceholder:null,ariaPosInSet:ae,ariaPressed:bt,ariaReadOnly:bt,ariaRelevant:null,ariaRequired:bt,ariaRoleDescription:Je,ariaRowCount:ae,ariaRowIndex:ae,ariaRowSpan:ae,ariaSelected:bt,ariaSetSize:ae,ariaSort:null,ariaValueMax:ae,ariaValueMin:ae,ariaValueNow:ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function pS(e,t){return t in e?e[t]:t}function mS(e,t){return pS(e,t.toLowerCase())}const mx=Qn({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Yn,acceptCharset:Je,accessKey:Je,action:null,allow:null,allowFullScreen:Le,allowPaymentRequest:Le,allowUserMedia:Le,alt:null,as:null,async:Le,autoCapitalize:null,autoComplete:Je,autoFocus:Le,autoPlay:Le,blocking:Je,capture:null,charSet:null,checked:Le,cite:null,className:Je,cols:ae,colSpan:null,content:null,contentEditable:bt,controls:Le,controlsList:Je,coords:ae|Yn,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Le,defer:Le,dir:null,dirName:null,disabled:Le,download:af,draggable:bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Le,formTarget:null,headers:Je,height:ae,hidden:af,high:ae,href:null,hrefLang:null,htmlFor:Je,httpEquiv:Je,id:null,imageSizes:null,imageSrcSet:null,inert:Le,inputMode:null,integrity:null,is:null,isMap:Le,itemId:null,itemProp:Je,itemRef:Je,itemScope:Le,itemType:Je,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Le,low:ae,manifest:null,max:null,maxLength:ae,media:null,method:null,min:null,minLength:ae,multiple:Le,muted:Le,name:null,nonce:null,noModule:Le,noValidate:Le,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:Le,optimum:ae,pattern:null,ping:Je,placeholder:null,playsInline:Le,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Le,referrerPolicy:null,rel:Je,required:Le,reversed:Le,rows:ae,rowSpan:ae,sandbox:Je,scope:null,scoped:Le,seamless:Le,selected:Le,shadowRootClonable:Le,shadowRootDelegatesFocus:Le,shadowRootMode:null,shape:null,size:ae,sizes:null,slot:null,span:ae,spellCheck:bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ae,step:null,style:null,tabIndex:ae,target:null,title:null,translate:null,type:null,typeMustMatch:Le,useMap:null,value:bt,width:ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Je,axis:null,background:null,bgColor:null,border:ae,borderColor:null,bottomMargin:ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Le,declare:Le,event:null,face:null,frame:null,frameBorder:null,hSpace:ae,leftMargin:ae,link:null,longDesc:null,lowSrc:null,marginHeight:ae,marginWidth:ae,noResize:Le,noHref:Le,noShade:Le,noWrap:Le,object:null,profile:null,prompt:null,rev:null,rightMargin:ae,rules:null,scheme:null,scrolling:bt,standby:null,summary:null,text:null,topMargin:ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Le,disableRemotePlayback:Le,prefix:null,property:null,results:ae,security:null,unselectable:null},space:"html",transform:mS}),gx=Qn({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:xi,accentHeight:ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ae,amplitude:ae,arabicForm:null,ascent:ae,attributeName:null,attributeType:null,azimuth:ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ae,by:null,calcMode:null,capHeight:ae,className:Je,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ae,diffuseConstant:ae,direction:null,display:null,dur:null,divisor:ae,dominantBaseline:null,download:Le,dx:null,dy:null,edgeMode:null,editable:null,elevation:ae,enableBackground:null,end:null,event:null,exponent:ae,externalResourcesRequired:null,fill:null,fillOpacity:ae,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Yn,g2:Yn,glyphName:Yn,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ae,horizOriginX:ae,horizOriginY:ae,id:null,ideographic:ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ae,k:ae,k1:ae,k2:ae,k3:ae,k4:ae,kernelMatrix:xi,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ae,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ae,overlineThickness:ae,paintOrder:null,panose1:null,path:null,pathLength:ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Je,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ae,pointsAtY:ae,pointsAtZ:ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:xi,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:xi,rev:xi,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:xi,requiredFeatures:xi,requiredFonts:xi,requiredFormats:xi,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ae,specularExponent:ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ae,strikethroughThickness:ae,string:null,stroke:null,strokeDashArray:xi,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ae,strokeOpacity:ae,strokeWidth:null,style:null,surfaceScale:ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:xi,tabIndex:ae,tableValues:null,target:null,targetX:ae,targetY:ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:xi,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ae,underlineThickness:ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ae,values:null,vAlphabetic:ae,vMathematical:ae,vectorEffect:null,vHanging:ae,vIdeographic:ae,version:null,vertAdvY:ae,vertOriginX:ae,vertOriginY:ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:pS}),gS=Qn({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),vS=Qn({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:mS}),yS=Qn({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),vx=/[A-Z]/g,ry=/-[a-z]/g,yx=/^data[-\w.:]+$/i;function Sx(e,t){const r=nf(t);let n=t,l=fi;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&yx.test(t)){if(t.charAt(4)==="-"){const c=t.slice(5).replace(ry,wx);n="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=t.slice(4);if(!ry.test(c)){let u=c.replace(vx,bx);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}l=d_}return new l(n,t)}function bx(e){return"-"+e.toLowerCase()}function wx(e){return e.charAt(1).toUpperCase()}const Cx=fS([_S,mx,gS,vS,yS],"html"),SS=fS([_S,gx,gS,vS,yS],"svg"),sy={}.hasOwnProperty;function Ex(e,t){const r=t||{};function n(l,...c){let u=n.invalid;const d=n.handlers;if(l&&sy.call(l,e)){const _=String(l[e]);u=sy.call(d,_)?d[_]:n.unknown}if(u)return u.call(this,l,...c)}return n.handlers=r.handlers||{},n.invalid=r.invalid,n.unknown=r.unknown,n}const xx=/["&'<>`]/g,Ax=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,kx=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Tx=/[|\\{}()[\]^$+*?.]/g,ny=new WeakMap;function Rx(e,t){if(e=e.replace(t.subset?Dx(t.subset):xx,n),t.subset||t.escapeOnly)return e;return e.replace(Ax,r).replace(kx,n);function r(l,c,u){return t.format((l.charCodeAt(0)-55296)*1024+l.charCodeAt(1)-56320+65536,u.charCodeAt(c+2),t)}function n(l,c,u){return t.format(l.charCodeAt(0),u.charCodeAt(c+1),t)}}function Dx(e){let t=ny.get(e);return t||(t=Lx(e),ny.set(e,t)),t}function Lx(e){const t=[];let r=-1;for(;++r<e.length;)t.push(e[r].replace(Tx,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Ox=/[\dA-Fa-f]/;function Mx(e,t,r){const n="&#x"+e.toString(16).toUpperCase();return r&&t&&!Ox.test(String.fromCharCode(t))?n:n+";"}const Nx=/\d/;function Bx(e,t,r){const n="&#"+String(e);return r&&t&&!Nx.test(String.fromCharCode(t))?n:n+";"}const zx=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Ad={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Px=["cent","copy","divide","gt","lt","not","para","times"],bS={}.hasOwnProperty,of={};let Qo;for(Qo in Ad)bS.call(Ad,Qo)&&(of[Ad[Qo]]=Qo);const Ix=/[^\dA-Za-z]/;function Hx(e,t,r,n){const l=String.fromCharCode(e);if(bS.call(of,l)){const c=of[l],u="&"+c;return r&&zx.includes(c)&&!Px.includes(c)&&(!n||t&&t!==61&&Ix.test(String.fromCharCode(t)))?u:u+";"}return""}function Ux(e,t,r){let n=Mx(e,t,r.omitOptionalSemicolons),l;if((r.useNamedReferences||r.useShortestReferences)&&(l=Hx(e,t,r.omitOptionalSemicolons,r.attribute)),(r.useShortestReferences||!l)&&r.useShortestReferences){const c=Bx(e,t,r.omitOptionalSemicolons);c.length<n.length&&(n=c)}return l&&(!r.useShortestReferences||l.length<n.length)?l:n}function Kn(e,t){return Rx(e,Object.assign({format:Ux},t))}const jx=/^>|^->|<!--|-->|--!>|<!-$/g,Vx=[">"],$x=["<",">"];function Gx(e,t,r,n){return n.settings.bogusComments?"<?"+Kn(e.value,Object.assign({},n.settings.characterReferences,{subset:Vx}))+">":"<!--"+e.value.replace(jx,l)+"-->";function l(c){return Kn(c,Object.assign({},n.settings.characterReferences,{subset:$x}))}}function qx(e,t,r,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"}function ay(e,t){const r=String(e);if(typeof t!="string")throw new TypeError("Expected character");let n=0,l=r.indexOf(t);for(;l!==-1;)n++,l=r.indexOf(t,l+t.length);return n}function Wx(e,t){const r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}function Fx(e){return e.join(" ").trim()}const Yx=/[ \t\n\f\r]/g;function f_(e){return typeof e=="object"?e.type==="text"?ly(e.value):!1:ly(e)}function ly(e){return e.replace(Yx,"")===""}const Dt=CS(1),wS=CS(-1),Kx=[];function CS(e){return t;function t(r,n,l){const c=r?r.children:Kx;let u=(n||0)+e,d=c[u];if(!l)for(;d&&f_(d);)u+=e,d=c[u];return d}}const Xx={}.hasOwnProperty;function ES(e){return t;function t(r,n,l){return Xx.call(e,r.tagName)&&e[r.tagName](r,n,l)}}const __=ES({body:Qx,caption:kd,colgroup:kd,dd:i2,dt:t2,head:kd,html:Zx,li:e2,optgroup:r2,option:s2,p:Jx,rp:oy,rt:oy,tbody:a2,td:cy,tfoot:l2,th:cy,thead:n2,tr:o2});function kd(e,t,r){const n=Dt(r,t,!0);return!n||n.type!=="comment"&&!(n.type==="text"&&f_(n.value.charAt(0)))}function Zx(e,t,r){const n=Dt(r,t);return!n||n.type!=="comment"}function Qx(e,t,r){const n=Dt(r,t);return!n||n.type!=="comment"}function Jx(e,t,r){const n=Dt(r,t);return n?n.type==="element"&&(n.tagName==="address"||n.tagName==="article"||n.tagName==="aside"||n.tagName==="blockquote"||n.tagName==="details"||n.tagName==="div"||n.tagName==="dl"||n.tagName==="fieldset"||n.tagName==="figcaption"||n.tagName==="figure"||n.tagName==="footer"||n.tagName==="form"||n.tagName==="h1"||n.tagName==="h2"||n.tagName==="h3"||n.tagName==="h4"||n.tagName==="h5"||n.tagName==="h6"||n.tagName==="header"||n.tagName==="hgroup"||n.tagName==="hr"||n.tagName==="main"||n.tagName==="menu"||n.tagName==="nav"||n.tagName==="ol"||n.tagName==="p"||n.tagName==="pre"||n.tagName==="section"||n.tagName==="table"||n.tagName==="ul"):!r||!(r.type==="element"&&(r.tagName==="a"||r.tagName==="audio"||r.tagName==="del"||r.tagName==="ins"||r.tagName==="map"||r.tagName==="noscript"||r.tagName==="video"))}function e2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&n.tagName==="li"}function t2(e,t,r){const n=Dt(r,t);return!!(n&&n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd"))}function i2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&(n.tagName==="dt"||n.tagName==="dd")}function oy(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&(n.tagName==="rp"||n.tagName==="rt")}function r2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&n.tagName==="optgroup"}function s2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&(n.tagName==="option"||n.tagName==="optgroup")}function n2(e,t,r){const n=Dt(r,t);return!!(n&&n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot"))}function a2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&(n.tagName==="tbody"||n.tagName==="tfoot")}function l2(e,t,r){return!Dt(r,t)}function o2(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&n.tagName==="tr"}function cy(e,t,r){const n=Dt(r,t);return!n||n.type==="element"&&(n.tagName==="td"||n.tagName==="th")}const c2=ES({body:d2,colgroup:f2,head:h2,html:u2,tbody:_2});function u2(e){const t=Dt(e,-1);return!t||t.type!=="comment"}function h2(e){const t=new Set;for(const n of e.children)if(n.type==="element"&&(n.tagName==="base"||n.tagName==="title")){if(t.has(n.tagName))return!1;t.add(n.tagName)}const r=e.children[0];return!r||r.type==="element"}function d2(e){const t=Dt(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&f_(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function f2(e,t,r){const n=wS(r,t),l=Dt(e,-1,!0);return r&&n&&n.type==="element"&&n.tagName==="colgroup"&&__(n,r.children.indexOf(n),r)?!1:!!(l&&l.type==="element"&&l.tagName==="col")}function _2(e,t,r){const n=wS(r,t),l=Dt(e,-1);return r&&n&&n.type==="element"&&(n.tagName==="thead"||n.tagName==="tbody")&&__(n,r.children.indexOf(n),r)?!1:!!(l&&l.type==="element"&&l.tagName==="tr")}const Jo={name:[[`
|
|
53
53
|
\f\r &/=>`.split(""),`
|
|
54
54
|
\f\r "&'/=>\``.split("")],[`\0
|
|
55
55
|
\f\r "&'/<=>`.split(""),`\0
|
|
@@ -57,10 +57,10 @@ Error generating stack: `+o.message+`
|
|
|
57
57
|
\f\r &>`.split(""),`\0
|
|
58
58
|
\f\r "&'<=>\``.split("")],[`\0
|
|
59
59
|
\f\r "&'<=>\``.split(""),`\0
|
|
60
|
-
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function f2(e,t,r,n){const l=n.schema,c=l.space==="svg"?!1:n.settings.omitOptionalTags;let u=l.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(e.tagName.toLowerCase());const d=[];let _;l.space==="html"&&e.tagName==="svg"&&(n.schema=mS);const f=_2(n,e.properties),v=n.all(l.space==="html"&&e.tagName==="template"?e.content:e);return n.schema=l,v&&(u=!1),(f||!c||!l2(e,t,r))&&(d.push("<",e.tagName,f?" "+f:""),u&&(l.space==="svg"||n.settings.closeSelfClosing)&&(_=f.charAt(f.length-1),(!n.settings.tightSelfClosing||_==="/"||_&&_!=='"'&&_!=="'")&&d.push(" "),d.push("/")),d.push(">")),d.push(v),!u&&(!c||!f_(e,t,r))&&d.push("</"+e.tagName+">"),d.join("")}function _2(e,t){const r=[];let n=-1,l;if(t){for(l in t)if(t[l]!==null&&t[l]!==void 0){const c=p2(e,l,t[l]);c&&r.push(c)}}for(;++n<r.length;){const c=e.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&c!=='"'&&c!=="'"&&(r[n]+=" ")}return r.join("")}function p2(e,t,r){const n=vx(e.schema,t),l=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,c=e.settings.allowDangerousCharacters?0:1;let u=e.quote,d;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const _=Kn(n.attribute,Object.assign({},e.settings.characterReferences,{subset:Jo.name[l][c]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?Gx:qx)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?_:(e.settings.preferUnquoted&&(d=Kn(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Jo.unquoted[l][c]}))),d!==r&&(e.settings.quoteSmart&&sy(r,u)>sy(r,e.alternative)&&(u=e.alternative),d=u+Kn(r,Object.assign({},e.settings.characterReferences,{subset:(u==="'"?Jo.single:Jo.double)[l][c],attribute:!0}))+u),_+(d&&"="+d))}const m2=["<","&"];function bS(e,t,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?e.value:Kn(e.value,Object.assign({},n.settings.characterReferences,{subset:m2}))}function g2(e,t,r,n){return n.settings.allowDangerousHtml?e.value:bS(e,t,r,n)}function v2(e,t,r,n){return n.all(e)}const y2=wx("type",{invalid:S2,unknown:b2,handlers:{comment:Vx,doctype:$x,element:f2,raw:g2,root:v2,text:bS}});function S2(e){throw new Error("Expected node, not `"+e+"`")}function b2(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const w2={},C2={},E2=[];function x2(e,t){const r=t||w2,n=r.quote||'"',l=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:A2,all:k2,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||dx,characterReferences:r.characterReferences||C2,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?mS:bx,quote:n,alternative:l}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function A2(e,t,r){return y2(e,t,r,this)}function k2(e){const t=[],r=e&&e.children||E2;let n=-1;for(;++n<r.length;)t[n]=this.one(r[n],n,e);return t.join("")}function wS(e,t){var n;if(!t)return e;e.properties||(e.properties={}),(n=e.properties).class||(n.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const r=Array.isArray(t)?t:t.split(/\s+/g);for(const l of r)l&&!e.properties.class.includes(l)&&e.properties.class.push(l);return e}function T2(e){const t=$c(e,!0).map(([l])=>l);function r(l){if(l===e.length)return{line:t.length-1,character:t[t.length-1].length};let c=l,u=0;for(const d of t){if(c<d.length)break;c-=d.length,u++}return{line:u,character:c}}function n(l,c){let u=0;for(let d=0;d<l;d++)u+=t[d].length;return u+=c,u}return{lines:t,indexToPos:r,posToIndex:n}}function R2(e,t,r){const n=new Set;for(const c of e.matchAll(/:?lang=["']([^"']+)["']/g)){const u=c[1].toLowerCase().trim();u&&n.add(u)}for(const c of e.matchAll(/(?:```|~~~)([\w-]+)/g)){const u=c[1].toLowerCase().trim();u&&n.add(u)}for(const c of e.matchAll(/\\begin\{([\w-]+)\}/g)){const u=c[1].toLowerCase().trim();u&&n.add(u)}for(const c of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const u=c[1].toLowerCase().trim(),d=u.includes("/")?u.split("/").pop():u;d&&n.add(d)}if(!r)return Array.from(n);const l=r.getBundledLanguages();return Array.from(n).filter(c=>c&&l[c])}const __="light-dark()",D2=["color","background-color"];function L2(e,t){let r=0;const n=[];for(const l of t)l>r&&n.push({...e,content:e.content.slice(r,l),offset:e.offset+r}),r=l;return r<e.content.length&&n.push({...e,content:e.content.slice(r),offset:e.offset+r}),n}function O2(e,t){const r=Array.from(t instanceof Set?t:new Set(t)).sort((n,l)=>n-l);return r.length?e.map(n=>n.flatMap(l=>{const c=r.filter(u=>l.offset<u&&u<l.offset+l.content.length).map(u=>u-l.offset).sort((u,d)=>u-d);return c.length?L2(l,c):l})):e}function M2(e,t,r,n,l="css-vars"){const c={content:e.content,explanation:e.explanation,offset:e.offset},u=t.map(v=>kc(e.variants[v])),d=new Set(u.flatMap(v=>Object.keys(v))),_={},f=(v,m)=>{const y=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return r+t[v]+(m==="color"?"":y)};return u.forEach((v,m)=>{for(const y of d){const S=v[y]||"inherit";if(m===0&&n&&D2.includes(y))if(n===__&&u.length>1){const b=t.findIndex(T=>T==="light"),E=t.findIndex(T=>T==="dark");if(b===-1||E===-1)throw new et('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');_[y]=`light-dark(${u[b][y]||"inherit"}, ${u[E][y]||"inherit"})`,l==="css-vars"&&(_[f(m,y)]=S)}else _[y]=S;else l==="css-vars"&&(_[f(m,y)]=S)}}),c.htmlStyle=_,c}function kc(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Zt.Italic&&(t["font-style"]="italic"),e.fontStyle&Zt.Bold&&(t["font-weight"]="bold");const r=[];e.fontStyle&Zt.Underline&&r.push("underline"),e.fontStyle&Zt.Strikethrough&&r.push("line-through"),r.length&&(t["text-decoration"]=r.join(" "))}return t}function of(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r}`).join(";")}function N2(){const e=new WeakMap;function t(r){if(!e.has(r.meta)){let c=function(d){if(typeof d=="number"){if(d<0||d>r.source.length)throw new et(`Invalid decoration offset: ${d}. Code length: ${r.source.length}`);return{...l.indexToPos(d),offset:d}}else{const _=l.lines[d.line];if(_===void 0)throw new et(`Invalid decoration position ${JSON.stringify(d)}. Lines length: ${l.lines.length}`);let f=d.character;if(f<0&&(f=_.length+f),f<0||f>_.length)throw new et(`Invalid decoration position ${JSON.stringify(d)}. Line ${d.line} length: ${_.length}`);return{...d,character:f,offset:l.posToIndex(d.line,f)}}};var n=c;const l=T2(r.source),u=(r.options.decorations||[]).map(d=>({...d,start:c(d.start),end:c(d.end)}));B2(u),e.set(r.meta,{decorations:u,converter:l,source:r.source})}return e.get(r.meta)}return{name:"shiki:decorations",tokens(r){var n;if((n=this.options.decorations)!=null&&n.length)return O2(r,t(this).decorations.flatMap(l=>[l.start.offset,l.end.offset]))},code(r){var v;if(!((v=this.options.decorations)!=null&&v.length))return;const n=t(this),l=Array.from(r.children).filter(m=>m.type==="element"&&m.tagName==="span");if(l.length!==n.converter.lines.length)throw new et(`Number of lines in code element (${l.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function c(m,y,S,b){const E=l[m];let T="",O=-1,H=-1;if(y===0&&(O=0),S===0&&(H=0),S===Number.POSITIVE_INFINITY&&(H=E.children.length),O===-1||H===-1)for(let I=0;I<E.children.length;I++)T+=CS(E.children[I]),O===-1&&T.length===y&&(O=I+1),H===-1&&T.length===S&&(H=I+1);if(O===-1)throw new et(`Failed to find start index for decoration ${JSON.stringify(b.start)}`);if(H===-1)throw new et(`Failed to find end index for decoration ${JSON.stringify(b.end)}`);const B=E.children.slice(O,H);if(!b.alwaysWrap&&B.length===E.children.length)d(E,b,"line");else if(!b.alwaysWrap&&B.length===1&&B[0].type==="element")d(B[0],b,"token");else{const I={type:"element",tagName:"span",properties:{},children:B};d(I,b,"wrapper"),E.children.splice(O,B.length,I)}}function u(m,y){l[m]=d(l[m],y,"line")}function d(m,y,S){var T;const b=y.properties||{},E=y.transform||(O=>O);return m.tagName=y.tagName||"span",m.properties={...m.properties,...b,class:m.properties.class},(T=y.properties)!=null&&T.class&&wS(m,y.properties.class),m=E(m,S)||m,m}const _=[],f=n.decorations.sort((m,y)=>y.start.offset-m.start.offset||m.end.offset-y.end.offset);for(const m of f){const{start:y,end:S}=m;if(y.line===S.line)c(y.line,y.character,S.character,m);else if(y.line<S.line){c(y.line,y.character,Number.POSITIVE_INFINITY,m);for(let b=y.line+1;b<S.line;b++)_.unshift(()=>u(b,m));c(S.line,0,S.character,m)}}_.forEach(m=>m())}}}function B2(e){for(let t=0;t<e.length;t++){const r=e[t];if(r.start.offset>r.end.offset)throw new et(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let n=t+1;n<e.length;n++){const l=e[n],c=r.start.offset<=l.start.offset&&l.start.offset<r.end.offset,u=r.start.offset<l.end.offset&&l.end.offset<=r.end.offset,d=l.start.offset<=r.start.offset&&r.start.offset<l.end.offset,_=l.start.offset<r.end.offset&&r.end.offset<=l.end.offset;if(c||u||d||_){if(c&&u||d&&_||d&&r.start.offset===r.end.offset||u&&l.start.offset===l.end.offset)continue;throw new et(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(l.start)} intersect.`)}}}}function CS(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(CS).join(""):""}const z2=[N2()];function Tc(e){const t=P2(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...z2]}function P2(e){const t=[],r=[],n=[];for(const l of e)switch(l.enforce){case"pre":t.push(l);break;case"post":r.push(l);break;default:n.push(l)}return{pre:t,post:r,normal:n}}var Gs=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],kd={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function I2(e,t){const r=e.indexOf("\x1B",t);if(r!==-1&&e[r+1]==="["){const n=e.indexOf("m",r);if(n!==-1)return{sequence:e.substring(r+2,n).split(";"),startPosition:r,position:n+1}}return{position:e.length}}function oy(e){const t=e.shift();if(t==="2"){const r=e.splice(0,3).map(n=>Number.parseInt(n));return r.length!==3||r.some(n=>Number.isNaN(n))?void 0:{type:"rgb",rgb:r}}else if(t==="5"){const r=e.shift();if(r)return{type:"table",index:Number(r)}}}function H2(e){const t=[];for(;e.length>0;){const r=e.shift();if(!r)continue;const n=Number.parseInt(r);if(!Number.isNaN(n))if(n===0)t.push({type:"resetAll"});else if(n<=9)kd[n]&&t.push({type:"setDecoration",value:kd[n]});else if(n<=29){const l=kd[n-20];l&&(t.push({type:"resetDecoration",value:l}),l==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Gs[n-30]}});else if(n===38){const l=oy(e);l&&t.push({type:"setForegroundColor",value:l})}else if(n===39)t.push({type:"resetForegroundColor"});else if(n<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Gs[n-40]}});else if(n===48){const l=oy(e);l&&t.push({type:"setBackgroundColor",value:l})}else n===49?t.push({type:"resetBackgroundColor"}):n===53?t.push({type:"setDecoration",value:"overline"}):n===55?t.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Gs[n-90+8]}}):n>=100&&n<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Gs[n-100+8]}})}return t}function U2(){let e=null,t=null,r=new Set;return{parse(n){const l=[];let c=0;do{const u=I2(n,c),d=u.sequence?n.substring(c,u.startPosition):n.substring(c);if(d.length>0&&l.push({value:d,foreground:e,background:t,decorations:new Set(r)}),u.sequence){const _=H2(u.sequence);for(const f of _)f.type==="resetAll"?(e=null,t=null,r.clear()):f.type==="resetForegroundColor"?e=null:f.type==="resetBackgroundColor"?t=null:f.type==="resetDecoration"&&r.delete(f.value);for(const f of _)f.type==="setForegroundColor"?e=f.value:f.type==="setBackgroundColor"?t=f.value:f.type==="setDecoration"&&r.add(f.value)}c=u.position}while(c<n.length);return l}}}var j2={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function V2(e=j2){function t(d){return e[d]}function r(d){return`#${d.map(_=>Math.max(0,Math.min(_,255)).toString(16).padStart(2,"0")).join("")}`}let n;function l(){if(n)return n;n=[];for(let f=0;f<Gs.length;f++)n.push(t(Gs[f]));let d=[0,95,135,175,215,255];for(let f=0;f<6;f++)for(let v=0;v<6;v++)for(let m=0;m<6;m++)n.push(r([d[f],d[v],d[m]]));let _=8;for(let f=0;f<24;f++,_+=10)n.push(r([_,_,_]));return n}function c(d){return l()[d]}function u(d){switch(d.type){case"named":return t(d.name);case"rgb":return r(d.rgb);case"table":return c(d.index)}}return{value:u}}const $2={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function G2(e,t,r){const n=Ac(e,r),l=$c(t),c=V2(Object.fromEntries(Gs.map(d=>{var f;const _=`terminal.ansi${d[0].toUpperCase()}${d.substring(1)}`;return[d,((f=e.colors)==null?void 0:f[_])||$2[d]]}))),u=U2();return l.map(d=>u.parse(d[0]).map(_=>{let f,v;_.decorations.has("reverse")?(f=_.background?c.value(_.background):e.bg,v=_.foreground?c.value(_.foreground):e.fg):(f=_.foreground?c.value(_.foreground):e.fg,v=_.background?c.value(_.background):void 0),f=gs(f,n),v=gs(v,n),_.decorations.has("dim")&&(f=q2(f));let m=Zt.None;return _.decorations.has("bold")&&(m|=Zt.Bold),_.decorations.has("italic")&&(m|=Zt.Italic),_.decorations.has("underline")&&(m|=Zt.Underline),_.decorations.has("strikethrough")&&(m|=Zt.Strikethrough),{content:_.value,offset:d[1],color:f,bgColor:v,fontStyle:m}}))}function q2(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const n=t[1];if(n.length===8){const l=Math.round(Number.parseInt(n.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${n.slice(0,6)}${l}`}else{if(n.length===6)return`#${n}80`;if(n.length===4){const l=n[0],c=n[1],u=n[2],d=n[3];return`#${l}${l}${c}${c}${u}${u}${Math.round(Number.parseInt(`${d}${d}`,16)/2).toString(16).padStart(2,"0")}`}else if(n.length===3){const l=n[0],c=n[1],u=n[2];return`#${l}${l}${c}${c}${u}${u}80`}}}const r=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return r?`var(${r[1]}-dim)`:e}function cf(e,t,r={}){const n=e.resolveLangAlias(r.lang||"text"),{theme:l=e.getLoadedThemes()[0]}=r;if(!jc(n)&&!Vc(l)&&n==="ansi"){const{theme:c}=e.setTheme(l);return G2(c,t,r)}return lS(e,t,r)}function Rc(e,t,r){let n,l,c,u,d,_;if("themes"in r){const{defaultColor:f="light",cssVariablePrefix:v="--shiki-",colorsRendering:m="css-vars"}=r,y=Object.entries(r.themes).filter(O=>O[1]).map(O=>({color:O[0],theme:O[1]})).sort((O,H)=>O.color===f?-1:H.color===f?1:0);if(y.length===0)throw new et("`themes` option must not be empty");const S=oS(e,t,r,cf);if(_=vl(S),f&&__!==f&&!y.find(O=>O.color===f))throw new et(`\`themes\` option must contain the defaultColor key \`${f}\``);const b=y.map(O=>e.getTheme(O.theme)),E=y.map(O=>O.color);c=S.map(O=>O.map(H=>M2(H,E,v,f,m))),_&&Gc(c,_);const T=y.map(O=>Ac(O.theme,r));l=cy(y,b,T,v,f,"fg",m),n=cy(y,b,T,v,f,"bg",m),u=`shiki-themes ${b.map(O=>O.name).join(" ")}`,d=f?void 0:[l,n].join(";")}else if("theme"in r){const f=Ac(r.theme,r);c=cf(e,t,r);const v=e.getTheme(r.theme);n=gs(v.bg,f),l=gs(v.fg,f),u=v.name,_=vl(c)}else throw new et("Invalid options, either `theme` or `themes` must be provided");return{tokens:c,fg:l,bg:n,themeName:u,rootStyle:d,grammarState:_}}function cy(e,t,r,n,l,c,u){return e.map((d,_)=>{const f=gs(t[_][c],r[_])||"inherit",v=`${n+d.color}${c==="bg"?"-bg":""}:${f}`;if(_===0&&l){if(l===__&&e.length>1){const m=e.findIndex(S=>S.color==="light"),y=e.findIndex(S=>S.color==="dark");if(m===-1||y===-1)throw new et('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${gs(t[m][c],r[m])||"inherit"}, ${gs(t[y][c],r[y])||"inherit"});${v}`}return f}return u==="css-vars"?v:null}).filter(d=>!!d).join(";")}function Dc(e,t,r,n={meta:{},options:r,codeToHast:(l,c)=>Dc(e,l,c),codeToTokens:(l,c)=>Rc(e,l,c)}){var b,E;let l=t;for(const T of Tc(r))l=((b=T.preprocess)==null?void 0:b.call(n,l,r))||l;let{tokens:c,fg:u,bg:d,themeName:_,rootStyle:f,grammarState:v}=Rc(e,l,r);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:y=!1}=r;m===!0?c=F2(c):m==="never"&&(c=Y2(c)),y&&(c=K2(c));const S={...n,get source(){return l}};for(const T of Tc(r))c=((E=T.tokens)==null?void 0:E.call(S,c))||c;return W2(c,{...r,fg:u,bg:d,themeName:_,rootStyle:r.rootStyle===!1?!1:r.rootStyle??f},S,v)}function W2(e,t,r,n=vl(e)){var E,T,O,H;const l=Tc(t),c=[],u={type:"root",children:[]},{structure:d="classic",tabindex:_="0"}=t,f={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?f.style=t.rootStyle:f.style=`background-color:${t.bg};color:${t.fg}`),_!==!1&&_!=null&&(f.tabindex=_.toString());for(const[B,I]of Object.entries(t.meta||{}))B.startsWith("_")||(f[B]=I);let v={type:"element",tagName:"pre",properties:f,children:[],data:t.data},m={type:"element",tagName:"code",properties:{},children:c};const y=[],S={...r,structure:d,addClassToHast:wS,get source(){return r.source},get tokens(){return e},get options(){return t},get root(){return u},get pre(){return v},get code(){return m},get lines(){return y}};if(e.forEach((B,I)=>{var te,ge;I&&(d==="inline"?u.children.push({type:"element",tagName:"br",properties:{},children:[]}):d==="classic"&&c.push({type:"text",value:`
|
|
61
|
-
`}));let j={type:"element",tagName:"span",properties:{class:"line"},children:[]}
|
|
60
|
+
\f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function p2(e,t,r,n){const l=n.schema,c=l.space==="svg"?!1:n.settings.omitOptionalTags;let u=l.space==="svg"?n.settings.closeEmptyElements:n.settings.voids.includes(e.tagName.toLowerCase());const d=[];let _;l.space==="html"&&e.tagName==="svg"&&(n.schema=SS);const f=m2(n,e.properties),v=n.all(l.space==="html"&&e.tagName==="template"?e.content:e);return n.schema=l,v&&(u=!1),(f||!c||!c2(e,t,r))&&(d.push("<",e.tagName,f?" "+f:""),u&&(l.space==="svg"||n.settings.closeSelfClosing)&&(_=f.charAt(f.length-1),(!n.settings.tightSelfClosing||_==="/"||_&&_!=='"'&&_!=="'")&&d.push(" "),d.push("/")),d.push(">")),d.push(v),!u&&(!c||!__(e,t,r))&&d.push("</"+e.tagName+">"),d.join("")}function m2(e,t){const r=[];let n=-1,l;if(t){for(l in t)if(t[l]!==null&&t[l]!==void 0){const c=g2(e,l,t[l]);c&&r.push(c)}}for(;++n<r.length;){const c=e.settings.tightAttributes?r[n].charAt(r[n].length-1):void 0;n!==r.length-1&&c!=='"'&&c!=="'"&&(r[n]+=" ")}return r.join("")}function g2(e,t,r){const n=Sx(e.schema,t),l=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,c=e.settings.allowDangerousCharacters?0:1;let u=e.quote,d;if(n.overloadedBoolean&&(r===n.attribute||r==="")?r=!0:(n.boolean||n.overloadedBoolean)&&(typeof r!="string"||r===n.attribute||r==="")&&(r=!!r),r==null||r===!1||typeof r=="number"&&Number.isNaN(r))return"";const _=Kn(n.attribute,Object.assign({},e.settings.characterReferences,{subset:Jo.name[l][c]}));return r===!0||(r=Array.isArray(r)?(n.commaSeparated?Wx:Fx)(r,{padLeft:!e.settings.tightCommaSeparatedLists}):String(r),e.settings.collapseEmptyAttributes&&!r)?_:(e.settings.preferUnquoted&&(d=Kn(r,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:Jo.unquoted[l][c]}))),d!==r&&(e.settings.quoteSmart&&ay(r,u)>ay(r,e.alternative)&&(u=e.alternative),d=u+Kn(r,Object.assign({},e.settings.characterReferences,{subset:(u==="'"?Jo.single:Jo.double)[l][c],attribute:!0}))+u),_+(d&&"="+d))}const v2=["<","&"];function xS(e,t,r,n){return r&&r.type==="element"&&(r.tagName==="script"||r.tagName==="style")?e.value:Kn(e.value,Object.assign({},n.settings.characterReferences,{subset:v2}))}function y2(e,t,r,n){return n.settings.allowDangerousHtml?e.value:xS(e,t,r,n)}function S2(e,t,r,n){return n.all(e)}const b2=Ex("type",{invalid:w2,unknown:C2,handlers:{comment:Gx,doctype:qx,element:p2,raw:y2,root:S2,text:xS}});function w2(e){throw new Error("Expected node, not `"+e+"`")}function C2(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const E2={},x2={},A2=[];function k2(e,t){const r=t||E2,n=r.quote||'"',l=n==='"'?"'":'"';if(n!=='"'&&n!=="'")throw new Error("Invalid quote `"+n+"`, expected `'` or `\"`");return{one:T2,all:R2,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||_x,characterReferences:r.characterReferences||x2,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:r.space==="svg"?SS:Cx,quote:n,alternative:l}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function T2(e,t,r){return b2(e,t,r,this)}function R2(e){const t=[],r=e&&e.children||A2;let n=-1;for(;++n<r.length;)t[n]=this.one(r[n],n,e);return t.join("")}function AS(e,t){var n;if(!t)return e;e.properties||(e.properties={}),(n=e.properties).class||(n.class=[]),typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(/\s+/g)),Array.isArray(e.properties.class)||(e.properties.class=[]);const r=Array.isArray(t)?t:t.split(/\s+/g);for(const l of r)l&&!e.properties.class.includes(l)&&e.properties.class.push(l);return e}function D2(e){const t=$c(e,!0).map(([l])=>l);function r(l){if(l===e.length)return{line:t.length-1,character:t[t.length-1].length};let c=l,u=0;for(const d of t){if(c<d.length)break;c-=d.length,u++}return{line:u,character:c}}function n(l,c){let u=0;for(let d=0;d<l;d++)u+=t[d].length;return u+=c,u}return{lines:t,indexToPos:r,posToIndex:n}}function L2(e,t,r){const n=new Set;for(const c of e.matchAll(/:?lang=["']([^"']+)["']/g)){const u=c[1].toLowerCase().trim();u&&n.add(u)}for(const c of e.matchAll(/(?:```|~~~)([\w-]+)/g)){const u=c[1].toLowerCase().trim();u&&n.add(u)}for(const c of e.matchAll(/\\begin\{([\w-]+)\}/g)){const u=c[1].toLowerCase().trim();u&&n.add(u)}for(const c of e.matchAll(/<script\s+(?:type|lang)=["']([^"']+)["']/gi)){const u=c[1].toLowerCase().trim(),d=u.includes("/")?u.split("/").pop():u;d&&n.add(d)}if(!r)return Array.from(n);const l=r.getBundledLanguages();return Array.from(n).filter(c=>c&&l[c])}const p_="light-dark()",O2=["color","background-color"];function M2(e,t){let r=0;const n=[];for(const l of t)l>r&&n.push({...e,content:e.content.slice(r,l),offset:e.offset+r}),r=l;return r<e.content.length&&n.push({...e,content:e.content.slice(r),offset:e.offset+r}),n}function N2(e,t){const r=Array.from(t instanceof Set?t:new Set(t)).sort((n,l)=>n-l);return r.length?e.map(n=>n.flatMap(l=>{const c=r.filter(u=>l.offset<u&&u<l.offset+l.content.length).map(u=>u-l.offset).sort((u,d)=>u-d);return c.length?M2(l,c):l})):e}function B2(e,t,r,n,l="css-vars"){const c={content:e.content,explanation:e.explanation,offset:e.offset},u=t.map(v=>kc(e.variants[v])),d=new Set(u.flatMap(v=>Object.keys(v))),_={},f=(v,m)=>{const y=m==="color"?"":m==="background-color"?"-bg":`-${m}`;return r+t[v]+(m==="color"?"":y)};return u.forEach((v,m)=>{for(const y of d){const S=v[y]||"inherit";if(m===0&&n&&O2.includes(y))if(n===p_&&u.length>1){const b=t.findIndex(T=>T==="light"),x=t.findIndex(T=>T==="dark");if(b===-1||x===-1)throw new et('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');_[y]=`light-dark(${u[b][y]||"inherit"}, ${u[x][y]||"inherit"})`,l==="css-vars"&&(_[f(m,y)]=S)}else _[y]=S;else l==="css-vars"&&(_[f(m,y)]=S)}}),c.htmlStyle=_,c}function kc(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&Qt.Italic&&(t["font-style"]="italic"),e.fontStyle&Qt.Bold&&(t["font-weight"]="bold");const r=[];e.fontStyle&Qt.Underline&&r.push("underline"),e.fontStyle&Qt.Strikethrough&&r.push("line-through"),r.length&&(t["text-decoration"]=r.join(" "))}return t}function cf(e){return typeof e=="string"?e:Object.entries(e).map(([t,r])=>`${t}:${r}`).join(";")}function z2(){const e=new WeakMap;function t(r){if(!e.has(r.meta)){let c=function(d){if(typeof d=="number"){if(d<0||d>r.source.length)throw new et(`Invalid decoration offset: ${d}. Code length: ${r.source.length}`);return{...l.indexToPos(d),offset:d}}else{const _=l.lines[d.line];if(_===void 0)throw new et(`Invalid decoration position ${JSON.stringify(d)}. Lines length: ${l.lines.length}`);let f=d.character;if(f<0&&(f=_.length+f),f<0||f>_.length)throw new et(`Invalid decoration position ${JSON.stringify(d)}. Line ${d.line} length: ${_.length}`);return{...d,character:f,offset:l.posToIndex(d.line,f)}}};var n=c;const l=D2(r.source),u=(r.options.decorations||[]).map(d=>({...d,start:c(d.start),end:c(d.end)}));P2(u),e.set(r.meta,{decorations:u,converter:l,source:r.source})}return e.get(r.meta)}return{name:"shiki:decorations",tokens(r){var n;if((n=this.options.decorations)!=null&&n.length)return N2(r,t(this).decorations.flatMap(l=>[l.start.offset,l.end.offset]))},code(r){var v;if(!((v=this.options.decorations)!=null&&v.length))return;const n=t(this),l=Array.from(r.children).filter(m=>m.type==="element"&&m.tagName==="span");if(l.length!==n.converter.lines.length)throw new et(`Number of lines in code element (${l.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function c(m,y,S,b){const x=l[m];let T="",O=-1,H=-1;if(y===0&&(O=0),S===0&&(H=0),S===Number.POSITIVE_INFINITY&&(H=x.children.length),O===-1||H===-1)for(let I=0;I<x.children.length;I++)T+=kS(x.children[I]),O===-1&&T.length===y&&(O=I+1),H===-1&&T.length===S&&(H=I+1);if(O===-1)throw new et(`Failed to find start index for decoration ${JSON.stringify(b.start)}`);if(H===-1)throw new et(`Failed to find end index for decoration ${JSON.stringify(b.end)}`);const B=x.children.slice(O,H);if(!b.alwaysWrap&&B.length===x.children.length)d(x,b,"line");else if(!b.alwaysWrap&&B.length===1&&B[0].type==="element")d(B[0],b,"token");else{const I={type:"element",tagName:"span",properties:{},children:B};d(I,b,"wrapper"),x.children.splice(O,B.length,I)}}function u(m,y){l[m]=d(l[m],y,"line")}function d(m,y,S){var T;const b=y.properties||{},x=y.transform||(O=>O);return m.tagName=y.tagName||"span",m.properties={...m.properties,...b,class:m.properties.class},(T=y.properties)!=null&&T.class&&AS(m,y.properties.class),m=x(m,S)||m,m}const _=[],f=n.decorations.sort((m,y)=>y.start.offset-m.start.offset||m.end.offset-y.end.offset);for(const m of f){const{start:y,end:S}=m;if(y.line===S.line)c(y.line,y.character,S.character,m);else if(y.line<S.line){c(y.line,y.character,Number.POSITIVE_INFINITY,m);for(let b=y.line+1;b<S.line;b++)_.unshift(()=>u(b,m));c(S.line,0,S.character,m)}}_.forEach(m=>m())}}}function P2(e){for(let t=0;t<e.length;t++){const r=e[t];if(r.start.offset>r.end.offset)throw new et(`Invalid decoration range: ${JSON.stringify(r.start)} - ${JSON.stringify(r.end)}`);for(let n=t+1;n<e.length;n++){const l=e[n],c=r.start.offset<=l.start.offset&&l.start.offset<r.end.offset,u=r.start.offset<l.end.offset&&l.end.offset<=r.end.offset,d=l.start.offset<=r.start.offset&&r.start.offset<l.end.offset,_=l.start.offset<r.end.offset&&r.end.offset<=l.end.offset;if(c||u||d||_){if(c&&u||d&&_||d&&r.start.offset===r.end.offset||u&&l.start.offset===l.end.offset)continue;throw new et(`Decorations ${JSON.stringify(r.start)} and ${JSON.stringify(l.start)} intersect.`)}}}}function kS(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(kS).join(""):""}const I2=[z2()];function Tc(e){const t=H2(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...I2]}function H2(e){const t=[],r=[],n=[];for(const l of e)switch(l.enforce){case"pre":t.push(l);break;case"post":r.push(l);break;default:n.push(l)}return{pre:t,post:r,normal:n}}var Gs=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Td={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function U2(e,t){const r=e.indexOf("\x1B",t);if(r!==-1&&e[r+1]==="["){const n=e.indexOf("m",r);if(n!==-1)return{sequence:e.substring(r+2,n).split(";"),startPosition:r,position:n+1}}return{position:e.length}}function uy(e){const t=e.shift();if(t==="2"){const r=e.splice(0,3).map(n=>Number.parseInt(n));return r.length!==3||r.some(n=>Number.isNaN(n))?void 0:{type:"rgb",rgb:r}}else if(t==="5"){const r=e.shift();if(r)return{type:"table",index:Number(r)}}}function j2(e){const t=[];for(;e.length>0;){const r=e.shift();if(!r)continue;const n=Number.parseInt(r);if(!Number.isNaN(n))if(n===0)t.push({type:"resetAll"});else if(n<=9)Td[n]&&t.push({type:"setDecoration",value:Td[n]});else if(n<=29){const l=Td[n-20];l&&(t.push({type:"resetDecoration",value:l}),l==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Gs[n-30]}});else if(n===38){const l=uy(e);l&&t.push({type:"setForegroundColor",value:l})}else if(n===39)t.push({type:"resetForegroundColor"});else if(n<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Gs[n-40]}});else if(n===48){const l=uy(e);l&&t.push({type:"setBackgroundColor",value:l})}else n===49?t.push({type:"resetBackgroundColor"}):n===53?t.push({type:"setDecoration",value:"overline"}):n===55?t.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Gs[n-90+8]}}):n>=100&&n<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Gs[n-100+8]}})}return t}function V2(){let e=null,t=null,r=new Set;return{parse(n){const l=[];let c=0;do{const u=U2(n,c),d=u.sequence?n.substring(c,u.startPosition):n.substring(c);if(d.length>0&&l.push({value:d,foreground:e,background:t,decorations:new Set(r)}),u.sequence){const _=j2(u.sequence);for(const f of _)f.type==="resetAll"?(e=null,t=null,r.clear()):f.type==="resetForegroundColor"?e=null:f.type==="resetBackgroundColor"?t=null:f.type==="resetDecoration"&&r.delete(f.value);for(const f of _)f.type==="setForegroundColor"?e=f.value:f.type==="setBackgroundColor"?t=f.value:f.type==="setDecoration"&&r.add(f.value)}c=u.position}while(c<n.length);return l}}}var $2={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function G2(e=$2){function t(d){return e[d]}function r(d){return`#${d.map(_=>Math.max(0,Math.min(_,255)).toString(16).padStart(2,"0")).join("")}`}let n;function l(){if(n)return n;n=[];for(let f=0;f<Gs.length;f++)n.push(t(Gs[f]));let d=[0,95,135,175,215,255];for(let f=0;f<6;f++)for(let v=0;v<6;v++)for(let m=0;m<6;m++)n.push(r([d[f],d[v],d[m]]));let _=8;for(let f=0;f<24;f++,_+=10)n.push(r([_,_,_]));return n}function c(d){return l()[d]}function u(d){switch(d.type){case"named":return t(d.name);case"rgb":return r(d.rgb);case"table":return c(d.index)}}return{value:u}}const q2={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function W2(e,t,r){const n=Ac(e,r),l=$c(t),c=G2(Object.fromEntries(Gs.map(d=>{var f;const _=`terminal.ansi${d[0].toUpperCase()}${d.substring(1)}`;return[d,((f=e.colors)==null?void 0:f[_])||q2[d]]}))),u=V2();return l.map(d=>u.parse(d[0]).map(_=>{let f,v;_.decorations.has("reverse")?(f=_.background?c.value(_.background):e.bg,v=_.foreground?c.value(_.foreground):e.fg):(f=_.foreground?c.value(_.foreground):e.fg,v=_.background?c.value(_.background):void 0),f=gs(f,n),v=gs(v,n),_.decorations.has("dim")&&(f=F2(f));let m=Qt.None;return _.decorations.has("bold")&&(m|=Qt.Bold),_.decorations.has("italic")&&(m|=Qt.Italic),_.decorations.has("underline")&&(m|=Qt.Underline),_.decorations.has("strikethrough")&&(m|=Qt.Strikethrough),{content:_.value,offset:d[1],color:f,bgColor:v,fontStyle:m}}))}function F2(e){const t=e.match(/#([0-9a-f]{3,8})/i);if(t){const n=t[1];if(n.length===8){const l=Math.round(Number.parseInt(n.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${n.slice(0,6)}${l}`}else{if(n.length===6)return`#${n}80`;if(n.length===4){const l=n[0],c=n[1],u=n[2],d=n[3];return`#${l}${l}${c}${c}${u}${u}${Math.round(Number.parseInt(`${d}${d}`,16)/2).toString(16).padStart(2,"0")}`}else if(n.length===3){const l=n[0],c=n[1],u=n[2];return`#${l}${l}${c}${c}${u}${u}80`}}}const r=e.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return r?`var(${r[1]}-dim)`:e}function uf(e,t,r={}){const n=e.resolveLangAlias(r.lang||"text"),{theme:l=e.getLoadedThemes()[0]}=r;if(!jc(n)&&!Vc(l)&&n==="ansi"){const{theme:c}=e.setTheme(l);return W2(c,t,r)}return hS(e,t,r)}function Rc(e,t,r){let n,l,c,u,d,_;if("themes"in r){const{defaultColor:f="light",cssVariablePrefix:v="--shiki-",colorsRendering:m="css-vars"}=r,y=Object.entries(r.themes).filter(O=>O[1]).map(O=>({color:O[0],theme:O[1]})).sort((O,H)=>O.color===f?-1:H.color===f?1:0);if(y.length===0)throw new et("`themes` option must not be empty");const S=dS(e,t,r,uf);if(_=yl(S),f&&p_!==f&&!y.find(O=>O.color===f))throw new et(`\`themes\` option must contain the defaultColor key \`${f}\``);const b=y.map(O=>e.getTheme(O.theme)),x=y.map(O=>O.color);c=S.map(O=>O.map(H=>B2(H,x,v,f,m))),_&&Gc(c,_);const T=y.map(O=>Ac(O.theme,r));l=hy(y,b,T,v,f,"fg",m),n=hy(y,b,T,v,f,"bg",m),u=`shiki-themes ${b.map(O=>O.name).join(" ")}`,d=f?void 0:[l,n].join(";")}else if("theme"in r){const f=Ac(r.theme,r);c=uf(e,t,r);const v=e.getTheme(r.theme);n=gs(v.bg,f),l=gs(v.fg,f),u=v.name,_=yl(c)}else throw new et("Invalid options, either `theme` or `themes` must be provided");return{tokens:c,fg:l,bg:n,themeName:u,rootStyle:d,grammarState:_}}function hy(e,t,r,n,l,c,u){return e.map((d,_)=>{const f=gs(t[_][c],r[_])||"inherit",v=`${n+d.color}${c==="bg"?"-bg":""}:${f}`;if(_===0&&l){if(l===p_&&e.length>1){const m=e.findIndex(S=>S.color==="light"),y=e.findIndex(S=>S.color==="dark");if(m===-1||y===-1)throw new et('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${gs(t[m][c],r[m])||"inherit"}, ${gs(t[y][c],r[y])||"inherit"});${v}`}return f}return u==="css-vars"?v:null}).filter(d=>!!d).join(";")}function Dc(e,t,r,n={meta:{},options:r,codeToHast:(l,c)=>Dc(e,l,c),codeToTokens:(l,c)=>Rc(e,l,c)}){var b,x;let l=t;for(const T of Tc(r))l=((b=T.preprocess)==null?void 0:b.call(n,l,r))||l;let{tokens:c,fg:u,bg:d,themeName:_,rootStyle:f,grammarState:v}=Rc(e,l,r);const{mergeWhitespaces:m=!0,mergeSameStyleTokens:y=!1}=r;m===!0?c=K2(c):m==="never"&&(c=X2(c)),y&&(c=Z2(c));const S={...n,get source(){return l}};for(const T of Tc(r))c=((x=T.tokens)==null?void 0:x.call(S,c))||c;return Y2(c,{...r,fg:u,bg:d,themeName:_,rootStyle:r.rootStyle===!1?!1:r.rootStyle??f},S,v)}function Y2(e,t,r,n=yl(e)){var x,T,O,H;const l=Tc(t),c=[],u={type:"root",children:[]},{structure:d="classic",tabindex:_="0"}=t,f={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?f.style=t.rootStyle:f.style=`background-color:${t.bg};color:${t.fg}`),_!==!1&&_!=null&&(f.tabindex=_.toString());for(const[B,I]of Object.entries(t.meta||{}))B.startsWith("_")||(f[B]=I);let v={type:"element",tagName:"pre",properties:f,children:[],data:t.data},m={type:"element",tagName:"code",properties:{},children:c};const y=[],S={...r,structure:d,addClassToHast:AS,get source(){return r.source},get tokens(){return e},get options(){return t},get root(){return u},get pre(){return v},get code(){return m},get lines(){return y}};if(e.forEach((B,I)=>{var ee,ge;I&&(d==="inline"?u.children.push({type:"element",tagName:"br",properties:{},children:[]}):d==="classic"&&c.push({type:"text",value:`
|
|
61
|
+
`}));let j={type:"element",tagName:"span",properties:{class:"line"},children:[]},$=0;for(const Se of B){let _e={type:"element",tagName:"span",properties:{...Se.htmlAttrs},children:[{type:"text",value:Se.content}]};const he=cf(Se.htmlStyle||kc(Se));he&&(_e.properties.style=he);for(const J of l)_e=((ee=J==null?void 0:J.span)==null?void 0:ee.call(S,_e,I+1,$,j,Se))||_e;d==="inline"?u.children.push(_e):d==="classic"&&j.children.push(_e),$+=Se.content.length}if(d==="classic"){for(const Se of l)j=((ge=Se==null?void 0:Se.line)==null?void 0:ge.call(S,j,I+1))||j;y.push(j),c.push(j)}else d==="inline"&&y.push(j)}),d==="classic"){for(const B of l)m=((x=B==null?void 0:B.code)==null?void 0:x.call(S,m))||m;v.children.push(m);for(const B of l)v=((T=B==null?void 0:B.pre)==null?void 0:T.call(S,v))||v;u.children.push(v)}else if(d==="inline"){const B=[];let I={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const $ of u.children)$.type==="element"&&$.tagName==="br"?(B.push(I),I={type:"element",tagName:"span",properties:{class:"line"},children:[]}):($.type==="element"||$.type==="text")&&I.children.push($);B.push(I);let j={type:"element",tagName:"code",properties:{},children:B};for(const $ of l)j=((O=$==null?void 0:$.code)==null?void 0:O.call(S,j))||j;u.children=[];for(let $=0;$<j.children.length;$++){$>0&&u.children.push({type:"element",tagName:"br",properties:{},children:[]});const ee=j.children[$];ee.type==="element"&&u.children.push(...ee.children)}}let b=u;for(const B of l)b=((H=B==null?void 0:B.root)==null?void 0:H.call(S,b))||b;return n&&Gc(b,n),b}function K2(e){return e.map(t=>{const r=[];let n="",l;return t.forEach((c,u)=>{const d=!(c.fontStyle&&(c.fontStyle&Qt.Underline||c.fontStyle&Qt.Strikethrough));d&&c.content.match(/^\s+$/)&&t[u+1]?(l===void 0&&(l=c.offset),n+=c.content):n?(d?r.push({...c,offset:l,content:n+c.content}):r.push({content:n,offset:l},c),l=void 0,n=""):r.push(c)}),r})}function X2(e){return e.map(t=>t.flatMap(r=>{if(r.content.match(/^\s+$/))return r;const n=r.content.match(/^(\s*)(.*?)(\s*)$/);if(!n)return r;const[,l,c,u]=n;if(!l&&!u)return r;const d=[{...r,offset:r.offset+l.length,content:c}];return l&&d.unshift({content:l,offset:r.offset}),u&&d.push({content:u,offset:r.offset+l.length+c.length}),d}))}function Z2(e){return e.map(t=>{const r=[];for(const n of t){if(r.length===0){r.push({...n});continue}const l=r[r.length-1],c=cf(l.htmlStyle||kc(l)),u=cf(n.htmlStyle||kc(n)),d=l.fontStyle&&(l.fontStyle&Qt.Underline||l.fontStyle&Qt.Strikethrough),_=n.fontStyle&&(n.fontStyle&Qt.Underline||n.fontStyle&Qt.Strikethrough);!d&&!_&&c===u?l.content+=n.content:r.push({...n})}return r})}const Q2=k2;function J2(e,t,r){var c;const n={meta:{},options:r,codeToHast:(u,d)=>Dc(e,u,d),codeToTokens:(u,d)=>Rc(e,u,d)};let l=Q2(Dc(e,t,r,n));for(const u of Tc(r))l=((c=u.postprocess)==null?void 0:c.call(n,l,r))||l;return l}async function eA(e){const t=await sx(e);return{getLastGrammarState:(...r)=>lx(t,...r),codeToTokensBase:(r,n)=>uf(t,r,n),codeToTokensWithThemes:(r,n)=>dS(t,r,n),codeToTokens:(r,n)=>Rc(t,r,n),codeToHast:(r,n)=>Dc(t,r,n),codeToHtml:(r,n)=>J2(t,r,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function tA(e){const t=e.langs,r=e.themes,n=e.engine;async function l(c){function u(m){var y;if(typeof m=="string"){if(m=((y=c.langAlias)==null?void 0:y[m])||m,sS(m))return[];const S=t[m];if(!S)throw new et(`Language \`${m}\` is not included in this bundle. You may want to load it from external source.`);return S}return m}function d(m){if(nS(m))return"none";if(typeof m=="string"){const y=r[m];if(!y)throw new et(`Theme \`${m}\` is not included in this bundle. You may want to load it from external source.`);return y}return m}const _=(c.themes??[]).map(m=>d(m)),f=(c.langs??[]).map(m=>u(m)),v=await eA({engine:c.engine??n(),...c,themes:_,langs:f});return{...v,loadLanguage(...m){return v.loadLanguage(...m.map(u))},loadTheme(...m){return v.loadTheme(...m.map(d))},getBundledLanguages(){return t},getBundledThemes(){return r}}}return l}function iA(e){let t;async function r(n={}){if(t){const l=await t;return await Promise.all([l.loadTheme(...n.themes||[]),l.loadLanguage(...n.langs||[])]),l}else{t=e({...n,themes:[],langs:[]});const l=await t;return await Promise.all([l.loadTheme(...n.themes||[]),l.loadLanguage(...n.langs||[])]),l}}return r}function rA(e,t){const r=iA(e);async function n(l,c){var _;const u=await r({langs:[c.lang],themes:"theme"in c?[c.theme]:Object.values(c.themes)}),d=await((_=t==null?void 0:t.guessEmbeddedLanguages)==null?void 0:_.call(t,l,c.lang,u));return d&&await u.loadLanguage(...d),u}return{getSingletonHighlighter(l){return r(l)},async codeToHtml(l,c){return(await n(l,c)).codeToHtml(l,c)},async codeToHast(l,c){return(await n(l,c)).codeToHast(l,c)},async codeToTokens(l,c){return(await n(l,c)).codeToTokens(l,c)},async codeToTokensBase(l,c){return(await n(l,c)).codeToTokensBase(l,c)},async codeToTokensWithThemes(l,c){return(await n(l,c)).codeToTokensWithThemes(l,c)},async getLastGrammarState(l,c){return(await r({langs:[c.lang],themes:[c.theme]})).getLastGrammarState(l,c)}}}var sA=t_({bundledLanguages:()=>s_,bundledLanguagesAlias:()=>r_,bundledLanguagesBase:()=>i_,bundledLanguagesInfo:()=>Ic,bundledThemes:()=>a_,bundledThemesInfo:()=>n_,codeToHast:()=>RS,codeToHtml:()=>TS,codeToTokens:()=>DS,codeToTokensBase:()=>LS,codeToTokensWithThemes:()=>OS,createHighlighter:()=>Wc,getLastGrammarState:()=>NS,getSingletonHighlighter:()=>MS});const Wc=tA({langs:s_,themes:a_,engine:()=>(0,j0.createOnigurumaEngine)(C(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{codeToHtml:TS,codeToHast:RS,codeToTokens:DS,codeToTokensBase:LS,codeToTokensWithThemes:OS,getSingletonHighlighter:MS,getLastGrammarState:NS}=rA(Wc,{guessEmbeddedLanguages:L2}),dy=4294967295;var nA=class{constructor(e,t={}){Y(this,"regexps");this.patterns=e,this.options=t;const{forgiving:r=!1,cache:n,regexConstructor:l}=t;if(!l)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(c=>{if(typeof c!="string")return c;const u=n==null?void 0:n.get(c);if(u){if(u instanceof RegExp)return u;if(r)return null;throw u}try{const d=l(c);return n==null||n.set(c,d),d}catch(d){if(n==null||n.set(c,d),r)return null;throw d}})}findNextMatchSync(e,t,r){const n=typeof e=="string"?e:e.content,l=[];function c(u,d,_=0){return{index:u,captureIndices:d.indices.map(f=>f==null?{start:dy,end:dy,length:0}:{start:f[0]+_,end:f[1]+_,length:f[1]-f[0]})}}for(let u=0;u<this.regexps.length;u++){const d=this.regexps[u];if(d)try{d.lastIndex=t;const _=d.exec(n);if(!_)continue;if(_.index===t)return c(u,_,0);l.push([u,_,0])}catch(_){if(this.options.forgiving)continue;throw _}}if(l.length){const u=Math.min(...l.map(d=>d[1].index));for(const[d,_,f]of l)if(_.index===u)return c(d,_,f)}return null}};function Jn(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function aA(e,t,r){return e.has(t)||e.set(t,r),e.get(t)}const m_=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),It=String.raw;function ea(e,t){if(e==null)throw new Error(t??"Value expected");return e}const BS=It`\[\^?`,zS=`c.? | C(?:-.?)?|${It`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${It`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${It`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${It`o\{[^\}]*\}?`}|${It`\d{1,3}`}`,g_=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,ec=new RegExp(It`
|
|
62
62
|
\\ (?:
|
|
63
|
-
${
|
|
63
|
+
${zS}
|
|
64
64
|
| [gk]<[^>]*>?
|
|
65
65
|
| [gk]'[^']*'?
|
|
66
66
|
| .
|
|
@@ -77,20 +77,20 @@ Error generating stack: `+o.message+`
|
|
|
77
77
|
)?
|
|
78
78
|
| \*[^\)]*\)?
|
|
79
79
|
)?
|
|
80
|
-
| (?:${
|
|
81
|
-
| ${
|
|
80
|
+
| (?:${g_.source})+
|
|
81
|
+
| ${BS}
|
|
82
82
|
| .
|
|
83
|
-
`.replace(/\s+/g,""),"gsu"),
|
|
83
|
+
`.replace(/\s+/g,""),"gsu"),Rd=new RegExp(It`
|
|
84
84
|
\\ (?:
|
|
85
|
-
${
|
|
85
|
+
${zS}
|
|
86
86
|
| .
|
|
87
87
|
)
|
|
88
88
|
| \[:(?:\^?\p{Alpha}+|\^):\]
|
|
89
|
-
| ${
|
|
89
|
+
| ${BS}
|
|
90
90
|
| &&
|
|
91
91
|
| .
|
|
92
|
-
`.replace(/\s+/g,""),"gsu");function
|
|
93
|
-
`,n);return{lastIndex:u===-1?t.length:u}}if(/^\s$/.test(r)){const u=/\s+/y;return u.lastIndex=n,{lastIndex:u.exec(t)?u.lastIndex:n}}}if(r===".")return{token:qs("dot",r)};if(r==="^"||r==="$"){const u=e.singleline?{"^":It`\A`,$:It`\Z`}[r]:r;return{token:hy(u,r)}}return r==="|"?{token:cA(r)}:m_.test(r)?{tokens:kA(r)}:{token:Lr(Jn(r),r)}}function lA(e,t,r){const n=[dy(t[1]==="^",t)];let l=1,c;for(Td.lastIndex=r;c=Td.exec(e);){const u=c[0];if(u[0]==="["&&u[1]!==":")l++,n.push(dy(u[1]==="^",u));else if(u==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(Lr(93,u));else if(l--,n.push(uA(u)),!l)break}else{const d=oA(u);Array.isArray(d)?n.push(...d):n.push(d)}}return{tokens:n,lastIndex:Td.lastIndex||e.length}}function oA(e){if(e[0]==="\\")return MS(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!p_.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return qs("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?hA(e):e==="&&"?dA(e):Lr(Jn(e),e)}function MS(e,{inCharClass:t}){const r=e[1];if(r==="c"||r==="C")return yA(e);if("dDhHsSwW".includes(r))return wA(e);if(e.startsWith(It`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return CA(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const n=e.split(/\\x/).slice(1).map(u=>parseInt(u,16)),l=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),c=new TextEncoder;return[...l].map(u=>{const d=[...c.encode(u)].map(_=>`\\x${_.toString(16)}`).join("");return Lr(Jn(u),d)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(r==="u"||r==="x")return Lr(xA(e),e);if(fy.has(r))return Lr(fy.get(r),e);if(/\d/.test(r))return fA(t,e);if(e==="\\")throw new Error(It`Incomplete escape "\"`);if(r==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Lr(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function cA(e){return{type:"Alternator",raw:e}}function hy(e,t){return{type:"Assertion",kind:e,raw:t}}function NS(e){return{type:"Backreference",raw:e}}function Lr(e,t){return{type:"Character",value:e,raw:t}}function uA(e){return{type:"CharacterClassClose",raw:e}}function hA(e){return{type:"CharacterClassHyphen",raw:e}}function dA(e){return{type:"CharacterClassIntersector",raw:e}}function dy(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function qs(e,t,r={}){return{type:"CharacterSet",kind:e,...r,raw:t}}function BS(e,t,r={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:ea(r.flags),raw:t}}function fA(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function _A(e){return{type:"GroupClose",raw:e}}function qn(e,t,r={}){return{type:"GroupOpen",kind:e,...r,raw:t}}function pA(e,t,r,n){return{type:"NamedCallout",kind:e,tag:t,arguments:r,raw:n}}function mA(e,t,r,n){return{type:"Quantifier",kind:e,min:t,max:r,raw:n}}function gA(e){return{type:"Subroutine",raw:e}}const vA=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),fy=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function yA(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Lr(Jn(t.toUpperCase())-64,e)}function SA(e,t){let{on:r,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;n??(n="");const l=(t.getCurrentModX()||r.includes("x"))&&!n.includes("x"),c=py(r),u=py(n),d={};if(c&&(d.enable=c),u&&(d.disable=u),e.endsWith(")"))return t.replaceCurrentModX(l),BS("flags",e,{flags:d});if(e.endsWith(":"))return t.pushModX(l),t.numOpenGroups++,qn("group",e,{...(c||u)&&{flags:d}});throw new Error(`Unexpected flag modifier "${e}"`)}function bA(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:r,tag:n,args:l}=t.groups;if(!r)throw new Error(`Invalid named callout "${e}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const c=l?l.split(",").filter(v=>v!=="").map(v=>/^[+-]?\d+$/.test(v)?+v:v):[],[u,d,_]=c,f=vA.has(r)?r.toLowerCase():"custom";switch(f){case"fail":case"mismatch":case"skip":if(c.length>0)throw new Error(`Named callout arguments not allowed "${c}"`);break;case"error":if(c.length>1)throw new Error(`Named callout allows only one argument "${c}"`);if(typeof u=="string")throw new Error(`Named callout argument must be a number "${u}"`);break;case"max":if(!c.length||c.length>2)throw new Error(`Named callout must have one or two arguments "${c}"`);if(typeof u=="string"&&!/^[A-Za-z_]\w*$/.test(u))throw new Error(`Named callout argument one must be a tag or number "${u}"`);if(c.length===2&&(typeof d=="number"||!/^[<>X]$/.test(d)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${d}"`);break;case"count":case"total_count":if(c.length>1)throw new Error(`Named callout allows only one argument "${c}"`);if(c.length===1&&(typeof u=="number"||!/^[<>X]$/.test(u)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${u}"`);break;case"cmp":if(c.length!==3)throw new Error(`Named callout must have three arguments "${c}"`);if(typeof u=="string"&&!/^[A-Za-z_]\w*$/.test(u))throw new Error(`Named callout argument one must be a tag or number "${u}"`);if(typeof d=="number"||!/^(?:[<>!=]=|[<>])$/.test(d))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${d}"`);if(typeof _=="string"&&!/^[A-Za-z_]\w*$/.test(_))throw new Error(`Named callout argument three must be a tag or number "${_}"`);break;case"custom":throw new Error(`Undefined callout name "${r}"`);default:throw new Error(`Unexpected named callout kind "${f}"`)}return pA(f,n??null,(l==null?void 0:l.split(","))??null,e)}function _y(e){let t=null,r,n;if(e[0]==="{"){const{minStr:l,maxStr:c}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,u=1e5;if(+l>u||c&&+c>u)throw new Error("Quantifier value unsupported in Oniguruma");if(r=+l,n=c===void 0?+l:c===""?1/0:+c,r>n&&(t="possessive",[r,n]=[n,r]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else r=e[0]==="+"?1:0,n=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return mA(t,r,n,e)}function wA(e){const t=e[1].toLowerCase();return qs({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function CA(e){const{p:t,neg:r,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return qs("property",e,{value:n,negate:t==="P"&&!r||t==="p"&&!!r})}function py(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function EA(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let r=0;r<e.length;r++){const n=e[r];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(e.slice(r)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[r+2]==="g"?"grapheme":"word",r+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return t}function xA(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function AA(e,t){const{raw:r,inCharClass:n}=e,l=r.slice(1);if(!n&&(l!=="0"&&l.length===1||l[0]!=="0"&&+l<=t))return[NS(r)];const c=[],u=l.match(/^[0-7]+|\d/g);for(let d=0;d<u.length;d++){const _=u[d];let f;if(d===0&&_!=="8"&&_!=="9"){if(f=parseInt(_,8),f>127)throw new Error(It`Octal encoded byte above 177 unsupported "${r}"`)}else f=Jn(_);c.push(Lr(f,(d===0?"\\":"")+_))}return c}function kA(e){const t=[],r=new RegExp(m_,"gy");let n;for(;n=r.exec(e);){const l=n[0];if(l[0]==="{"){const c=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(l);if(c){const{min:u,max:d}=c.groups;if(+u>+d&&l.endsWith("?")){r.lastIndex--,t.push(_y(l.slice(0,-1)));continue}}}t.push(_y(l))}return t}function zS(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const r=e.body[0];return!t||Object.keys(t).every(n=>t[n]===r[n])}function TA(e){return RA.has(e.type)}const RA=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function PS(e,t={}){const r={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},n=nA(e,{flags:r.flags,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline}}),l=(y,S)=>{const b=n.tokens[c.nextIndex];switch(c.parent=y,c.nextIndex++,b.type){case"Alternator":return Zs();case"Assertion":return DA(b);case"Backreference":return LA(b,c);case"Character":return Fc(b.value,{useLastValid:!!S.isCheckingRangeEnd});case"CharacterClassHyphen":return OA(b,c,S);case"CharacterClassOpen":return MA(b,c,S);case"CharacterSet":return NA(b,c);case"Directive":return UA(b.kind,{flags:b.flags});case"GroupOpen":return BA(b,c,S);case"NamedCallout":return VA(b.kind,b.tag,b.arguments);case"Quantifier":return zA(b,c);case"Subroutine":return PA(b,c);default:throw new Error(`Unexpected token type "${b.type}"`)}},c={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:r.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:r.skipBackrefValidation,skipLookbehindValidation:r.skipLookbehindValidation,skipPropertyNameValidation:r.skipPropertyNameValidation,subroutines:[],tokens:n.tokens,unicodePropertyMap:r.unicodePropertyMap,walk:l},u=GA(jA(n.flags));let d=u.body[0];for(;c.nextIndex<n.tokens.length;){const y=l(d,{});y.type==="Alternative"?(u.body.push(y),d=y):d.body.push(y)}const{capturingGroups:_,hasNumberedRef:f,namedGroupsByName:v,subroutines:m}=c;if(f&&v.size&&!r.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:y}of m)if(typeof y=="number"){if(y>_.length)throw new Error("Subroutine uses a group number that's not defined");y&&(_[y-1].isSubroutined=!0)}else if(v.has(y)){if(v.get(y).length>1)throw new Error(It`Subroutine uses a duplicate group name "\g<${y}>"`);v.get(y)[0].isSubroutined=!0}else throw new Error(It`Subroutine uses a group name that's not defined "\g<${y}>"`);return u}function DA({kind:e}){return uf(ea({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===It`\B`||e===It`\Y`})}function LA({raw:e},t){const r=/^\\k[<']/.test(e),n=r?e.slice(3,-1):e.slice(1),l=(c,u=!1)=>{const d=t.capturingGroups.length;let _=!1;if(c>d)if(t.skipBackrefValidation)_=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,hf(u?d+1-c:c,{orphan:_})};if(r){const c=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(c)return l(+c.groups.num,!!c.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${e}"`);return hf(n)}return l(+n)}function OA(e,t,r){const{tokens:n,walk:l}=t,c=t.parent,u=c.body.at(-1),d=n[t.nextIndex];if(!r.isCheckingRangeEnd&&u&&u.type!=="CharacterClass"&&u.type!=="CharacterClassRange"&&d&&d.type!=="CharacterClassOpen"&&d.type!=="CharacterClassClose"&&d.type!=="CharacterClassIntersector"){const _=l(c,{...r,isCheckingRangeEnd:!0});if(u.type==="Character"&&_.type==="Character")return c.body.pop(),HA(u,_);throw new Error("Invalid character class range")}return Fc(Jn("-"))}function MA({negate:e},t,r){const{tokens:n,walk:l}=t,c=n[t.nextIndex],u=[dc()];let d=vy(c);for(;d.type!=="CharacterClassClose";){if(d.type==="CharacterClassIntersector")u.push(dc()),t.nextIndex++;else{const f=u.at(-1);f.body.push(l(f,r))}d=vy(n[t.nextIndex],c)}const _=dc({negate:e});return u.length===1?_.body=u[0].body:(_.kind="intersection",_.body=u.map(f=>f.body.length===1?f.body[0]:f)),t.nextIndex++,_}function NA({kind:e,negate:t,value:r},n){const{normalizeUnknownPropertyNames:l,skipPropertyNameValidation:c,unicodePropertyMap:u}=n;if(e==="property"){const d=Yc(r);if(p_.has(d)&&!(u!=null&&u.has(d)))e="posix",r=d;else return Wn(r,{negate:t,normalizeUnknownPropertyNames:l,skipPropertyNameValidation:c,unicodePropertyMap:u})}return e==="posix"?$A(r,{negate:t}):df(e,{negate:t})}function BA(e,t,r){const{tokens:n,capturingGroups:l,namedGroupsByName:c,skipLookbehindValidation:u,walk:d}=t,_=qA(e),f=_.type==="AbsenceFunction",v=gy(_),m=v&&_.negate;if(_.type==="CapturingGroup"&&(l.push(_),_.name&&sA(c,_.name,[]).push(_)),f&&r.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=yy(n[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")_.body.push(Zs()),t.nextIndex++;else{const S=_.body.at(-1),b=d(S,{...r,isInAbsenceFunction:r.isInAbsenceFunction||f,isInLookbehind:r.isInLookbehind||v,isInNegLookbehind:r.isInNegLookbehind||m});if(S.body.push(b),(v||r.isInLookbehind)&&!u){const E="Lookbehind includes a pattern not allowed by Oniguruma";if(m||r.isInNegLookbehind){if(my(b)||b.type==="CapturingGroup")throw new Error(E)}else if(my(b)||gy(b)&&b.negate)throw new Error(E)}}y=yy(n[t.nextIndex])}return t.nextIndex++,_}function zA({kind:e,min:t,max:r},n){const l=n.parent,c=l.body.at(-1);if(!c||!TA(c))throw new Error("Quantifier requires a repeatable token");const u=HS(e,t,r,c);return l.body.pop(),u}function PA({raw:e},t){const{capturingGroups:r,subroutines:n}=t;let l=e.slice(3,-1);const c=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(l);if(c){const d=+c.groups.num,_=r.length;if(t.hasNumberedRef=!0,l={"":d,"+":_+d,"-":_+1-d}[c.groups.sign],l<1)throw new Error("Invalid subroutine number")}else l==="0"&&(l=0);const u=US(l);return n.push(u),u}function IA(e,t){return{type:"AbsenceFunction",kind:e,body:Al(t==null?void 0:t.body)}}function Zs(e){return{type:"Alternative",body:jS(e==null?void 0:e.body)}}function uf(e,t){const r={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(r.negate=!!(t!=null&&t.negate)),r}function hf(e,t){const r=!!(t!=null&&t.orphan);return{type:"Backreference",ref:e,...r&&{orphan:r}}}function IS(e,t){const r={name:void 0,isSubroutined:!1,...t};if(r.name!==void 0&&!WA(r.name))throw new Error(`Group name "${r.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...r.name&&{name:r.name},...r.isSubroutined&&{isSubroutined:r.isSubroutined},body:Al(t==null?void 0:t.body)}}function Fc(e,t){const r={useLastValid:!1,...t};if(e>1114111){const n=e.toString(16);if(r.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${n}}"`):new Error(`Invalid code point out of range in JS "\\x{${n}}"`)}return{type:"Character",value:e}}function dc(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:jS(e==null?void 0:e.body)}}function HA(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function df(e,t){const r=!!(t!=null&&t.negate),n={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(n.negate=r),(e==="text_segment"||e==="newline"&&!r)&&(n.variableLength=!0),n}function UA(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:ea(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function jA(e){return{type:"Flags",...e}}function Ki(e){const t=e==null?void 0:e.atomic,r=e==null?void 0:e.flags;if(t&&r)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...r&&{flags:r},body:Al(e==null?void 0:e.body)}}function $s(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Al(e==null?void 0:e.body)}}function VA(e,t,r){return{type:"NamedCallout",kind:e,tag:t,arguments:r}}function $A(e,t){const r=!!(t!=null&&t.negate);if(!p_.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:r}}function HS(e,t,r,n){if(t>r)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:r,body:n}}function GA(e,t){return{type:"Regex",body:Al(t==null?void 0:t.body),flags:e}}function US(e){return{type:"Subroutine",ref:e}}function Wn(e,t){var l;const r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let n=(l=r.unicodePropertyMap)==null?void 0:l.get(Yc(e));if(!n){if(r.normalizeUnknownPropertyNames)n=FA(e);else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw new Error(It`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:n??e,negate:r.negate}}function qA({flags:e,kind:t,name:r,negate:n,number:l}){switch(t){case"absence_repeater":return IA("repeater");case"atomic":return Ki({atomic:!0});case"capturing":return IS(l,{name:r});case"group":return Ki({flags:e});case"lookahead":case"lookbehind":return $s({behind:t==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${t}"`)}}function Al(e){if(e===void 0)e=[Zs()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function jS(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function my(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function gy(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function WA(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function FA(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Yc(e){return e.replace(/[- _]+/g,"").toLowerCase()}function vy(e,t){return ea(e,`${(t==null?void 0:t.type)==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function yy(e){return ea(e,"Unclosed group")}function dl(e,t,r=null){function n(c,u){for(let d=0;d<c.length;d++){const _=l(c[d],u,d,c);d=Math.max(-1,d+_)}}function l(c,u=null,d=null,_=null){var O,H;let f=0,v=!1;const m={node:c,parent:u,key:d,container:_,root:e,remove(){tc(_).splice(Math.max(0,jn(d)+f),1),f--,v=!0},removeAllNextSiblings(){return tc(_).splice(jn(d)+1)},removeAllPrevSiblings(){const B=jn(d)+f;return f-=B,tc(_).splice(0,Math.max(0,B))},replaceWith(B,I={}){const j=!!I.traverse;_?_[Math.max(0,jn(d)+f)]=B:ea(u,"Can't replace root node")[d]=B,j&&l(B,u,d,_),v=!0},replaceWithMultiple(B,I={}){const j=!!I.traverse;if(tc(_).splice(Math.max(0,jn(d)+f),1,...B),f+=B.length-1,j){let Y=0;for(let te=0;te<B.length;te++)Y+=l(B[te],u,jn(d)+te+Y,_)}v=!0},skip(){v=!0}},{type:y}=c,S=t["*"],b=t[y],E=typeof S=="function"?S:S==null?void 0:S.enter,T=typeof b=="function"?b:b==null?void 0:b.enter;if(E==null||E(m,r),T==null||T(m,r),!v)switch(y){case"AbsenceFunction":case"CapturingGroup":case"Group":n(c.body,c);break;case"Alternative":case"CharacterClass":n(c.body,c);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":l(c.min,c,"min"),l(c.max,c,"max");break;case"LookaroundAssertion":n(c.body,c);break;case"Quantifier":l(c.body,c,"body");break;case"Regex":n(c.body,c),l(c.flags,c,"flags");break;default:throw new Error(`Unexpected node type "${y}"`)}return(O=b==null?void 0:b.exit)==null||O.call(b,m,r),(H=S==null?void 0:S.exit)==null||H.call(S,m,r),f}return l(e),e}function tc(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function jn(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const YA=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function KA(e,t){for(let r=0;r<e.length;r++)e[r]>=t&&e[r]++}function XA(e,t,r,n){return e.slice(0,t)+n+e.slice(t+r.length)}const Vi=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function g_(e,t,r,n){const l=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),c=[!1];let u=0,d="";for(const _ of e.matchAll(l)){const{0:f,groups:{$skip:v}}=_;if(!v&&(!n||n===Vi.DEFAULT==!u)){r instanceof Function?d+=r(_,{context:u?Vi.CHAR_CLASS:Vi.DEFAULT,negated:c[c.length-1]}):d+=r;continue}f[0]==="["?(u++,c.push(f[1]==="^")):f==="]"&&u&&(u--,c.pop()),d+=f}return d}function VS(e,t,r,n){g_(e,t,r,n)}function ZA(e,t,r=0,n){if(!new RegExp(t,"su").test(e))return null;const l=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");l.lastIndex=r;let c=0,u;for(;u=l.exec(e);){const{0:d,groups:{$skip:_}}=u;if(!_&&(!n||n===Vi.DEFAULT==!c))return u;d==="["?c++:d==="]"&&c&&c--,l.lastIndex==u.index&&l.lastIndex++}return null}function ic(e,t,r){return!!ZA(e,t,0,r)}function QA(e,t){const r=/\\?./gsu;r.lastIndex=t;let n=e.length,l=0,c=1,u;for(;u=r.exec(e);){const[d]=u;if(d==="[")l++;else if(l)d==="]"&&l--;else if(d==="(")c++;else if(d===")"&&(c--,!c)){n=u.index;break}}return e.slice(t,n)}const Sy=new RegExp(String.raw`(?<noncapturingStart>${YA})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function JA(e,t){const r=(t==null?void 0:t.hiddenCaptures)??[];let n=(t==null?void 0:t.captureTransfers)??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:n,hiddenCaptures:r};const l="(?>",c="(?:(?=(",u=[0],d=[];let _=0,f=0,v=NaN,m;do{m=!1;let y=0,S=0,b=!1,E;for(Sy.lastIndex=Number.isNaN(v)?0:v+c.length;E=Sy.exec(e);){const{0:T,index:O,groups:{capturingStart:H,noncapturingStart:B}}=E;if(T==="[")y++;else if(y)T==="]"&&y--;else if(T===l&&!b)v=O,b=!0;else if(b&&B)S++;else if(H)b?S++:(_++,u.push(_+f));else if(T===")"&&b){if(!S){f++;const I=_+f;if(e=`${e.slice(0,v)}${c}${e.slice(v+l.length,O)}))<$$${I}>)${e.slice(O+1)}`,m=!0,d.push(I),KA(r,I),n.size){const j=new Map;n.forEach((Y,te)=>{j.set(te>=I?te+1:te,Y.map(ge=>ge>=I?ge+1:ge))}),n=j}break}S--}}}while(m);return r.push(...d),e=g_(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:S,wrappedBackrefNum:b}})=>{if(S){const E=+S;if(E>u.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${u[E]}`}return`\\${b}`},Vi.DEFAULT),{pattern:e,captureTransfers:n,hiddenCaptures:r}}const $S=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Rd=new RegExp(String.raw`
|
|
92
|
+
`.replace(/\s+/g,""),"gsu");function lA(e,t={}){const r={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const n=AA(r.flags),l=[n.extended],c={captureGroup:r.rules.captureGroup,getCurrentModX(){return l.at(-1)},numOpenGroups:0,popModX(){l.pop()},pushModX(m){l.push(m)},replaceCurrentModX(m){l[l.length-1]=m},singleline:r.rules.singleline};let u=[],d;for(ec.lastIndex=0;d=ec.exec(e);){const m=oA(c,e,d[0],ec.lastIndex);m.tokens?u.push(...m.tokens):m.token&&u.push(m.token),m.lastIndex!==void 0&&(ec.lastIndex=m.lastIndex)}const _=[];let f=0;u.filter(m=>m.type==="GroupOpen").forEach(m=>{m.kind==="capturing"?m.number=++f:m.raw==="("&&_.push(m)}),f||_.forEach((m,y)=>{m.kind="capturing",m.number=y+1});const v=f||_.length;return{tokens:u.map(m=>m.type==="EscapedNumber"?TA(m,v):m).flat(),flags:n}}function oA(e,t,r,n){const[l,c]=r;if(r==="["||r==="[^"){const u=cA(t,r,n);return{tokens:u.tokens,lastIndex:u.lastIndex}}if(l==="\\"){if("AbBGyYzZ".includes(c))return{token:fy(r,r)};if(/^\\g[<']/.test(r)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:yA(r)}}if(/^\\k[<']/.test(r)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(r))throw new Error(`Invalid group name "${r}"`);return{token:IS(r)}}if(c==="K")return{token:HS("keep",r)};if(c==="N"||c==="R")return{token:qs("newline",r,{negate:c==="N"})};if(c==="O")return{token:qs("any",r)};if(c==="X")return{token:qs("text_segment",r)};const u=PS(r,{inCharClass:!1});return Array.isArray(u)?{tokens:u}:{token:u}}if(l==="("){if(c==="*")return{token:CA(r)};if(r==="(?{")throw new Error(`Unsupported callout "${r}"`);if(r.startsWith("(?#")){if(t[n]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:n+1}}if(/^\(\?[-imx]+[:)]$/.test(r))return{token:wA(r,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,r==="("&&!e.captureGroup||r==="(?:")return{token:qn("group",r)};if(r==="(?>")return{token:qn("atomic",r)};if(r==="(?="||r==="(?!"||r==="(?<="||r==="(?<!")return{token:qn(r[2]==="<"?"lookbehind":"lookahead",r,{negate:r.endsWith("!")})};if(r==="("&&e.captureGroup||r.startsWith("(?<")&&r.endsWith(">")||r.startsWith("(?'")&&r.endsWith("'"))return{token:qn("capturing",r,{...r!=="("&&{name:r.slice(3,-1)}})};if(r.startsWith("(?~")){if(r==="(?~|")throw new Error(`Unsupported absence function kind "${r}"`);return{token:qn("absence_repeater",r)}}throw r==="(?("?new Error(`Unsupported conditional "${r}"`):new Error(`Invalid or unsupported group option "${r}"`)}if(r===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:mA(r)}}if(e.getCurrentModX()){if(r==="#"){const u=t.indexOf(`
|
|
93
|
+
`,n);return{lastIndex:u===-1?t.length:u}}if(/^\s$/.test(r)){const u=/\s+/y;return u.lastIndex=n,{lastIndex:u.exec(t)?u.lastIndex:n}}}if(r===".")return{token:qs("dot",r)};if(r==="^"||r==="$"){const u=e.singleline?{"^":It`\A`,$:It`\Z`}[r]:r;return{token:fy(u,r)}}return r==="|"?{token:hA(r)}:g_.test(r)?{tokens:RA(r)}:{token:Lr(Jn(r),r)}}function cA(e,t,r){const n=[_y(t[1]==="^",t)];let l=1,c;for(Rd.lastIndex=r;c=Rd.exec(e);){const u=c[0];if(u[0]==="["&&u[1]!==":")l++,n.push(_y(u[1]==="^",u));else if(u==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(Lr(93,u));else if(l--,n.push(dA(u)),!l)break}else{const d=uA(u);Array.isArray(d)?n.push(...d):n.push(d)}}return{tokens:n,lastIndex:Rd.lastIndex||e.length}}function uA(e){if(e[0]==="\\")return PS(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!m_.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return qs("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?fA(e):e==="&&"?_A(e):Lr(Jn(e),e)}function PS(e,{inCharClass:t}){const r=e[1];if(r==="c"||r==="C")return bA(e);if("dDhHsSwW".includes(r))return EA(e);if(e.startsWith(It`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return xA(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const n=e.split(/\\x/).slice(1).map(u=>parseInt(u,16)),l=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),c=new TextEncoder;return[...l].map(u=>{const d=[...c.encode(u)].map(_=>`\\x${_.toString(16)}`).join("");return Lr(Jn(u),d)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(r==="u"||r==="x")return Lr(kA(e),e);if(py.has(r))return Lr(py.get(r),e);if(/\d/.test(r))return pA(t,e);if(e==="\\")throw new Error(It`Incomplete escape "\"`);if(r==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Lr(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function hA(e){return{type:"Alternator",raw:e}}function fy(e,t){return{type:"Assertion",kind:e,raw:t}}function IS(e){return{type:"Backreference",raw:e}}function Lr(e,t){return{type:"Character",value:e,raw:t}}function dA(e){return{type:"CharacterClassClose",raw:e}}function fA(e){return{type:"CharacterClassHyphen",raw:e}}function _A(e){return{type:"CharacterClassIntersector",raw:e}}function _y(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function qs(e,t,r={}){return{type:"CharacterSet",kind:e,...r,raw:t}}function HS(e,t,r={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:ea(r.flags),raw:t}}function pA(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function mA(e){return{type:"GroupClose",raw:e}}function qn(e,t,r={}){return{type:"GroupOpen",kind:e,...r,raw:t}}function gA(e,t,r,n){return{type:"NamedCallout",kind:e,tag:t,arguments:r,raw:n}}function vA(e,t,r,n){return{type:"Quantifier",kind:e,min:t,max:r,raw:n}}function yA(e){return{type:"Subroutine",raw:e}}const SA=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),py=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function bA(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Lr(Jn(t.toUpperCase())-64,e)}function wA(e,t){let{on:r,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;n??(n="");const l=(t.getCurrentModX()||r.includes("x"))&&!n.includes("x"),c=gy(r),u=gy(n),d={};if(c&&(d.enable=c),u&&(d.disable=u),e.endsWith(")"))return t.replaceCurrentModX(l),HS("flags",e,{flags:d});if(e.endsWith(":"))return t.pushModX(l),t.numOpenGroups++,qn("group",e,{...(c||u)&&{flags:d}});throw new Error(`Unexpected flag modifier "${e}"`)}function CA(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:r,tag:n,args:l}=t.groups;if(!r)throw new Error(`Invalid named callout "${e}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const c=l?l.split(",").filter(v=>v!=="").map(v=>/^[+-]?\d+$/.test(v)?+v:v):[],[u,d,_]=c,f=SA.has(r)?r.toLowerCase():"custom";switch(f){case"fail":case"mismatch":case"skip":if(c.length>0)throw new Error(`Named callout arguments not allowed "${c}"`);break;case"error":if(c.length>1)throw new Error(`Named callout allows only one argument "${c}"`);if(typeof u=="string")throw new Error(`Named callout argument must be a number "${u}"`);break;case"max":if(!c.length||c.length>2)throw new Error(`Named callout must have one or two arguments "${c}"`);if(typeof u=="string"&&!/^[A-Za-z_]\w*$/.test(u))throw new Error(`Named callout argument one must be a tag or number "${u}"`);if(c.length===2&&(typeof d=="number"||!/^[<>X]$/.test(d)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${d}"`);break;case"count":case"total_count":if(c.length>1)throw new Error(`Named callout allows only one argument "${c}"`);if(c.length===1&&(typeof u=="number"||!/^[<>X]$/.test(u)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${u}"`);break;case"cmp":if(c.length!==3)throw new Error(`Named callout must have three arguments "${c}"`);if(typeof u=="string"&&!/^[A-Za-z_]\w*$/.test(u))throw new Error(`Named callout argument one must be a tag or number "${u}"`);if(typeof d=="number"||!/^(?:[<>!=]=|[<>])$/.test(d))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${d}"`);if(typeof _=="string"&&!/^[A-Za-z_]\w*$/.test(_))throw new Error(`Named callout argument three must be a tag or number "${_}"`);break;case"custom":throw new Error(`Undefined callout name "${r}"`);default:throw new Error(`Unexpected named callout kind "${f}"`)}return gA(f,n??null,(l==null?void 0:l.split(","))??null,e)}function my(e){let t=null,r,n;if(e[0]==="{"){const{minStr:l,maxStr:c}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,u=1e5;if(+l>u||c&&+c>u)throw new Error("Quantifier value unsupported in Oniguruma");if(r=+l,n=c===void 0?+l:c===""?1/0:+c,r>n&&(t="possessive",[r,n]=[n,r]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else r=e[0]==="+"?1:0,n=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return vA(t,r,n,e)}function EA(e){const t=e[1].toLowerCase();return qs({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function xA(e){const{p:t,neg:r,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return qs("property",e,{value:n,negate:t==="P"&&!r||t==="p"&&!!r})}function gy(e){const t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function AA(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let r=0;r<e.length;r++){const n=e[r];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(e.slice(r)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[r+2]==="g"?"grapheme":"word",r+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return t}function kA(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function TA(e,t){const{raw:r,inCharClass:n}=e,l=r.slice(1);if(!n&&(l!=="0"&&l.length===1||l[0]!=="0"&&+l<=t))return[IS(r)];const c=[],u=l.match(/^[0-7]+|\d/g);for(let d=0;d<u.length;d++){const _=u[d];let f;if(d===0&&_!=="8"&&_!=="9"){if(f=parseInt(_,8),f>127)throw new Error(It`Octal encoded byte above 177 unsupported "${r}"`)}else f=Jn(_);c.push(Lr(f,(d===0?"\\":"")+_))}return c}function RA(e){const t=[],r=new RegExp(g_,"gy");let n;for(;n=r.exec(e);){const l=n[0];if(l[0]==="{"){const c=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(l);if(c){const{min:u,max:d}=c.groups;if(+u>+d&&l.endsWith("?")){r.lastIndex--,t.push(my(l.slice(0,-1)));continue}}}t.push(my(l))}return t}function US(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const r=e.body[0];return!t||Object.keys(t).every(n=>t[n]===r[n])}function DA(e){return LA.has(e.type)}const LA=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function jS(e,t={}){const r={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},n=lA(e,{flags:r.flags,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline}}),l=(y,S)=>{const b=n.tokens[c.nextIndex];switch(c.parent=y,c.nextIndex++,b.type){case"Alternator":return Zs();case"Assertion":return OA(b);case"Backreference":return MA(b,c);case"Character":return Fc(b.value,{useLastValid:!!S.isCheckingRangeEnd});case"CharacterClassHyphen":return NA(b,c,S);case"CharacterClassOpen":return BA(b,c,S);case"CharacterSet":return zA(b,c);case"Directive":return VA(b.kind,{flags:b.flags});case"GroupOpen":return PA(b,c,S);case"NamedCallout":return GA(b.kind,b.tag,b.arguments);case"Quantifier":return IA(b,c);case"Subroutine":return HA(b,c);default:throw new Error(`Unexpected token type "${b.type}"`)}},c={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:r.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:r.skipBackrefValidation,skipLookbehindValidation:r.skipLookbehindValidation,skipPropertyNameValidation:r.skipPropertyNameValidation,subroutines:[],tokens:n.tokens,unicodePropertyMap:r.unicodePropertyMap,walk:l},u=WA($A(n.flags));let d=u.body[0];for(;c.nextIndex<n.tokens.length;){const y=l(d,{});y.type==="Alternative"?(u.body.push(y),d=y):d.body.push(y)}const{capturingGroups:_,hasNumberedRef:f,namedGroupsByName:v,subroutines:m}=c;if(f&&v.size&&!r.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:y}of m)if(typeof y=="number"){if(y>_.length)throw new Error("Subroutine uses a group number that's not defined");y&&(_[y-1].isSubroutined=!0)}else if(v.has(y)){if(v.get(y).length>1)throw new Error(It`Subroutine uses a duplicate group name "\g<${y}>"`);v.get(y)[0].isSubroutined=!0}else throw new Error(It`Subroutine uses a group name that's not defined "\g<${y}>"`);return u}function OA({kind:e}){return hf(ea({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===It`\B`||e===It`\Y`})}function MA({raw:e},t){const r=/^\\k[<']/.test(e),n=r?e.slice(3,-1):e.slice(1),l=(c,u=!1)=>{const d=t.capturingGroups.length;let _=!1;if(c>d)if(t.skipBackrefValidation)_=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,df(u?d+1-c:c,{orphan:_})};if(r){const c=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(c)return l(+c.groups.num,!!c.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${e}"`);return df(n)}return l(+n)}function NA(e,t,r){const{tokens:n,walk:l}=t,c=t.parent,u=c.body.at(-1),d=n[t.nextIndex];if(!r.isCheckingRangeEnd&&u&&u.type!=="CharacterClass"&&u.type!=="CharacterClassRange"&&d&&d.type!=="CharacterClassOpen"&&d.type!=="CharacterClassClose"&&d.type!=="CharacterClassIntersector"){const _=l(c,{...r,isCheckingRangeEnd:!0});if(u.type==="Character"&&_.type==="Character")return c.body.pop(),jA(u,_);throw new Error("Invalid character class range")}return Fc(Jn("-"))}function BA({negate:e},t,r){const{tokens:n,walk:l}=t,c=n[t.nextIndex],u=[dc()];let d=Sy(c);for(;d.type!=="CharacterClassClose";){if(d.type==="CharacterClassIntersector")u.push(dc()),t.nextIndex++;else{const f=u.at(-1);f.body.push(l(f,r))}d=Sy(n[t.nextIndex],c)}const _=dc({negate:e});return u.length===1?_.body=u[0].body:(_.kind="intersection",_.body=u.map(f=>f.body.length===1?f.body[0]:f)),t.nextIndex++,_}function zA({kind:e,negate:t,value:r},n){const{normalizeUnknownPropertyNames:l,skipPropertyNameValidation:c,unicodePropertyMap:u}=n;if(e==="property"){const d=Yc(r);if(m_.has(d)&&!(u!=null&&u.has(d)))e="posix",r=d;else return Wn(r,{negate:t,normalizeUnknownPropertyNames:l,skipPropertyNameValidation:c,unicodePropertyMap:u})}return e==="posix"?qA(r,{negate:t}):ff(e,{negate:t})}function PA(e,t,r){const{tokens:n,capturingGroups:l,namedGroupsByName:c,skipLookbehindValidation:u,walk:d}=t,_=FA(e),f=_.type==="AbsenceFunction",v=yy(_),m=v&&_.negate;if(_.type==="CapturingGroup"&&(l.push(_),_.name&&aA(c,_.name,[]).push(_)),f&&r.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let y=by(n[t.nextIndex]);for(;y.type!=="GroupClose";){if(y.type==="Alternator")_.body.push(Zs()),t.nextIndex++;else{const S=_.body.at(-1),b=d(S,{...r,isInAbsenceFunction:r.isInAbsenceFunction||f,isInLookbehind:r.isInLookbehind||v,isInNegLookbehind:r.isInNegLookbehind||m});if(S.body.push(b),(v||r.isInLookbehind)&&!u){const x="Lookbehind includes a pattern not allowed by Oniguruma";if(m||r.isInNegLookbehind){if(vy(b)||b.type==="CapturingGroup")throw new Error(x)}else if(vy(b)||yy(b)&&b.negate)throw new Error(x)}}y=by(n[t.nextIndex])}return t.nextIndex++,_}function IA({kind:e,min:t,max:r},n){const l=n.parent,c=l.body.at(-1);if(!c||!DA(c))throw new Error("Quantifier requires a repeatable token");const u=$S(e,t,r,c);return l.body.pop(),u}function HA({raw:e},t){const{capturingGroups:r,subroutines:n}=t;let l=e.slice(3,-1);const c=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(l);if(c){const d=+c.groups.num,_=r.length;if(t.hasNumberedRef=!0,l={"":d,"+":_+d,"-":_+1-d}[c.groups.sign],l<1)throw new Error("Invalid subroutine number")}else l==="0"&&(l=0);const u=GS(l);return n.push(u),u}function UA(e,t){return{type:"AbsenceFunction",kind:e,body:kl(t==null?void 0:t.body)}}function Zs(e){return{type:"Alternative",body:qS(e==null?void 0:e.body)}}function hf(e,t){const r={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(r.negate=!!(t!=null&&t.negate)),r}function df(e,t){const r=!!(t!=null&&t.orphan);return{type:"Backreference",ref:e,...r&&{orphan:r}}}function VS(e,t){const r={name:void 0,isSubroutined:!1,...t};if(r.name!==void 0&&!YA(r.name))throw new Error(`Group name "${r.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...r.name&&{name:r.name},...r.isSubroutined&&{isSubroutined:r.isSubroutined},body:kl(t==null?void 0:t.body)}}function Fc(e,t){const r={useLastValid:!1,...t};if(e>1114111){const n=e.toString(16);if(r.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${n}}"`):new Error(`Invalid code point out of range in JS "\\x{${n}}"`)}return{type:"Character",value:e}}function dc(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:qS(e==null?void 0:e.body)}}function jA(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function ff(e,t){const r=!!(t!=null&&t.negate),n={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(n.negate=r),(e==="text_segment"||e==="newline"&&!r)&&(n.variableLength=!0),n}function VA(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:ea(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function $A(e){return{type:"Flags",...e}}function Ki(e){const t=e==null?void 0:e.atomic,r=e==null?void 0:e.flags;if(t&&r)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...r&&{flags:r},body:kl(e==null?void 0:e.body)}}function $s(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:kl(e==null?void 0:e.body)}}function GA(e,t,r){return{type:"NamedCallout",kind:e,tag:t,arguments:r}}function qA(e,t){const r=!!(t!=null&&t.negate);if(!m_.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:r}}function $S(e,t,r,n){if(t>r)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:r,body:n}}function WA(e,t){return{type:"Regex",body:kl(t==null?void 0:t.body),flags:e}}function GS(e){return{type:"Subroutine",ref:e}}function Wn(e,t){var l;const r={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let n=(l=r.unicodePropertyMap)==null?void 0:l.get(Yc(e));if(!n){if(r.normalizeUnknownPropertyNames)n=KA(e);else if(r.unicodePropertyMap&&!r.skipPropertyNameValidation)throw new Error(It`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:n??e,negate:r.negate}}function FA({flags:e,kind:t,name:r,negate:n,number:l}){switch(t){case"absence_repeater":return UA("repeater");case"atomic":return Ki({atomic:!0});case"capturing":return VS(l,{name:r});case"group":return Ki({flags:e});case"lookahead":case"lookbehind":return $s({behind:t==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${t}"`)}}function kl(e){if(e===void 0)e=[Zs()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function qS(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function vy(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function yy(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function YA(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function KA(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function Yc(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Sy(e,t){return ea(e,`${(t==null?void 0:t.type)==="Character"&&t.value===93?"Empty":"Unclosed"} character class`)}function by(e){return ea(e,"Unclosed group")}function fl(e,t,r=null){function n(c,u){for(let d=0;d<c.length;d++){const _=l(c[d],u,d,c);d=Math.max(-1,d+_)}}function l(c,u=null,d=null,_=null){var O,H;let f=0,v=!1;const m={node:c,parent:u,key:d,container:_,root:e,remove(){tc(_).splice(Math.max(0,jn(d)+f),1),f--,v=!0},removeAllNextSiblings(){return tc(_).splice(jn(d)+1)},removeAllPrevSiblings(){const B=jn(d)+f;return f-=B,tc(_).splice(0,Math.max(0,B))},replaceWith(B,I={}){const j=!!I.traverse;_?_[Math.max(0,jn(d)+f)]=B:ea(u,"Can't replace root node")[d]=B,j&&l(B,u,d,_),v=!0},replaceWithMultiple(B,I={}){const j=!!I.traverse;if(tc(_).splice(Math.max(0,jn(d)+f),1,...B),f+=B.length-1,j){let $=0;for(let ee=0;ee<B.length;ee++)$+=l(B[ee],u,jn(d)+ee+$,_)}v=!0},skip(){v=!0}},{type:y}=c,S=t["*"],b=t[y],x=typeof S=="function"?S:S==null?void 0:S.enter,T=typeof b=="function"?b:b==null?void 0:b.enter;if(x==null||x(m,r),T==null||T(m,r),!v)switch(y){case"AbsenceFunction":case"CapturingGroup":case"Group":n(c.body,c);break;case"Alternative":case"CharacterClass":n(c.body,c);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":l(c.min,c,"min"),l(c.max,c,"max");break;case"LookaroundAssertion":n(c.body,c);break;case"Quantifier":l(c.body,c,"body");break;case"Regex":n(c.body,c),l(c.flags,c,"flags");break;default:throw new Error(`Unexpected node type "${y}"`)}return(O=b==null?void 0:b.exit)==null||O.call(b,m,r),(H=S==null?void 0:S.exit)==null||H.call(S,m,r),f}return l(e),e}function tc(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function jn(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const XA=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function ZA(e,t){for(let r=0;r<e.length;r++)e[r]>=t&&e[r]++}function QA(e,t,r,n){return e.slice(0,t)+n+e.slice(t+r.length)}const Vi=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function v_(e,t,r,n){const l=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),c=[!1];let u=0,d="";for(const _ of e.matchAll(l)){const{0:f,groups:{$skip:v}}=_;if(!v&&(!n||n===Vi.DEFAULT==!u)){r instanceof Function?d+=r(_,{context:u?Vi.CHAR_CLASS:Vi.DEFAULT,negated:c[c.length-1]}):d+=r;continue}f[0]==="["?(u++,c.push(f[1]==="^")):f==="]"&&u&&(u--,c.pop()),d+=f}return d}function WS(e,t,r,n){v_(e,t,r,n)}function JA(e,t,r=0,n){if(!new RegExp(t,"su").test(e))return null;const l=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");l.lastIndex=r;let c=0,u;for(;u=l.exec(e);){const{0:d,groups:{$skip:_}}=u;if(!_&&(!n||n===Vi.DEFAULT==!c))return u;d==="["?c++:d==="]"&&c&&c--,l.lastIndex==u.index&&l.lastIndex++}return null}function ic(e,t,r){return!!JA(e,t,0,r)}function ek(e,t){const r=/\\?./gsu;r.lastIndex=t;let n=e.length,l=0,c=1,u;for(;u=r.exec(e);){const[d]=u;if(d==="[")l++;else if(l)d==="]"&&l--;else if(d==="(")c++;else if(d===")"&&(c--,!c)){n=u.index;break}}return e.slice(t,n)}const wy=new RegExp(String.raw`(?<noncapturingStart>${XA})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function tk(e,t){const r=(t==null?void 0:t.hiddenCaptures)??[];let n=(t==null?void 0:t.captureTransfers)??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:n,hiddenCaptures:r};const l="(?>",c="(?:(?=(",u=[0],d=[];let _=0,f=0,v=NaN,m;do{m=!1;let y=0,S=0,b=!1,x;for(wy.lastIndex=Number.isNaN(v)?0:v+c.length;x=wy.exec(e);){const{0:T,index:O,groups:{capturingStart:H,noncapturingStart:B}}=x;if(T==="[")y++;else if(y)T==="]"&&y--;else if(T===l&&!b)v=O,b=!0;else if(b&&B)S++;else if(H)b?S++:(_++,u.push(_+f));else if(T===")"&&b){if(!S){f++;const I=_+f;if(e=`${e.slice(0,v)}${c}${e.slice(v+l.length,O)}))<$$${I}>)${e.slice(O+1)}`,m=!0,d.push(I),ZA(r,I),n.size){const j=new Map;n.forEach(($,ee)=>{j.set(ee>=I?ee+1:ee,$.map(ge=>ge>=I?ge+1:ge))}),n=j}break}S--}}}while(m);return r.push(...d),e=v_(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:y,groups:{backrefNum:S,wrappedBackrefNum:b}})=>{if(S){const x=+S;if(x>u.length-1)throw new Error(`Backref "${y}" greater than number of captures`);return`\\${u[x]}`}return`\\${b}`},Vi.DEFAULT),{pattern:e,captureTransfers:n,hiddenCaptures:r}}const FS=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Dd=new RegExp(String.raw`
|
|
94
94
|
\\(?: \d+
|
|
95
95
|
| c[A-Za-z]
|
|
96
96
|
| [gk]<[^>]+>
|
|
@@ -103,9 +103,9 @@ Error generating stack: `+o.message+`
|
|
|
103
103
|
| [A-Za-z\-]+:
|
|
104
104
|
| \(DEFINE\)
|
|
105
105
|
))?
|
|
106
|
-
| (?<qBase>${
|
|
106
|
+
| (?<qBase>${FS})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
|
|
107
107
|
| \\?.
|
|
108
|
-
`.replace(/\s+/g,""),"gsu");function
|
|
108
|
+
`.replace(/\s+/g,""),"gsu");function ik(e){if(!new RegExp(`${FS}\\+`).test(e))return{pattern:e};const t=[];let r=null,n=null,l="",c=0,u;for(Dd.lastIndex=0;u=Dd.exec(e);){const{0:d,index:_,groups:{qBase:f,qMod:v,invalidQ:m}}=u;if(d==="[")c||(n=_),c++;else if(d==="]")c?c--:n=null;else if(!c)if(v==="+"&&l&&!l.startsWith("(")){if(m)throw new Error(`Invalid quantifier "${d}"`);let y=-1;if(/^\{\d+\}$/.test(f))e=QA(e,_+f.length,v,"");else{if(l===")"||l==="]"){const S=l===")"?r:n;if(S===null)throw new Error(`Invalid unmatched "${l}"`);e=`${e.slice(0,S)}(?>${e.slice(S,_)}${f})${e.slice(_+d.length)}`}else e=`${e.slice(0,_-l.length)}(?>${l}${f})${e.slice(_+d.length)}`;y+=4}Dd.lastIndex+=y}else d[0]==="("?t.push(_):d===")"&&(r=t.length?t.pop():null);l=d}return{pattern:e}}const ji=String.raw,rk=ji`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,_f=ji`\(\?R=(?<rDepth>[^\)]+)\)|${rk}`,Kc=ji`\(\?<(?![=!])(?<captureName>[^>]+)>`,YS=ji`${Kc}|(?<unnamed>\()(?!\?)`,Hs=new RegExp(ji`${Kc}|${_f}|\(\?|\\?.`,"gsu"),Ld="Cannot use multiple overlapping recursions";function sk(e,t){const{hiddenCaptures:r,mode:n}={hiddenCaptures:[],mode:"plugin",...t};let l=(t==null?void 0:t.captureTransfers)??new Map;if(!new RegExp(_f,"su").test(e))return{pattern:e,captureTransfers:l,hiddenCaptures:r};if(n==="plugin"&&ic(e,ji`\(\?\(DEFINE\)`,Vi.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const c=[],u=ic(e,ji`\\[1-9]`,Vi.DEFAULT),d=new Map,_=[];let f=!1,v=0,m=0,y;for(Hs.lastIndex=0;y=Hs.exec(e);){const{0:S,groups:{captureName:b,rDepth:x,gRNameOrNum:T,gRDepth:O}}=y;if(S==="[")v++;else if(v)S==="]"&&v--;else if(x){if(Cy(x),f)throw new Error(Ld);if(u)throw new Error(`${n==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const H=e.slice(0,y.index),B=e.slice(Hs.lastIndex);if(ic(B,_f,Vi.DEFAULT))throw new Error(Ld);const I=+x-1;e=Ey(H,B,I,!1,r,c,m),l=Ay(l,H,I,c.length,0,m);break}else if(T){Cy(O);let H=!1;for(const J of _)if(J.name===T||J.num===+T){if(H=!0,J.hasRecursedWithin)throw new Error(Ld);break}if(!H)throw new Error(ji`Recursive \g cannot be used outside the referenced group "${n==="external"?T:ji`\g<${T}&R=${O}>`}"`);const B=d.get(T),I=ek(e,B);if(u&&ic(I,ji`${Kc}|\((?!\?)`,Vi.DEFAULT))throw new Error(`${n==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const j=e.slice(B,y.index),$=I.slice(j.length+S.length),ee=c.length,ge=+O-1,Se=Ey(j,$,ge,!0,r,c,m);l=Ay(l,j,ge,c.length-ee,ee,m);const _e=e.slice(0,B),he=e.slice(B+I.length);e=`${_e}${Se}${he}`,Hs.lastIndex+=Se.length-S.length-j.length-$.length,_.forEach(J=>J.hasRecursedWithin=!0),f=!0}else if(b)m++,d.set(String(m),Hs.lastIndex),d.set(b,Hs.lastIndex),_.push({num:m,name:b});else if(S[0]==="("){const H=S==="(";H&&(m++,d.set(String(m),Hs.lastIndex)),_.push(H?{num:m}:{})}else S===")"&&_.pop()}return r.push(...c),{pattern:e,captureTransfers:l,hiddenCaptures:r}}function Cy(e){const t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function Ey(e,t,r,n,l,c,u){const d=new Set;n&&WS(e+t,Kc,({groups:{captureName:f}})=>{d.add(f)},Vi.DEFAULT);const _=[r,n?d:null,l,c,u];return`${e}${xy(`(?:${e}`,"forward",..._)}(?:)${xy(`${t})`,"backward",..._)}${t}`}function xy(e,t,r,n,l,c,u){const _=v=>t==="forward"?v+2:r-v+2-1;let f="";for(let v=0;v<r;v++){const m=_(v);f+=v_(e,ji`${YS}|\\k<(?<backref>[^>]+)>`,({0:y,groups:{captureName:S,unnamed:b,backref:x}})=>{if(x&&n&&!n.has(x))return y;const T=`_$${m}`;if(b||S){const O=u+c.length+1;return c.push(O),nk(l,O),b?y:`(?<${S}${T}>`}return ji`\k<${x}${T}>`},Vi.DEFAULT)}return f}function nk(e,t){for(let r=0;r<e.length;r++)e[r]>=t&&e[r]++}function Ay(e,t,r,n,l,c){if(e.size&&n){let u=0;WS(t,YS,()=>u++,Vi.DEFAULT);const d=c-u+l,_=new Map;return e.forEach((f,v)=>{const m=(n-u*r)/r,y=u*r,S=v>d+u?v+n:v,b=[];for(const x of f)if(x<=d)b.push(x);else if(x>d+u+m)b.push(x+n);else if(x<=d+u)for(let T=0;T<=r;T++)b.push(x+u*T);else for(let T=0;T<=r;T++)b.push(x+y+m*T);_.set(S,b)}),_}return e}var Tt=String.fromCodePoint,Ae=String.raw,Mr={flagGroups:(()=>{try{new RegExp("(?i:)")}catch{return!1}return!0})(),unicodeSets:(()=>{try{new RegExp("[[]]","v")}catch{return!1}return!0})()};Mr.bugFlagVLiteralHyphenIsRange=Mr.unicodeSets?(()=>{try{new RegExp(Ae`[\d\-a]`,"v")}catch{return!0}return!1})():!1;Mr.bugNestedClassIgnoresNegation=Mr.unicodeSets&&new RegExp("[[^a]]","v").test("a");function Lc(e,{enable:t,disable:r}){return{dotAll:!(r!=null&&r.dotAll)&&!!(t!=null&&t.dotAll||e.dotAll),ignoreCase:!(r!=null&&r.ignoreCase)&&!!(t!=null&&t.ignoreCase||e.ignoreCase)}}function Sl(e,t,r){return e.has(t)||e.set(t,r),e.get(t)}function pf(e,t){return ky[e]>=ky[t]}function ak(e,t){if(e==null)throw new Error(t??"Value expected");return e}var ky={ES2025:2025,ES2024:2024,ES2018:2018},lk={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function KS(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!lk[e.target])throw new Error(`Unexpected target "${e.target}"`);const t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=Mr.flagGroups?"ES2025":Mr.unicodeSets?"ES2024":"ES2018"),t}var ok="[ -\r ]",ck=new Set([Tt(304),Tt(305)]),Ar=Ae`[\p{L}\p{M}\p{N}\p{Pc}]`;function XS(e){if(ck.has(e))return[e];const t=new Set,r=e.toLowerCase(),n=r.toUpperCase(),l=dk.get(r),c=uk.get(r),u=hk.get(r);return[...n].length===1&&t.add(n),u&&t.add(u),l&&t.add(l),t.add(r),c&&t.add(c),[...t]}var y_=new Map(`C Other
|
|
109
109
|
Cc Control cntrl
|
|
110
110
|
Cf Format
|
|
111
111
|
Cn Unassigned
|
|
@@ -195,10 +195,10 @@ Uppercase Upper
|
|
|
195
195
|
Variation_Selector VS
|
|
196
196
|
White_Space space
|
|
197
197
|
XID_Continue XIDC
|
|
198
|
-
XID_Start XIDS`.split(/\s/).map(e=>[Yc(e),e])),
|
|
198
|
+
XID_Start XIDS`.split(/\s/).map(e=>[Yc(e),e])),uk=new Map([["s",Tt(383)],[Tt(383),"s"]]),hk=new Map([[Tt(223),Tt(7838)],[Tt(107),Tt(8490)],[Tt(229),Tt(8491)],[Tt(969),Tt(8486)]]),dk=new Map([hs(453),hs(456),hs(459),hs(498),...Od(8072,8079),...Od(8088,8095),...Od(8104,8111),hs(8124),hs(8140),hs(8188)]),fk=new Map([["alnum",Ae`[\p{Alpha}\p{Nd}]`],["alpha",Ae`\p{Alpha}`],["ascii",Ae`\p{ASCII}`],["blank",Ae`[\p{Zs}\t]`],["cntrl",Ae`\p{Cc}`],["digit",Ae`\p{Nd}`],["graph",Ae`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",Ae`\p{Lower}`],["print",Ae`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",Ae`[\p{P}\p{S}]`],["space",Ae`\p{space}`],["upper",Ae`\p{Upper}`],["word",Ae`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",Ae`\p{AHex}`]]);function _k(e,t){const r=[];for(let n=e;n<=t;n++)r.push(n);return r}function hs(e){const t=Tt(e);return[t.toLowerCase(),t]}function Od(e,t){return _k(e,t).map(r=>hs(r))}var ZS=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function pk(e,t){const r={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};QS(e);const n={accuracy:r.accuracy,asciiWordBoundaries:r.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:pf(r.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};fl(e,mk,n);const l={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},c={currentFlags:l,prevFlags:null,globalFlags:l,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:n.subroutineRefMap};fl(e,gk,c);const u={groupsByName:c.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:c.reffedNodesByReferencer};return fl(e,vk,u),e._originMap=c.groupOriginByCopy,e._strategy=n.strategy,e}var mk={AbsenceFunction({node:e,parent:t,replaceWith:r}){const{body:n,kind:l}=e;if(l==="repeater"){const c=Ki();c.body[0].body.push($s({negate:!0,body:n}),Wn("Any"));const u=Ki();u.body[0].body.push($S("greedy",0,1/0,c)),r(mt(u,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:r},{flagDirectivesByAlt:n}){const l=e.body.filter(c=>c.kind==="flags");for(let c=r+1;c<t.body.length;c++){const u=t.body[c];Sl(n,u,[]).push(...l)}},exit({node:e},{flagDirectivesByAlt:t}){var r;if((r=t.get(e))!=null&&r.length){const n=eb(t.get(e));if(n){const l=Ki({flags:n});l.body[0].body=e.body,e.body=[mt(l,e)]}}}},Assertion({node:e,parent:t,key:r,container:n,root:l,remove:c,replaceWith:u},d){const{kind:_,negate:f}=e,{asciiWordBoundaries:v,avoidSubclass:m,supportedGNodes:y,wordIsAscii:S}=d;if(_==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${f?"Y":"y"}"`);if(_==="line_end")u(mt($s({body:[Zs({body:[hf("string_end")]}),Zs({body:[Fc(10)]})]}),t));else if(_==="line_start")u(mt(kr(Ae`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(_==="search_start")if(y.has(e))l.flags.sticky=!0,c();else{const b=n[r-1];if(b&&Ek(b))u(mt($s({negate:!0}),t));else{if(m)throw new Error(Ae`Uses "\G" in a way that requires a subclass`);u(ds(hf("string_start"),t)),d.strategy="clip_search"}}else if(!(_==="string_end"||_==="string_start"))if(_==="string_end_newline")u(mt(kr(Ae`(?=\n?\z)`),t));else if(_==="word_boundary"){if(!S&&!v){const b=`(?:(?<=${Ar})(?!${Ar})|(?<!${Ar})(?=${Ar}))`,x=`(?:(?<=${Ar})(?=${Ar})|(?<!${Ar})(?!${Ar}))`;u(mt(kr(f?x:b),t))}}else throw new Error(`Unexpected assertion kind "${_}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Nd(r)&&(r=Md(r,t),e.ref=r)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:r}){let{name:n}=e;n&&!Nd(n)&&(n=Md(n,t),e.name=n),r.set(e.number,e),n&&r.set(n,e)},CharacterClassRange({node:e,parent:t,replaceWith:r}){if(t.kind==="intersection"){const n=dc({body:[e]});r(mt(n,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:r},{accuracy:n,minTargetEs2024:l,digitIsAscii:c,spaceIsAscii:u,wordIsAscii:d}){const{kind:_,negate:f,value:v}=e;if(c&&(_==="digit"||v==="digit")){r(ds(ff("digit",{negate:f}),t));return}if(u&&(_==="space"||v==="space")){r(mt(Bd(kr(ok),f),t));return}if(d&&(_==="word"||v==="word")){r(ds(ff("word",{negate:f}),t));return}if(_==="any")r(ds(Wn("Any"),t));else if(_==="digit")r(ds(Wn("Nd",{negate:f}),t));else if(_!=="dot")if(_==="text_segment"){if(n==="strict")throw new Error(Ae`Use of "\X" requires non-strict accuracy`);const m="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",y=Ae`\p{RI}{2}|${m}(?:\u200D${m})*`;r(mt(kr(Ae`(?>\r\n|${l?Ae`\p{RGI_Emoji}`:y}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(_==="hex")r(ds(Wn("AHex",{negate:f}),t));else if(_==="newline")r(mt(kr(f?`[^
|
|
199
199
|
]`:`(?>\r
|
|
200
200
|
?|[
|
|
201
|
-
\v\f
\u2028\u2029])`),t));else if(_==="posix")if(!l&&(v==="graph"||v==="print")){if(n==="strict")throw new Error(`POSIX class "${v}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[v];f&&(m=`\0-${Tt(m.codePointAt(0)-1)}${Tt(m.codePointAt(2)+1)}-`),r(mt(kr(`[${m}]`),t))}else r(mt(Nd(kr(hk.get(v)),f),t));else if(_==="property")v_.has(Yc(v))||(e.key="sc");else if(_==="space")r(ds(Wn("space",{negate:f}),t));else if(_==="word")r(mt(Nd(kr(Ar),f),t));else throw new Error(`Unexpected character set kind "${_}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:l,removeAllPrevSiblings:c,removeAllNextSiblings:u}){const{kind:d,flags:_}=e;if(d==="flags")if(!_.enable&&!_.disable)n();else{const f=Ki({flags:_});f.body[0].body=u(),l(mt(f,t),{traverse:!0})}else if(d==="keep"){const f=r.body[0],m=r.body.length===1&&zS(f,{type:"Group"})&&f.body[0].body.length===1?f.body[0]:r;if(t.parent!==m||m.body.length>1)throw new Error(ke`Uses "\K" in a way that's unsupported`);const y=$s({behind:!0});y.body[0].body=c(),l(mt(y,t))}else throw new Error(`Unexpected directive kind "${d}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete e[r]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:r}=e.flags;t!=null&&t.extended&&delete t.extended,r!=null&&r.extended&&delete r.extended,t!=null&&t.dotAll&&(r!=null&&r.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(r!=null&&r.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:r}=e;r==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){const{kind:n}=e;if(n==="fail")r(mt($s({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Ki();t.body[0].body.push(e.body),e.body=mt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const r=[];let n=!1,l=!1;for(const c of e.body)if(c.body.length===1&&c.body[0].kind==="search_start")c.body.pop();else{const u=QS(c.body);u?(n=!0,Array.isArray(u)?r.push(...u):r.push(u)):l=!0}n&&!l&&r.forEach(c=>t.add(c))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if(t==="strict"&&r&&n)throw new Error(ke`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Md(r)&&(r=Od(r,t),e.ref=r)}},pk={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){const{orphan:n,ref:l}=e;n||r.set(e,[...t.get(l).map(({node:c})=>c)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:l,groupsByName:c,multiplexCapturesToLeftByRef:u,openRefs:d,reffedNodesByReferencer:_}){const f=l.get(e);if(f&&d.has(e.number)){const m=ds(Ay(e.number),t);_.set(m,d.get(e.number)),r(m);return}d.set(e.number,e),u.set(e.number,[]),e.name&&yl(u,e.name,[]);const v=u.get(e.name??e.number);for(let m=0;m<v.length;m++){const y=v[m];if(f===y.node||f&&f===y.origin||e===y.origin){v.splice(m,1);break}}if(u.get(e.number).push({node:e,origin:f}),e.name&&u.get(e.name).push({node:e,origin:f}),e.name){const m=yl(c,e.name,new Map);let y=!1;if(f)y=!0;else for(const S of m.values())if(!S.hasDuplicateNameToRemove){y=!0;break}c.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:y})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Lc(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){const{isRecursive:l,ref:c}=e;if(l){let v=t;for(;(v=v.parent)&&!(v.type==="CapturingGroup"&&(v.name===c||v.number===c)););n.reffedNodesByReferencer.set(e,v);return}const u=n.subroutineRefMap.get(c),d=c===0,_=d?Ay(0):KS(u,n.groupOriginByCopy,null);let f=_;if(!d){const v=XS(yk(u,y=>y.type==="Group"&&!!y.flags)),m=v?Lc(n.globalFlags,v):n.globalFlags;gk(m,n.currentFlags)||(f=Ki({flags:Sk(m)}),f.body[0].body.push(_))}r(mt(f,t),{traverse:!d})}},mk={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}const c=n.reffedNodesByReferencer.get(e).filter(u=>vk(u,e));if(!c.length)r(mt($s({negate:!0}),t));else if(c.length>1){const u=Ki({atomic:!0,body:c.reverse().map(d=>Zs({body:[hf(d.number)]}))});r(mt(u,t))}else e.ref=c[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let n=0;n<r;n++){const l=IS();e.body.at(-1).body.push(l)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function YS(e){dl(e,{"*"({node:t,parent:r}){t.parent=r}})}function gk(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function vk(e,t){let r=t;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===e)return!1;const n=ZS(r.parent);for(const l of n){if(l===r)break;if(l===e||JS(l,e))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function KS(e,t,r,n){const l=Array.isArray(e)?[]:{};for(const[c,u]of Object.entries(e))c==="parent"?l.parent=Array.isArray(r)?n:r:u&&typeof u=="object"?l[c]=KS(u,t,l,r):(c==="type"&&u==="CapturingGroup"&&t.set(l,t.get(e)??e),l[c]=u);return l}function Ay(e){const t=US(e);return t.isRecursive=!0,t}function yk(e,t){const r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}function Od(e,t){if(t.has(e))return t.get(e);const r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function XS(e){const t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return e.forEach(({flags:n})=>{t.forEach(l=>{var c,u;(c=n.enable)!=null&&c[l]&&(delete r.disable[l],r.enable[l]=!0),(u=n.disable)!=null&&u[l]&&(r.disable[l]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function Sk({dotAll:e,ignoreCase:t}){const r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),(!e||!t)&&(r.disable={},!e&&(r.disable.dotAll=!0),!t&&(r.disable.ignoreCase=!0)),r}function ZS(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function QS(e){const t=e.find(r=>r.kind==="search_start"||Ck(r,{negate:!1})||!bk(r));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const r=[];for(const n of t.body){const l=QS(n.body);if(!l)return null;Array.isArray(l)?r.push(...l):r.push(l)}return r}return null}function JS(e,t){const r=ZS(e)??[];for(const n of r)if(n===t||JS(n,t))return!0;return!1}function bk({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function wk(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Ck(e,t){const r={negate:null,...t};return e.type==="LookaroundAssertion"&&(r.negate===null||e.negate===r.negate)&&e.body.length===1&&zS(e.body[0],{type:"Assertion",kind:"search_start"})}function Md(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function kr(e,t){const n=PS(e,{...t,unicodePropertyMap:v_}).body;return n.length>1||n[0].body.length>1?Ki({body:n}):n[0].body[0]}function Nd(e,t){return e.negate=t,e}function ds(e,t){return e.parent=t,e}function mt(e,t){return YS(e),e.parent=t,e}function Ek(e,t){const r=qS(t),n=_f(r.target,"ES2024"),l=_f(r.target,"ES2025"),c=r.rules.recursionLimit;if(!Number.isInteger(c)||c<2||c>20)throw new Error("Invalid recursionLimit; use 2-20");let u=null,d=null;if(!l){const S=[e.flags.ignoreCase];dl(e,xk,{getCurrentModI:()=>S.at(-1),popModI(){S.pop()},pushModI(b){S.push(b)},setHasCasedChar(){S.at(-1)?u=!0:d=!0}})}const _={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||u)&&!d)};let f=e;const v={accuracy:r.accuracy,appliedGlobalFlags:_,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:f,originMap:e._originMap,recursionLimit:c,useAppliedIgnoreCase:!!(!l&&u&&d),useFlagMods:l,useFlagV:n,verbose:r.verbose};function m(S){return v.lastNode=f,f=S,sk(Ak[S.type],`Unexpected node type "${S.type}"`)(S,v,m)}const y={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return n||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],v.captureMap.forEach((S,b)=>{S.hidden&&y._hiddenCaptures.push(b),S.transferTo&&yl(y._captureTransfers,S.transferTo,[]).push(b)}),y}var xk={"*":{enter({node:e},t){if(Ty(e)){const r=t.getCurrentModI();t.pushModI(e.flags?Lc({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){Ty(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){y_(Tt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),eb(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&FS.has(e.value)&&t.setHasCasedChar()}},Ak={Alternative({body:e},t,r){return e.map(r).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?ke`\B`:ke`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){const{body:n,name:l,number:c}=e,u={ignoreCase:t.currentFlags.ignoreCase},d=t.originMap.get(e);return d&&(u.hidden=!0,c>d.number&&(u.transferTo=d.number)),t.captureMap.set(c,u),`(${l?`?<${l}>`:""}${n.map(r).join("|")})`},Character({value:e},t){const r=Tt(e),n=Vn(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&y_(r)){const l=WS(r);return t.inCharClass?l.join(""):l.length>1?`[${l.join("")}]`:l[0]}return r},CharacterClass(e,t,r){const{kind:n,negate:l,parent:c}=e;let{body:u}=e;if(n==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Mr.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&u.some(Ry)&&(u=[Fc(45),...u.filter(f=>!Ry(f))]);const d=()=>`[${l?"^":""}${u.map(r).join(n==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Mr.bugNestedClassIgnoresNegation)&&!l){const v=u.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(v.length){const m=Ki(),y=m.body[0];return m.parent=c,y.parent=m,u=u.filter(S=>!v.includes(S)),e.body=u,u.length?(e.parent=y,y.body.push(e)):m.body.pop(),v.forEach(S=>{const b=Zs({body:[S]});S.parent=b,b.parent=m,m.body.push(b)}),r(m)}}t.inCharClass=!0;const f=d();return t.inCharClass=!1,f}const _=u[0];if(n==="union"&&!l&&_&&((!t.useFlagV||!t.verbose)&&c.kind==="union"&&!(Mr.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&c.kind==="intersection"&&u.length===1&&_.type!=="CharacterClassRange"))return u.map(r).join("");if(!t.useFlagV&&c.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return d()},CharacterClassRange(e,t){const r=e.min.value,n=e.max.value,l={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},c=Vn(r,l),u=Vn(n,l),d=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const _=eb(e);Lk(_).forEach(v=>{d.add(Array.isArray(v)?`${Vn(v[0],l)}-${Vn(v[1],l)}`:Vn(v,l))})}return`${c}-${u}${[...d].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},l){if(e==="dot")return l.currentFlags.dotAll?l.appliedGlobalFlags.dotAll||l.useFlagMods?".":"[^]":ke`[^\n]`;if(e==="digit")return t?ke`\D`:ke`\d`;if(e==="property"){if(l.useAppliedIgnoreCase&&l.currentFlags.ignoreCase&&FS.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?ke`\P`:ke`\p`}{${n?`${n}=`:""}${r}}`}if(e==="word")return t?ke`\W`:ke`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:r,parent:n},l,c){const u=l.currentFlags;r&&(l.currentFlags=Lc(u,r));const d=t.map(c).join("|"),_=!l.verbose&&t.length===1&&n.type!=="Quantifier"&&!e&&(!l.useFlagMods||!r)?d:`(?${Ok(e,r,l.useFlagMods)}${d})`;return l.currentFlags=u,_},LookaroundAssertion({body:e,kind:t,negate:r},n,l){return`(?${`${t==="lookahead"?"":"<"}${r?"!":"="}`}${e.map(l).join("|")})`},Quantifier(e,t,r){return r(e.body)+Mk(e)},Subroutine({isRecursive:e,ref:t},r){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return t===0?`(?R=${n})`:ke`\g<${t}&R=${n}>`}},kk=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Tk=new Set(["-","\\","]","^","["]),Rk=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),ky=new Map([[9,ke`\t`],[10,ke`\n`],[11,ke`\v`],[12,ke`\f`],[13,ke`\r`],[8232,ke`\u2028`],[8233,ke`\u2029`],[65279,ke`\uFEFF`]]),Dk=new RegExp("^\\p{Cased}$","u");function y_(e){return Dk.test(e)}function eb(e,t){const r=!!(t!=null&&t.firstOnly),n=e.min.value,l=e.max.value,c=[];if(n<65&&(l===65535||l>=131071)||n===65536&&l>=131071)return c;for(let u=n;u<=l;u++){const d=Tt(u);if(!y_(d))continue;const _=WS(d).filter(f=>{const v=f.codePointAt(0);return v<n||v>l});if(_.length&&(c.push(..._),r))break}return c}function Vn(e,{escDigit:t,inCharClass:r,useFlagV:n}){if(ky.has(e))return ky.get(e);if(e<32||e>126&&e<160||e>262143||t&&Nk(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const l=r?n?Rk:Tk:kk,c=Tt(e);return(l.has(c)?"\\":"")+c}function Lk(e){const t=e.map(l=>l.codePointAt(0)).sort((l,c)=>l-c),r=[];let n=null;for(let l=0;l<t.length;l++)t[l+1]===t[l]+1?n??(n=t[l]):n===null?r.push(t[l]):(r.push([n,t[l]]),n=null);return r}function Ok(e,t,r){if(e)return">";let n="";if(t&&r){const{enable:l,disable:c}=t;n=(l!=null&&l.ignoreCase?"i":"")+(l!=null&&l.dotAll?"s":"")+(c?"-":"")+(c!=null&&c.ignoreCase?"i":"")+(c!=null&&c.dotAll?"s":"")}return`${n}:`}function Mk({kind:e,max:t,min:r}){let n;return!r&&t===1?n="?":!r&&t===1/0?n="*":r===1&&t===1/0?n="+":r===t?n=`{${r}}`:n=`{${r},${t===1/0?"":t}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function Ty({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Nk(e){return e>47&&e<58}function Ry({type:e,value:t}){return e==="Character"&&t===45}var _s,Rr,Ys,ps,Ks,Cl,pf,ys,Bk=(ys=class extends RegExp{constructor(r,n,l){var t=(...aO)=>(super(...aO),Is(this,Cl),Is(this,_s,new Map),Is(this,Rr,null),Is(this,Ys),Is(this,ps,null),Is(this,Ks,null),F(this,"rawOptions",{}),this);const c=!!(l!=null&&l.lazyCompile);if(r instanceof RegExp){if(l)throw new Error("Cannot provide options when copying a regexp");const u=r;t(u,n),Fi(this,Ys,u.source),u instanceof ys&&(Fi(this,_s,Jt(u,_s)),Fi(this,ps,Jt(u,ps)),Fi(this,Ks,Jt(u,Ks)),this.rawOptions=u.rawOptions)}else{const u={hiddenCaptures:[],strategy:null,transfers:[],...l};t(c?"":r,n),Fi(this,Ys,r),Fi(this,_s,Pk(u.hiddenCaptures,u.transfers)),Fi(this,Ks,u.strategy),this.rawOptions=l??{}}c||Fi(this,Rr,this)}get source(){return Jt(this,Ys)||"(?:)"}exec(r){if(!Jt(this,Rr)){const{lazyCompile:c,...u}=this.rawOptions;Fi(this,Rr,new ys(Jt(this,Ys),this.flags,u))}const n=this.global||this.sticky,l=this.lastIndex;if(Jt(this,Ks)==="clip_search"&&n&&l){this.lastIndex=0;const c=fd(this,Cl,pf).call(this,r.slice(l));return c&&(zk(c,l,r,this.hasIndices),this.lastIndex+=l),c}return fd(this,Cl,pf).call(this,r)}},_s=new WeakMap,Rr=new WeakMap,Ys=new WeakMap,ps=new WeakMap,Ks=new WeakMap,Cl=new WeakSet,pf=function(r){Jt(this,Rr).lastIndex=this.lastIndex;const n=Dv(ys.prototype,this,"exec").call(Jt(this,Rr),r);if(this.lastIndex=Jt(this,Rr).lastIndex,!n||!Jt(this,_s).size)return n;const l=[...n];n.length=1;let c;this.hasIndices&&(c=[...n.indices],n.indices.length=1);const u=[0];for(let d=1;d<l.length;d++){const{hidden:_,transferTo:f}=Jt(this,_s).get(d)??{};if(_?u.push(null):(u.push(n.length),n.push(l[d]),this.hasIndices&&n.indices.push(c[d])),f&&l[d]!==void 0){const v=u[f];if(!v)throw new Error(`Invalid capture transfer to "${v}"`);if(n[v]=l[d],this.hasIndices&&(n.indices[v]=c[d]),n.groups){Jt(this,ps)||Fi(this,ps,Ik(this.source));const m=Jt(this,ps).get(f);m&&(n.groups[m]=l[d],this.hasIndices&&(n.indices.groups[m]=c[d]))}}}return n},ys);function zk(e,t,r,n){if(e.index+=t,e.input=r,n){const l=e.indices;for(let u=0;u<l.length;u++){const d=l[u];d&&(l[u]=[d[0]+t,d[1]+t])}const c=l.groups;c&&Object.keys(c).forEach(u=>{const d=c[u];d&&(c[u]=[d[0]+t,d[1]+t])})}}function Pk(e,t){const r=new Map;for(const n of e)r.set(n,{hidden:!0});for(const[n,l]of t)for(const c of l)yl(r,c,{}).transferTo=n;return r}function Ik(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,l=0,c;for(;c=t.exec(e);){const{0:u,groups:{capture:d,name:_}}=c;u==="["?n++:n?u==="]"&&n--:d&&(l++,_&&r.set(l,_))}return r}function Hk(e,t){const r=Uk(e,t);return r.options?new Bk(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function Uk(e,t){const r=qS(t),n=PS(e,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:v_}),l=fk(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),c=Ek(l,r),u=ik(c.pattern,{captureTransfers:c._captureTransfers,hiddenCaptures:c._hiddenCaptures,mode:"external"}),d=ek(u.pattern),_=JA(d.pattern,{captureTransfers:u.captureTransfers,hiddenCaptures:u.hiddenCaptures}),f={pattern:_.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${c.flags}${c.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const v=_.hiddenCaptures.sort((b,E)=>b-E),m=Array.from(_.captureTransfers),y=l._strategy,S=f.pattern.length>=r.lazyCompileLength;(v.length||m.length||y||S)&&(f.options={...v.length&&{hiddenCaptures:v},...m.length&&{transfers:m},...y&&{strategy:y},...S&&{lazyCompile:S}})}return f}function tb(e,t){return Hk(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function jk(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||(t.regexConstructor=r=>tb(r,{target:t.target})),{createScanner(r){return new rA(r,t)},createString(r){return{content:r}}}}var Vk=e_({bundledLanguages:()=>r_,bundledLanguagesAlias:()=>i_,bundledLanguagesBase:()=>t_,bundledLanguagesInfo:()=>Ic,bundledThemes:()=>n_,bundledThemesInfo:()=>s_,codeToHast:()=>xS,codeToHtml:()=>ES,codeToTokens:()=>AS,codeToTokensBase:()=>kS,codeToTokensWithThemes:()=>TS,createHighlighter:()=>Wc,createJavaScriptRegexEngine:()=>jk,createOnigurumaEngine:()=>z0,defaultJavaScriptRegexConstructor:()=>tb,getLastGrammarState:()=>DS,getSingletonHighlighter:()=>RS,loadWasm:()=>l_});M0(Vk,iA);let Bd=null;const zd=new Set;function $k(){return Bd||(Bd=Wc({themes:["github-dark"],langs:["text"]})),Bd}function Gk(e){var l,c;const t=((l=e.split(".").pop())==null?void 0:l.toLowerCase())??"",r={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",md:"markdown",css:"css",scss:"scss",html:"html",xml:"xml",svg:"xml",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",hpp:"cpp",sh:"bash",bash:"bash",zsh:"bash",sql:"sql",yaml:"yaml",yml:"yaml",toml:"toml",dockerfile:"dockerfile",makefile:"makefile",vue:"vue",svelte:"svelte",graphql:"graphql",gql:"graphql",lua:"lua",php:"php",r:"r"},n=((c=e.split("/").pop())==null?void 0:c.toLowerCase())??"";return n==="dockerfile"?"dockerfile":n==="makefile"||n==="gnumakefile"?"makefile":r[t]||"text"}function qk(e,t,r){let n=0;return e.replace(/<span class="line"/g,()=>{n++;const l=["line"];return t!=null&&t.has(n)&&l.push("diff-added"),r!=null&&r.has(n)&&l.push("diff-removed"),`<span class="${l.join(" ")}" data-line="${n}"`})}function rc(e,t){const r=e.querySelectorAll("[data-line]");for(let n=0;n<r.length;n++){const l=r[n].getBoundingClientRect();if(t.clientY>=l.top&&t.clientY<=l.bottom)return parseInt(r[n].getAttribute("data-line"),10)}if(r.length>0){const n=r[0].getBoundingClientRect();if(t.clientY<n.top)return 1;const l=r[r.length-1];return parseInt(l.getAttribute("data-line"),10)}return null}const ib=$.memo(function({code:t,filePath:r,addedLines:n,removedLines:l,onSelectionChange:c,scrollToLine:u}){const[d,_]=$.useState(null),[f,v]=$.useState(!1),[m,y]=$.useState(new Set),S=$.useRef(null),b=$.useRef(null),E=$.useRef(c);E.current=c;const T=$.useRef(null),O=$.useRef(!1),H=$.useRef(null),B=$.useRef(!1),I=$.useRef(null),j=$.useRef(null),Y=$.useRef(!1);$.useEffect(()=>{let ie=!1;return(async()=>{try{const oe=await $k(),x=Gk(r);if(x!=="text"&&!zd.has(x))try{await oe.loadLanguage(x),zd.add(x)}catch{}const M=zd.has(x)?x:"text",X=oe.codeToHtml(t,{lang:M,theme:"github-dark"});ie||_(X)}catch{ie||v(!0)}})(),()=>{ie=!0}},[t,r]),$.useEffect(()=>{y(new Set),H.current=null,c==null||c([])},[r,t]);const te=$.useRef(null);$.useLayoutEffect(()=>{if(u==null||!d||!S.current)return;const ie=`${r}:${u}`;if(te.current===ie)return;te.current=ie;const oe=S.current.querySelector(`[data-line="${u}"]`);if(!oe){b.current&&(b.current.style.visibility="");return}const x=S.current.closest(".file-content-body");if(!x){b.current&&(b.current.style.visibility="");return}const M=oe.offsetTop-x.offsetTop-3*19.2;x.scrollTo({top:Math.max(0,M),behavior:"instant"}),b.current&&(b.current.style.visibility="")},[d,u,r]);const ge=$.useMemo(()=>d?qk(d,n,l):null,[d,n,l]),ve=$.useMemo(()=>{if(m.size===0)return null;const ie=Array.from(m).sort((oe,x)=>oe-x);return{start:ie[0],end:ie[ie.length-1]}},[m]),fe=$.useCallback((ie,oe)=>{var M;const x=new Set;for(let X=ie;X<=oe;X++)x.add(X);y(x),(M=E.current)==null||M.call(E,Array.from(x).sort((X,ee)=>X-ee))},[]),he=$.useCallback(()=>{var ie;y(new Set),H.current=null,Y.current=!1,(ie=E.current)==null||ie.call(E,[])},[]),J=$.useCallback(ie=>{var x;if(O.current||!S.current)return;const oe=rc(S.current,ie);oe!==null&&(ie.preventDefault(),(x=window.getSelection())==null||x.removeAllRanges(),T.current={anchor:oe,dragged:!1,startX:ie.clientX,startY:ie.clientY})},[]),G=$.useCallback(ie=>{if(!T.current||!S.current)return;if(!T.current.dragged){const ee=ie.clientX-T.current.startX,ue=ie.clientY-T.current.startY;if(ee*ee+ue*ue<25)return;T.current.dragged=!0}const oe=rc(S.current,ie);if(oe===null)return;const x=Math.min(T.current.anchor,oe),M=Math.max(T.current.anchor,oe),X=new Set;for(let ee=x;ee<=M;ee++)X.add(ee);y(X)},[]),re=$.useCallback(()=>{if(!T.current)return;const ie=T.current.dragged;T.current=null,ie?y(oe=>{var M;const x=Array.from(oe).sort((X,ee)=>X-ee);return(M=E.current)==null||M.call(E,x),oe}):he()},[he]);$.useEffect(()=>{const ie=()=>{if(!T.current)return;const oe=T.current.dragged;T.current=null,oe?y(x=>{var X;const M=Array.from(x).sort((ee,ue)=>ee-ue);return(X=E.current)==null||X.call(E,M),x}):he()};return window.addEventListener("mouseup",ie),()=>window.removeEventListener("mouseup",ie)},[he]),$.useEffect(()=>{if(!S.current)return;const ie=S.current,oe=300,x=10;let M=null,X=0,ee=0,ue=-1;const pe=$e=>{$e.pointerType!=="mouse"&&ie.contains($e.target)&&(B.current||(ue=$e.pointerId,X=$e.clientX,ee=$e.clientY,O.current=!0,M=setTimeout(()=>{var Le;M=null;const at=rc(ie,{clientY:ee});at!==null&&(H.current=at,fe(at,at),(Le=navigator.vibrate)==null||Le.call(navigator,50))},oe)))},we=$e=>{if($e.pointerId!==ue||!M)return;const at=$e.clientX-X,Le=$e.clientY-ee;at*at+Le*Le>x*x&&(clearTimeout(M),M=null)},Fe=$e=>{$e.pointerId===ue&&(ue=-1,M&&(clearTimeout(M),M=null,he()),setTimeout(()=>{O.current=!1},400))},ze=$e=>{$e.pointerId===ue&&(ue=-1,M&&(clearTimeout(M),M=null),setTimeout(()=>{O.current=!1},400))},Ft=$e=>{ie.contains($e.target)&&$e.preventDefault()};return document.addEventListener("pointerdown",pe),document.addEventListener("pointermove",we),document.addEventListener("pointerup",Fe),document.addEventListener("pointercancel",ze),document.addEventListener("contextmenu",Ft),()=>{document.removeEventListener("pointerdown",pe),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",Fe),document.removeEventListener("pointercancel",ze),document.removeEventListener("contextmenu",Ft),M&&clearTimeout(M)}},[d,fe,he]);const se=$.useCallback(ie=>{ie.preventDefault(),ie.stopPropagation(),B.current=!0,j.current=null,ie.currentTarget.setPointerCapture(ie.pointerId)},[]),D=$.useCallback(ie=>{if(!B.current||!S.current||H.current===null)return;const oe=rc(S.current,ie);if(oe===null)return;const x=Math.min(H.current,oe),M=Math.max(H.current,oe),X=oe<H.current;j.current={start:x,end:M},Y.current=X;const ee=S.current.querySelectorAll("[data-line]");for(let ue=0;ue<ee.length;ue++){const pe=parseInt(ee[ue].getAttribute("data-line"),10);pe>=x&&pe<=M?ee[ue].classList.add("line-selected"):ee[ue].classList.remove("line-selected")}if(I.current&&b.current){const ue=X?x:M,pe=S.current.querySelector(`[data-line="${ue}"]`);if(pe){const we=b.current.getBoundingClientRect(),Fe=pe.getBoundingClientRect();X?(I.current.style.top=`${Fe.top-we.top-I.current.offsetHeight}px`,I.current.classList.add("cv-drag-handle--top")):(I.current.style.top=`${Fe.bottom-we.top}px`,I.current.classList.remove("cv-drag-handle--top"))}}},[]),W=$.useCallback(()=>{B.current&&(B.current=!1,j.current&&(fe(j.current.start,j.current.end),j.current=null))},[fe]);if($.useLayoutEffect(()=>{if(!S.current)return;if(S.current.querySelectorAll("[data-line]").forEach(oe=>{const x=parseInt(oe.getAttribute("data-line"),10);m.has(x)?oe.classList.add("line-selected"):oe.classList.remove("line-selected")}),I.current&&b.current&&m.size>0){const oe=Array.from(m).sort((M,X)=>M-X),x=b.current.getBoundingClientRect();if(Y.current){const M=S.current.querySelector(`[data-line="${oe[0]}"]`);if(M){const X=M.getBoundingClientRect();I.current.style.top=`${X.top-x.top-I.current.offsetHeight}px`,I.current.classList.add("cv-drag-handle--top")}}else{const M=S.current.querySelector(`[data-line="${oe[oe.length-1]}"]`);if(M){const X=M.getBoundingClientRect();I.current.style.top=`${X.bottom-x.top}px`,I.current.classList.remove("cv-drag-handle--top")}}}},[m,d]),f)return k.jsx("pre",{className:"code-viewer-fallback",children:t});if(!ge)return k.jsx("div",{className:"code-viewer-loading",children:"..."});const q=u!=null&&te.current!==`${r}:${u}`;return k.jsxs("div",{ref:b,className:"code-viewer-wrapper",style:q?{visibility:"hidden"}:void 0,children:[k.jsx("div",{ref:S,className:"code-viewer",dangerouslySetInnerHTML:{__html:ge},onMouseDown:J,onMouseMove:G,onMouseUp:re}),ve&&k.jsx("div",{ref:I,className:"cv-drag-handle",onPointerDown:se,onPointerMove:D,onPointerUp:W,children:k.jsx("div",{className:"cv-drag-handle-pill"})})]})});function rb({entry:e,parentPath:t,requestLs:r,onFileClick:n,selectedFile:l,depth:c=0}){const[u,d]=$.useState(!1),[_,f]=$.useState(null),[v,m]=$.useState(!1),y=t?`${t}/${e.name}`:e.name,S=async()=>{if(e.type==="dir"){if(u){d(!1);return}if(_===null){m(!0);const b=await r(y);f(b),m(!1)}d(!0)}};if(e.type==="file"){const b=l===y;return k.jsxs("div",{className:`file-tree-item file${b?" selected":""}`,style:{paddingLeft:`${12+c*16+18}px`},onClick:()=>n(y),children:[k.jsx("span",{className:"file-icon",children:k.jsx(_l,{})}),k.jsx("span",{className:"file-name",children:e.name})]})}return k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"file-tree-item folder",style:{paddingLeft:`${12+c*16}px`},onClick:S,children:[k.jsx("span",{className:`chevron ${u?"expanded":""}`,children:k.jsx(IC,{})}),k.jsx("span",{className:"file-icon",children:k.jsx(L0,{})}),k.jsxs("span",{className:"file-name",children:[e.name,"/"]}),v&&k.jsx("span",{className:"tree-loading",children:"…"})]}),u&&(_==null?void 0:_.map(b=>k.jsx(rb,{entry:b,parentPath:y,requestLs:r,onFileClick:n,selectedFile:l,depth:c+1},b.name)))]})}function Wk({topLevel:e,requestLs:t,requestFile:r,onFileContext:n}){const[l,c]=$.useState(200),u=$.useRef(null),d=$.useRef(null),[_,f]=$.useState(null),[v,m]=$.useState(null),[y,S]=$.useState(!1),b=$.useCallback(j=>{if(!d.current||!u.current)return;const Y=u.current.getBoundingClientRect(),te=Y.bottom,ge=Math.max(80,Math.min(te-j,Y.height-80));c(ge)},[]),E=$.useCallback(()=>{d.current=null},[]),T=j=>{j.preventDefault(),d.current={startY:j.clientY,startHeight:l};const Y=ge=>b(ge.clientY),te=()=>{E(),window.removeEventListener("mousemove",Y),window.removeEventListener("mouseup",te)};window.addEventListener("mousemove",Y),window.addEventListener("mouseup",te)},O=j=>{const Y=j.touches[0];d.current={startY:Y.clientY,startHeight:l};const te=ve=>{ve.preventDefault(),b(ve.touches[0].clientY)},ge=()=>{E(),window.removeEventListener("touchmove",te),window.removeEventListener("touchend",ge)};window.addEventListener("touchmove",te,{passive:!1}),window.addEventListener("touchend",ge)},H=async j=>{f(j),m(null),S(!0),n==null||n(null);const Y=await r(j);m(Y),S(!1)},B=$.useCallback(j=>{_&&(j.length===0?n==null||n(null):n==null||n({file:_,lines:j}))},[_,n]),I=e.length===0;return k.jsxs("div",{className:"file-browser",ref:u,children:[k.jsx("div",{className:"file-browser-content",children:_?k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"file-content-header",children:[k.jsx(_l,{}),k.jsx("span",{className:"file-content-path",children:_})]}),k.jsx("div",{className:"file-content-body",children:y?k.jsx("div",{className:"file-content-loading",children:"加载中…"}):v!==null?k.jsx(ib,{code:v,filePath:_,onSelectionChange:B}):k.jsx("div",{className:"file-content-error",children:"无法读取文件"})})]}):k.jsxs("div",{className:"file-empty",children:[k.jsx(_l,{size:36}),k.jsx("p",{children:"选择文件查看内容"})]})}),k.jsx("div",{className:"resize-handle",onMouseDown:T,onTouchStart:O,children:k.jsx("div",{className:"resize-grip"})}),k.jsx("div",{className:"file-browser-sidebar",style:{height:l},children:k.jsx("div",{className:"file-tree",children:I?k.jsxs("div",{className:"file-tree-empty",children:[k.jsx(L0,{size:40}),k.jsx("p",{children:"加载中…"})]}):e.map(j=>k.jsx(rb,{entry:j,parentPath:"",requestLs:t,onFileClick:H,selectedFile:_},j.name))})})]})}function Fk(e){switch(e){case"A":case"?":return"added";case"M":return"modified";case"D":return"deleted";case"R":return"renamed";default:return"modified"}}function Yk(e){switch(e){case"?":return"U";default:return e}}function Kk({changes:e,requestFile:t,requestDiff:r,onFileContext:n}){const[l,c]=$.useState(200),u=$.useRef(null),d=$.useRef(null),[_,f]=$.useState(null),[v,m]=$.useState(null),[y,S]=$.useState(!1),[b,E]=$.useState(new Set),[T,O]=$.useState(null),H=$.useRef(null);$.useEffect(()=>{if(!_)return;if(!e.some(he=>he.file===_)){f(null),m(null),E(new Set),n==null||n(null);return}let fe=!1;return(async()=>{const[he,J]=await Promise.all([t(_),r(_)]);fe||(m(he),E(new Set(J.added)))})(),()=>{fe=!0}},[e,_,n,t,r]);const B=$.useCallback(fe=>{if(!d.current||!u.current)return;const he=u.current.getBoundingClientRect(),J=he.bottom,G=Math.max(80,Math.min(J-fe,he.height-80));c(G)},[]),I=$.useCallback(()=>{d.current=null},[]),j=fe=>{fe.preventDefault(),d.current={startY:fe.clientY,startHeight:l};const he=G=>B(G.clientY),J=()=>{I(),window.removeEventListener("mousemove",he),window.removeEventListener("mouseup",J)};window.addEventListener("mousemove",he),window.addEventListener("mouseup",J)},Y=fe=>{const he=fe.touches[0];d.current={startY:he.clientY,startHeight:l};const J=re=>{re.preventDefault(),B(re.touches[0].clientY)},G=()=>{I(),window.removeEventListener("touchmove",J),window.removeEventListener("touchend",G)};window.addEventListener("touchmove",J,{passive:!1}),window.addEventListener("touchend",G)},te=async fe=>{f(fe),m(null),E(new Set),O(null),S(!0),n==null||n(null),H.current&&H.current.scrollTo({top:0,behavior:"instant"});const[he,J]=await Promise.all([t(fe),r(fe)]);m(he),E(new Set(J.added)),S(!1);const G=[...J.added].sort((re,se)=>re-se);G.length>0&&O(G[0])},ge=$.useCallback(fe=>{_&&(fe.length===0?n==null||n(null):n==null||n({file:_,lines:fe}))},[_,n]),ve=e.length===0;return k.jsxs("div",{className:"changes-view",ref:u,children:[k.jsx("div",{className:"changes-diff",children:_?k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"file-content-header",children:[k.jsx(_l,{}),k.jsx("span",{className:"file-content-path",children:_})]}),k.jsx("div",{className:"file-content-body",ref:H,children:y?k.jsx("div",{className:"file-content-loading",children:"加载中…"}):v!==null?k.jsx(ib,{code:v,filePath:_,addedLines:b,onSelectionChange:ge,scrollToLine:T}):k.jsx("div",{className:"file-content-error",children:"无法读取文件"})})]}):null}),k.jsx("div",{className:"resize-handle",onMouseDown:j,onTouchStart:Y,children:k.jsx("div",{className:"resize-grip"})}),k.jsx("div",{className:"changes-list",style:{height:l},children:k.jsx("div",{className:"change-items",children:ve?k.jsxs("div",{className:"changes-empty",children:[k.jsx(D0,{size:36}),k.jsx("p",{children:"工作区干净"})]}):e.map(fe=>k.jsxs("div",{className:`change-item ${Fk(fe.status)}${_===fe.file?" selected":""}`,onClick:()=>te(fe.file),children:[k.jsx(_l,{}),k.jsx("span",{children:fe.file}),k.jsx("span",{className:"change-badge",children:Yk(fe.status)})]},fe.file))})})]})}function Xk({previewPort:e}){if(!e)return k.jsx("div",{className:"preview-tab",children:k.jsxs("div",{className:"preview-empty",children:[k.jsx(R0,{size:36}),k.jsx("p",{children:"通过对话让 AI 生成界面,结果将展示在这里"})]})});const t=`${location.protocol}//${location.hostname}:${e}`;return k.jsx("div",{className:"preview-tab",children:k.jsx("iframe",{className:"preview-iframe",src:t,title:"Preview"})})}/**
|
|
201
|
+
\v\f
\u2028\u2029])`),t));else if(_==="posix")if(!l&&(v==="graph"||v==="print")){if(n==="strict")throw new Error(`POSIX class "${v}" requires min target ES2024 or non-strict accuracy`);let m={graph:"!-~",print:" -~"}[v];f&&(m=`\0-${Tt(m.codePointAt(0)-1)}${Tt(m.codePointAt(2)+1)}-`),r(mt(kr(`[${m}]`),t))}else r(mt(Bd(kr(fk.get(v)),f),t));else if(_==="property")y_.has(Yc(v))||(e.key="sc");else if(_==="space")r(ds(Wn("space",{negate:f}),t));else if(_==="word")r(mt(Bd(kr(Ar),f),t));else throw new Error(`Unexpected character set kind "${_}"`)},Directive({node:e,parent:t,root:r,remove:n,replaceWith:l,removeAllPrevSiblings:c,removeAllNextSiblings:u}){const{kind:d,flags:_}=e;if(d==="flags")if(!_.enable&&!_.disable)n();else{const f=Ki({flags:_});f.body[0].body=u(),l(mt(f,t),{traverse:!0})}else if(d==="keep"){const f=r.body[0],m=r.body.length===1&&US(f,{type:"Group"})&&f.body[0].body.length===1?f.body[0]:r;if(t.parent!==m||m.body.length>1)throw new Error(Ae`Uses "\K" in a way that's unsupported`);const y=$s({behind:!0});y.body[0].body=c(),l(mt(y,t))}else throw new Error(`Unexpected directive kind "${d}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(r=>delete e[r]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:r}=e.flags;t!=null&&t.extended&&delete t.extended,r!=null&&r.extended&&delete r.extended,t!=null&&t.dotAll&&(r!=null&&r.dotAll)&&delete t.dotAll,t!=null&&t.ignoreCase&&(r!=null&&r.ignoreCase)&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,r&&!Object.keys(r).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:r}=e;r==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:r}){const{kind:n}=e;if(n==="fail")r(mt($s({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Ki();t.body[0].body.push(e.body),e.body=mt(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const r=[];let n=!1,l=!1;for(const c of e.body)if(c.body.length===1&&c.body[0].kind==="search_start")c.body.pop();else{const u=ib(c.body);u?(n=!0,Array.isArray(u)?r.push(...u):r.push(u)):l=!0}n&&!l&&r.forEach(c=>t.add(c))},exit(e,{accuracy:t,passedLookbehind:r,strategy:n}){if(t==="strict"&&r&&n)throw new Error(Ae`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:r}=e;typeof r=="string"&&!Nd(r)&&(r=Md(r,t),e.ref=r)}},gk={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:r}){const{orphan:n,ref:l}=e;n||r.set(e,[...t.get(l).map(({node:c})=>c)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:r,skip:n},{groupOriginByCopy:l,groupsByName:c,multiplexCapturesToLeftByRef:u,openRefs:d,reffedNodesByReferencer:_}){const f=l.get(e);if(f&&d.has(e.number)){const m=ds(Ty(e.number),t);_.set(m,d.get(e.number)),r(m);return}d.set(e.number,e),u.set(e.number,[]),e.name&&Sl(u,e.name,[]);const v=u.get(e.name??e.number);for(let m=0;m<v.length;m++){const y=v[m];if(f===y.node||f&&f===y.origin||e===y.origin){v.splice(m,1);break}}if(u.get(e.number).push({node:e,origin:f}),e.name&&u.get(e.name).push({node:e,origin:f}),e.name){const m=Sl(c,e.name,new Map);let y=!1;if(f)y=!0;else for(const S of m.values())if(!S.hasDuplicateNameToRemove){y=!0;break}c.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:y})}},exit({node:e},{openRefs:t}){t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Lc(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:r},n){const{isRecursive:l,ref:c}=e;if(l){let v=t;for(;(v=v.parent)&&!(v.type==="CapturingGroup"&&(v.name===c||v.number===c)););n.reffedNodesByReferencer.set(e,v);return}const u=n.subroutineRefMap.get(c),d=c===0,_=d?Ty(0):JS(u,n.groupOriginByCopy,null);let f=_;if(!d){const v=eb(bk(u,y=>y.type==="Group"&&!!y.flags)),m=v?Lc(n.globalFlags,v):n.globalFlags;yk(m,n.currentFlags)||(f=Ki({flags:wk(m)}),f.body[0].body.push(_))}r(mt(f,t),{traverse:!d})}},vk={Backreference({node:e,parent:t,replaceWith:r},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}const c=n.reffedNodesByReferencer.get(e).filter(u=>Sk(u,e));if(!c.length)r(mt($s({negate:!0}),t));else if(c.length>1){const u=Ki({atomic:!0,body:c.reverse().map(d=>Zs({body:[df(d.number)]}))});r(mt(u,t))}else e.ref=c[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){const r=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let n=0;n<r;n++){const l=VS();e.body.at(-1).body.push(l)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function QS(e){fl(e,{"*"({node:t,parent:r}){t.parent=r}})}function yk(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Sk(e,t){let r=t;do{if(r.type==="Regex")return!1;if(r.type==="Alternative")continue;if(r===e)return!1;const n=tb(r.parent);for(const l of n){if(l===r)break;if(l===e||rb(l,e))return!0}}while(r=r.parent);throw new Error("Unexpected path")}function JS(e,t,r,n){const l=Array.isArray(e)?[]:{};for(const[c,u]of Object.entries(e))c==="parent"?l.parent=Array.isArray(r)?n:r:u&&typeof u=="object"?l[c]=JS(u,t,l,r):(c==="type"&&u==="CapturingGroup"&&t.set(l,t.get(e)??e),l[c]=u);return l}function Ty(e){const t=GS(e);return t.isRecursive=!0,t}function bk(e,t){const r=[];for(;e=e.parent;)(!t||t(e))&&r.push(e);return r}function Md(e,t){if(t.has(e))return t.get(e);const r=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,r),r}function eb(e){const t=["dotAll","ignoreCase"],r={enable:{},disable:{}};return e.forEach(({flags:n})=>{t.forEach(l=>{var c,u;(c=n.enable)!=null&&c[l]&&(delete r.disable[l],r.enable[l]=!0),(u=n.disable)!=null&&u[l]&&(r.disable[l]=!0)})}),Object.keys(r.enable).length||delete r.enable,Object.keys(r.disable).length||delete r.disable,r.enable||r.disable?r:null}function wk({dotAll:e,ignoreCase:t}){const r={};return(e||t)&&(r.enable={},e&&(r.enable.dotAll=!0),t&&(r.enable.ignoreCase=!0)),(!e||!t)&&(r.disable={},!e&&(r.disable.dotAll=!0),!t&&(r.disable.ignoreCase=!0)),r}function tb(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function ib(e){const t=e.find(r=>r.kind==="search_start"||xk(r,{negate:!1})||!Ck(r));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const r=[];for(const n of t.body){const l=ib(n.body);if(!l)return null;Array.isArray(l)?r.push(...l):r.push(l)}return r}return null}function rb(e,t){const r=tb(e)??[];for(const n of r)if(n===t||rb(n,t))return!0;return!1}function Ck({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Ek(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function xk(e,t){const r={negate:null,...t};return e.type==="LookaroundAssertion"&&(r.negate===null||e.negate===r.negate)&&e.body.length===1&&US(e.body[0],{type:"Assertion",kind:"search_start"})}function Nd(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function kr(e,t){const n=jS(e,{...t,unicodePropertyMap:y_}).body;return n.length>1||n[0].body.length>1?Ki({body:n}):n[0].body[0]}function Bd(e,t){return e.negate=t,e}function ds(e,t){return e.parent=t,e}function mt(e,t){return QS(e),e.parent=t,e}function Ak(e,t){const r=KS(t),n=pf(r.target,"ES2024"),l=pf(r.target,"ES2025"),c=r.rules.recursionLimit;if(!Number.isInteger(c)||c<2||c>20)throw new Error("Invalid recursionLimit; use 2-20");let u=null,d=null;if(!l){const S=[e.flags.ignoreCase];fl(e,kk,{getCurrentModI:()=>S.at(-1),popModI(){S.pop()},pushModI(b){S.push(b)},setHasCasedChar(){S.at(-1)?u=!0:d=!0}})}const _={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||u)&&!d)};let f=e;const v={accuracy:r.accuracy,appliedGlobalFlags:_,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:f,originMap:e._originMap,recursionLimit:c,useAppliedIgnoreCase:!!(!l&&u&&d),useFlagMods:l,useFlagV:n,verbose:r.verbose};function m(S){return v.lastNode=f,f=S,ak(Tk[S.type],`Unexpected node type "${S.type}"`)(S,v,m)}const y={pattern:e.body.map(m).join("|"),flags:m(e.flags),options:{...e.options}};return n||(delete y.options.force.v,y.options.disable.v=!0,y.options.unicodeSetsPlugin=null),y._captureTransfers=new Map,y._hiddenCaptures=[],v.captureMap.forEach((S,b)=>{S.hidden&&y._hiddenCaptures.push(b),S.transferTo&&Sl(y._captureTransfers,S.transferTo,[]).push(b)}),y}var kk={"*":{enter({node:e},t){if(Dy(e)){const r=t.getCurrentModI();t.pushModI(e.flags?Lc({ignoreCase:r},e.flags).ignoreCase:r)}},exit({node:e},t){Dy(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){S_(Tt(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},r){t(),sb(e,{firstOnly:!0}).length&&r.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&ZS.has(e.value)&&t.setHasCasedChar()}},Tk={Alternative({body:e},t,r){return e.map(r).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?Ae`\B`:Ae`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,r){const{body:n,name:l,number:c}=e,u={ignoreCase:t.currentFlags.ignoreCase},d=t.originMap.get(e);return d&&(u.hidden=!0,c>d.number&&(u.transferTo=d.number)),t.captureMap.set(c,u),`(${l?`?<${l}>`:""}${n.map(r).join("|")})`},Character({value:e},t){const r=Tt(e),n=Vn(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==r)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&S_(r)){const l=XS(r);return t.inCharClass?l.join(""):l.length>1?`[${l.join("")}]`:l[0]}return r},CharacterClass(e,t,r){const{kind:n,negate:l,parent:c}=e;let{body:u}=e;if(n==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");Mr.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&u.some(Ly)&&(u=[Fc(45),...u.filter(f=>!Ly(f))]);const d=()=>`[${l?"^":""}${u.map(r).join(n==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||Mr.bugNestedClassIgnoresNegation)&&!l){const v=u.filter(m=>m.type==="CharacterClass"&&m.kind==="union"&&m.negate);if(v.length){const m=Ki(),y=m.body[0];return m.parent=c,y.parent=m,u=u.filter(S=>!v.includes(S)),e.body=u,u.length?(e.parent=y,y.body.push(e)):m.body.pop(),v.forEach(S=>{const b=Zs({body:[S]});S.parent=b,b.parent=m,m.body.push(b)}),r(m)}}t.inCharClass=!0;const f=d();return t.inCharClass=!1,f}const _=u[0];if(n==="union"&&!l&&_&&((!t.useFlagV||!t.verbose)&&c.kind==="union"&&!(Mr.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&c.kind==="intersection"&&u.length===1&&_.type!=="CharacterClassRange"))return u.map(r).join("");if(!t.useFlagV&&c.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return d()},CharacterClassRange(e,t){const r=e.min.value,n=e.max.value,l={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},c=Vn(r,l),u=Vn(n,l),d=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const _=sb(e);Mk(_).forEach(v=>{d.add(Array.isArray(v)?`${Vn(v[0],l)}-${Vn(v[1],l)}`:Vn(v,l))})}return`${c}-${u}${[...d].join("")}`},CharacterSet({kind:e,negate:t,value:r,key:n},l){if(e==="dot")return l.currentFlags.dotAll?l.appliedGlobalFlags.dotAll||l.useFlagMods?".":"[^]":Ae`[^\n]`;if(e==="digit")return t?Ae`\D`:Ae`\d`;if(e==="property"){if(l.useAppliedIgnoreCase&&l.currentFlags.ignoreCase&&ZS.has(r))throw new Error(`Unicode property "${r}" can't be case-insensitive when other chars have specific case`);return`${t?Ae`\P`:Ae`\p`}{${n?`${n}=`:""}${r}}`}if(e==="word")return t?Ae`\W`:Ae`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:r,parent:n},l,c){const u=l.currentFlags;r&&(l.currentFlags=Lc(u,r));const d=t.map(c).join("|"),_=!l.verbose&&t.length===1&&n.type!=="Quantifier"&&!e&&(!l.useFlagMods||!r)?d:`(?${Nk(e,r,l.useFlagMods)}${d})`;return l.currentFlags=u,_},LookaroundAssertion({body:e,kind:t,negate:r},n,l){return`(?${`${t==="lookahead"?"":"<"}${r?"!":"="}`}${e.map(l).join("|")})`},Quantifier(e,t,r){return r(e.body)+Bk(e)},Subroutine({isRecursive:e,ref:t},r){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=r.recursionLimit;return t===0?`(?R=${n})`:Ae`\g<${t}&R=${n}>`}},Rk=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Dk=new Set(["-","\\","]","^","["]),Lk=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Ry=new Map([[9,Ae`\t`],[10,Ae`\n`],[11,Ae`\v`],[12,Ae`\f`],[13,Ae`\r`],[8232,Ae`\u2028`],[8233,Ae`\u2029`],[65279,Ae`\uFEFF`]]),Ok=new RegExp("^\\p{Cased}$","u");function S_(e){return Ok.test(e)}function sb(e,t){const r=!!(t!=null&&t.firstOnly),n=e.min.value,l=e.max.value,c=[];if(n<65&&(l===65535||l>=131071)||n===65536&&l>=131071)return c;for(let u=n;u<=l;u++){const d=Tt(u);if(!S_(d))continue;const _=XS(d).filter(f=>{const v=f.codePointAt(0);return v<n||v>l});if(_.length&&(c.push(..._),r))break}return c}function Vn(e,{escDigit:t,inCharClass:r,useFlagV:n}){if(Ry.has(e))return Ry.get(e);if(e<32||e>126&&e<160||e>262143||t&&zk(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const l=r?n?Lk:Dk:Rk,c=Tt(e);return(l.has(c)?"\\":"")+c}function Mk(e){const t=e.map(l=>l.codePointAt(0)).sort((l,c)=>l-c),r=[];let n=null;for(let l=0;l<t.length;l++)t[l+1]===t[l]+1?n??(n=t[l]):n===null?r.push(t[l]):(r.push([n,t[l]]),n=null);return r}function Nk(e,t,r){if(e)return">";let n="";if(t&&r){const{enable:l,disable:c}=t;n=(l!=null&&l.ignoreCase?"i":"")+(l!=null&&l.dotAll?"s":"")+(c?"-":"")+(c!=null&&c.ignoreCase?"i":"")+(c!=null&&c.dotAll?"s":"")}return`${n}:`}function Bk({kind:e,max:t,min:r}){let n;return!r&&t===1?n="?":!r&&t===1/0?n="*":r===1&&t===1/0?n="+":r===t?n=`{${r}}`:n=`{${r},${t===1/0?"":t}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function Dy({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function zk(e){return e>47&&e<58}function Ly({type:e,value:t}){return e==="Character"&&t===45}var _s,Rr,Ys,ps,Ks,El,mf,ys,Pk=(ys=class extends RegExp{constructor(r,n,l){var t=(...oO)=>(super(...oO),Is(this,El),Is(this,_s,new Map),Is(this,Rr,null),Is(this,Ys),Is(this,ps,null),Is(this,Ks,null),Y(this,"rawOptions",{}),this);const c=!!(l!=null&&l.lazyCompile);if(r instanceof RegExp){if(l)throw new Error("Cannot provide options when copying a regexp");const u=r;t(u,n),Fi(this,Ys,u.source),u instanceof ys&&(Fi(this,_s,ei(u,_s)),Fi(this,ps,ei(u,ps)),Fi(this,Ks,ei(u,Ks)),this.rawOptions=u.rawOptions)}else{const u={hiddenCaptures:[],strategy:null,transfers:[],...l};t(c?"":r,n),Fi(this,Ys,r),Fi(this,_s,Hk(u.hiddenCaptures,u.transfers)),Fi(this,Ks,u.strategy),this.rawOptions=l??{}}c||Fi(this,Rr,this)}get source(){return ei(this,Ys)||"(?:)"}exec(r){if(!ei(this,Rr)){const{lazyCompile:c,...u}=this.rawOptions;Fi(this,Rr,new ys(ei(this,Ys),this.flags,u))}const n=this.global||this.sticky,l=this.lastIndex;if(ei(this,Ks)==="clip_search"&&n&&l){this.lastIndex=0;const c=_d(this,El,mf).call(this,r.slice(l));return c&&(Ik(c,l,r,this.hasIndices),this.lastIndex+=l),c}return _d(this,El,mf).call(this,r)}},_s=new WeakMap,Rr=new WeakMap,Ys=new WeakMap,ps=new WeakMap,Ks=new WeakMap,El=new WeakSet,mf=function(r){ei(this,Rr).lastIndex=this.lastIndex;const n=Lv(ys.prototype,this,"exec").call(ei(this,Rr),r);if(this.lastIndex=ei(this,Rr).lastIndex,!n||!ei(this,_s).size)return n;const l=[...n];n.length=1;let c;this.hasIndices&&(c=[...n.indices],n.indices.length=1);const u=[0];for(let d=1;d<l.length;d++){const{hidden:_,transferTo:f}=ei(this,_s).get(d)??{};if(_?u.push(null):(u.push(n.length),n.push(l[d]),this.hasIndices&&n.indices.push(c[d])),f&&l[d]!==void 0){const v=u[f];if(!v)throw new Error(`Invalid capture transfer to "${v}"`);if(n[v]=l[d],this.hasIndices&&(n.indices[v]=c[d]),n.groups){ei(this,ps)||Fi(this,ps,Uk(this.source));const m=ei(this,ps).get(f);m&&(n.groups[m]=l[d],this.hasIndices&&(n.indices.groups[m]=c[d]))}}}return n},ys);function Ik(e,t,r,n){if(e.index+=t,e.input=r,n){const l=e.indices;for(let u=0;u<l.length;u++){const d=l[u];d&&(l[u]=[d[0]+t,d[1]+t])}const c=l.groups;c&&Object.keys(c).forEach(u=>{const d=c[u];d&&(c[u]=[d[0]+t,d[1]+t])})}}function Hk(e,t){const r=new Map;for(const n of e)r.set(n,{hidden:!0});for(const[n,l]of t)for(const c of l)Sl(r,c,{}).transferTo=n;return r}function Uk(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,r=new Map;let n=0,l=0,c;for(;c=t.exec(e);){const{0:u,groups:{capture:d,name:_}}=c;u==="["?n++:n?u==="]"&&n--:d&&(l++,_&&r.set(l,_))}return r}function jk(e,t){const r=Vk(e,t);return r.options?new Pk(r.pattern,r.flags,r.options):new RegExp(r.pattern,r.flags)}function Vk(e,t){const r=KS(t),n=jS(e,{flags:r.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:r.rules.captureGroup,singleline:r.rules.singleline},skipBackrefValidation:r.rules.allowOrphanBackrefs,unicodePropertyMap:y_}),l=pk(n,{accuracy:r.accuracy,asciiWordBoundaries:r.rules.asciiWordBoundaries,avoidSubclass:r.avoidSubclass,bestEffortTarget:r.target}),c=Ak(l,r),u=sk(c.pattern,{captureTransfers:c._captureTransfers,hiddenCaptures:c._hiddenCaptures,mode:"external"}),d=ik(u.pattern),_=tk(d.pattern,{captureTransfers:u.captureTransfers,hiddenCaptures:u.hiddenCaptures}),f={pattern:_.pattern,flags:`${r.hasIndices?"d":""}${r.global?"g":""}${c.flags}${c.options.disable.v?"u":"v"}`};if(r.avoidSubclass){if(r.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const v=_.hiddenCaptures.sort((b,x)=>b-x),m=Array.from(_.captureTransfers),y=l._strategy,S=f.pattern.length>=r.lazyCompileLength;(v.length||m.length||y||S)&&(f.options={...v.length&&{hiddenCaptures:v},...m.length&&{transfers:m},...y&&{strategy:y},...S&&{lazyCompile:S}})}return f}function nb(e,t){return jk(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function $k(e={}){const t=Object.assign({target:"auto",cache:new Map},e);return t.regexConstructor||(t.regexConstructor=r=>nb(r,{target:t.target})),{createScanner(r){return new nA(r,t)},createString(r){return{content:r}}}}var Gk=t_({bundledLanguages:()=>s_,bundledLanguagesAlias:()=>r_,bundledLanguagesBase:()=>i_,bundledLanguagesInfo:()=>Ic,bundledThemes:()=>a_,bundledThemesInfo:()=>n_,codeToHast:()=>RS,codeToHtml:()=>TS,codeToTokens:()=>DS,codeToTokensBase:()=>LS,codeToTokensWithThemes:()=>OS,createHighlighter:()=>Wc,createJavaScriptRegexEngine:()=>$k,createOnigurumaEngine:()=>U0,defaultJavaScriptRegexConstructor:()=>nb,getLastGrammarState:()=>NS,getSingletonHighlighter:()=>MS,loadWasm:()=>o_});P0(Gk,sA);let zd=null;const Pd=new Set;function qk(){return zd||(zd=Wc({themes:["github-dark"],langs:["text"]})),zd}function Wk(e){var l,c;const t=((l=e.split(".").pop())==null?void 0:l.toLowerCase())??"",r={ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",json:"json",md:"markdown",css:"css",scss:"scss",html:"html",xml:"xml",svg:"xml",py:"python",rb:"ruby",rs:"rust",go:"go",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",hpp:"cpp",sh:"bash",bash:"bash",zsh:"bash",sql:"sql",yaml:"yaml",yml:"yaml",toml:"toml",dockerfile:"dockerfile",makefile:"makefile",vue:"vue",svelte:"svelte",graphql:"graphql",gql:"graphql",lua:"lua",php:"php",r:"r"},n=((c=e.split("/").pop())==null?void 0:c.toLowerCase())??"";return n==="dockerfile"?"dockerfile":n==="makefile"||n==="gnumakefile"?"makefile":r[t]||"text"}function Fk(e,t,r){let n=0;return e.replace(/<span class="line"/g,()=>{n++;const l=["line"];return t!=null&&t.has(n)&&l.push("diff-added"),r!=null&&r.has(n)&&l.push("diff-removed"),`<span class="${l.join(" ")}" data-line="${n}"`})}function rc(e,t){const r=e.querySelectorAll("[data-line]");for(let n=0;n<r.length;n++){const l=r[n].getBoundingClientRect();if(t.clientY>=l.top&&t.clientY<=l.bottom)return parseInt(r[n].getAttribute("data-line"),10)}if(r.length>0){const n=r[0].getBoundingClientRect();if(t.clientY<n.top)return 1;const l=r[r.length-1];return parseInt(l.getAttribute("data-line"),10)}return null}const ab=V.memo(function({code:t,filePath:r,addedLines:n,removedLines:l,onSelectionChange:c,scrollToLine:u}){const[d,_]=V.useState(null),[f,v]=V.useState(!1),[m,y]=V.useState(new Set),S=V.useRef(null),b=V.useRef(null),x=V.useRef(c);x.current=c;const T=V.useRef(null),O=V.useRef(!1),H=V.useRef(null),B=V.useRef(!1),I=V.useRef(null),j=V.useRef(null),$=V.useRef(!1);V.useEffect(()=>{let re=!1;return(async()=>{try{const le=await qk(),E=Wk(r);if(E!=="text"&&!Pd.has(E))try{await le.loadLanguage(E),Pd.add(E)}catch{}const M=Pd.has(E)?E:"text",X=le.codeToHtml(t,{lang:M,theme:"github-dark"});re||_(X)}catch{re||v(!0)}})(),()=>{re=!0}},[t,r]),V.useEffect(()=>{y(new Set),H.current=null,c==null||c([])},[r,t]);const ee=V.useRef(null);V.useLayoutEffect(()=>{if(u==null||!d||!S.current)return;const re=`${r}:${u}`;if(ee.current===re)return;ee.current=re;const le=S.current.querySelector(`[data-line="${u}"]`);if(!le){b.current&&(b.current.style.visibility="");return}const E=S.current.closest(".file-content-body");if(!E){b.current&&(b.current.style.visibility="");return}const M=le.offsetTop-E.offsetTop-3*19.2;E.scrollTo({top:Math.max(0,M),behavior:"instant"}),b.current&&(b.current.style.visibility="")},[d,u,r]);const ge=V.useMemo(()=>d?Fk(d,n,l):null,[d,n,l]),Se=V.useMemo(()=>{if(m.size===0)return null;const re=Array.from(m).sort((le,E)=>le-E);return{start:re[0],end:re[re.length-1]}},[m]),_e=V.useCallback((re,le)=>{var M;const E=new Set;for(let X=re;X<=le;X++)E.add(X);y(E),(M=x.current)==null||M.call(x,Array.from(E).sort((X,te)=>X-te))},[]),he=V.useCallback(()=>{var re;y(new Set),H.current=null,$.current=!1,(re=x.current)==null||re.call(x,[])},[]),J=V.useCallback(re=>{var E;if(O.current||!S.current)return;const le=rc(S.current,re);le!==null&&(re.preventDefault(),(E=window.getSelection())==null||E.removeAllRanges(),T.current={anchor:le,dragged:!1,startX:re.clientX,startY:re.clientY})},[]),W=V.useCallback(re=>{if(!T.current||!S.current)return;if(!T.current.dragged){const te=re.clientX-T.current.startX,ue=re.clientY-T.current.startY;if(te*te+ue*ue<25)return;T.current.dragged=!0}const le=rc(S.current,re);if(le===null)return;const E=Math.min(T.current.anchor,le),M=Math.max(T.current.anchor,le),X=new Set;for(let te=E;te<=M;te++)X.add(te);y(X)},[]),ne=V.useCallback(()=>{if(!T.current)return;const re=T.current.dragged;T.current=null,re?y(le=>{var M;const E=Array.from(le).sort((X,te)=>X-te);return(M=x.current)==null||M.call(x,E),le}):he()},[he]);V.useEffect(()=>{const re=()=>{if(!T.current)return;const le=T.current.dragged;T.current=null,le?y(E=>{var X;const M=Array.from(E).sort((te,ue)=>te-ue);return(X=x.current)==null||X.call(x,M),E}):he()};return window.addEventListener("mouseup",re),()=>window.removeEventListener("mouseup",re)},[he]),V.useEffect(()=>{if(!S.current)return;const re=S.current,le=300,E=10;let M=null,X=0,te=0,ue=-1;const pe=$e=>{$e.pointerType!=="mouse"&&re.contains($e.target)&&(B.current||(ue=$e.pointerId,X=$e.clientX,te=$e.clientY,O.current=!0,M=setTimeout(()=>{var Te;M=null;const at=rc(re,{clientY:te});at!==null&&(H.current=at,_e(at,at),(Te=navigator.vibrate)==null||Te.call(navigator,50))},le)))},we=$e=>{if($e.pointerId!==ue||!M)return;const at=$e.clientX-X,Te=$e.clientY-te;at*at+Te*Te>E*E&&(clearTimeout(M),M=null)},We=$e=>{$e.pointerId===ue&&(ue=-1,M&&(clearTimeout(M),M=null,he()),setTimeout(()=>{O.current=!1},400))},ze=$e=>{$e.pointerId===ue&&(ue=-1,M&&(clearTimeout(M),M=null),setTimeout(()=>{O.current=!1},400))},Ft=$e=>{re.contains($e.target)&&$e.preventDefault()};return document.addEventListener("pointerdown",pe),document.addEventListener("pointermove",we),document.addEventListener("pointerup",We),document.addEventListener("pointercancel",ze),document.addEventListener("contextmenu",Ft),()=>{document.removeEventListener("pointerdown",pe),document.removeEventListener("pointermove",we),document.removeEventListener("pointerup",We),document.removeEventListener("pointercancel",ze),document.removeEventListener("contextmenu",Ft),M&&clearTimeout(M)}},[d,_e,he]);const se=V.useCallback(re=>{re.preventDefault(),re.stopPropagation(),B.current=!0,j.current=null,re.currentTarget.setPointerCapture(re.pointerId)},[]),D=V.useCallback(re=>{if(!B.current||!S.current||H.current===null)return;const le=rc(S.current,re);if(le===null)return;const E=Math.min(H.current,le),M=Math.max(H.current,le),X=le<H.current;j.current={start:E,end:M},$.current=X;const te=S.current.querySelectorAll("[data-line]");for(let ue=0;ue<te.length;ue++){const pe=parseInt(te[ue].getAttribute("data-line"),10);pe>=E&&pe<=M?te[ue].classList.add("line-selected"):te[ue].classList.remove("line-selected")}if(I.current&&b.current){const ue=X?E:M,pe=S.current.querySelector(`[data-line="${ue}"]`);if(pe){const we=b.current.getBoundingClientRect(),We=pe.getBoundingClientRect();X?(I.current.style.top=`${We.top-we.top-I.current.offsetHeight}px`,I.current.classList.add("cv-drag-handle--top")):(I.current.style.top=`${We.bottom-we.top}px`,I.current.classList.remove("cv-drag-handle--top"))}}},[]),q=V.useCallback(()=>{B.current&&(B.current=!1,j.current&&(_e(j.current.start,j.current.end),j.current=null))},[_e]);if(V.useLayoutEffect(()=>{if(!S.current)return;if(S.current.querySelectorAll("[data-line]").forEach(le=>{const E=parseInt(le.getAttribute("data-line"),10);m.has(E)?le.classList.add("line-selected"):le.classList.remove("line-selected")}),I.current&&b.current&&m.size>0){const le=Array.from(m).sort((M,X)=>M-X),E=b.current.getBoundingClientRect();if($.current){const M=S.current.querySelector(`[data-line="${le[0]}"]`);if(M){const X=M.getBoundingClientRect();I.current.style.top=`${X.top-E.top-I.current.offsetHeight}px`,I.current.classList.add("cv-drag-handle--top")}}else{const M=S.current.querySelector(`[data-line="${le[le.length-1]}"]`);if(M){const X=M.getBoundingClientRect();I.current.style.top=`${X.bottom-E.top}px`,I.current.classList.remove("cv-drag-handle--top")}}}},[m,d]),f)return k.jsx("pre",{className:"code-viewer-fallback",children:t});if(!ge)return k.jsx("div",{className:"code-viewer-loading",children:"..."});const F=u!=null&&ee.current!==`${r}:${u}`;return k.jsxs("div",{ref:b,className:"code-viewer-wrapper",style:F?{visibility:"hidden"}:void 0,children:[k.jsx("div",{ref:S,className:"code-viewer",dangerouslySetInnerHTML:{__html:ge},onMouseDown:J,onMouseMove:W,onMouseUp:ne}),Se&&k.jsx("div",{ref:I,className:"cv-drag-handle",onPointerDown:se,onPointerMove:D,onPointerUp:q,children:k.jsx("div",{className:"cv-drag-handle-pill"})})]})});function lb({entry:e,parentPath:t,requestLs:r,onFileClick:n,selectedFile:l,depth:c=0}){const[u,d]=V.useState(!1),[_,f]=V.useState(null),[v,m]=V.useState(!1),y=t?`${t}/${e.name}`:e.name,S=async()=>{if(e.type==="dir"){if(u){d(!1);return}if(_===null){m(!0);const b=await r(y);f(b),m(!1)}d(!0)}};if(e.type==="file"){const b=l===y;return k.jsxs("div",{className:`file-tree-item file${b?" selected":""}`,style:{paddingLeft:`${12+c*16+18}px`},onClick:()=>n(y),children:[k.jsx("span",{className:"file-icon",children:k.jsx(pl,{})}),k.jsx("span",{className:"file-name",children:e.name})]})}return k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"file-tree-item folder",style:{paddingLeft:`${12+c*16}px`},onClick:S,children:[k.jsx("span",{className:`chevron ${u?"expanded":""}`,children:k.jsx(jC,{})}),k.jsx("span",{className:"file-icon",children:k.jsx(B0,{})}),k.jsxs("span",{className:"file-name",children:[e.name,"/"]}),v&&k.jsx("span",{className:"tree-loading",children:"…"})]}),u&&(_==null?void 0:_.map(b=>k.jsx(lb,{entry:b,parentPath:y,requestLs:r,onFileClick:n,selectedFile:l,depth:c+1},b.name)))]})}function Yk({topLevel:e,requestLs:t,requestFile:r,onFileContext:n}){const[l,c]=V.useState(200),u=V.useRef(null),d=V.useRef(null),[_,f]=V.useState(null),[v,m]=V.useState(null),[y,S]=V.useState(!1),b=V.useCallback(j=>{if(!d.current||!u.current)return;const $=u.current.getBoundingClientRect(),ee=$.bottom,ge=Math.max(80,Math.min(ee-j,$.height-80));c(ge)},[]),x=V.useCallback(()=>{d.current=null},[]),T=j=>{j.preventDefault(),d.current={startY:j.clientY,startHeight:l};const $=ge=>b(ge.clientY),ee=()=>{x(),window.removeEventListener("mousemove",$),window.removeEventListener("mouseup",ee)};window.addEventListener("mousemove",$),window.addEventListener("mouseup",ee)},O=j=>{const $=j.touches[0];d.current={startY:$.clientY,startHeight:l};const ee=Se=>{Se.preventDefault(),b(Se.touches[0].clientY)},ge=()=>{x(),window.removeEventListener("touchmove",ee),window.removeEventListener("touchend",ge)};window.addEventListener("touchmove",ee,{passive:!1}),window.addEventListener("touchend",ge)},H=async j=>{f(j),m(null),S(!0),n==null||n(null);const $=await r(j);m($),S(!1)},B=V.useCallback(j=>{_&&(j.length===0?n==null||n(null):n==null||n({file:_,lines:j}))},[_,n]),I=e.length===0;return k.jsxs("div",{className:"file-browser",ref:u,children:[k.jsx("div",{className:"file-browser-content",children:_?k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"file-content-header",children:[k.jsx(pl,{}),k.jsx("span",{className:"file-content-path",children:_})]}),k.jsx("div",{className:"file-content-body",children:y?k.jsx("div",{className:"file-content-loading",children:"加载中…"}):v!==null?k.jsx(ab,{code:v,filePath:_,onSelectionChange:B}):k.jsx("div",{className:"file-content-error",children:"无法读取文件"})})]}):k.jsxs("div",{className:"file-empty",children:[k.jsx(pl,{size:36}),k.jsx("p",{children:"选择文件查看内容"})]})}),k.jsx("div",{className:"resize-handle",onMouseDown:T,onTouchStart:O,children:k.jsx("div",{className:"resize-grip"})}),k.jsx("div",{className:"file-browser-sidebar",style:{height:l},children:k.jsx("div",{className:"file-tree",children:I?k.jsxs("div",{className:"file-tree-empty",children:[k.jsx(B0,{size:40}),k.jsx("p",{children:"加载中…"})]}):e.map(j=>k.jsx(lb,{entry:j,parentPath:"",requestLs:t,onFileClick:H,selectedFile:_},j.name))})})]})}function Kk(e){switch(e){case"A":case"?":return"added";case"M":return"modified";case"D":return"deleted";case"R":return"renamed";default:return"modified"}}function Xk(e){switch(e){case"?":return"U";default:return e}}function Zk({changes:e,requestFile:t,requestDiff:r,onFileContext:n}){const[l,c]=V.useState(200),u=V.useRef(null),d=V.useRef(null),[_,f]=V.useState(null),[v,m]=V.useState(null),[y,S]=V.useState(!1),[b,x]=V.useState(new Set),[T,O]=V.useState(null),H=V.useRef(null);V.useEffect(()=>{if(!_)return;if(!e.some(he=>he.file===_)){f(null),m(null),x(new Set),n==null||n(null);return}let _e=!1;return(async()=>{const[he,J]=await Promise.all([t(_),r(_)]);_e||(m(he),x(new Set(J.added)))})(),()=>{_e=!0}},[e,_,n,t,r]);const B=V.useCallback(_e=>{if(!d.current||!u.current)return;const he=u.current.getBoundingClientRect(),J=he.bottom,W=Math.max(80,Math.min(J-_e,he.height-80));c(W)},[]),I=V.useCallback(()=>{d.current=null},[]),j=_e=>{_e.preventDefault(),d.current={startY:_e.clientY,startHeight:l};const he=W=>B(W.clientY),J=()=>{I(),window.removeEventListener("mousemove",he),window.removeEventListener("mouseup",J)};window.addEventListener("mousemove",he),window.addEventListener("mouseup",J)},$=_e=>{const he=_e.touches[0];d.current={startY:he.clientY,startHeight:l};const J=ne=>{ne.preventDefault(),B(ne.touches[0].clientY)},W=()=>{I(),window.removeEventListener("touchmove",J),window.removeEventListener("touchend",W)};window.addEventListener("touchmove",J,{passive:!1}),window.addEventListener("touchend",W)},ee=async _e=>{f(_e),m(null),x(new Set),O(null),S(!0),n==null||n(null),H.current&&H.current.scrollTo({top:0,behavior:"instant"});const[he,J]=await Promise.all([t(_e),r(_e)]);m(he),x(new Set(J.added)),S(!1);const W=[...J.added].sort((ne,se)=>ne-se);W.length>0&&O(W[0])},ge=V.useCallback(_e=>{_&&(_e.length===0?n==null||n(null):n==null||n({file:_,lines:_e}))},[_,n]),Se=e.length===0;return k.jsxs("div",{className:"changes-view",ref:u,children:[k.jsx("div",{className:"changes-diff",children:_?k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"file-content-header",children:[k.jsx(pl,{}),k.jsx("span",{className:"file-content-path",children:_})]}),k.jsx("div",{className:"file-content-body",ref:H,children:y?k.jsx("div",{className:"file-content-loading",children:"加载中…"}):v!==null?k.jsx(ab,{code:v,filePath:_,addedLines:b,onSelectionChange:ge,scrollToLine:T}):k.jsx("div",{className:"file-content-error",children:"无法读取文件"})})]}):null}),k.jsx("div",{className:"resize-handle",onMouseDown:j,onTouchStart:$,children:k.jsx("div",{className:"resize-grip"})}),k.jsx("div",{className:"changes-list",style:{height:l},children:k.jsx("div",{className:"change-items",children:Se?k.jsxs("div",{className:"changes-empty",children:[k.jsx(N0,{size:36}),k.jsx("p",{children:"工作区干净"})]}):e.map(_e=>k.jsxs("div",{className:`change-item ${Kk(_e.status)}${_===_e.file?" selected":""}`,onClick:()=>ee(_e.file),children:[k.jsx(pl,{}),k.jsx("span",{children:_e.file}),k.jsx("span",{className:"change-badge",children:Xk(_e.status)})]},_e.file))})})]})}function Qk({previewPort:e}){if(!e)return k.jsx("div",{className:"preview-tab",children:k.jsxs("div",{className:"preview-empty",children:[k.jsx(M0,{size:36}),k.jsx("p",{children:"通过对话让 AI 生成界面,结果将展示在这里"})]})});const t=`${location.protocol}//${location.hostname}:${e}`;return k.jsx("div",{className:"preview-tab",children:k.jsx("iframe",{className:"preview-iframe",src:t,title:"Preview"})})}/**
|
|
202
202
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
203
203
|
* @license MIT
|
|
204
204
|
*
|
|
@@ -209,22 +209,22 @@ XID_Start XIDS`.split(/\s/).map(e=>[Yc(e),e])),ok=new Map([["s",Tt(383)],[Tt(383
|
|
|
209
209
|
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
210
210
|
* http://bellard.org/jslinux/
|
|
211
211
|
* Copyright (c) 2011 Fabrice Bellard
|
|
212
|
-
*/var
|
|
212
|
+
*/var ob=Object.defineProperty,Jk=Object.getOwnPropertyDescriptor,eT=(e,t)=>{for(var r in t)ob(e,r,{get:t[r],enumerable:!0})},dt=(e,t,r,n)=>{for(var l=n>1?void 0:n?Jk(t,r):t,c=e.length-1,u;c>=0;c--)(u=e[c])&&(l=(n?u(t,r,l):u(l))||l);return n&&l&&ob(t,r,l),l},de=(e,t)=>(r,n)=>t(r,n,e),Oy="Terminal input",gf={get:()=>Oy,set:e=>Oy=e},My="Too much output to announce, navigate to rows manually to read",vf={get:()=>My,set:e=>My=e};function tT(e){return e.replace(/\r?\n/g,"\r")}function iT(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function rT(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function sT(e,t,r,n){if(e.stopPropagation(),e.clipboardData){let l=e.clipboardData.getData("text/plain");cb(l,t,r,n)}}function cb(e,t,r,n){e=tT(e),e=iT(e,r.decPrivateModes.bracketedPasteMode&&n.rawOptions.ignoreBracketedPasteMode!==!0),r.triggerDataEvent(e,!0),t.value=""}function ub(e,t,r){let n=r.getBoundingClientRect(),l=e.clientX-n.left-10,c=e.clientY-n.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${l}px`,t.style.top=`${c}px`,t.style.zIndex="1000",t.focus()}function Ny(e,t,r,n,l){ub(e,t,r),l&&n.rightClickSelect(e),t.value=n.selectionText,t.select()}function fs(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function Xc(e,t=0,r=e.length){let n="";for(let l=t;l<r;++l){let c=e[l];c>65535?(c-=65536,n+=String.fromCharCode((c>>10)+55296)+String.fromCharCode(c%1024+56320)):n+=String.fromCharCode(c)}return n}var nT=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let r=e.length;if(!r)return 0;let n=0,l=0;if(this._interim){let c=e.charCodeAt(l++);56320<=c&&c<=57343?t[n++]=(this._interim-55296)*1024+c-56320+65536:(t[n++]=this._interim,t[n++]=c),this._interim=0}for(let c=l;c<r;++c){let u=e.charCodeAt(c);if(55296<=u&&u<=56319){if(++c>=r)return this._interim=u,n;let d=e.charCodeAt(c);56320<=d&&d<=57343?t[n++]=(u-55296)*1024+d-56320+65536:(t[n++]=u,t[n++]=d);continue}u!==65279&&(t[n++]=u)}return n}},aT=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let r=e.length;if(!r)return 0;let n=0,l,c,u,d,_=0,f=0;if(this.interim[0]){let y=!1,S=this.interim[0];S&=(S&224)===192?31:(S&240)===224?15:7;let b=0,x;for(;(x=this.interim[++b]&63)&&b<4;)S<<=6,S|=x;let T=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,O=T-b;for(;f<O;){if(f>=r)return 0;if(x=e[f++],(x&192)!==128){f--,y=!0;break}else this.interim[b++]=x,S<<=6,S|=x&63}y||(T===2?S<128?f--:t[n++]=S:T===3?S<2048||S>=55296&&S<=57343||S===65279||(t[n++]=S):S<65536||S>1114111||(t[n++]=S)),this.interim.fill(0)}let v=r-4,m=f;for(;m<r;){for(;m<v&&!((l=e[m])&128)&&!((c=e[m+1])&128)&&!((u=e[m+2])&128)&&!((d=e[m+3])&128);)t[n++]=l,t[n++]=c,t[n++]=u,t[n++]=d,m+=4;if(l=e[m++],l<128)t[n++]=l;else if((l&224)===192){if(m>=r)return this.interim[0]=l,n;if(c=e[m++],(c&192)!==128){m--;continue}if(_=(l&31)<<6|c&63,_<128){m--;continue}t[n++]=_}else if((l&240)===224){if(m>=r)return this.interim[0]=l,n;if(c=e[m++],(c&192)!==128){m--;continue}if(m>=r)return this.interim[0]=l,this.interim[1]=c,n;if(u=e[m++],(u&192)!==128){m--;continue}if(_=(l&15)<<12|(c&63)<<6|u&63,_<2048||_>=55296&&_<=57343||_===65279)continue;t[n++]=_}else if((l&248)===240){if(m>=r)return this.interim[0]=l,n;if(c=e[m++],(c&192)!==128){m--;continue}if(m>=r)return this.interim[0]=l,this.interim[1]=c,n;if(u=e[m++],(u&192)!==128){m--;continue}if(m>=r)return this.interim[0]=l,this.interim[1]=c,this.interim[2]=u,n;if(d=e[m++],(d&192)!==128){m--;continue}if(_=(l&7)<<18|(c&63)<<12|(u&63)<<6|d&63,_<65536||_>1114111)continue;t[n++]=_}}return n}},hb="",ms=" ",Tl=class db{constructor(){this.fg=0,this.bg=0,this.extended=new Oc}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new db;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}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}},Oc=class fb{constructor(t=0,r=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new fb(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},$i=class _b extends Tl{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Oc,this.combinedData=""}static fromCharData(t){let r=new _b;return r.setFromCharData(t),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?fs(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let r=!1;if(t[1].length>2)r=!0;else if(t[1].length===2){let n=t[1].charCodeAt(0);if(55296<=n&&n<=56319){let l=t[1].charCodeAt(1);56320<=l&&l<=57343?this.content=(n-55296)*1024+l-56320+65536|t[2]<<22:r=!0}else r=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;r&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},By="di$target",yf="di$dependencies",Id=new Map;function lT(e){return e[yf]||[]}function Ht(e){if(Id.has(e))return Id.get(e);let t=function(r,n,l){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");oT(t,r,l)};return t._id=e,Id.set(e,t),t}function oT(e,t,r){t[By]===t?t[yf].push({id:e,index:r}):(t[yf]=[{id:e,index:r}],t[By]=t)}var ii=Ht("BufferService"),pb=Ht("CoreMouseService"),tn=Ht("CoreService"),cT=Ht("CharsetService"),b_=Ht("InstantiationService"),mb=Ht("LogService"),ri=Ht("OptionsService"),gb=Ht("OscLinkService"),uT=Ht("UnicodeService"),Rl=Ht("DecorationService"),Sf=class{constructor(e,t,r){this._bufferService=e,this._optionsService=t,this._oscLinkService=r}provideLinks(e,t){var v;let r=this._bufferService.buffer.lines.get(e-1);if(!r){t(void 0);return}let n=[],l=this._optionsService.rawOptions.linkHandler,c=new $i,u=r.getTrimmedLength(),d=-1,_=-1,f=!1;for(let m=0;m<u;m++)if(!(_===-1&&!r.hasContent(m))){if(r.loadCell(m,c),c.hasExtendedAttrs()&&c.extended.urlId)if(_===-1){_=m,d=c.extended.urlId;continue}else f=c.extended.urlId!==d;else _!==-1&&(f=!0);if(f||_!==-1&&m===u-1){let y=(v=this._oscLinkService.getLinkData(d))==null?void 0:v.uri;if(y){let S={start:{x:_+1,y:e},end:{x:m+(!f&&m===u-1?1:0),y:e}},b=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{let x=new URL(y);["http:","https:"].includes(x.protocol)||(b=!0)}catch{b=!0}b||n.push({text:y,range:S,activate:(x,T)=>l?l.activate(x,T,S):hT(x,T),hover:(x,T)=>{var O;return(O=l==null?void 0:l.hover)==null?void 0:O.call(l,x,T,S)},leave:(x,T)=>{var O;return(O=l==null?void 0:l.leave)==null?void 0:O.call(l,x,T,S)}})}f=!1,c.hasExtendedAttrs()&&c.extended.urlId?(_=m,d=c.extended.urlId):(_=-1,d=-1)}}t(n)}};Sf=dt([de(0,ii),de(1,ri),de(2,gb)],Sf);function hT(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
213
213
|
|
|
214
|
-
WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Zc=Ht("CharSizeService"),Nr=Ht("CoreBrowserService"),
|
|
214
|
+
WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){try{r.opener=null}catch{}r.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Zc=Ht("CharSizeService"),Nr=Ht("CoreBrowserService"),w_=Ht("MouseService"),Br=Ht("RenderService"),dT=Ht("SelectionService"),vb=Ht("CharacterJoinerService"),ta=Ht("ThemeService"),yb=Ht("LinkProviderService"),fT=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?zy.isErrorNoTelemetry(e)?new zy(e.message+`
|
|
215
215
|
|
|
216
216
|
`+e.stack):new Error(e.message+`
|
|
217
217
|
|
|
218
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(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)}},dT=new hT;function fc(e){fT(e)||dT.onUnexpectedError(e)}var Sf="Canceled";function fT(e){return e instanceof _T?!0:e instanceof Error&&e.name===Sf&&e.message===Sf}var _T=class extends Error{constructor(){super(Sf),this.name=this.message}};function pT(e){return new Error(`Illegal argument: ${e}`)}var Ny=class bf extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof bf)return t;let r=new bf;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},wf=class mb extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,mb.prototype)}};function Ci(e,t=0){return e[e.length-(1+t)]}var mT;(e=>{function t(c){return c<0}e.isLessThan=t;function r(c){return c<=0}e.isLessThanOrEqual=r;function n(c){return c>0}e.isGreaterThan=n;function l(c){return c===0}e.isNeitherLessOrGreaterThan=l,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(mT||(mT={}));function gT(e,t){let r=this,n=!1,l;return function(){return n||(n=!0,t||(l=e.apply(r,arguments))),l}}var gb;(e=>{function t(I){return I&&typeof I=="object"&&typeof I[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function n(){return r}e.empty=n;function*l(I){yield I}e.single=l;function c(I){return t(I)?I:l(I)}e.wrap=c;function u(I){return I||r}e.from=u;function*d(I){for(let j=I.length-1;j>=0;j--)yield I[j]}e.reverse=d;function _(I){return!I||I[Symbol.iterator]().next().done===!0}e.isEmpty=_;function f(I){return I[Symbol.iterator]().next().value}e.first=f;function v(I,j){let Y=0;for(let te of I)if(j(te,Y++))return!0;return!1}e.some=v;function m(I,j){for(let Y of I)if(j(Y))return Y}e.find=m;function*y(I,j){for(let Y of I)j(Y)&&(yield Y)}e.filter=y;function*S(I,j){let Y=0;for(let te of I)yield j(te,Y++)}e.map=S;function*b(I,j){let Y=0;for(let te of I)yield*j(te,Y++)}e.flatMap=b;function*E(...I){for(let j of I)yield*j}e.concat=E;function T(I,j,Y){let te=Y;for(let ge of I)te=j(te,ge);return te}e.reduce=T;function*O(I,j,Y=I.length){for(j<0&&(j+=I.length),Y<0?Y+=I.length:Y>I.length&&(Y=I.length);j<Y;j++)yield I[j]}e.slice=O;function H(I,j=Number.POSITIVE_INFINITY){let Y=[];if(j===0)return[Y,I];let te=I[Symbol.iterator]();for(let ge=0;ge<j;ge++){let ve=te.next();if(ve.done)return[Y,e.empty()];Y.push(ve.value)}return[Y,{[Symbol.iterator](){return te}}]}e.consume=H;async function B(I){let j=[];for await(let Y of I)j.push(Y);return Promise.resolve(j)}e.asyncToArray=B})(gb||(gb={}));function Qs(e){if(gb.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function vT(...e){return nt(()=>Qs(e))}function nt(e){return{dispose:gT(()=>{e()})}}var vb=class yb{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{Qs(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?yb.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};vb.DISABLE_DISPOSED_WARNING=!1;var vs=vb,Me=class{constructor(){this._store=new vs,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)}};Me.None=Object.freeze({dispose(){}});var Zn=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.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}},Or=typeof window=="object"?window:globalThis,Cf=class Ef{constructor(t){this.element=t,this.next=Ef.Undefined,this.prev=Ef.Undefined}};Cf.Undefined=new Cf(void 0);var lt=Cf,By=class{constructor(){this._first=lt.Undefined,this._last=lt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===lt.Undefined}clear(){let e=this._first;for(;e!==lt.Undefined;){let t=e.next;e.prev=lt.Undefined,e.next=lt.Undefined,e=t}this._first=lt.Undefined,this._last=lt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new lt(e);if(this._first===lt.Undefined)this._first=r,this._last=r;else if(t){let l=this._last;this._last=r,r.prev=l,l.next=r}else{let l=this._first;this._first=r,r.next=l,l.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==lt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==lt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==lt.Undefined&&e.next!==lt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===lt.Undefined&&e.next===lt.Undefined?(this._first=lt.Undefined,this._last=lt.Undefined):e.next===lt.Undefined?(this._last=this._last.prev,this._last.next=lt.Undefined):e.prev===lt.Undefined&&(this._first=this._first.next,this._first.prev=lt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==lt.Undefined;)yield e.element,e=e.next}},yT=globalThis.performance&&typeof globalThis.performance.now=="function",ST=class Sb{static create(t){return new Sb(t)}constructor(t){this._now=yT&&t===!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}},Wt;(e=>{e.None=()=>Me.None;function t(J,G){return m(J,()=>{},0,void 0,!0,void 0,G)}e.defer=t;function r(J){return(G,re=null,se)=>{let D=!1,W;return W=J(q=>{if(!D)return W?W.dispose():D=!0,G.call(re,q)},null,se),D&&W.dispose(),W}}e.once=r;function n(J,G,re){return f((se,D=null,W)=>J(q=>se.call(D,G(q)),null,W),re)}e.map=n;function l(J,G,re){return f((se,D=null,W)=>J(q=>{G(q),se.call(D,q)},null,W),re)}e.forEach=l;function c(J,G,re){return f((se,D=null,W)=>J(q=>G(q)&&se.call(D,q),null,W),re)}e.filter=c;function u(J){return J}e.signal=u;function d(...J){return(G,re=null,se)=>{let D=vT(...J.map(W=>W(q=>G.call(re,q))));return v(D,se)}}e.any=d;function _(J,G,re,se){let D=re;return n(J,W=>(D=G(D,W),D),se)}e.reduce=_;function f(J,G){let re,se={onWillAddFirstListener(){re=J(D.fire,D)},onDidRemoveLastListener(){re==null||re.dispose()}},D=new le(se);return G==null||G.add(D),D.event}function v(J,G){return G instanceof Array?G.push(J):G&&G.add(J),J}function m(J,G,re=100,se=!1,D=!1,W,q){let ie,oe,x,M=0,X,ee={leakWarningThreshold:W,onWillAddFirstListener(){ie=J(pe=>{M++,oe=G(oe,pe),se&&!x&&(ue.fire(oe),oe=void 0),X=()=>{let we=oe;oe=void 0,x=void 0,(!se||M>1)&&ue.fire(we),M=0},typeof re=="number"?(clearTimeout(x),x=setTimeout(X,re)):x===void 0&&(x=0,queueMicrotask(X))})},onWillRemoveListener(){D&&M>0&&(X==null||X())},onDidRemoveLastListener(){X=void 0,ie.dispose()}},ue=new le(ee);return q==null||q.add(ue),ue.event}e.debounce=m;function y(J,G=0,re){return e.debounce(J,(se,D)=>se?(se.push(D),se):[D],G,void 0,!0,void 0,re)}e.accumulate=y;function S(J,G=(se,D)=>se===D,re){let se=!0,D;return c(J,W=>{let q=se||!G(W,D);return se=!1,D=W,q},re)}e.latch=S;function b(J,G,re){return[e.filter(J,G,re),e.filter(J,se=>!G(se),re)]}e.split=b;function E(J,G=!1,re=[],se){let D=re.slice(),W=J(oe=>{D?D.push(oe):ie.fire(oe)});se&&se.add(W);let q=()=>{D==null||D.forEach(oe=>ie.fire(oe)),D=null},ie=new le({onWillAddFirstListener(){W||(W=J(oe=>ie.fire(oe)),se&&se.add(W))},onDidAddFirstListener(){D&&(G?setTimeout(q):q())},onDidRemoveLastListener(){W&&W.dispose(),W=null}});return se&&se.add(ie),ie.event}e.buffer=E;function T(J,G){return(re,se,D)=>{let W=G(new H);return J(function(q){let ie=W.evaluate(q);ie!==O&&re.call(se,ie)},void 0,D)}}e.chain=T;let O=Symbol("HaltChainable");class H{constructor(){this.steps=[]}map(G){return this.steps.push(G),this}forEach(G){return this.steps.push(re=>(G(re),re)),this}filter(G){return this.steps.push(re=>G(re)?re:O),this}reduce(G,re){let se=re;return this.steps.push(D=>(se=G(se,D),se)),this}latch(G=(re,se)=>re===se){let re=!0,se;return this.steps.push(D=>{let W=re||!G(D,se);return re=!1,se=D,W?D:O}),this}evaluate(G){for(let re of this.steps)if(G=re(G),G===O)break;return G}}function B(J,G,re=se=>se){let se=(...ie)=>q.fire(re(...ie)),D=()=>J.on(G,se),W=()=>J.removeListener(G,se),q=new le({onWillAddFirstListener:D,onDidRemoveLastListener:W});return q.event}e.fromNodeEventEmitter=B;function I(J,G,re=se=>se){let se=(...ie)=>q.fire(re(...ie)),D=()=>J.addEventListener(G,se),W=()=>J.removeEventListener(G,se),q=new le({onWillAddFirstListener:D,onDidRemoveLastListener:W});return q.event}e.fromDOMEventEmitter=I;function j(J){return new Promise(G=>r(J)(G))}e.toPromise=j;function Y(J){let G=new le;return J.then(re=>{G.fire(re)},()=>{G.fire(void 0)}).finally(()=>{G.dispose()}),G.event}e.fromPromise=Y;function te(J,G){return J(re=>G.fire(re))}e.forward=te;function ge(J,G,re){return G(re),J(se=>G(se))}e.runAndSubscribe=ge;class ve{constructor(G,re){this._observable=G,this._counter=0,this._hasChanged=!1;let se={onWillAddFirstListener:()=>{G.addObserver(this)},onDidRemoveLastListener:()=>{G.removeObserver(this)}};this.emitter=new le(se),re&&re.add(this.emitter)}beginUpdate(G){this._counter++}handlePossibleChange(G){}handleChange(G,re){this._hasChanged=!0}endUpdate(G){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function fe(J,G){return new ve(J,G).emitter.event}e.fromObservable=fe;function he(J){return(G,re,se)=>{let D=0,W=!1,q={beginUpdate(){D++},endUpdate(){D--,D===0&&(J.reportChanges(),W&&(W=!1,G.call(re)))},handlePossibleChange(){},handleChange(){W=!0}};J.addObserver(q),J.reportChanges();let ie={dispose(){J.removeObserver(q)}};return se instanceof vs?se.add(ie):Array.isArray(se)&&se.push(ie),ie}}e.fromObservableLight=he})(Wt||(Wt={}));var xf=class Af{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${Af._idPool++}`,Af.all.add(this)}start(t){this._stopWatch=new ST,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};xf.all=new Set,xf._idPool=0;var bT=xf,wT=-1,bb=class wb{constructor(t,r,n=(wb._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let n=this.threshold;if(n<=0||r<n)return;this._stacks||(this._stacks=new Map);let l=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[c,u]=this.getMostFrequentStack(),d=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${u}):`;console.warn(d),console.warn(c);let _=new xT(d,c);this._errorHandler(_)}return()=>{let c=this._stacks.get(t.value)||0;this._stacks.set(t.value,c-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[n,l]of this._stacks)(!t||r<l)&&(t=[n,l],r=l);return t}};bb._idPool=1;var CT=bb,ET=class Cb{constructor(t){this.value=t}static create(){let t=new Error;return new Cb(t.stack??"")}print(){console.warn(this.value.split(`
|
|
218
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(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)}},_T=new fT;function fc(e){pT(e)||_T.onUnexpectedError(e)}var bf="Canceled";function pT(e){return e instanceof mT?!0:e instanceof Error&&e.name===bf&&e.message===bf}var mT=class extends Error{constructor(){super(bf),this.name=this.message}};function gT(e){return new Error(`Illegal argument: ${e}`)}var zy=class wf extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof wf)return t;let r=new wf;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},Cf=class Sb extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,Sb.prototype)}};function Ci(e,t=0){return e[e.length-(1+t)]}var vT;(e=>{function t(c){return c<0}e.isLessThan=t;function r(c){return c<=0}e.isLessThanOrEqual=r;function n(c){return c>0}e.isGreaterThan=n;function l(c){return c===0}e.isNeitherLessOrGreaterThan=l,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(vT||(vT={}));function yT(e,t){let r=this,n=!1,l;return function(){return n||(n=!0,t||(l=e.apply(r,arguments))),l}}var bb;(e=>{function t(I){return I&&typeof I=="object"&&typeof I[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function n(){return r}e.empty=n;function*l(I){yield I}e.single=l;function c(I){return t(I)?I:l(I)}e.wrap=c;function u(I){return I||r}e.from=u;function*d(I){for(let j=I.length-1;j>=0;j--)yield I[j]}e.reverse=d;function _(I){return!I||I[Symbol.iterator]().next().done===!0}e.isEmpty=_;function f(I){return I[Symbol.iterator]().next().value}e.first=f;function v(I,j){let $=0;for(let ee of I)if(j(ee,$++))return!0;return!1}e.some=v;function m(I,j){for(let $ of I)if(j($))return $}e.find=m;function*y(I,j){for(let $ of I)j($)&&(yield $)}e.filter=y;function*S(I,j){let $=0;for(let ee of I)yield j(ee,$++)}e.map=S;function*b(I,j){let $=0;for(let ee of I)yield*j(ee,$++)}e.flatMap=b;function*x(...I){for(let j of I)yield*j}e.concat=x;function T(I,j,$){let ee=$;for(let ge of I)ee=j(ee,ge);return ee}e.reduce=T;function*O(I,j,$=I.length){for(j<0&&(j+=I.length),$<0?$+=I.length:$>I.length&&($=I.length);j<$;j++)yield I[j]}e.slice=O;function H(I,j=Number.POSITIVE_INFINITY){let $=[];if(j===0)return[$,I];let ee=I[Symbol.iterator]();for(let ge=0;ge<j;ge++){let Se=ee.next();if(Se.done)return[$,e.empty()];$.push(Se.value)}return[$,{[Symbol.iterator](){return ee}}]}e.consume=H;async function B(I){let j=[];for await(let $ of I)j.push($);return Promise.resolve(j)}e.asyncToArray=B})(bb||(bb={}));function Qs(e){if(bb.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(n){t.push(n)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function ST(...e){return nt(()=>Qs(e))}function nt(e){return{dispose:yT(()=>{e()})}}var wb=class Cb{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{Qs(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Cb.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(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};wb.DISABLE_DISPOSED_WARNING=!1;var vs=wb,Me=class{constructor(){this._store=new vs,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)}};Me.None=Object.freeze({dispose(){}});var Zn=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.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}},Or=typeof window=="object"?window:globalThis,Ef=class xf{constructor(t){this.element=t,this.next=xf.Undefined,this.prev=xf.Undefined}};Ef.Undefined=new Ef(void 0);var lt=Ef,Py=class{constructor(){this._first=lt.Undefined,this._last=lt.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===lt.Undefined}clear(){let e=this._first;for(;e!==lt.Undefined;){let t=e.next;e.prev=lt.Undefined,e.next=lt.Undefined,e=t}this._first=lt.Undefined,this._last=lt.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new lt(e);if(this._first===lt.Undefined)this._first=r,this._last=r;else if(t){let l=this._last;this._last=r,r.prev=l,l.next=r}else{let l=this._first;this._first=r,r.next=l,l.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==lt.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==lt.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==lt.Undefined&&e.next!==lt.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===lt.Undefined&&e.next===lt.Undefined?(this._first=lt.Undefined,this._last=lt.Undefined):e.next===lt.Undefined?(this._last=this._last.prev,this._last.next=lt.Undefined):e.prev===lt.Undefined&&(this._first=this._first.next,this._first.prev=lt.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==lt.Undefined;)yield e.element,e=e.next}},bT=globalThis.performance&&typeof globalThis.performance.now=="function",wT=class Eb{static create(t){return new Eb(t)}constructor(t){this._now=bT&&t===!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}},Wt;(e=>{e.None=()=>Me.None;function t(J,W){return m(J,()=>{},0,void 0,!0,void 0,W)}e.defer=t;function r(J){return(W,ne=null,se)=>{let D=!1,q;return q=J(F=>{if(!D)return q?q.dispose():D=!0,W.call(ne,F)},null,se),D&&q.dispose(),q}}e.once=r;function n(J,W,ne){return f((se,D=null,q)=>J(F=>se.call(D,W(F)),null,q),ne)}e.map=n;function l(J,W,ne){return f((se,D=null,q)=>J(F=>{W(F),se.call(D,F)},null,q),ne)}e.forEach=l;function c(J,W,ne){return f((se,D=null,q)=>J(F=>W(F)&&se.call(D,F),null,q),ne)}e.filter=c;function u(J){return J}e.signal=u;function d(...J){return(W,ne=null,se)=>{let D=ST(...J.map(q=>q(F=>W.call(ne,F))));return v(D,se)}}e.any=d;function _(J,W,ne,se){let D=ne;return n(J,q=>(D=W(D,q),D),se)}e.reduce=_;function f(J,W){let ne,se={onWillAddFirstListener(){ne=J(D.fire,D)},onDidRemoveLastListener(){ne==null||ne.dispose()}},D=new oe(se);return W==null||W.add(D),D.event}function v(J,W){return W instanceof Array?W.push(J):W&&W.add(J),J}function m(J,W,ne=100,se=!1,D=!1,q,F){let re,le,E,M=0,X,te={leakWarningThreshold:q,onWillAddFirstListener(){re=J(pe=>{M++,le=W(le,pe),se&&!E&&(ue.fire(le),le=void 0),X=()=>{let we=le;le=void 0,E=void 0,(!se||M>1)&&ue.fire(we),M=0},typeof ne=="number"?(clearTimeout(E),E=setTimeout(X,ne)):E===void 0&&(E=0,queueMicrotask(X))})},onWillRemoveListener(){D&&M>0&&(X==null||X())},onDidRemoveLastListener(){X=void 0,re.dispose()}},ue=new oe(te);return F==null||F.add(ue),ue.event}e.debounce=m;function y(J,W=0,ne){return e.debounce(J,(se,D)=>se?(se.push(D),se):[D],W,void 0,!0,void 0,ne)}e.accumulate=y;function S(J,W=(se,D)=>se===D,ne){let se=!0,D;return c(J,q=>{let F=se||!W(q,D);return se=!1,D=q,F},ne)}e.latch=S;function b(J,W,ne){return[e.filter(J,W,ne),e.filter(J,se=>!W(se),ne)]}e.split=b;function x(J,W=!1,ne=[],se){let D=ne.slice(),q=J(le=>{D?D.push(le):re.fire(le)});se&&se.add(q);let F=()=>{D==null||D.forEach(le=>re.fire(le)),D=null},re=new oe({onWillAddFirstListener(){q||(q=J(le=>re.fire(le)),se&&se.add(q))},onDidAddFirstListener(){D&&(W?setTimeout(F):F())},onDidRemoveLastListener(){q&&q.dispose(),q=null}});return se&&se.add(re),re.event}e.buffer=x;function T(J,W){return(ne,se,D)=>{let q=W(new H);return J(function(F){let re=q.evaluate(F);re!==O&&ne.call(se,re)},void 0,D)}}e.chain=T;let O=Symbol("HaltChainable");class H{constructor(){this.steps=[]}map(W){return this.steps.push(W),this}forEach(W){return this.steps.push(ne=>(W(ne),ne)),this}filter(W){return this.steps.push(ne=>W(ne)?ne:O),this}reduce(W,ne){let se=ne;return this.steps.push(D=>(se=W(se,D),se)),this}latch(W=(ne,se)=>ne===se){let ne=!0,se;return this.steps.push(D=>{let q=ne||!W(D,se);return ne=!1,se=D,q?D:O}),this}evaluate(W){for(let ne of this.steps)if(W=ne(W),W===O)break;return W}}function B(J,W,ne=se=>se){let se=(...re)=>F.fire(ne(...re)),D=()=>J.on(W,se),q=()=>J.removeListener(W,se),F=new oe({onWillAddFirstListener:D,onDidRemoveLastListener:q});return F.event}e.fromNodeEventEmitter=B;function I(J,W,ne=se=>se){let se=(...re)=>F.fire(ne(...re)),D=()=>J.addEventListener(W,se),q=()=>J.removeEventListener(W,se),F=new oe({onWillAddFirstListener:D,onDidRemoveLastListener:q});return F.event}e.fromDOMEventEmitter=I;function j(J){return new Promise(W=>r(J)(W))}e.toPromise=j;function $(J){let W=new oe;return J.then(ne=>{W.fire(ne)},()=>{W.fire(void 0)}).finally(()=>{W.dispose()}),W.event}e.fromPromise=$;function ee(J,W){return J(ne=>W.fire(ne))}e.forward=ee;function ge(J,W,ne){return W(ne),J(se=>W(se))}e.runAndSubscribe=ge;class Se{constructor(W,ne){this._observable=W,this._counter=0,this._hasChanged=!1;let se={onWillAddFirstListener:()=>{W.addObserver(this)},onDidRemoveLastListener:()=>{W.removeObserver(this)}};this.emitter=new oe(se),ne&&ne.add(this.emitter)}beginUpdate(W){this._counter++}handlePossibleChange(W){}handleChange(W,ne){this._hasChanged=!0}endUpdate(W){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function _e(J,W){return new Se(J,W).emitter.event}e.fromObservable=_e;function he(J){return(W,ne,se)=>{let D=0,q=!1,F={beginUpdate(){D++},endUpdate(){D--,D===0&&(J.reportChanges(),q&&(q=!1,W.call(ne)))},handlePossibleChange(){},handleChange(){q=!0}};J.addObserver(F),J.reportChanges();let re={dispose(){J.removeObserver(F)}};return se instanceof vs?se.add(re):Array.isArray(se)&&se.push(re),re}}e.fromObservableLight=he})(Wt||(Wt={}));var Af=class kf{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${kf._idPool++}`,kf.all.add(this)}start(t){this._stopWatch=new wT,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};Af.all=new Set,Af._idPool=0;var CT=Af,ET=-1,xb=class Ab{constructor(t,r,n=(Ab._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=n,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let n=this.threshold;if(n<=0||r<n)return;this._stacks||(this._stacks=new Map);let l=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=n*.5;let[c,u]=this.getMostFrequentStack(),d=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${u}):`;console.warn(d),console.warn(c);let _=new kT(d,c);this._errorHandler(_)}return()=>{let c=this._stacks.get(t.value)||0;this._stacks.set(t.value,c-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[n,l]of this._stacks)(!t||r<l)&&(t=[n,l],r=l);return t}};xb._idPool=1;var xT=xb,AT=class kb{constructor(t){this.value=t}static create(){let t=new Error;return new kb(t.stack??"")}print(){console.warn(this.value.split(`
|
|
219
219
|
`).slice(2).join(`
|
|
220
|
-
`))}},xT=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},AT=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},kT=0,Id=class{constructor(e){this.value=e,this.id=kT++}},TT=2,RT,le=class{constructor(e){var t,r,n,l;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new CT((e==null?void 0:e.onListenerError)??fc,((r=this._options)==null?void 0:r.leakWarningThreshold)??wT):void 0,this._perfMon=(n=this._options)!=null&&n._profName?new bT(this._options._profName):void 0,this._deliveryQueue=(l=this._options)==null?void 0:l.deliveryQueue}dispose(){var e,t,r,n;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),(r=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t),(n=this._leakageMon)==null||n.dispose())}get event(){return this._event??(this._event=(e,t,r)=>{var u,d,_,f,v;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let y=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],S=new AT(`${m}. HINT: Stack shows most frequent listener (${y[1]}-times)`,y[0]);return(((u=this._options)==null?void 0:u.onListenerError)||fc)(S),Me.None}if(this._disposed)return Me.None;t&&(e=e.bind(t));let n=new Id(e),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=ET.create(),l=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof Id?(this._deliveryQueue??(this._deliveryQueue=new DT),this._listeners=[this._listeners,n]):this._listeners.push(n):((_=(d=this._options)==null?void 0:d.onWillAddFirstListener)==null||_.call(d,this),this._listeners=n,(v=(f=this._options)==null?void 0:f.onDidAddFirstListener)==null||v.call(f,this)),this._size++;let c=nt(()=>{l==null||l(),this._removeListener(n)});return r instanceof vs?r.add(c):Array.isArray(r)&&r.push(c),c}),this._event}_removeListener(e){var l,c,u,d;if((c=(l=this._options)==null?void 0:l.onWillRemoveListener)==null||c.call(l,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(d=(u=this._options)==null?void 0:u.onDidRemoveLastListener)==null||d.call(u,this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);if(r===-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--,t[r]=void 0;let n=this._deliveryQueue.current===this;if(this._size*TT<=t.length){let _=0;for(let f=0;f<t.length;f++)t[f]?t[_++]=t[f]:n&&(this._deliveryQueue.end--,_<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=_}}_deliver(e,t){var n;if(!e)return;let r=((n=this._options)==null?void 0:n.onListenerError)||fc;if(!r){e.value(t);return}try{e.value(t)}catch(l){r(l)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,r,n,l;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(n=this._perfMon)==null||n.start(this._size),this._listeners)if(this._listeners instanceof Id)this._deliver(this._listeners,e);else{let c=this._deliveryQueue;c.enqueue(this,e,this._listeners.length),this._deliverQueue(c)}(l=this._perfMon)==null||l.stop()}hasListeners(){return this._size>0}},DT=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},kf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new le,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new le,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};kf.INSTANCE=new kf;var w_=kf;function LT(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}w_.INSTANCE.onDidChangeZoomLevel;function OT(e){return w_.INSTANCE.getZoomFactor(e)}w_.INSTANCE.onDidChangeFullscreen;var ia=typeof navigator=="object"?navigator.userAgent:"",Tf=ia.indexOf("Firefox")>=0,MT=ia.indexOf("AppleWebKit")>=0,C_=ia.indexOf("Chrome")>=0,NT=!C_&&ia.indexOf("Safari")>=0;ia.indexOf("Electron/")>=0;ia.indexOf("Android")>=0;var Hd=!1;if(typeof Or.matchMedia=="function"){let e=Or.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Or.matchMedia("(display-mode: fullscreen)");Hd=e.matches,LT(Or,e,({matches:r})=>{Hd&&t.matches||(Hd=r)})}var Fn="en",Rf=!1,Df=!1,_c=!1,Eb=!1,sc,pc=Fn,zy=Fn,BT,Yi,Xs=globalThis,qt,A0;typeof Xs.vscode<"u"&&typeof Xs.vscode.process<"u"?qt=Xs.vscode.process:typeof process<"u"&&typeof((A0=process==null?void 0:process.versions)==null?void 0:A0.node)=="string"&&(qt=process);var k0,zT=typeof((k0=qt==null?void 0:qt.versions)==null?void 0:k0.electron)=="string",PT=zT&&(qt==null?void 0:qt.type)==="renderer",T0;if(typeof qt=="object"){Rf=qt.platform==="win32",Df=qt.platform==="darwin",_c=qt.platform==="linux",_c&&qt.env.SNAP&&qt.env.SNAP_REVISION,qt.env.CI||qt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,sc=Fn,pc=Fn;let e=qt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);sc=t.userLocale,zy=t.osLocale,pc=t.resolvedLanguage||Fn,BT=(T0=t.languagePack)==null?void 0:T0.translationsConfigFile}catch{}Eb=!0}else typeof navigator=="object"&&!PT?(Yi=navigator.userAgent,Rf=Yi.indexOf("Windows")>=0,Df=Yi.indexOf("Macintosh")>=0,(Yi.indexOf("Macintosh")>=0||Yi.indexOf("iPad")>=0||Yi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_c=Yi.indexOf("Linux")>=0,(Yi==null?void 0:Yi.indexOf("Mobi"))>=0,pc=globalThis._VSCODE_NLS_LANGUAGE||Fn,sc=navigator.language.toLowerCase(),zy=sc):console.error("Unable to resolve platform.");var xb=Rf,ar=Df,IT=_c,Py=Eb,lr=Yi,ls=pc,HT;(e=>{function t(){return ls}e.value=t;function r(){return ls.length===2?ls==="en":ls.length>=3?ls[0]==="e"&&ls[1]==="n"&&ls[2]==="-":!1}e.isDefaultVariant=r;function n(){return ls==="en"}e.isDefault=n})(HT||(HT={}));var UT=typeof Xs.postMessage=="function"&&!Xs.importScripts;(()=>{if(UT){let e=[];Xs.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,l=e.length;n<l;n++){let c=e[n];if(c.id===r.data.vscodeScheduleAsyncWork){e.splice(n,1),c.callback();return}}});let t=0;return r=>{let n=++t;e.push({id:n,callback:r}),Xs.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var jT=!!(lr&&lr.indexOf("Chrome")>=0);lr&&lr.indexOf("Firefox")>=0;!jT&&lr&&lr.indexOf("Safari")>=0;lr&&lr.indexOf("Edg/")>=0;lr&&lr.indexOf("Android")>=0;var $n=typeof navigator=="object"?navigator:{};Py||document.queryCommandSupported&&document.queryCommandSupported("copy")||$n&&$n.clipboard&&$n.clipboard.writeText,Py||$n&&$n.clipboard&&$n.clipboard.readText;var E_=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Ud=new E_,Iy=new E_,Hy=new E_,VT=new Array(230),Ab;(e=>{function t(d){return Ud.keyCodeToStr(d)}e.toString=t;function r(d){return Ud.strToKeyCode(d)}e.fromString=r;function n(d){return Iy.keyCodeToStr(d)}e.toUserSettingsUS=n;function l(d){return Hy.keyCodeToStr(d)}e.toUserSettingsGeneral=l;function c(d){return Iy.strToKeyCode(d)||Hy.strToKeyCode(d)}e.fromUserSettings=c;function u(d){if(d>=98&&d<=113)return null;switch(d){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Ud.keyCodeToStr(d)}e.toElectronAccelerator=u})(Ab||(Ab={}));var $T=class kb{constructor(t,r,n,l,c){this.ctrlKey=t,this.shiftKey=r,this.altKey=n,this.metaKey=l,this.keyCode=c}equals(t){return t instanceof kb&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",n=this.altKey?"1":"0",l=this.metaKey?"1":"0";return`K${t}${r}${n}${l}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new GT([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},GT=class{constructor(e){if(e.length===0)throw pT("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t<r;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function qT(e){if(e.charCode){let r=String.fromCharCode(e.charCode).toUpperCase();return Ab.fromString(r)}let t=e.keyCode;if(t===3)return 7;if(Tf)switch(t){case 59:return 85;case 60:if(IT)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(ar)return 57;break}else if(MT&&(ar&&t===93||!ar&&t===92))return 57;return VT[t]||0}var WT=ar?256:2048,FT=512,YT=1024,KT=ar?2048:256,Uy=class{constructor(e){var r;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(r=t.getModifierState)==null?void 0:r.call(t,"AltGraph"),this.keyCode=qT(t),this.code=t.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(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=WT),this.altKey&&(t|=FT),this.shiftKey&&(t|=YT),this.metaKey&&(t|=KT),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new $T(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},jy=new WeakMap;function XT(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,r=e.parent.location;if(t.origin!=="null"&&r.origin!=="null"&&t.origin!==r.origin)return null}catch{return null}return e.parent}var ZT=class{static getSameOriginWindowChain(e){let t=jy.get(e);if(!t){t=[],jy.set(e,t);let r=e,n;do n=XT(r),n?t.push({window:new WeakRef(r),iframeElement:r.frameElement||null}):t.push({window:new WeakRef(r),iframeElement:null}),r=n;while(r)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let r=0,n=0,l=this.getSameOriginWindowChain(e);for(let c of l){let u=c.window.deref();if(r+=(u==null?void 0:u.scrollY)??0,n+=(u==null?void 0:u.scrollX)??0,u===t||!c.iframeElement)break;let d=c.iframeElement.getBoundingClientRect();r+=d.top,n+=d.left}return{top:r,left:n}}},nc=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let r=ZT.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=r.left,this.posy-=r.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Vy=class{constructor(e,t=0,r=0){var l;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=t;let n=!1;if(C_){let c=navigator.userAgent.match(/Chrome\/(\d+)/);n=(c?parseInt(c[1]):123)<=122}if(e){let c=e,u=e,d=((l=e.view)==null?void 0:l.devicePixelRatio)||1;if(typeof c.wheelDeltaY<"u")n?this.deltaY=c.wheelDeltaY/(120*d):this.deltaY=c.wheelDeltaY/120;else if(typeof u.VERTICAL_AXIS<"u"&&u.axis===u.VERTICAL_AXIS)this.deltaY=-u.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?Tf&&!ar?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof c.wheelDeltaX<"u")NT&&xb?this.deltaX=-(c.wheelDeltaX/120):n?this.deltaX=c.wheelDeltaX/(120*d):this.deltaX=c.wheelDeltaX/120;else if(typeof u.HORIZONTAL_AXIS<"u"&&u.axis===u.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?Tf&&!ar?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*d):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},Tb=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),QT;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof JT?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Wt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Tb})})(QT||(QT={}));var JT=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?Tb:(this._emitter||(this._emitter=new le),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},x_=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new wf("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new wf("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},eR=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new wf("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=r.setInterval(()=>{e()},t);this.disposable=nt(()=>{r.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},tR;(e=>{async function t(n){let l,c=await Promise.all(n.map(u=>u.then(d=>d,d=>{l||(l=d)})));if(typeof l<"u")throw l;return c}e.settled=t;function r(n){return new Promise(async(l,c)=>{try{await n(l,c)}catch(u){c(u)}})}e.withAsyncBody=r})(tR||(tR={}));var $y=class Ii{static fromArray(t){return new Ii(r=>{r.emitMany(t)})}static fromPromise(t){return new Ii(async r=>{r.emitMany(await t)})}static fromPromises(t){return new Ii(async r=>{await Promise.all(t.map(async n=>r.emitOne(await n)))})}static merge(t){return new Ii(async r=>{await Promise.all(t.map(async n=>{for await(let l of n)r.emitOne(l)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new le,queueMicrotask(async()=>{let n={emitOne:l=>this.emitOne(l),emitMany:l=>this.emitMany(l),reject:l=>this.reject(l)};try{await Promise.resolve(t(n)),this.resolve()}catch(l){this.reject(l)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Wt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new Ii(async n=>{for await(let l of t)n.emitOne(r(l))})}map(t){return Ii.map(this,t)}static filter(t,r){return new Ii(async n=>{for await(let l of t)r(l)&&n.emitOne(l)})}filter(t){return Ii.filter(this,t)}static coalesce(t){return Ii.filter(t,r=>!!r)}coalesce(){return Ii.coalesce(this)}static async toPromise(t){let r=[];for await(let n of t)r.push(n);return r}toPromise(){return Ii.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};$y.EMPTY=$y.fromArray([]);var{getWindow:nr,getWindowId:iR,onDidRegisterWindow:rR}=(function(){let e=new Map,t={window:Or,disposables:new vs};e.set(Or.vscodeWindowId,t);let r=new le,n=new le,l=new le;function c(u,d){return(typeof u=="number"?e.get(u):void 0)??(d?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:l.event,onDidUnregisterWindow:n.event,registerWindow(u){if(e.has(u.vscodeWindowId))return Me.None;let d=new vs,_={window:u,disposables:d.add(new vs)};return e.set(u.vscodeWindowId,_),d.add(nt(()=>{e.delete(u.vscodeWindowId),n.fire(u)})),d.add(Ce(u,Nt.BEFORE_UNLOAD,()=>{l.fire(u)})),r.fire(_),d},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return e.has(u)},getWindowById:c,getWindow(u){var f;let d=u;if((f=d==null?void 0:d.ownerDocument)!=null&&f.defaultView)return d.ownerDocument.defaultView.window;let _=u;return _!=null&&_.view?_.view.window:Or},getDocument(u){return nr(u).document}}})(),sR=class{constructor(e,t,r,n){this._node=e,this._type=t,this._handler=r,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 Ce(e,t,r,n){return new sR(e,t,r,n)}var Gy=function(e,t,r,n){return Ce(e,t,r,n)},A_,nR=class extends eR{constructor(e){super(),this.defaultTarget=e&&nr(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},qy=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){fc(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,n=new Map,l=c=>{r.set(c,!1);let u=e.get(c)??[];for(t.set(c,u),e.set(c,[]),n.set(c,!0);u.length>0;)u.sort(qy.sort),u.shift().execute();n.set(c,!1)};A_=(c,u,d=0)=>{let _=iR(c),f=new qy(u,d),v=e.get(_);return v||(v=[],e.set(_,v)),v.push(f),r.get(_)||(r.set(_,!0),c.requestAnimationFrame(()=>l(_))),f}})();function aR(e){let t=e.getBoundingClientRect(),r=nr(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var Nt={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"},lR=class{constructor(e){this.domNode=e,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(e){let t=ui(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=ui(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=ui(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=ui(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=ui(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=ui(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=ui(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=ui(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=ui(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=ui(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=ui(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=ui(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=ui(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=ui(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function ui(e){return typeof e=="number"?`${e}px`:e}function fl(e){return new lR(e)}var Rb=class{constructor(){this._hooks=new vs,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,n,l){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=l;let c=e;try{e.setPointerCapture(t),this._hooks.add(nt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{c=nr(e)}this._hooks.add(Ce(c,Nt.POINTER_MOVE,u=>{if(u.buttons!==r){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(Ce(c,Nt.POINTER_UP,u=>this.stopMonitoring(!0)))}};function oR(e,t,r){let n=null,l=null;if(typeof r.value=="function"?(n="value",l=r.value,l.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(n="get",l=r.get),!l)throw new Error("not supported");let c=`$memoize$${t}`;r[n]=function(...u){return this.hasOwnProperty(c)||Object.defineProperty(this,c,{configurable:!1,enumerable:!1,writable:!1,value:l.apply(this,u)}),this[c]}}var sr;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(sr||(sr={}));var al=class Xt extends Me{constructor(){super(),this.dispatched=!1,this.targets=new By,this.ignoreTargets=new By,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Wt.runAndSubscribe(rR,({window:t,disposables:r})=>{r.add(Ce(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),r.add(Ce(t.document,"touchend",n=>this.onTouchEnd(t,n))),r.add(Ce(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:Or,disposables:this._store}))}static addTarget(t){if(!Xt.isTouchDevice())return Me.None;Xt.INSTANCE||(Xt.INSTANCE=new Xt);let r=Xt.INSTANCE.targets.push(t);return nt(r)}static ignoreTarget(t){if(!Xt.isTouchDevice())return Me.None;Xt.INSTANCE||(Xt.INSTANCE=new Xt);let r=Xt.INSTANCE.ignoreTargets.push(t);return nt(r)}static isTouchDevice(){return"ontouchstart"in Or||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,l=t.targetTouches.length;n<l;n++){let c=t.targetTouches.item(n);this.activeTouches[c.identifier]={id:c.identifier,initialTarget:c.target,initialTimeStamp:r,initialPageX:c.pageX,initialPageY:c.pageY,rollingTimestamps:[r],rollingPageX:[c.pageX],rollingPageY:[c.pageY]};let u=this.newGestureEvent(sr.Start,c.target);u.pageX=c.pageX,u.pageY=c.pageY,this.dispatchEvent(u)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,r){let n=Date.now(),l=Object.keys(this.activeTouches).length;for(let c=0,u=r.changedTouches.length;c<u;c++){let d=r.changedTouches.item(c);if(!this.activeTouches.hasOwnProperty(String(d.identifier))){console.warn("move of an UNKNOWN touch",d);continue}let _=this.activeTouches[d.identifier],f=Date.now()-_.initialTimeStamp;if(f<Xt.HOLD_DELAY&&Math.abs(_.initialPageX-Ci(_.rollingPageX))<30&&Math.abs(_.initialPageY-Ci(_.rollingPageY))<30){let v=this.newGestureEvent(sr.Tap,_.initialTarget);v.pageX=Ci(_.rollingPageX),v.pageY=Ci(_.rollingPageY),this.dispatchEvent(v)}else if(f>=Xt.HOLD_DELAY&&Math.abs(_.initialPageX-Ci(_.rollingPageX))<30&&Math.abs(_.initialPageY-Ci(_.rollingPageY))<30){let v=this.newGestureEvent(sr.Contextmenu,_.initialTarget);v.pageX=Ci(_.rollingPageX),v.pageY=Ci(_.rollingPageY),this.dispatchEvent(v)}else if(l===1){let v=Ci(_.rollingPageX),m=Ci(_.rollingPageY),y=Ci(_.rollingTimestamps)-_.rollingTimestamps[0],S=v-_.rollingPageX[0],b=m-_.rollingPageY[0],E=[...this.targets].filter(T=>_.initialTarget instanceof Node&&T.contains(_.initialTarget));this.inertia(t,E,n,Math.abs(S)/y,S>0?1:-1,v,Math.abs(b)/y,b>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(sr.End,_.initialTarget)),delete this.activeTouches[d.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=r,n.tapCount=0,n}dispatchEvent(t){if(t.type===sr.Tap){let r=new Date().getTime(),n=0;r-this._lastSetTapCountTime>Xt.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=r,t.tapCount=n}else(t.type===sr.Change||t.type===sr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let r=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let l=0,c=t.initialTarget;for(;c&&c!==n;)l++,c=c.parentElement;r.push([l,n])}r.sort((n,l)=>n[0]-l[0]);for(let[n,l]of r)l.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,n,l,c,u,d,_,f){this.handle=A_(t,()=>{let v=Date.now(),m=v-n,y=0,S=0,b=!0;l+=Xt.SCROLL_FRICTION*m,d+=Xt.SCROLL_FRICTION*m,l>0&&(b=!1,y=c*l*m),d>0&&(b=!1,S=_*d*m);let E=this.newGestureEvent(sr.Change);E.translationX=y,E.translationY=S,r.forEach(T=>T.dispatchEvent(E)),b||this.inertia(t,r,v,l,c,u+y,d,_,f+S)})}onTouchMove(t){let r=Date.now();for(let n=0,l=t.changedTouches.length;n<l;n++){let c=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(c.identifier))){console.warn("end of an UNKNOWN touch",c);continue}let u=this.activeTouches[c.identifier],d=this.newGestureEvent(sr.Change,u.initialTarget);d.translationX=c.pageX-Ci(u.rollingPageX),d.translationY=c.pageY-Ci(u.rollingPageY),d.pageX=c.pageX,d.pageY=c.pageY,this.dispatchEvent(d),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(c.pageX),u.rollingPageY.push(c.pageY),u.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};al.SCROLL_FRICTION=-.005,al.HOLD_DELAY=700,al.CLEAR_TAP_COUNT_TIME=400,dt([oR],al,"isTouchDevice",1);var cR=al,k_=class extends Me{onclick(e,t){this._register(Ce(e,Nt.CLICK,r=>t(new nc(nr(e),r))))}onmousedown(e,t){this._register(Ce(e,Nt.MOUSE_DOWN,r=>t(new nc(nr(e),r))))}onmouseover(e,t){this._register(Ce(e,Nt.MOUSE_OVER,r=>t(new nc(nr(e),r))))}onmouseleave(e,t){this._register(Ce(e,Nt.MOUSE_LEAVE,r=>t(new nc(nr(e),r))))}onkeydown(e,t){this._register(Ce(e,Nt.KEY_DOWN,r=>t(new Uy(r))))}onkeyup(e,t){this._register(Ce(e,Nt.KEY_UP,r=>t(new Uy(r))))}oninput(e,t){this._register(Ce(e,Nt.INPUT,t))}onblur(e,t){this._register(Ce(e,Nt.BLUR,t))}onfocus(e,t){this._register(Ce(e,Nt.FOCUS,t))}onchange(e,t){this._register(Ce(e,Nt.CHANGE,t))}ignoreGesture(e){return cR.ignoreTarget(e)}},Wy=11,uR=class extends k_{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Wy+"px",this.domNode.style.height=Wy+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Rb),this._register(Gy(this.bgDomNode,Nt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Gy(this.domNode,Nt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new nR),this._pointerdownScheduleRepeatTimer=this._register(new x_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,nr(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},hR=class Lf{constructor(t,r,n,l,c,u,d){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,n=n|0,l=l|0,c=c|0,u=u|0,d=d|0),this.rawScrollLeft=l,this.rawScrollTop=d,r<0&&(r=0),l+r>n&&(l=n-r),l<0&&(l=0),c<0&&(c=0),d+c>u&&(d=u-c),d<0&&(d=0),this.width=r,this.scrollWidth=n,this.scrollLeft=l,this.height=c,this.scrollHeight=u,this.scrollTop=d}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new Lf(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Lf(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let n=this.width!==t.width,l=this.scrollWidth!==t.scrollWidth,c=this.scrollLeft!==t.scrollLeft,u=this.height!==t.height,d=this.scrollHeight!==t.scrollHeight,_=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:l,scrollLeftChanged:c,heightChanged:u,scrollHeightChanged:d,scrollTopChanged:_}}},dR=class extends Me{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new hR(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let n;t?n=new Yy(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=Yy.start(this._state,r,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 e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},Fy=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function jd(e,t){let r=t-e;return function(n){return e+r*pR(n)}}function fR(e,t,r){return function(n){return n<r?e(n/r):t((n-r)/(1-r))}}var Yy=class Of{constructor(t,r,n,l){this.from=t,this.to=r,this.duration=l,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(t,r,n){if(Math.abs(t-r)>2.5*n){let l,c;return t<r?(l=t+.75*n,c=r-.75*n):(l=t-.75*n,c=r+.75*n),fR(jd(t,l),jd(c,r),.33)}return jd(t,r)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let r=(t-this.startTime)/this.duration;if(r<1){let n=this.scrollLeft(r),l=this.scrollTop(r);return new Fy(n,l,!1)}return new Fy(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,r,n){return Of.start(t,r,n)}static start(t,r,n){n=n+10;let l=Date.now()-10;return new Of(t,r,l,n)}};function _R(e){return Math.pow(e,3)}function pR(e){return 1-_R(1-e)}var mR=class extends Me{constructor(e,t,r){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new x_)}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 t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},gR=140,Db=class extends k_{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 mR(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Rb),this._shouldRender=!0,this.domNode=fl(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(Ce(this.domNode.domNode,Nt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new uR(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,n){this.slider=fl(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ce(this.slider.domNode,Nt.POINTER_DOWN,l=>{l.button===0&&(l.preventDefault(),this._sliderPointerDown(l))})),this.onclick(this.slider.domNode,l=>{l.leftButton&&l.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 t=this.domNode.domNode.getClientRects()[0].top,r=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),l=this._sliderPointerPosition(e);r<=l&&l<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let l=aR(this.domNode.domNode);t=e.pageX-l.left,r=e.pageY-l.top}let n=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,l=>{let c=this._sliderOrthogonalPointerPosition(l),u=Math.abs(c-r);if(xb&&u>gR){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let d=this._sliderPointerPosition(l)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(d))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Lb=class Mf{constructor(t,r,n,l,c,u){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=l,this._scrollSize=c,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Mf(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,n,l,c){let u=Math.max(0,n-t),d=Math.max(0,u-2*r),_=l>0&&l>n;if(!_)return{computedAvailableSize:Math.round(u),computedIsNeeded:_,computedSliderSize:Math.round(d),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(n*d/l))),v=(d-f)/(l-n),m=c*v;return{computedAvailableSize:Math.round(u),computedIsNeeded:_,computedSliderSize:Math.round(f),computedSliderRatio:v,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=Mf._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.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(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,n=this._scrollPosition;return r<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let r=this._computedSliderPosition+t;return Math.round(r/this._computedSliderRatio)}},vR=class extends Db{constructor(e,t,r){let n=e.getScrollDimensions(),l=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new Lb(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,l.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),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,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}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}},yR=class extends Db{constructor(e,t,r){let n=e.getScrollDimensions(),l=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new Lb(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,l.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},SR=500,Ky=50,bR=class{constructor(e,t,r){this.timestamp=e,this.deltaX=t,this.deltaY=r,this.score=0}},Nf=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,r=0,n=1,l=this._rear;do{let c=l===this._front?t:Math.pow(2,-n);if(t-=c,r+=this._memory[l].score*c,l===this._front)break;l=(this._capacity+l-1)%this._capacity,n++}while(!0);return r<=.5}acceptStandardWheelEvent(t){if(C_){let r=nr(t.browserEvent),n=OT(r);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,r,n){let l=null,c=new bR(t,r,n);this._front===-1&&this._rear===-1?(this._memory[0]=c,this._front=0,this._rear=0):(l=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]=c),c.score=this._computeScore(c,l)}_computeScore(t,r){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),r){let l=Math.abs(t.deltaX),c=Math.abs(t.deltaY),u=Math.abs(r.deltaX),d=Math.abs(r.deltaY),_=Math.max(Math.min(l,u),1),f=Math.max(Math.min(c,d),1),v=Math.max(l,u),m=Math.max(c,d);v%_===0&&m%f===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Nf.INSTANCE=new Nf;var wR=Nf,CR=class extends k_{constructor(e,t,r){super(),this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new le),this.onWillScroll=this._onWillScroll.event,this._options=xR(t),this._scrollable=r,this._register(this._scrollable.onScroll(l=>{this._onWillScroll.fire(l),this._onDidScroll(l),this._onScroll.fire(l)}));let n={onMouseWheel:l=>this._onMouseWheel(l),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new yR(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new vR(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(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=fl(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=fl(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=fl(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,l=>this._onMouseOver(l)),this.onmouseleave(this._listenOnDomNode,l=>this._onMouseLeave(l)),this._hideTimeout=this._register(new x_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Qs(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ar&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Vy(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Qs(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new Vy(r))};this._mouseWheelToDispose.push(Ce(this._listenOnDomNode,Nt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var l;if((l=e.browserEvent)!=null&&l.defaultPrevented)return;let t=wR.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let c=e.deltaY*this._options.mouseWheelScrollSensitivity,u=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&u+c===0?u=c=0:Math.abs(c)>=Math.abs(u)?u=0:c=0),this._options.flipAxes&&([c,u]=[u,c]);let d=!ar&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||d)&&!u&&(u=c,c=0),e.browserEvent&&e.browserEvent.altKey&&(u=u*this._options.fastScrollSensitivity,c=c*this._options.fastScrollSensitivity);let _=this._scrollable.getFutureScrollPosition(),f={};if(c){let v=Ky*c,m=_.scrollTop-(v<0?Math.floor(v):Math.ceil(v));this._verticalScrollbar.writeScrollPosition(f,m)}if(u){let v=Ky*u,m=_.scrollLeft-(v<0?Math.floor(v):Math.ceil(v));this._horizontalScrollbar.writeScrollPosition(f,m)}f=this._scrollable.validateScrollPosition(f),(_.scrollLeft!==f.scrollLeft||_.scrollTop!==f.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(f):this._scrollable.setScrollPositionNow(f),r=!0)}let n=r;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||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 e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,r=e.scrollLeft>0,n=r?" left":"",l=t?" top":"",c=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${l}`),this._topLeftShadowDomNode.setClassName(`shadow${c}${l}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){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(),SR)}},ER=class extends CR{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function xR(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,ar&&(t.className+=" mac"),t}var Bf=class extends Me{constructor(e,t,r,n,l,c,u,d){super(),this._bufferService=r,this._optionsService=u,this._renderService=d,this._onRequestScrollLines=this._register(new le),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let _=this._register(new dR({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>A_(n.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{_.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new ER(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},_)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(l.onProtocolChange(f=>{this._scrollableElement.updateOptions({handleMouseWheel:!(f&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Wt.runAndSubscribe(c.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=c.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(nt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(nt(()=>this._styleElement.remove())),this._register(Wt.runAndSubscribe(c.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${c.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${c.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${c.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
221
|
-
`)})),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(f=>this._handleScroll(f)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,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 t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};Bf=dt([de(2,ti),de(3,Nr),de(4,hb),de(5,ta),de(6,ii),de(7,Br)],Bf);var zf=class extends Me{constructor(e,t,r,n,l){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=n,this._renderService=l,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(c=>this._removeDecoration(c))),this._register(nt(()=>{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 n;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((n=e==null?void 0:e.options)==null?void 0:n.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};zf=dt([de(1,ti),de(2,Nr),de(3,Tl),de(4,Br)],zf);var AR=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 t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,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,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},er={full:0,left:0,center:0,right:0},os={full:0,left:0,center:0,right:0},Ja={full:0,left:0,center:0,right:0},Mc=class extends Me{constructor(e,t,r,n,l,c,u,d){var f;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=n,this._renderService=l,this._optionsService=c,this._themeService=u,this._coreBrowserService=d,this._colorZoneStore=new AR,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(),(f=this._viewportElement.parentElement)==null||f.insertBefore(this._canvas,this._viewportElement),this._register(nt(()=>{var v;return(v=this._canvas)==null?void 0:v.remove()}));let _=this._canvas.getContext("2d");if(_)this._ctx=_;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),t=Math.ceil((this._canvas.width-1)/3);os.full=this._canvas.width,os.left=e,os.center=t,os.right=e,this._refreshDrawHeightConstants(),Ja.full=1,Ja.left=1,Ja.center=1+os.left,Ja.right=1+os.left+os.center}_refreshDrawHeightConstants(){er.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);er.left=t,er.center=t,er.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*er.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*er.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*er.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*er.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 t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);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(Ja[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-er[e.position||"full"]/2),os[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+er[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Mc=dt([de(2,ti),de(3,Tl),de(4,Br),de(5,ii),de(6,ta),de(7,Nr)],Mc);var Q;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
222
|
-
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(Q||(Q={}));var mc;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(mc||(mc={}));var Ob;(e=>e.ST=`${Q.ESC}\\`)(Ob||(Ob={}));var Pf=class{constructor(e,t,r,n,l,c){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=n,this._coreService=l,this._renderService=c,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 t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.length<e.length?this._coreService.triggerDataEvent(`${Q.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let c=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(c.width,1)+"px",this._textarea.style.height=Math.max(c.height,1)+"px",this._textarea.style.lineHeight=c.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};Pf=dt([de(2,ti),de(3,ii),de(4,tn),de(5,Br)],Pf);var Bt=0,zt=0,Pt=0,ht=0,Xy={css:"#00000000",rgba:0},Ct;(e=>{function t(l,c,u,d){return d!==void 0?`#${Us(l)}${Us(c)}${Us(u)}${Us(d)}`:`#${Us(l)}${Us(c)}${Us(u)}`}e.toCss=t;function r(l,c,u,d=255){return(l<<24|c<<16|u<<8|d)>>>0}e.toRgba=r;function n(l,c,u,d){return{css:e.toCss(l,c,u,d),rgba:e.toRgba(l,c,u,d)}}e.toColor=n})(Ct||(Ct={}));var rt;(e=>{function t(_,f){if(ht=(f.rgba&255)/255,ht===1)return{css:f.css,rgba:f.rgba};let v=f.rgba>>24&255,m=f.rgba>>16&255,y=f.rgba>>8&255,S=_.rgba>>24&255,b=_.rgba>>16&255,E=_.rgba>>8&255;Bt=S+Math.round((v-S)*ht),zt=b+Math.round((m-b)*ht),Pt=E+Math.round((y-E)*ht);let T=Ct.toCss(Bt,zt,Pt),O=Ct.toRgba(Bt,zt,Pt);return{css:T,rgba:O}}e.blend=t;function r(_){return(_.rgba&255)===255}e.isOpaque=r;function n(_,f,v){let m=gc.ensureContrastRatio(_.rgba,f.rgba,v);if(m)return Ct.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=n;function l(_){let f=(_.rgba|255)>>>0;return[Bt,zt,Pt]=gc.toChannels(f),{css:Ct.toCss(Bt,zt,Pt),rgba:f}}e.opaque=l;function c(_,f){return ht=Math.round(f*255),[Bt,zt,Pt]=gc.toChannels(_.rgba),{css:Ct.toCss(Bt,zt,Pt,ht),rgba:Ct.toRgba(Bt,zt,Pt,ht)}}e.opacity=c;function u(_,f){return ht=_.rgba&255,c(_,ht*f/255)}e.multiplyOpacity=u;function d(_){return[_.rgba>>24&255,_.rgba>>16&255,_.rgba>>8&255]}e.toColorRGB=d})(rt||(rt={}));var ot;(e=>{let t,r;try{let l=document.createElement("canvas");l.width=1,l.height=1;let c=l.getContext("2d",{willReadFrequently:!0});c&&(t=c,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return Bt=parseInt(l.slice(1,2).repeat(2),16),zt=parseInt(l.slice(2,3).repeat(2),16),Pt=parseInt(l.slice(3,4).repeat(2),16),Ct.toColor(Bt,zt,Pt);case 5:return Bt=parseInt(l.slice(1,2).repeat(2),16),zt=parseInt(l.slice(2,3).repeat(2),16),Pt=parseInt(l.slice(3,4).repeat(2),16),ht=parseInt(l.slice(4,5).repeat(2),16),Ct.toColor(Bt,zt,Pt,ht);case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}let c=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return Bt=parseInt(c[1]),zt=parseInt(c[2]),Pt=parseInt(c[3]),ht=Math.round((c[5]===void 0?1:parseFloat(c[5]))*255),Ct.toColor(Bt,zt,Pt,ht);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=l,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Bt,zt,Pt,ht]=t.getImageData(0,0,1,1).data,ht!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ct.toRgba(Bt,zt,Pt,ht),css:l}}e.toColor=n})(ot||(ot={}));var ei;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,l,c){let u=n/255,d=l/255,_=c/255,f=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),v=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),m=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4);return f*.2126+v*.7152+m*.0722}e.relativeLuminance2=r})(ei||(ei={}));var gc;(e=>{function t(u,d){if(ht=(d&255)/255,ht===1)return d;let _=d>>24&255,f=d>>16&255,v=d>>8&255,m=u>>24&255,y=u>>16&255,S=u>>8&255;return Bt=m+Math.round((_-m)*ht),zt=y+Math.round((f-y)*ht),Pt=S+Math.round((v-S)*ht),Ct.toRgba(Bt,zt,Pt)}e.blend=t;function r(u,d,_){let f=ei.relativeLuminance(u>>8),v=ei.relativeLuminance(d>>8);if(Tr(f,v)<_){if(v<f){let S=n(u,d,_),b=Tr(f,ei.relativeLuminance(S>>8));if(b<_){let E=l(u,d,_),T=Tr(f,ei.relativeLuminance(E>>8));return b>T?S:E}return S}let m=l(u,d,_),y=Tr(f,ei.relativeLuminance(m>>8));if(y<_){let S=n(u,d,_),b=Tr(f,ei.relativeLuminance(S>>8));return y>b?m:S}return m}}e.ensureContrastRatio=r;function n(u,d,_){let f=u>>24&255,v=u>>16&255,m=u>>8&255,y=d>>24&255,S=d>>16&255,b=d>>8&255,E=Tr(ei.relativeLuminance2(y,S,b),ei.relativeLuminance2(f,v,m));for(;E<_&&(y>0||S>0||b>0);)y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),b-=Math.max(0,Math.ceil(b*.1)),E=Tr(ei.relativeLuminance2(y,S,b),ei.relativeLuminance2(f,v,m));return(y<<24|S<<16|b<<8|255)>>>0}e.reduceLuminance=n;function l(u,d,_){let f=u>>24&255,v=u>>16&255,m=u>>8&255,y=d>>24&255,S=d>>16&255,b=d>>8&255,E=Tr(ei.relativeLuminance2(y,S,b),ei.relativeLuminance2(f,v,m));for(;E<_&&(y<255||S<255||b<255);)y=Math.min(255,y+Math.ceil((255-y)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),E=Tr(ei.relativeLuminance2(y,S,b),ei.relativeLuminance2(f,v,m));return(y<<24|S<<16|b<<8|255)>>>0}e.increaseLuminance=l;function c(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=c})(gc||(gc={}));function Us(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Tr(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var kR=class extends kl{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}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()]}},Nc=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new $i}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let r=[],n=t.translateToString(!0),l=0,c=0,u=0,d=t.getFg(0),_=t.getBg(0);for(let f=0;f<t.getTrimmedLength();f++)if(t.loadCell(f,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==d||this._workCell.bg!==_){if(f-l>1){let v=this._getJoinedRanges(n,u,c,t,l);for(let m=0;m<v.length;m++)r.push(v[m])}l=f,u=c,d=this._workCell.fg,_=this._workCell.bg}c+=this._workCell.getChars().length||ms.length}if(this._bufferService.cols-l>1){let f=this._getJoinedRanges(n,u,c,t,l);for(let v=0;v<f.length;v++)r.push(f[v])}return r}_getJoinedRanges(e,t,r,n,l){let c=e.substring(t,r),u=[];try{u=this._characterJoiners[0].handler(c)}catch(d){console.error(d)}for(let d=1;d<this._characterJoiners.length;d++)try{let _=this._characterJoiners[d].handler(c);for(let f=0;f<_.length;f++)Nc._mergeRanges(u,_[f])}catch(_){console.error(_)}return this._stringRangesToCellRanges(u,n,l),u}_stringRangesToCellRanges(e,t,r){let n=0,l=!1,c=0,u=e[n];if(u){for(let d=r;d<this._bufferService.cols;d++){let _=t.getWidth(d),f=t.getString(d).length||ms.length;if(_!==0){if(!l&&u[0]<=c&&(u[0]=d,l=!0),u[1]<=c){if(u[1]=d,u=e[++n],!u)break;u[0]<=c?(u[0]=d,l=!0):l=!1}c+=f}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let r=!1;for(let n=0;n<e.length;n++){let l=e[n];if(r){if(t[1]<=l[0])return e[n-1][1]=t[1],e;if(t[1]<=l[1])return e[n-1][1]=Math.max(t[1],l[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=l[0])return e.splice(n,0,t),e;if(t[1]<=l[1])return l[0]=Math.min(t[0],l[0]),e;t[0]<l[1]&&(l[0]=Math.min(t[0],l[0]),r=!0);continue}}return r?e[e.length-1][1]=t[1]:e.push(t),e}};Nc=dt([de(0,ti)],Nc);function TR(e){return 57508<=e&&e<=57558}function RR(e){return 9472<=e&&e<=9631}function DR(e){return TR(e)||RR(e)}function LR(){return{css:{canvas:ac(),cell:ac()},device:{canvas:ac(),cell:ac(),char:{width:0,height:0,left:0,top:0}}}}function ac(){return{width:0,height:0}}var If=class{constructor(e,t,r,n,l,c,u){this._document=e,this._characterJoinerService=t,this._optionsService=r,this._coreBrowserService=n,this._coreService=l,this._decorationService=c,this._themeService=u,this._workCell=new $i,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,r){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=r}createRow(e,t,r,n,l,c,u,d,_,f,v){let m=[],y=this._characterJoinerService.getJoinedCharacters(t),S=this._themeService.colors,b=e.getNoBgTrimmedLength();r&&b<c+1&&(b=c+1);let E,T=0,O="",H=0,B=0,I=0,j=0,Y=!1,te=0,ge=!1,ve=0,fe=0,he=[],J=f!==-1&&v!==-1;for(let G=0;G<b;G++){e.loadCell(G,this._workCell);let re=this._workCell.getWidth();if(re===0)continue;let se=!1,D=G>=fe,W=G,q=this._workCell;if(y.length>0&&G===y[0][0]&&D){let Le=y.shift(),di=this._isCellInSelection(Le[0],t);for(H=Le[0]+1;H<Le[1];H++)D&&(D=di===this._isCellInSelection(H,t));D&&(D=!r||c<Le[0]||c>=Le[1]),D?(se=!0,q=new kR(this._workCell,e.translateToString(!0,Le[0],Le[1]),Le[1]-Le[0]),W=Le[1]-1,re=q.getWidth()):fe=Le[1]}let ie=this._isCellInSelection(G,t),oe=r&&G===c,x=J&&G>=f&&G<=v,M=!1;this._decorationService.forEachDecorationAtCell(G,t,void 0,Le=>{M=!0});let X=q.getChars()||ms;if(X===" "&&(q.isUnderline()||q.isOverline())&&(X=" "),ve=re*d-_.get(X,q.isBold(),q.isItalic()),!E)E=this._document.createElement("span");else if(T&&(ie&&ge||!ie&&!ge&&q.bg===B)&&(ie&&ge&&S.selectionForeground||q.fg===I)&&q.extended.ext===j&&x===Y&&ve===te&&!oe&&!se&&!M&&D){q.isInvisible()?O+=ms:O+=X,T++;continue}else T&&(E.textContent=O),E=this._document.createElement("span"),T=0,O="";if(B=q.bg,I=q.fg,j=q.extended.ext,Y=x,te=ve,ge=ie,se&&c>=G&&c<=W&&(c=G),!this._coreService.isCursorHidden&&oe&&this._coreService.isCursorInitialized){if(he.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&he.push("xterm-cursor-blink"),he.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(l)switch(l){case"outline":he.push("xterm-cursor-outline");break;case"block":he.push("xterm-cursor-block");break;case"bar":he.push("xterm-cursor-bar");break;case"underline":he.push("xterm-cursor-underline");break}}if(q.isBold()&&he.push("xterm-bold"),q.isItalic()&&he.push("xterm-italic"),q.isDim()&&he.push("xterm-dim"),q.isInvisible()?O=ms:O=q.getChars()||ms,q.isUnderline()&&(he.push(`xterm-underline-${q.extended.underlineStyle}`),O===" "&&(O=" "),!q.isUnderlineColorDefault()))if(q.isUnderlineColorRGB())E.style.textDecorationColor=`rgb(${kl.toColorRGB(q.getUnderlineColor()).join(",")})`;else{let Le=q.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&q.isBold()&&Le<8&&(Le+=8),E.style.textDecorationColor=S.ansi[Le].css}q.isOverline()&&(he.push("xterm-overline"),O===" "&&(O=" ")),q.isStrikethrough()&&he.push("xterm-strikethrough"),x&&(E.style.textDecoration="underline");let ee=q.getFgColor(),ue=q.getFgColorMode(),pe=q.getBgColor(),we=q.getBgColorMode(),Fe=!!q.isInverse();if(Fe){let Le=ee;ee=pe,pe=Le;let di=ue;ue=we,we=di}let ze,Ft,$e=!1;this._decorationService.forEachDecorationAtCell(G,t,void 0,Le=>{Le.options.layer!=="top"&&$e||(Le.backgroundColorRGB&&(we=50331648,pe=Le.backgroundColorRGB.rgba>>8&16777215,ze=Le.backgroundColorRGB),Le.foregroundColorRGB&&(ue=50331648,ee=Le.foregroundColorRGB.rgba>>8&16777215,Ft=Le.foregroundColorRGB),$e=Le.options.layer==="top")}),!$e&&ie&&(ze=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,pe=ze.rgba>>8&16777215,we=50331648,$e=!0,S.selectionForeground&&(ue=50331648,ee=S.selectionForeground.rgba>>8&16777215,Ft=S.selectionForeground)),$e&&he.push("xterm-decoration-top");let at;switch(we){case 16777216:case 33554432:at=S.ansi[pe],he.push(`xterm-bg-${pe}`);break;case 50331648:at=Ct.toColor(pe>>16,pe>>8&255,pe&255),this._addStyle(E,`background-color:#${Zy((pe>>>0).toString(16),"0",6)}`);break;case 0:default:Fe?(at=S.foreground,he.push("xterm-bg-257")):at=S.background}switch(ze||q.isDim()&&(ze=rt.multiplyOpacity(at,.5)),ue){case 16777216:case 33554432:q.isBold()&&ee<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ee+=8),this._applyMinimumContrast(E,at,S.ansi[ee],q,ze,void 0)||he.push(`xterm-fg-${ee}`);break;case 50331648:let Le=Ct.toColor(ee>>16&255,ee>>8&255,ee&255);this._applyMinimumContrast(E,at,Le,q,ze,Ft)||this._addStyle(E,`color:#${Zy(ee.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(E,at,S.foreground,q,ze,Ft)||Fe&&he.push("xterm-fg-257")}he.length&&(E.className=he.join(" "),he.length=0),!oe&&!se&&!M&&D?T++:E.textContent=O,ve!==this.defaultSpacing&&(E.style.letterSpacing=`${ve}px`),m.push(E),G=W}return E&&T&&(E.textContent=O),m}_applyMinimumContrast(e,t,r,n,l,c){if(this._optionsService.rawOptions.minimumContrastRatio===1||DR(n.getCode()))return!1;let u=this._getContrastCache(n),d;if(!l&&!c&&(d=u.getColor(t.rgba,r.rgba)),d===void 0){let _=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);d=rt.ensureContrastRatio(l||t,c||r,_),u.setColor((l||t).rgba,(c||r).rgba,d??null)}return d?(this._addStyle(e,`color:${d.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let r=this._selectionStart,n=this._selectionEnd;return!r||!n?!1:this._columnSelectMode?r[0]<=n[0]?e>=r[0]&&t>=r[1]&&e<n[0]&&t<=n[1]:e<r[0]&&t>=r[1]&&e>=n[0]&&t<=n[1]:t>r[1]&&t<n[1]||r[1]===n[1]&&t===r[1]&&e>=r[0]&&e<n[0]||r[1]<n[1]&&t===n[1]&&e<n[0]||r[1]<n[1]&&t===r[1]&&e>=r[0]}};If=dt([de(1,_b),de(2,ii),de(3,Nr),de(4,tn),de(5,Tl),de(6,ta)],If);function Zy(e,t,r){for(;e.length<r;)e=t+e;return e}var OR=class{constructor(e,t){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 r=e.createElement("span");r.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontStyle="italic";let c=e.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold",c.style.fontStyle="italic",this._measureElements=[r,n,l,c],this._container.appendChild(r),this._container.appendChild(n),this._container.appendChild(l),this._container.appendChild(c),t.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,t,r,n){e===this._font&&t===this._fontSize&&r===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=r,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${r}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${r}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,r){let n=0;if(!t&&!r&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let u=this._measure(e,0);return u>0&&(this._flat[n]=u),u}let l=e;t&&(l+="B"),r&&(l+="I");let c=this._holey.get(l);if(c===void 0){let u=0;t&&(u|=1),r&&(u|=2),c=this._measure(e,u),c>0&&this._holey.set(l,c)}return c}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},MR=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,t,r,n=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let l=e.buffers.active.ydisp,c=t[1]-l,u=r[1]-l,d=Math.max(c,0),_=Math.min(u,e.rows-1);if(d>=e.rows||_<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=c,this.viewportEndRow=u,this.viewportCappedStartRow=d,this.viewportCappedEndRow=_,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t<this.endCol&&r<=this.viewportCappedEndRow:t<this.startCol&&r>=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol):!1}};function NR(){return new MR}var Vd="xterm-dom-renderer-owner-",zi="xterm-rows",lc="xterm-fg-",Qy="xterm-bg-",el="xterm-focus",oc="xterm-selection",BR=1,Hf=class extends Me{constructor(e,t,r,n,l,c,u,d,_,f,v,m,y,S){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=n,this._viewportElement=l,this._helperContainer=c,this._linkifier2=u,this._charSizeService=_,this._optionsService=f,this._bufferService=v,this._coreService=m,this._coreBrowserService=y,this._themeService=S,this._terminalClass=BR++,this._rowElements=[],this._selectionRenderModel=NR(),this.onRequestRedraw=this._register(new le).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(zi),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(oc),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=LR(),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=d.createInstance(If,document),this._element.classList.add(Vd+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(nt(()=>{this._element.classList.remove(Vd+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new OR(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 r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${zi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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 t=`${this._terminalSelector} .${zi} { 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}`;t+=`${this._terminalSelector} .${zi} .xterm-dim { color: ${rt.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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 r=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,l=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${l} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${zi}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${zi}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${zi}.${el} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${oc} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${oc} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${oc} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[c,u]of e.ansi.entries())t+=`${this._terminalSelector} .${lc}${c} { color: ${u.css}; }${this._terminalSelector} .${lc}${c}.xterm-dim { color: ${rt.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${Qy}${c} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${lc}257 { color: ${rt.opaque(e.background).css}; }${this._terminalSelector} .${lc}257.xterm-dim { color: ${rt.multiplyOpacity(rt.opaque(e.background),.5).css}; }${this._terminalSelector} .${Qy}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_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,t){for(let r=this._rowElements.length;r<=t;r++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(el),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(el),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,l=this._selectionRenderModel.viewportEndRow,c=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,d=this._document.createDocumentFragment();if(r){let _=e[0]>t[0];d.appendChild(this._createSelectionElement(c,_?t[0]:e[0],_?e[0]:t[0],u-c+1))}else{let _=n===c?e[0]:0,f=c===l?t[0]:this._bufferService.cols;d.appendChild(this._createSelectionElement(c,_,f));let v=u-c-1;if(d.appendChild(this._createSelectionElement(c+1,0,this._bufferService.cols,v)),c!==u){let m=l===u?t[0]:this._bufferService.cols;d.appendChild(this._createSelectionElement(u,0,m))}}this._selectionContainer.appendChild(d)}_createSelectionElement(e,t,r,n=1){let l=this._document.createElement("div"),c=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(r-t);return c+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-c),l.style.height=`${n*this.dimensions.css.cell.height}px`,l.style.top=`${e*this.dimensions.css.cell.height}px`,l.style.left=`${c}px`,l.style.width=`${u}px`,l}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,t){let r=this._bufferService.buffer,n=r.ybase+r.y,l=Math.min(r.x,this._bufferService.cols-1),c=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,u=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let _=e;_<=t;_++){let f=_+r.ydisp,v=this._rowElements[_],m=r.lines.get(f);if(!v||!m)break;v.replaceChildren(...this._rowFactory.createRow(m,f,f===n,u,d,l,c,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${Vd}${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,t,r,n,l,c){r<0&&(e=0),n<0&&(t=0);let u=this._bufferService.rows-1;r=Math.max(Math.min(r,u),0),n=Math.max(Math.min(n,u),0),l=Math.min(l,this._bufferService.cols);let d=this._bufferService.buffer,_=d.ybase+d.y,f=Math.min(d.x,l-1),v=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,y=this._optionsService.rawOptions.cursorInactiveStyle;for(let S=r;S<=n;++S){let b=S+d.ydisp,E=this._rowElements[S],T=d.lines.get(b);if(!E||!T)break;E.replaceChildren(...this._rowFactory.createRow(T,b,b===_,m,y,f,v,this.dimensions.css.cell.width,this._widthCache,c?S===r?e:0:-1,c?(S===n?t:l)-1:-1))}}};Hf=dt([de(7,S_),de(8,Zc),de(9,ii),de(10,ti),de(11,tn),de(12,Nr),de(13,ta)],Hf);var Uf=class extends Me{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new le),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new PR(this._optionsService))}catch{this._measureStrategy=this._register(new zR(e,t,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())}};Uf=dt([de(2,ii)],Uf);var Mb=class extends Me{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},zR=class extends Mb{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,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}},PR=class extends Mb{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))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}},IR=class extends Me{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new HR(this._window)),this._onDprChange=this._register(new le),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new le),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(Wt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ce(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ce(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}},HR=class extends Me{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Zn),this._onDprChange=this._register(new le),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(nt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ce(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)}},UR=class extends Me{constructor(){super(),this.linkProviders=[],this._register(nt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function T_(e,t,r){let n=r.getBoundingClientRect(),l=e.getComputedStyle(r),c=parseInt(l.getPropertyValue("padding-left")),u=parseInt(l.getPropertyValue("padding-top"));return[t.clientX-n.left-c,t.clientY-n.top-u]}function jR(e,t,r,n,l,c,u,d,_){if(!c)return;let f=T_(e,t,r);if(f)return f[0]=Math.ceil((f[0]+(_?u/2:0))/u),f[1]=Math.ceil(f[1]/d),f[0]=Math.min(Math.max(f[0],1),n+(_?1:0)),f[1]=Math.min(Math.max(f[1],1),l),f}var jf=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,n,l){return jR(window,e,t,r,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(e,t){let r=T_(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};jf=dt([de(0,Br),de(1,Zc)],jf);var VR=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,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,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t,!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),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Nb={};Qk(Nb,{getSafariVersion:()=>GR,isChromeOS:()=>Ib,isFirefox:()=>Bb,isIpad:()=>qR,isIphone:()=>WR,isLegacyEdge:()=>$R,isLinux:()=>R_,isMac:()=>Bc,isNode:()=>Qc,isSafari:()=>zb,isWindows:()=>Pb});var Qc=typeof process<"u"&&"title"in process,Rl=Qc?"node":navigator.userAgent,Dl=Qc?"node":navigator.platform,Bb=Rl.includes("Firefox"),$R=Rl.includes("Edge"),zb=/^((?!chrome|android).)*safari/i.test(Rl);function GR(){if(!zb)return 0;let e=Rl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Bc=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Dl),qR=Dl==="iPad",WR=Dl==="iPhone",Pb=["Windows","Win16","Win32","WinCE"].includes(Dl),R_=Dl.indexOf("Linux")>=0,Ib=/\bCrOS\b/.test(Rl),Hb=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,r=0,n=e.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),r=Math.max(t,r),l=e.timeRemaining(),r*1.5>l){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=l}this.clear()}},FR=class extends Hb{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},YR=class extends Hb{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},zc=!Qc&&"requestIdleCallback"in window?YR:FR,KR=class{constructor(){this._queue=new zc}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},Vf=class extends Me{constructor(e,t,r,n,l,c,u,d,_){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=n,this._coreService=l,this._coreBrowserService=d,this._renderer=this._register(new Zn),this._pausedResizeTask=new KR,this._observerDisposable=this._register(new Zn),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 le),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new le),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new le),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new le),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new VR((f,v)=>this._renderRows(f,v),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new XR(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(nt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(u.onResize(()=>this._fullRefresh())),this._register(u.buffers.onBufferActivate(()=>{var f;return(f=this._renderer.value)==null?void 0:f.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(c.onDecorationRegistered(()=>this._fullRefresh())),this._register(c.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(u.cols,u.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(u.buffer.y,u.buffer.y,!0))),this._register(_.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(f=>this._registerIntersectionObserver(f,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=nt(()=>r.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,t,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),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:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(t=>this.refreshRows(t.start,t.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,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var r;return(r=this._renderer.value)==null?void 0:r.handleResize(e,t)}):this._renderer.value.handleResize(e,t),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,t,r){var n;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,(n=this._renderer.value)==null||n.handleSelectionChanged(e,t,r)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};Vf=dt([de(2,ii),de(3,Zc),de(4,tn),de(5,Tl),de(6,ti),de(7,Nr),de(8,ta)],Vf);var XR=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,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 e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function ZR(e,t,r,n){let l=r.buffer.x,c=r.buffer.y;if(!r.buffer.hasScrollback)return eD(l,c,e,t,r,n)+Jc(c,t,r,n)+tD(l,c,e,t,r,n);let u;if(c===t)return u=l>e?"D":"C",bl(Math.abs(l-e),Sl(u,n));u=c>t?"D":"C";let d=Math.abs(c-t),_=JR(c>t?e:l,r)+(d-1)*r.cols+1+QR(c>t?l:e);return bl(_,Sl(u,n))}function QR(e,t){return e-1}function JR(e,t){return t.cols-e}function eD(e,t,r,n,l,c){return Jc(t,n,l,c).length===0?"":bl(jb(e,t,e,t-Js(t,l),!1,l).length,Sl("D",c))}function Jc(e,t,r,n){let l=e-Js(e,r),c=t-Js(t,r),u=Math.abs(l-c)-iD(e,t,r);return bl(u,Sl(Ub(e,t),n))}function tD(e,t,r,n,l,c){let u;Jc(t,n,l,c).length>0?u=n-Js(n,l):u=t;let d=n,_=rD(e,t,r,n,l,c);return bl(jb(e,u,r,d,_==="C",l).length,Sl(_,c))}function iD(e,t,r){var u;let n=0,l=e-Js(e,r),c=t-Js(t,r);for(let d=0;d<Math.abs(l-c);d++){let _=Ub(e,t)==="A"?-1:1;(u=r.buffer.lines.get(l+_*d))!=null&&u.isWrapped&&n++}return n}function Js(e,t){let r=0,n=t.buffer.lines.get(e),l=n==null?void 0:n.isWrapped;for(;l&&e>=0&&e<t.rows;)r++,n=t.buffer.lines.get(--e),l=n==null?void 0:n.isWrapped;return r}function rD(e,t,r,n,l,c){let u;return Jc(r,n,l,c).length>0?u=n-Js(n,l):u=t,e<r&&u<=n||e>=r&&u<n?"C":"D"}function Ub(e,t){return e>t?"A":"B"}function jb(e,t,r,n,l,c){let u=e,d=t,_="";for(;(u!==r||d!==n)&&d>=0&&d<c.buffer.lines.length;)u+=l?1:-1,l&&u>c.cols-1?(_+=c.buffer.translateBufferLineToString(d,!1,e,u),u=0,e=0,d++):!l&&u<0&&(_+=c.buffer.translateBufferLineToString(d,!1,0,e+1),u=c.cols-1,e=u,d--);return _+c.buffer.translateBufferLineToString(d,!1,e,u)}function Sl(e,t){let r=t?"O":"[";return Q.ESC+r+e}function bl(e,t){e=Math.floor(e);let r="";for(let n=0;n<e;n++)r+=t;return r}var sD=class{constructor(e){this._bufferService=e,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 e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Jy(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var $d=50,nD=15,aD=50,lD=500,oD=" ",cD=new RegExp(oD,"g"),$f=class extends Me{constructor(e,t,r,n,l,c,u,d,_){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=n,this._coreService=l,this._mouseService=c,this._optionsService=u,this._renderService=d,this._coreBrowserService=_,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new $i,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new le),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new le),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new le),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new le),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=f=>this._handleMouseMove(f),this._mouseUpListener=f=>this._handleMouseUp(f),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(f=>this._handleTrim(f)),this._register(this._bufferService.buffers.onBufferActivate(f=>this._handleBufferActivate(f))),this.enable(),this._model=new sD(this._bufferService),this._activeSelectionMode=0,this._register(nt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(f=>{f.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,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let r=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let l=e[0]<t[0]?e[0]:t[0],c=e[0]<t[0]?t[0]:e[0];for(let u=e[1];u<=t[1];u++){let d=r.translateBufferLineToString(u,!0,l,c);n.push(d)}}else{let l=e[1]===t[1]?t[0]:void 0;n.push(r.translateBufferLineToString(e[1],!0,e[0],l));for(let c=e[1]+1;c<=t[1]-1;c++){let u=r.lines.get(c),d=r.translateBufferLineToString(c,!0);u!=null&&u.isWrapped?n[n.length-1]+=d:n.push(d)}if(e[1]!==t[1]){let c=r.lines.get(t[1]),u=r.translateBufferLineToString(t[1],!0,0,t[0]);c&&c.isWrapped?n[n.length-1]+=u:n.push(u)}}return n.map(l=>l.replace(cD," ")).join(Pb?`\r
|
|
220
|
+
`))}},kT=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},TT=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},RT=0,Hd=class{constructor(e){this.value=e,this.id=RT++}},DT=2,LT,oe=class{constructor(e){var t,r,n,l;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new xT((e==null?void 0:e.onListenerError)??fc,((r=this._options)==null?void 0:r.leakWarningThreshold)??ET):void 0,this._perfMon=(n=this._options)!=null&&n._profName?new CT(this._options._profName):void 0,this._deliveryQueue=(l=this._options)==null?void 0:l.deliveryQueue}dispose(){var e,t,r,n;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),(r=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t),(n=this._leakageMon)==null||n.dispose())}get event(){return this._event??(this._event=(e,t,r)=>{var u,d,_,f,v;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let y=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],S=new TT(`${m}. HINT: Stack shows most frequent listener (${y[1]}-times)`,y[0]);return(((u=this._options)==null?void 0:u.onListenerError)||fc)(S),Me.None}if(this._disposed)return Me.None;t&&(e=e.bind(t));let n=new Hd(e),l;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(n.stack=AT.create(),l=this._leakageMon.check(n.stack,this._size+1)),this._listeners?this._listeners instanceof Hd?(this._deliveryQueue??(this._deliveryQueue=new OT),this._listeners=[this._listeners,n]):this._listeners.push(n):((_=(d=this._options)==null?void 0:d.onWillAddFirstListener)==null||_.call(d,this),this._listeners=n,(v=(f=this._options)==null?void 0:f.onDidAddFirstListener)==null||v.call(f,this)),this._size++;let c=nt(()=>{l==null||l(),this._removeListener(n)});return r instanceof vs?r.add(c):Array.isArray(r)&&r.push(c),c}),this._event}_removeListener(e){var l,c,u,d;if((c=(l=this._options)==null?void 0:l.onWillRemoveListener)==null||c.call(l,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(d=(u=this._options)==null?void 0:u.onDidRemoveLastListener)==null||d.call(u,this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);if(r===-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--,t[r]=void 0;let n=this._deliveryQueue.current===this;if(this._size*DT<=t.length){let _=0;for(let f=0;f<t.length;f++)t[f]?t[_++]=t[f]:n&&(this._deliveryQueue.end--,_<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=_}}_deliver(e,t){var n;if(!e)return;let r=((n=this._options)==null?void 0:n.onListenerError)||fc;if(!r){e.value(t);return}try{e.value(t)}catch(l){r(l)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,r,n,l;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(n=this._perfMon)==null||n.start(this._size),this._listeners)if(this._listeners instanceof Hd)this._deliver(this._listeners,e);else{let c=this._deliveryQueue;c.enqueue(this,e,this._listeners.length),this._deliverQueue(c)}(l=this._perfMon)==null||l.stop()}hasListeners(){return this._size>0}},OT=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Tf=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new oe,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new oe,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,r){if(this.getZoomLevel(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(n,t),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),t)}setFullscreen(t,r){if(this.isFullscreen(r)===t)return;let n=this.getWindowId(r);this.mapWindowIdToFullScreen.set(n,t),this._onDidChangeFullscreen.fire(n)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Tf.INSTANCE=new Tf;var C_=Tf;function MT(e,t,r){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",r)}C_.INSTANCE.onDidChangeZoomLevel;function NT(e){return C_.INSTANCE.getZoomFactor(e)}C_.INSTANCE.onDidChangeFullscreen;var ia=typeof navigator=="object"?navigator.userAgent:"",Rf=ia.indexOf("Firefox")>=0,BT=ia.indexOf("AppleWebKit")>=0,E_=ia.indexOf("Chrome")>=0,zT=!E_&&ia.indexOf("Safari")>=0;ia.indexOf("Electron/")>=0;ia.indexOf("Android")>=0;var Ud=!1;if(typeof Or.matchMedia=="function"){let e=Or.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=Or.matchMedia("(display-mode: fullscreen)");Ud=e.matches,MT(Or,e,({matches:r})=>{Ud&&t.matches||(Ud=r)})}var Fn="en",Df=!1,Lf=!1,_c=!1,Tb=!1,sc,pc=Fn,Iy=Fn,PT,Yi,Xs=globalThis,qt,D0;typeof Xs.vscode<"u"&&typeof Xs.vscode.process<"u"?qt=Xs.vscode.process:typeof process<"u"&&typeof((D0=process==null?void 0:process.versions)==null?void 0:D0.node)=="string"&&(qt=process);var L0,IT=typeof((L0=qt==null?void 0:qt.versions)==null?void 0:L0.electron)=="string",HT=IT&&(qt==null?void 0:qt.type)==="renderer",O0;if(typeof qt=="object"){Df=qt.platform==="win32",Lf=qt.platform==="darwin",_c=qt.platform==="linux",_c&&qt.env.SNAP&&qt.env.SNAP_REVISION,qt.env.CI||qt.env.BUILD_ARTIFACTSTAGINGDIRECTORY,sc=Fn,pc=Fn;let e=qt.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);sc=t.userLocale,Iy=t.osLocale,pc=t.resolvedLanguage||Fn,PT=(O0=t.languagePack)==null?void 0:O0.translationsConfigFile}catch{}Tb=!0}else typeof navigator=="object"&&!HT?(Yi=navigator.userAgent,Df=Yi.indexOf("Windows")>=0,Lf=Yi.indexOf("Macintosh")>=0,(Yi.indexOf("Macintosh")>=0||Yi.indexOf("iPad")>=0||Yi.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,_c=Yi.indexOf("Linux")>=0,(Yi==null?void 0:Yi.indexOf("Mobi"))>=0,pc=globalThis._VSCODE_NLS_LANGUAGE||Fn,sc=navigator.language.toLowerCase(),Iy=sc):console.error("Unable to resolve platform.");var Rb=Df,ar=Lf,UT=_c,Hy=Tb,lr=Yi,ls=pc,jT;(e=>{function t(){return ls}e.value=t;function r(){return ls.length===2?ls==="en":ls.length>=3?ls[0]==="e"&&ls[1]==="n"&&ls[2]==="-":!1}e.isDefaultVariant=r;function n(){return ls==="en"}e.isDefault=n})(jT||(jT={}));var VT=typeof Xs.postMessage=="function"&&!Xs.importScripts;(()=>{if(VT){let e=[];Xs.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let n=0,l=e.length;n<l;n++){let c=e[n];if(c.id===r.data.vscodeScheduleAsyncWork){e.splice(n,1),c.callback();return}}});let t=0;return r=>{let n=++t;e.push({id:n,callback:r}),Xs.postMessage({vscodeScheduleAsyncWork:n},"*")}}return e=>setTimeout(e)})();var $T=!!(lr&&lr.indexOf("Chrome")>=0);lr&&lr.indexOf("Firefox")>=0;!$T&&lr&&lr.indexOf("Safari")>=0;lr&&lr.indexOf("Edg/")>=0;lr&&lr.indexOf("Android")>=0;var $n=typeof navigator=="object"?navigator:{};Hy||document.queryCommandSupported&&document.queryCommandSupported("copy")||$n&&$n.clipboard&&$n.clipboard.writeText,Hy||$n&&$n.clipboard&&$n.clipboard.readText;var x_=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},jd=new x_,Uy=new x_,jy=new x_,GT=new Array(230),Db;(e=>{function t(d){return jd.keyCodeToStr(d)}e.toString=t;function r(d){return jd.strToKeyCode(d)}e.fromString=r;function n(d){return Uy.keyCodeToStr(d)}e.toUserSettingsUS=n;function l(d){return jy.keyCodeToStr(d)}e.toUserSettingsGeneral=l;function c(d){return Uy.strToKeyCode(d)||jy.strToKeyCode(d)}e.fromUserSettings=c;function u(d){if(d>=98&&d<=113)return null;switch(d){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return jd.keyCodeToStr(d)}e.toElectronAccelerator=u})(Db||(Db={}));var qT=class Lb{constructor(t,r,n,l,c){this.ctrlKey=t,this.shiftKey=r,this.altKey=n,this.metaKey=l,this.keyCode=c}equals(t){return t instanceof Lb&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",r=this.shiftKey?"1":"0",n=this.altKey?"1":"0",l=this.metaKey?"1":"0";return`K${t}${r}${n}${l}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new WT([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},WT=class{constructor(e){if(e.length===0)throw gT("chords");this.chords=e}getHashCode(){let e="";for(let t=0,r=this.chords.length;t<r;t++)t!==0&&(e+=";"),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function FT(e){if(e.charCode){let r=String.fromCharCode(e.charCode).toUpperCase();return Db.fromString(r)}let t=e.keyCode;if(t===3)return 7;if(Rf)switch(t){case 59:return 85;case 60:if(UT)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(ar)return 57;break}else if(BT&&(ar&&t===93||!ar&&t===92))return 57;return GT[t]||0}var YT=ar?256:2048,KT=512,XT=1024,ZT=ar?2048:256,Vy=class{constructor(e){var r;this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=(r=t.getModifierState)==null?void 0:r.call(t,"AltGraph"),this.keyCode=FT(t),this.code=t.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(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=YT),this.altKey&&(t|=KT),this.shiftKey&&(t|=XT),this.metaKey&&(t|=ZT),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new qT(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},$y=new WeakMap;function QT(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,r=e.parent.location;if(t.origin!=="null"&&r.origin!=="null"&&t.origin!==r.origin)return null}catch{return null}return e.parent}var JT=class{static getSameOriginWindowChain(e){let t=$y.get(e);if(!t){t=[],$y.set(e,t);let r=e,n;do n=QT(r),n?t.push({window:new WeakRef(r),iframeElement:r.frameElement||null}):t.push({window:new WeakRef(r),iframeElement:null}),r=n;while(r)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let r=0,n=0,l=this.getSameOriginWindowChain(e);for(let c of l){let u=c.window.deref();if(r+=(u==null?void 0:u.scrollY)??0,n+=(u==null?void 0:u.scrollX)??0,u===t||!c.iframeElement)break;let d=c.iframeElement.getBoundingClientRect();r+=d.top,n+=d.left}return{top:r,left:n}}},nc=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type==="dblclick"&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX=="number"?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let r=JT.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=r.left,this.posy-=r.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},Gy=class{constructor(e,t=0,r=0){var l;this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=r,this.deltaX=t;let n=!1;if(E_){let c=navigator.userAgent.match(/Chrome\/(\d+)/);n=(c?parseInt(c[1]):123)<=122}if(e){let c=e,u=e,d=((l=e.view)==null?void 0:l.devicePixelRatio)||1;if(typeof c.wheelDeltaY<"u")n?this.deltaY=c.wheelDeltaY/(120*d):this.deltaY=c.wheelDeltaY/120;else if(typeof u.VERTICAL_AXIS<"u"&&u.axis===u.VERTICAL_AXIS)this.deltaY=-u.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?Rf&&!ar?this.deltaY=-e.deltaY/3:this.deltaY=-e.deltaY:this.deltaY=-e.deltaY/40}if(typeof c.wheelDeltaX<"u")zT&&Rb?this.deltaX=-(c.wheelDeltaX/120):n?this.deltaX=c.wheelDeltaX/(120*d):this.deltaX=c.wheelDeltaX/120;else if(typeof u.HORIZONTAL_AXIS<"u"&&u.axis===u.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type==="wheel"){let _=e;_.deltaMode===_.DOM_DELTA_LINE?Rf&&!ar?this.deltaX=-e.deltaX/3:this.deltaX=-e.deltaX:this.deltaX=-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(n?this.deltaY=e.wheelDelta/(120*d):this.deltaY=e.wheelDelta/120)}}preventDefault(){var e;(e=this.browserEvent)==null||e.preventDefault()}stopPropagation(){var e;(e=this.browserEvent)==null||e.stopPropagation()}},Ob=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),eR;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof tR?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Wt.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Ob})})(eR||(eR={}));var tR=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?Ob:(this._emitter||(this._emitter=new oe),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},A_=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new Cf("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new Cf("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},iR=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){var e;(e=this.disposable)==null||e.dispose(),this.disposable=void 0}cancelAndSet(e,t,r=globalThis){if(this.isDisposed)throw new Cf("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let n=r.setInterval(()=>{e()},t);this.disposable=nt(()=>{r.clearInterval(n),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},rR;(e=>{async function t(n){let l,c=await Promise.all(n.map(u=>u.then(d=>d,d=>{l||(l=d)})));if(typeof l<"u")throw l;return c}e.settled=t;function r(n){return new Promise(async(l,c)=>{try{await n(l,c)}catch(u){c(u)}})}e.withAsyncBody=r})(rR||(rR={}));var qy=class Ii{static fromArray(t){return new Ii(r=>{r.emitMany(t)})}static fromPromise(t){return new Ii(async r=>{r.emitMany(await t)})}static fromPromises(t){return new Ii(async r=>{await Promise.all(t.map(async n=>r.emitOne(await n)))})}static merge(t){return new Ii(async r=>{await Promise.all(t.map(async n=>{for await(let l of n)r.emitOne(l)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new oe,queueMicrotask(async()=>{let n={emitOne:l=>this.emitOne(l),emitMany:l=>this.emitMany(l),reject:l=>this.reject(l)};try{await Promise.resolve(t(n)),this.resolve()}catch(l){this.reject(l)}finally{n.emitOne=void 0,n.emitMany=void 0,n.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await Wt.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new Ii(async n=>{for await(let l of t)n.emitOne(r(l))})}map(t){return Ii.map(this,t)}static filter(t,r){return new Ii(async n=>{for await(let l of t)r(l)&&n.emitOne(l)})}filter(t){return Ii.filter(this,t)}static coalesce(t){return Ii.filter(t,r=>!!r)}coalesce(){return Ii.coalesce(this)}static async toPromise(t){let r=[];for await(let n of t)r.push(n);return r}toPromise(){return Ii.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};qy.EMPTY=qy.fromArray([]);var{getWindow:nr,getWindowId:sR,onDidRegisterWindow:nR}=(function(){let e=new Map,t={window:Or,disposables:new vs};e.set(Or.vscodeWindowId,t);let r=new oe,n=new oe,l=new oe;function c(u,d){return(typeof u=="number"?e.get(u):void 0)??(d?t:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:l.event,onDidUnregisterWindow:n.event,registerWindow(u){if(e.has(u.vscodeWindowId))return Me.None;let d=new vs,_={window:u,disposables:d.add(new vs)};return e.set(u.vscodeWindowId,_),d.add(nt(()=>{e.delete(u.vscodeWindowId),n.fire(u)})),d.add(Ce(u,Nt.BEFORE_UNLOAD,()=>{l.fire(u)})),r.fire(_),d},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(u){return u.vscodeWindowId},hasWindow(u){return e.has(u)},getWindowById:c,getWindow(u){var f;let d=u;if((f=d==null?void 0:d.ownerDocument)!=null&&f.defaultView)return d.ownerDocument.defaultView.window;let _=u;return _!=null&&_.view?_.view.window:Or},getDocument(u){return nr(u).document}}})(),aR=class{constructor(e,t,r,n){this._node=e,this._type=t,this._handler=r,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 Ce(e,t,r,n){return new aR(e,t,r,n)}var Wy=function(e,t,r,n){return Ce(e,t,r,n)},k_,lR=class extends iR{constructor(e){super(),this.defaultTarget=e&&nr(e)}cancelAndSet(e,t,r){return super.cancelAndSet(e,t,r??this.defaultTarget)}},Fy=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){fc(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,r=new Map,n=new Map,l=c=>{r.set(c,!1);let u=e.get(c)??[];for(t.set(c,u),e.set(c,[]),n.set(c,!0);u.length>0;)u.sort(Fy.sort),u.shift().execute();n.set(c,!1)};k_=(c,u,d=0)=>{let _=sR(c),f=new Fy(u,d),v=e.get(_);return v||(v=[],e.set(_,v)),v.push(f),r.get(_)||(r.set(_,!0),c.requestAnimationFrame(()=>l(_))),f}})();function oR(e){let t=e.getBoundingClientRect(),r=nr(e);return{left:t.left+r.scrollX,top:t.top+r.scrollY,width:t.width,height:t.height}}var Nt={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"},cR=class{constructor(e){this.domNode=e,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(e){let t=di(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=di(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=di(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=di(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=di(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=di(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=di(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=di(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=di(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=di(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=di(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=di(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=di(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=di(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function di(e){return typeof e=="number"?`${e}px`:e}function _l(e){return new cR(e)}var Mb=class{constructor(){this._hooks=new vs,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let r=this._onStopCallback;this._onStopCallback=null,e&&r&&r(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,r,n,l){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=n,this._onStopCallback=l;let c=e;try{e.setPointerCapture(t),this._hooks.add(nt(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{c=nr(e)}this._hooks.add(Ce(c,Nt.POINTER_MOVE,u=>{if(u.buttons!==r){this.stopMonitoring(!0);return}u.preventDefault(),this._pointerMoveCallback(u)})),this._hooks.add(Ce(c,Nt.POINTER_UP,u=>this.stopMonitoring(!0)))}};function uR(e,t,r){let n=null,l=null;if(typeof r.value=="function"?(n="value",l=r.value,l.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof r.get=="function"&&(n="get",l=r.get),!l)throw new Error("not supported");let c=`$memoize$${t}`;r[n]=function(...u){return this.hasOwnProperty(c)||Object.defineProperty(this,c,{configurable:!1,enumerable:!1,writable:!1,value:l.apply(this,u)}),this[c]}}var sr;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(sr||(sr={}));var ll=class Zt extends Me{constructor(){super(),this.dispatched=!1,this.targets=new Py,this.ignoreTargets=new Py,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(Wt.runAndSubscribe(nR,({window:t,disposables:r})=>{r.add(Ce(t.document,"touchstart",n=>this.onTouchStart(n),{passive:!1})),r.add(Ce(t.document,"touchend",n=>this.onTouchEnd(t,n))),r.add(Ce(t.document,"touchmove",n=>this.onTouchMove(n),{passive:!1}))},{window:Or,disposables:this._store}))}static addTarget(t){if(!Zt.isTouchDevice())return Me.None;Zt.INSTANCE||(Zt.INSTANCE=new Zt);let r=Zt.INSTANCE.targets.push(t);return nt(r)}static ignoreTarget(t){if(!Zt.isTouchDevice())return Me.None;Zt.INSTANCE||(Zt.INSTANCE=new Zt);let r=Zt.INSTANCE.ignoreTargets.push(t);return nt(r)}static isTouchDevice(){return"ontouchstart"in Or||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let r=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let n=0,l=t.targetTouches.length;n<l;n++){let c=t.targetTouches.item(n);this.activeTouches[c.identifier]={id:c.identifier,initialTarget:c.target,initialTimeStamp:r,initialPageX:c.pageX,initialPageY:c.pageY,rollingTimestamps:[r],rollingPageX:[c.pageX],rollingPageY:[c.pageY]};let u=this.newGestureEvent(sr.Start,c.target);u.pageX=c.pageX,u.pageY=c.pageY,this.dispatchEvent(u)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}onTouchEnd(t,r){let n=Date.now(),l=Object.keys(this.activeTouches).length;for(let c=0,u=r.changedTouches.length;c<u;c++){let d=r.changedTouches.item(c);if(!this.activeTouches.hasOwnProperty(String(d.identifier))){console.warn("move of an UNKNOWN touch",d);continue}let _=this.activeTouches[d.identifier],f=Date.now()-_.initialTimeStamp;if(f<Zt.HOLD_DELAY&&Math.abs(_.initialPageX-Ci(_.rollingPageX))<30&&Math.abs(_.initialPageY-Ci(_.rollingPageY))<30){let v=this.newGestureEvent(sr.Tap,_.initialTarget);v.pageX=Ci(_.rollingPageX),v.pageY=Ci(_.rollingPageY),this.dispatchEvent(v)}else if(f>=Zt.HOLD_DELAY&&Math.abs(_.initialPageX-Ci(_.rollingPageX))<30&&Math.abs(_.initialPageY-Ci(_.rollingPageY))<30){let v=this.newGestureEvent(sr.Contextmenu,_.initialTarget);v.pageX=Ci(_.rollingPageX),v.pageY=Ci(_.rollingPageY),this.dispatchEvent(v)}else if(l===1){let v=Ci(_.rollingPageX),m=Ci(_.rollingPageY),y=Ci(_.rollingTimestamps)-_.rollingTimestamps[0],S=v-_.rollingPageX[0],b=m-_.rollingPageY[0],x=[...this.targets].filter(T=>_.initialTarget instanceof Node&&T.contains(_.initialTarget));this.inertia(t,x,n,Math.abs(S)/y,S>0?1:-1,v,Math.abs(b)/y,b>0?1:-1,m)}this.dispatchEvent(this.newGestureEvent(sr.End,_.initialTarget)),delete this.activeTouches[d.identifier]}this.dispatched&&(r.preventDefault(),r.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,r){let n=document.createEvent("CustomEvent");return n.initEvent(t,!1,!0),n.initialTarget=r,n.tapCount=0,n}dispatchEvent(t){if(t.type===sr.Tap){let r=new Date().getTime(),n=0;r-this._lastSetTapCountTime>Zt.CLEAR_TAP_COUNT_TIME?n=1:n=2,this._lastSetTapCountTime=r,t.tapCount=n}else(t.type===sr.Change||t.type===sr.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let n of this.ignoreTargets)if(n.contains(t.initialTarget))return;let r=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let l=0,c=t.initialTarget;for(;c&&c!==n;)l++,c=c.parentElement;r.push([l,n])}r.sort((n,l)=>n[0]-l[0]);for(let[n,l]of r)l.dispatchEvent(t),this.dispatched=!0}}inertia(t,r,n,l,c,u,d,_,f){this.handle=k_(t,()=>{let v=Date.now(),m=v-n,y=0,S=0,b=!0;l+=Zt.SCROLL_FRICTION*m,d+=Zt.SCROLL_FRICTION*m,l>0&&(b=!1,y=c*l*m),d>0&&(b=!1,S=_*d*m);let x=this.newGestureEvent(sr.Change);x.translationX=y,x.translationY=S,r.forEach(T=>T.dispatchEvent(x)),b||this.inertia(t,r,v,l,c,u+y,d,_,f+S)})}onTouchMove(t){let r=Date.now();for(let n=0,l=t.changedTouches.length;n<l;n++){let c=t.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(c.identifier))){console.warn("end of an UNKNOWN touch",c);continue}let u=this.activeTouches[c.identifier],d=this.newGestureEvent(sr.Change,u.initialTarget);d.translationX=c.pageX-Ci(u.rollingPageX),d.translationY=c.pageY-Ci(u.rollingPageY),d.pageX=c.pageX,d.pageY=c.pageY,this.dispatchEvent(d),u.rollingPageX.length>3&&(u.rollingPageX.shift(),u.rollingPageY.shift(),u.rollingTimestamps.shift()),u.rollingPageX.push(c.pageX),u.rollingPageY.push(c.pageY),u.rollingTimestamps.push(r)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};ll.SCROLL_FRICTION=-.005,ll.HOLD_DELAY=700,ll.CLEAR_TAP_COUNT_TIME=400,dt([uR],ll,"isTouchDevice",1);var hR=ll,T_=class extends Me{onclick(e,t){this._register(Ce(e,Nt.CLICK,r=>t(new nc(nr(e),r))))}onmousedown(e,t){this._register(Ce(e,Nt.MOUSE_DOWN,r=>t(new nc(nr(e),r))))}onmouseover(e,t){this._register(Ce(e,Nt.MOUSE_OVER,r=>t(new nc(nr(e),r))))}onmouseleave(e,t){this._register(Ce(e,Nt.MOUSE_LEAVE,r=>t(new nc(nr(e),r))))}onkeydown(e,t){this._register(Ce(e,Nt.KEY_DOWN,r=>t(new Vy(r))))}onkeyup(e,t){this._register(Ce(e,Nt.KEY_UP,r=>t(new Vy(r))))}oninput(e,t){this._register(Ce(e,Nt.INPUT,t))}onblur(e,t){this._register(Ce(e,Nt.BLUR,t))}onfocus(e,t){this._register(Ce(e,Nt.FOCUS,t))}onchange(e,t){this._register(Ce(e,Nt.CHANGE,t))}ignoreGesture(e){return hR.ignoreTarget(e)}},Yy=11,dR=class extends T_{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Yy+"px",this.domNode.style.height=Yy+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Mb),this._register(Wy(this.bgDomNode,Nt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Wy(this.domNode,Nt.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new lR),this._pointerdownScheduleRepeatTimer=this._register(new A_)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,nr(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},fR=class Of{constructor(t,r,n,l,c,u,d){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(r=r|0,n=n|0,l=l|0,c=c|0,u=u|0,d=d|0),this.rawScrollLeft=l,this.rawScrollTop=d,r<0&&(r=0),l+r>n&&(l=n-r),l<0&&(l=0),c<0&&(c=0),d+c>u&&(d=u-c),d<0&&(d=0),this.width=r,this.scrollWidth=n,this.scrollLeft=l,this.height=c,this.scrollHeight=u,this.scrollTop=d}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,r){return new Of(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,r?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,r?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Of(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,r){let n=this.width!==t.width,l=this.scrollWidth!==t.scrollWidth,c=this.scrollLeft!==t.scrollLeft,u=this.height!==t.height,d=this.scrollHeight!==t.scrollHeight,_=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:r,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:l,scrollLeftChanged:c,heightChanged:u,scrollHeightChanged:d,scrollTopChanged:_}}},_R=class extends Me{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new fR(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){var n;let r=this._state.withScrollDimensions(e,t);this._setState(r,!!this._smoothScrolling),(n=this._smoothScrolling)==null||n.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let r=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===r.scrollLeft&&this._smoothScrolling.to.scrollTop===r.scrollTop)return;let n;t?n=new Xy(this._smoothScrolling.from,r,this._smoothScrolling.startTime,this._smoothScrolling.duration):n=this._smoothScrolling.combine(this._state,r,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=n}else{let r=this._state.withScrollPosition(e);this._smoothScrolling=Xy.start(this._state,r,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 e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let r=this._state;r.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(r,t)))}},Ky=class{constructor(e,t,r){this.scrollLeft=e,this.scrollTop=t,this.isDone=r}};function Vd(e,t){let r=t-e;return function(n){return e+r*gR(n)}}function pR(e,t,r){return function(n){return n<r?e(n/r):t((n-r)/(1-r))}}var Xy=class Mf{constructor(t,r,n,l){this.from=t,this.to=r,this.duration=l,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(t,r,n){if(Math.abs(t-r)>2.5*n){let l,c;return t<r?(l=t+.75*n,c=r-.75*n):(l=t-.75*n,c=r+.75*n),pR(Vd(t,l),Vd(c,r),.33)}return Vd(t,r)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(t){this.to=t.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(t){let r=(t-this.startTime)/this.duration;if(r<1){let n=this.scrollLeft(r),l=this.scrollTop(r);return new Ky(n,l,!1)}return new Ky(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,r,n){return Mf.start(t,r,n)}static start(t,r,n){n=n+10;let l=Date.now()-10;return new Mf(t,r,l,n)}};function mR(e){return Math.pow(e,3)}function gR(e){return 1-mR(1-e)}var vR=class extends Me{constructor(e,t,r){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=r,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new A_)}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 t;this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,(t=this._domNode)==null||t.setClassName(this._invisibleClassName+(e?" fade":"")))}},yR=140,Nb=class extends T_{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 vR(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Mb),this._shouldRender=!0,this.domNode=_l(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(Ce(this.domNode.domNode,Nt.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new dR(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,r,n){this.slider=_l(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof r=="number"&&this.slider.setWidth(r),typeof n=="number"&&this.slider.setHeight(n),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(Ce(this.slider.domNode,Nt.POINTER_DOWN,l=>{l.button===0&&(l.preventDefault(),this._sliderPointerDown(l))})),this.onclick(this.slider.domNode,l=>{l.leftButton&&l.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 t=this.domNode.domNode.getClientRects()[0].top,r=t+this._scrollbarState.getSliderPosition(),n=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),l=this._sliderPointerPosition(e);r<=l&&l<=n?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,r;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,r=e.offsetY;else{let l=oR(this.domNode.domNode);t=e.pageX-l.left,r=e.pageY-l.top}let n=this._pointerDownRelativePosition(t,r);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(n):this._scrollbarState.getDesiredScrollPositionFromOffset(n)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),r=this._sliderOrthogonalPointerPosition(e),n=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,l=>{let c=this._sliderOrthogonalPointerPosition(l),u=Math.abs(c-r);if(Rb&&u>yR){this._setDesiredScrollPositionNow(n.getScrollPosition());return}let d=this._sliderPointerPosition(l)-t;this._setDesiredScrollPositionNow(n.getDesiredScrollPositionFromDelta(d))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Bb=class Nf{constructor(t,r,n,l,c,u){this._scrollbarSize=Math.round(r),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(t),this._visibleSize=l,this._scrollSize=c,this._scrollPosition=u,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Nf(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let r=Math.round(t);return this._visibleSize!==r?(this._visibleSize=r,this._refreshComputedValues(),!0):!1}setScrollSize(t){let r=Math.round(t);return this._scrollSize!==r?(this._scrollSize=r,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let r=Math.round(t);return this._scrollPosition!==r?(this._scrollPosition=r,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,r,n,l,c){let u=Math.max(0,n-t),d=Math.max(0,u-2*r),_=l>0&&l>n;if(!_)return{computedAvailableSize:Math.round(u),computedIsNeeded:_,computedSliderSize:Math.round(d),computedSliderRatio:0,computedSliderPosition:0};let f=Math.round(Math.max(20,Math.floor(n*d/l))),v=(d-f)/(l-n),m=c*v;return{computedAvailableSize:Math.round(u),computedIsNeeded:_,computedSliderSize:Math.round(f),computedSliderRatio:v,computedSliderPosition:Math.round(m)}}_refreshComputedValues(){let t=Nf._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.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(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize-this._computedSliderSize/2;return Math.round(r/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let r=t-this._arrowSize,n=this._scrollPosition;return r<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(t){if(!this._computedIsNeeded)return 0;let r=this._computedSliderPosition+t;return Math.round(r/this._computedSliderRatio)}},SR=class extends Nb{constructor(e,t,r){let n=e.getScrollDimensions(),l=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new Bb(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,n.width,n.scrollWidth,l.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:"horizontal",scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),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,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}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}},bR=class extends Nb{constructor(e,t,r){let n=e.getScrollDimensions(),l=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:r,scrollbarState:new Bb(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,n.height,n.scrollHeight,l.scrollTop),visibility:t.vertical,extraScrollbarClassName:"vertical",scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw new Error("horizontalHasArrows is not supported in xterm.js");this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},wR=500,Zy=50,CR=class{constructor(e,t,r){this.timestamp=e,this.deltaX=t,this.deltaY=r,this.score=0}},Bf=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let t=1,r=0,n=1,l=this._rear;do{let c=l===this._front?t:Math.pow(2,-n);if(t-=c,r+=this._memory[l].score*c,l===this._front)break;l=(this._capacity+l-1)%this._capacity,n++}while(!0);return r<=.5}acceptStandardWheelEvent(t){if(E_){let r=nr(t.browserEvent),n=NT(r);this.accept(Date.now(),t.deltaX*n,t.deltaY*n)}else this.accept(Date.now(),t.deltaX,t.deltaY)}accept(t,r,n){let l=null,c=new CR(t,r,n);this._front===-1&&this._rear===-1?(this._memory[0]=c,this._front=0,this._rear=0):(l=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]=c),c.score=this._computeScore(c,l)}_computeScore(t,r){if(Math.abs(t.deltaX)>0&&Math.abs(t.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(n+=.25),r){let l=Math.abs(t.deltaX),c=Math.abs(t.deltaY),u=Math.abs(r.deltaX),d=Math.abs(r.deltaY),_=Math.max(Math.min(l,u),1),f=Math.max(Math.min(c,d),1),v=Math.max(l,u),m=Math.max(c,d);v%_===0&&m%f===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Bf.INSTANCE=new Bf;var ER=Bf,xR=class extends T_{constructor(e,t,r){super(),this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new oe),this.onWillScroll=this._onWillScroll.event,this._options=kR(t),this._scrollable=r,this._register(this._scrollable.onScroll(l=>{this._onWillScroll.fire(l),this._onDidScroll(l),this._onScroll.fire(l)}));let n={onMouseWheel:l=>this._onMouseWheel(l),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new bR(this._scrollable,this._options,n)),this._horizontalScrollbar=this._register(new SR(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(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=_l(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=_l(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=_l(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,l=>this._onMouseOver(l)),this.onmouseleave(this._listenOnDomNode,l=>this._onMouseLeave(l)),this._hideTimeout=this._register(new A_),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Qs(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,ar&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Gy(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Qs(this._mouseWheelToDispose),e)){let t=r=>{this._onMouseWheel(new Gy(r))};this._mouseWheelToDispose.push(Ce(this._listenOnDomNode,Nt.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){var l;if((l=e.browserEvent)!=null&&l.defaultPrevented)return;let t=ER.INSTANCE;t.acceptStandardWheelEvent(e);let r=!1;if(e.deltaY||e.deltaX){let c=e.deltaY*this._options.mouseWheelScrollSensitivity,u=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&u+c===0?u=c=0:Math.abs(c)>=Math.abs(u)?u=0:c=0),this._options.flipAxes&&([c,u]=[u,c]);let d=!ar&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||d)&&!u&&(u=c,c=0),e.browserEvent&&e.browserEvent.altKey&&(u=u*this._options.fastScrollSensitivity,c=c*this._options.fastScrollSensitivity);let _=this._scrollable.getFutureScrollPosition(),f={};if(c){let v=Zy*c,m=_.scrollTop-(v<0?Math.floor(v):Math.ceil(v));this._verticalScrollbar.writeScrollPosition(f,m)}if(u){let v=Zy*u,m=_.scrollLeft-(v<0?Math.floor(v):Math.ceil(v));this._horizontalScrollbar.writeScrollPosition(f,m)}f=this._scrollable.validateScrollPosition(f),(_.scrollLeft!==f.scrollLeft||_.scrollTop!==f.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(f):this._scrollable.setScrollPositionNow(f),r=!0)}let n=r;!n&&this._options.alwaysConsumeMouseWheel&&(n=!0),!n&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(n=!0),n&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||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 e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,r=e.scrollLeft>0,n=r?" left":"",l=t?" top":"",c=r||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${n}`),this._topShadowDomNode.setClassName(`shadow${l}`),this._topLeftShadowDomNode.setClassName(`shadow${c}${l}${n}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){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(),wR)}},AR=class extends xR{constructor(e,t,r){super(e,t,r)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function kR(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,ar&&(t.className+=" mac"),t}var zf=class extends Me{constructor(e,t,r,n,l,c,u,d){super(),this._bufferService=r,this._optionsService=u,this._renderService=d,this._onRequestScrollLines=this._register(new oe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let _=this._register(new _R({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:f=>k_(n.window,f)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{_.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new AR(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},_)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(l.onProtocolChange(f=>{this._scrollableElement.updateOptions({handleMouseWheel:!(f&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(Wt.runAndSubscribe(c.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=c.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(nt(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=n.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(nt(()=>this._styleElement.remove())),this._register(Wt.runAndSubscribe(c.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${c.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${c.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${c.colors.scrollbarSliderActiveBackground.css};`,"}"].join(`
|
|
221
|
+
`)})),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(f=>this._handleScroll(f)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,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 t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),r=t-this._bufferService.buffer.ydisp;r!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(r)),this._isHandlingScroll=!1}};zf=dt([de(2,ii),de(3,Nr),de(4,pb),de(5,ta),de(6,ri),de(7,Br)],zf);var Pf=class extends Me{constructor(e,t,r,n,l){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=r,this._decorationService=n,this._renderService=l,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(c=>this._removeDecoration(c))),this._register(nt(()=>{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 n;let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",((n=e==null?void 0:e.options)==null?void 0:n.layer)==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let r=e.options.x??0;return r&&r>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let r=this._decorationElements.get(e);r||(r=this._createElement(e),e.element=r,this._decorationElements.set(e,r),this._container.appendChild(r),e.onDispose(()=>{this._decorationElements.delete(e),r.remove()})),r.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(r.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,r.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(r)}}_refreshXPosition(e,t=e.element){if(!t)return;let r=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=r?`${r*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=r?`${r*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){var t;(t=this._decorationElements.get(e))==null||t.remove(),this._decorationElements.delete(e),e.dispose()}};Pf=dt([de(1,ii),de(2,Nr),de(3,Rl),de(4,Br)],Pf);var TR=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 t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,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,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,r){return t>=e.startBufferLine-this._linePadding[r||"full"]&&t<=e.endBufferLine+this._linePadding[r||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},er={full:0,left:0,center:0,right:0},os={full:0,left:0,center:0,right:0},el={full:0,left:0,center:0,right:0},Mc=class extends Me{constructor(e,t,r,n,l,c,u,d){var f;super(),this._viewportElement=e,this._screenElement=t,this._bufferService=r,this._decorationService=n,this._renderService=l,this._optionsService=c,this._themeService=u,this._coreBrowserService=d,this._colorZoneStore=new TR,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(),(f=this._viewportElement.parentElement)==null||f.insertBefore(this._canvas,this._viewportElement),this._register(nt(()=>{var v;return(v=this._canvas)==null?void 0:v.remove()}));let _=this._canvas.getContext("2d");if(_)this._ctx=_;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),t=Math.ceil((this._canvas.width-1)/3);os.full=this._canvas.width,os.left=e,os.center=t,os.right=e,this._refreshDrawHeightConstants(),el.full=1,el.left=1,el.center=1+os.left,el.right=1+os.left+os.center}_refreshDrawHeightConstants(){er.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);er.left=t,er.center=t,er.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*er.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*er.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*er.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*er.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 t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);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(el[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-er[e.position||"full"]/2),os[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+er[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Mc=dt([de(2,ii),de(3,Rl),de(4,Br),de(5,ri),de(6,ta),de(7,Nr)],Mc);var Q;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=`
|
|
222
|
+
`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(Q||(Q={}));var mc;(e=>(e.PAD="",e.HOP="",e.BPH="",e.NBH="",e.IND="",e.NEL="
",e.SSA="",e.ESA="",e.HTS="",e.HTJ="",e.VTS="",e.PLD="",e.PLU="",e.RI="",e.SS2="",e.SS3="",e.DCS="",e.PU1="",e.PU2="",e.STS="",e.CCH="",e.MW="",e.SPA="",e.EPA="",e.SOS="",e.SGCI="",e.SCI="",e.CSI="",e.ST="",e.OSC="",e.PM="",e.APC=""))(mc||(mc={}));var zb;(e=>e.ST=`${Q.ESC}\\`)(zb||(zb={}));var If=class{constructor(e,t,r,n,l,c){this._textarea=e,this._compositionView=t,this._bufferService=r,this._optionsService=n,this._coreService=l,this._renderService=c,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 t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let r;t.start+=this._dataAlreadySent.length,this._isComposing?r=this._textarea.value.substring(t.start,this._compositionPosition.start):r=this._textarea.value.substring(t.start),r.length>0&&this._coreService.triggerDataEvent(r,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,r=t.replace(e,"");this._dataAlreadySent=r,t.length>e.length?this._coreService.triggerDataEvent(r,!0):t.length<e.length?this._coreService.triggerDataEvent(`${Q.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=t*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let c=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(c.width,1)+"px",this._textarea.style.height=Math.max(c.height,1)+"px",this._textarea.style.lineHeight=c.height+"px"}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};If=dt([de(2,ii),de(3,ri),de(4,tn),de(5,Br)],If);var Bt=0,zt=0,Pt=0,ht=0,Qy={css:"#00000000",rgba:0},Ct;(e=>{function t(l,c,u,d){return d!==void 0?`#${Us(l)}${Us(c)}${Us(u)}${Us(d)}`:`#${Us(l)}${Us(c)}${Us(u)}`}e.toCss=t;function r(l,c,u,d=255){return(l<<24|c<<16|u<<8|d)>>>0}e.toRgba=r;function n(l,c,u,d){return{css:e.toCss(l,c,u,d),rgba:e.toRgba(l,c,u,d)}}e.toColor=n})(Ct||(Ct={}));var rt;(e=>{function t(_,f){if(ht=(f.rgba&255)/255,ht===1)return{css:f.css,rgba:f.rgba};let v=f.rgba>>24&255,m=f.rgba>>16&255,y=f.rgba>>8&255,S=_.rgba>>24&255,b=_.rgba>>16&255,x=_.rgba>>8&255;Bt=S+Math.round((v-S)*ht),zt=b+Math.round((m-b)*ht),Pt=x+Math.round((y-x)*ht);let T=Ct.toCss(Bt,zt,Pt),O=Ct.toRgba(Bt,zt,Pt);return{css:T,rgba:O}}e.blend=t;function r(_){return(_.rgba&255)===255}e.isOpaque=r;function n(_,f,v){let m=gc.ensureContrastRatio(_.rgba,f.rgba,v);if(m)return Ct.toColor(m>>24&255,m>>16&255,m>>8&255)}e.ensureContrastRatio=n;function l(_){let f=(_.rgba|255)>>>0;return[Bt,zt,Pt]=gc.toChannels(f),{css:Ct.toCss(Bt,zt,Pt),rgba:f}}e.opaque=l;function c(_,f){return ht=Math.round(f*255),[Bt,zt,Pt]=gc.toChannels(_.rgba),{css:Ct.toCss(Bt,zt,Pt,ht),rgba:Ct.toRgba(Bt,zt,Pt,ht)}}e.opacity=c;function u(_,f){return ht=_.rgba&255,c(_,ht*f/255)}e.multiplyOpacity=u;function d(_){return[_.rgba>>24&255,_.rgba>>16&255,_.rgba>>8&255]}e.toColorRGB=d})(rt||(rt={}));var ot;(e=>{let t,r;try{let l=document.createElement("canvas");l.width=1,l.height=1;let c=l.getContext("2d",{willReadFrequently:!0});c&&(t=c,t.globalCompositeOperation="copy",r=t.createLinearGradient(0,0,1,1))}catch{}function n(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return Bt=parseInt(l.slice(1,2).repeat(2),16),zt=parseInt(l.slice(2,3).repeat(2),16),Pt=parseInt(l.slice(3,4).repeat(2),16),Ct.toColor(Bt,zt,Pt);case 5:return Bt=parseInt(l.slice(1,2).repeat(2),16),zt=parseInt(l.slice(2,3).repeat(2),16),Pt=parseInt(l.slice(3,4).repeat(2),16),ht=parseInt(l.slice(4,5).repeat(2),16),Ct.toColor(Bt,zt,Pt,ht);case 7:return{css:l,rgba:(parseInt(l.slice(1),16)<<8|255)>>>0};case 9:return{css:l,rgba:parseInt(l.slice(1),16)>>>0}}let c=l.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(c)return Bt=parseInt(c[1]),zt=parseInt(c[2]),Pt=parseInt(c[3]),ht=Math.round((c[5]===void 0?1:parseFloat(c[5]))*255),Ct.toColor(Bt,zt,Pt,ht);if(!t||!r)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=r,t.fillStyle=l,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Bt,zt,Pt,ht]=t.getImageData(0,0,1,1).data,ht!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:Ct.toRgba(Bt,zt,Pt,ht),css:l}}e.toColor=n})(ot||(ot={}));var ti;(e=>{function t(n){return r(n>>16&255,n>>8&255,n&255)}e.relativeLuminance=t;function r(n,l,c){let u=n/255,d=l/255,_=c/255,f=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4),v=d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4),m=_<=.03928?_/12.92:Math.pow((_+.055)/1.055,2.4);return f*.2126+v*.7152+m*.0722}e.relativeLuminance2=r})(ti||(ti={}));var gc;(e=>{function t(u,d){if(ht=(d&255)/255,ht===1)return d;let _=d>>24&255,f=d>>16&255,v=d>>8&255,m=u>>24&255,y=u>>16&255,S=u>>8&255;return Bt=m+Math.round((_-m)*ht),zt=y+Math.round((f-y)*ht),Pt=S+Math.round((v-S)*ht),Ct.toRgba(Bt,zt,Pt)}e.blend=t;function r(u,d,_){let f=ti.relativeLuminance(u>>8),v=ti.relativeLuminance(d>>8);if(Tr(f,v)<_){if(v<f){let S=n(u,d,_),b=Tr(f,ti.relativeLuminance(S>>8));if(b<_){let x=l(u,d,_),T=Tr(f,ti.relativeLuminance(x>>8));return b>T?S:x}return S}let m=l(u,d,_),y=Tr(f,ti.relativeLuminance(m>>8));if(y<_){let S=n(u,d,_),b=Tr(f,ti.relativeLuminance(S>>8));return y>b?m:S}return m}}e.ensureContrastRatio=r;function n(u,d,_){let f=u>>24&255,v=u>>16&255,m=u>>8&255,y=d>>24&255,S=d>>16&255,b=d>>8&255,x=Tr(ti.relativeLuminance2(y,S,b),ti.relativeLuminance2(f,v,m));for(;x<_&&(y>0||S>0||b>0);)y-=Math.max(0,Math.ceil(y*.1)),S-=Math.max(0,Math.ceil(S*.1)),b-=Math.max(0,Math.ceil(b*.1)),x=Tr(ti.relativeLuminance2(y,S,b),ti.relativeLuminance2(f,v,m));return(y<<24|S<<16|b<<8|255)>>>0}e.reduceLuminance=n;function l(u,d,_){let f=u>>24&255,v=u>>16&255,m=u>>8&255,y=d>>24&255,S=d>>16&255,b=d>>8&255,x=Tr(ti.relativeLuminance2(y,S,b),ti.relativeLuminance2(f,v,m));for(;x<_&&(y<255||S<255||b<255);)y=Math.min(255,y+Math.ceil((255-y)*.1)),S=Math.min(255,S+Math.ceil((255-S)*.1)),b=Math.min(255,b+Math.ceil((255-b)*.1)),x=Tr(ti.relativeLuminance2(y,S,b),ti.relativeLuminance2(f,v,m));return(y<<24|S<<16|b<<8|255)>>>0}e.increaseLuminance=l;function c(u){return[u>>24&255,u>>16&255,u>>8&255,u&255]}e.toChannels=c})(gc||(gc={}));function Us(e){let t=e.toString(16);return t.length<2?"0"+t:t}function Tr(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var RR=class extends Tl{constructor(e,t,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=r}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()]}},Nc=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new $i}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let r=[],n=t.translateToString(!0),l=0,c=0,u=0,d=t.getFg(0),_=t.getBg(0);for(let f=0;f<t.getTrimmedLength();f++)if(t.loadCell(f,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==d||this._workCell.bg!==_){if(f-l>1){let v=this._getJoinedRanges(n,u,c,t,l);for(let m=0;m<v.length;m++)r.push(v[m])}l=f,u=c,d=this._workCell.fg,_=this._workCell.bg}c+=this._workCell.getChars().length||ms.length}if(this._bufferService.cols-l>1){let f=this._getJoinedRanges(n,u,c,t,l);for(let v=0;v<f.length;v++)r.push(f[v])}return r}_getJoinedRanges(e,t,r,n,l){let c=e.substring(t,r),u=[];try{u=this._characterJoiners[0].handler(c)}catch(d){console.error(d)}for(let d=1;d<this._characterJoiners.length;d++)try{let _=this._characterJoiners[d].handler(c);for(let f=0;f<_.length;f++)Nc._mergeRanges(u,_[f])}catch(_){console.error(_)}return this._stringRangesToCellRanges(u,n,l),u}_stringRangesToCellRanges(e,t,r){let n=0,l=!1,c=0,u=e[n];if(u){for(let d=r;d<this._bufferService.cols;d++){let _=t.getWidth(d),f=t.getString(d).length||ms.length;if(_!==0){if(!l&&u[0]<=c&&(u[0]=d,l=!0),u[1]<=c){if(u[1]=d,u=e[++n],!u)break;u[0]<=c?(u[0]=d,l=!0):l=!1}c+=f}}u&&(u[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let r=!1;for(let n=0;n<e.length;n++){let l=e[n];if(r){if(t[1]<=l[0])return e[n-1][1]=t[1],e;if(t[1]<=l[1])return e[n-1][1]=Math.max(t[1],l[1]),e.splice(n,1),e;e.splice(n,1),n--}else{if(t[1]<=l[0])return e.splice(n,0,t),e;if(t[1]<=l[1])return l[0]=Math.min(t[0],l[0]),e;t[0]<l[1]&&(l[0]=Math.min(t[0],l[0]),r=!0);continue}}return r?e[e.length-1][1]=t[1]:e.push(t),e}};Nc=dt([de(0,ii)],Nc);function DR(e){return 57508<=e&&e<=57558}function LR(e){return 9472<=e&&e<=9631}function OR(e){return DR(e)||LR(e)}function MR(){return{css:{canvas:ac(),cell:ac()},device:{canvas:ac(),cell:ac(),char:{width:0,height:0,left:0,top:0}}}}function ac(){return{width:0,height:0}}var Hf=class{constructor(e,t,r,n,l,c,u){this._document=e,this._characterJoinerService=t,this._optionsService=r,this._coreBrowserService=n,this._coreService=l,this._decorationService=c,this._themeService=u,this._workCell=new $i,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,r){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=r}createRow(e,t,r,n,l,c,u,d,_,f,v){let m=[],y=this._characterJoinerService.getJoinedCharacters(t),S=this._themeService.colors,b=e.getNoBgTrimmedLength();r&&b<c+1&&(b=c+1);let x,T=0,O="",H=0,B=0,I=0,j=0,$=!1,ee=0,ge=!1,Se=0,_e=0,he=[],J=f!==-1&&v!==-1;for(let W=0;W<b;W++){e.loadCell(W,this._workCell);let ne=this._workCell.getWidth();if(ne===0)continue;let se=!1,D=W>=_e,q=W,F=this._workCell;if(y.length>0&&W===y[0][0]&&D){let Te=y.shift(),si=this._isCellInSelection(Te[0],t);for(H=Te[0]+1;H<Te[1];H++)D&&(D=si===this._isCellInSelection(H,t));D&&(D=!r||c<Te[0]||c>=Te[1]),D?(se=!0,F=new RR(this._workCell,e.translateToString(!0,Te[0],Te[1]),Te[1]-Te[0]),q=Te[1]-1,ne=F.getWidth()):_e=Te[1]}let re=this._isCellInSelection(W,t),le=r&&W===c,E=J&&W>=f&&W<=v,M=!1;this._decorationService.forEachDecorationAtCell(W,t,void 0,Te=>{M=!0});let X=F.getChars()||ms;if(X===" "&&(F.isUnderline()||F.isOverline())&&(X=" "),Se=ne*d-_.get(X,F.isBold(),F.isItalic()),!x)x=this._document.createElement("span");else if(T&&(re&&ge||!re&&!ge&&F.bg===B)&&(re&&ge&&S.selectionForeground||F.fg===I)&&F.extended.ext===j&&E===$&&Se===ee&&!le&&!se&&!M&&D){F.isInvisible()?O+=ms:O+=X,T++;continue}else T&&(x.textContent=O),x=this._document.createElement("span"),T=0,O="";if(B=F.bg,I=F.fg,j=F.extended.ext,$=E,ee=Se,ge=re,se&&c>=W&&c<=q&&(c=W),!this._coreService.isCursorHidden&&le&&this._coreService.isCursorInitialized){if(he.push("xterm-cursor"),this._coreBrowserService.isFocused)u&&he.push("xterm-cursor-blink"),he.push(n==="bar"?"xterm-cursor-bar":n==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(l)switch(l){case"outline":he.push("xterm-cursor-outline");break;case"block":he.push("xterm-cursor-block");break;case"bar":he.push("xterm-cursor-bar");break;case"underline":he.push("xterm-cursor-underline");break}}if(F.isBold()&&he.push("xterm-bold"),F.isItalic()&&he.push("xterm-italic"),F.isDim()&&he.push("xterm-dim"),F.isInvisible()?O=ms:O=F.getChars()||ms,F.isUnderline()&&(he.push(`xterm-underline-${F.extended.underlineStyle}`),O===" "&&(O=" "),!F.isUnderlineColorDefault()))if(F.isUnderlineColorRGB())x.style.textDecorationColor=`rgb(${Tl.toColorRGB(F.getUnderlineColor()).join(",")})`;else{let Te=F.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&F.isBold()&&Te<8&&(Te+=8),x.style.textDecorationColor=S.ansi[Te].css}F.isOverline()&&(he.push("xterm-overline"),O===" "&&(O=" ")),F.isStrikethrough()&&he.push("xterm-strikethrough"),E&&(x.style.textDecoration="underline");let te=F.getFgColor(),ue=F.getFgColorMode(),pe=F.getBgColor(),we=F.getBgColorMode(),We=!!F.isInverse();if(We){let Te=te;te=pe,pe=Te;let si=ue;ue=we,we=si}let ze,Ft,$e=!1;this._decorationService.forEachDecorationAtCell(W,t,void 0,Te=>{Te.options.layer!=="top"&&$e||(Te.backgroundColorRGB&&(we=50331648,pe=Te.backgroundColorRGB.rgba>>8&16777215,ze=Te.backgroundColorRGB),Te.foregroundColorRGB&&(ue=50331648,te=Te.foregroundColorRGB.rgba>>8&16777215,Ft=Te.foregroundColorRGB),$e=Te.options.layer==="top")}),!$e&&re&&(ze=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,pe=ze.rgba>>8&16777215,we=50331648,$e=!0,S.selectionForeground&&(ue=50331648,te=S.selectionForeground.rgba>>8&16777215,Ft=S.selectionForeground)),$e&&he.push("xterm-decoration-top");let at;switch(we){case 16777216:case 33554432:at=S.ansi[pe],he.push(`xterm-bg-${pe}`);break;case 50331648:at=Ct.toColor(pe>>16,pe>>8&255,pe&255),this._addStyle(x,`background-color:#${Jy((pe>>>0).toString(16),"0",6)}`);break;case 0:default:We?(at=S.foreground,he.push("xterm-bg-257")):at=S.background}switch(ze||F.isDim()&&(ze=rt.multiplyOpacity(at,.5)),ue){case 16777216:case 33554432:F.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(x,at,S.ansi[te],F,ze,void 0)||he.push(`xterm-fg-${te}`);break;case 50331648:let Te=Ct.toColor(te>>16&255,te>>8&255,te&255);this._applyMinimumContrast(x,at,Te,F,ze,Ft)||this._addStyle(x,`color:#${Jy(te.toString(16),"0",6)}`);break;case 0:default:this._applyMinimumContrast(x,at,S.foreground,F,ze,Ft)||We&&he.push("xterm-fg-257")}he.length&&(x.className=he.join(" "),he.length=0),!le&&!se&&!M&&D?T++:x.textContent=O,Se!==this.defaultSpacing&&(x.style.letterSpacing=`${Se}px`),m.push(x),W=q}return x&&T&&(x.textContent=O),m}_applyMinimumContrast(e,t,r,n,l,c){if(this._optionsService.rawOptions.minimumContrastRatio===1||OR(n.getCode()))return!1;let u=this._getContrastCache(n),d;if(!l&&!c&&(d=u.getColor(t.rgba,r.rgba)),d===void 0){let _=this._optionsService.rawOptions.minimumContrastRatio/(n.isDim()?2:1);d=rt.ensureContrastRatio(l||t,c||r,_),u.setColor((l||t).rgba,(c||r).rgba,d??null)}return d?(this._addStyle(e,`color:${d.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let r=this._selectionStart,n=this._selectionEnd;return!r||!n?!1:this._columnSelectMode?r[0]<=n[0]?e>=r[0]&&t>=r[1]&&e<n[0]&&t<=n[1]:e<r[0]&&t>=r[1]&&e>=n[0]&&t<=n[1]:t>r[1]&&t<n[1]||r[1]===n[1]&&t===r[1]&&e>=r[0]&&e<n[0]||r[1]<n[1]&&t===n[1]&&e<n[0]||r[1]<n[1]&&t===r[1]&&e>=r[0]}};Hf=dt([de(1,vb),de(2,ri),de(3,Nr),de(4,tn),de(5,Rl),de(6,ta)],Hf);function Jy(e,t,r){for(;e.length<r;)e=t+e;return e}var NR=class{constructor(e,t){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 r=e.createElement("span");r.classList.add("xterm-char-measure-element");let n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold";let l=e.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontStyle="italic";let c=e.createElement("span");c.classList.add("xterm-char-measure-element"),c.style.fontWeight="bold",c.style.fontStyle="italic",this._measureElements=[r,n,l,c],this._container.appendChild(r),this._container.appendChild(n),this._container.appendChild(l),this._container.appendChild(c),t.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,t,r,n){e===this._font&&t===this._fontSize&&r===this._weight&&n===this._weightBold||(this._font=e,this._fontSize=t,this._weight=r,this._weightBold=n,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${r}`,this._measureElements[1].style.fontWeight=`${n}`,this._measureElements[2].style.fontWeight=`${r}`,this._measureElements[3].style.fontWeight=`${n}`,this.clear())}get(e,t,r){let n=0;if(!t&&!r&&e.length===1&&(n=e.charCodeAt(0))<256){if(this._flat[n]!==-9999)return this._flat[n];let u=this._measure(e,0);return u>0&&(this._flat[n]=u),u}let l=e;t&&(l+="B"),r&&(l+="I");let c=this._holey.get(l);if(c===void 0){let u=0;t&&(u|=1),r&&(u|=2),c=this._measure(e,u),c>0&&this._holey.set(l,c)}return c}_measure(e,t){let r=this._measureElements[t];return r.textContent=e.repeat(32),r.offsetWidth/32}},BR=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,t,r,n=!1){if(this.selectionStart=t,this.selectionEnd=r,!t||!r||t[0]===r[0]&&t[1]===r[1]){this.clear();return}let l=e.buffers.active.ydisp,c=t[1]-l,u=r[1]-l,d=Math.max(c,0),_=Math.min(u,e.rows-1);if(d>=e.rows||_<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=n,this.viewportStartRow=c,this.viewportEndRow=u,this.viewportCappedStartRow=d,this.viewportCappedEndRow=_,this.startCol=t[0],this.endCol=r[0]}isCellSelected(e,t,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&r>=this.viewportCappedStartRow&&t<this.endCol&&r<=this.viewportCappedEndRow:t<this.startCol&&r>=this.viewportCappedStartRow&&t>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&t>=this.startCol):!1}};function zR(){return new BR}var $d="xterm-dom-renderer-owner-",zi="xterm-rows",lc="xterm-fg-",e0="xterm-bg-",tl="xterm-focus",oc="xterm-selection",PR=1,Uf=class extends Me{constructor(e,t,r,n,l,c,u,d,_,f,v,m,y,S){super(),this._terminal=e,this._document=t,this._element=r,this._screenElement=n,this._viewportElement=l,this._helperContainer=c,this._linkifier2=u,this._charSizeService=_,this._optionsService=f,this._bufferService=v,this._coreService=m,this._coreBrowserService=y,this._themeService=S,this._terminalClass=PR++,this._rowElements=[],this._selectionRenderModel=zR(),this.onRequestRedraw=this._register(new oe).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(zi),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(oc),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=MR(),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=d.createInstance(Hf,document),this._element.classList.add($d+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(nt(()=>{this._element.classList.remove($d+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new NR(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 r of this._rowElements)r.style.width=`${this.dimensions.css.canvas.width}px`,r.style.height=`${this.dimensions.css.cell.height}px`,r.style.lineHeight=`${this.dimensions.css.cell.height}px`,r.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${zi} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,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 t=`${this._terminalSelector} .${zi} { 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}`;t+=`${this._terminalSelector} .${zi} .xterm-dim { color: ${rt.multiplyOpacity(e.foreground,.5).css};}`,t+=`${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 r=`blink_underline_${this._terminalClass}`,n=`blink_bar_${this._terminalClass}`,l=`blink_block_${this._terminalClass}`;t+=`@keyframes ${r} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${n} { 50% { box-shadow: none; }}`,t+=`@keyframes ${l} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${zi}.${tl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${zi}.${tl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${zi}.${tl} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${l} 1s step-end infinite;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${zi} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${oc} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${oc} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${oc} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[c,u]of e.ansi.entries())t+=`${this._terminalSelector} .${lc}${c} { color: ${u.css}; }${this._terminalSelector} .${lc}${c}.xterm-dim { color: ${rt.multiplyOpacity(u,.5).css}; }${this._terminalSelector} .${e0}${c} { background-color: ${u.css}; }`;t+=`${this._terminalSelector} .${lc}257 { color: ${rt.opaque(e.background).css}; }${this._terminalSelector} .${lc}257.xterm-dim { color: ${rt.multiplyOpacity(rt.opaque(e.background),.5).css}; }${this._terminalSelector} .${e0}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_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,t){for(let r=this._rowElements.length;r<=t;r++){let n=this._document.createElement("div");this._rowContainer.appendChild(n),this._rowElements.push(n)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),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(tl),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(tl),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,r){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,r),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,r),!this._selectionRenderModel.hasSelection))return;let n=this._selectionRenderModel.viewportStartRow,l=this._selectionRenderModel.viewportEndRow,c=this._selectionRenderModel.viewportCappedStartRow,u=this._selectionRenderModel.viewportCappedEndRow,d=this._document.createDocumentFragment();if(r){let _=e[0]>t[0];d.appendChild(this._createSelectionElement(c,_?t[0]:e[0],_?e[0]:t[0],u-c+1))}else{let _=n===c?e[0]:0,f=c===l?t[0]:this._bufferService.cols;d.appendChild(this._createSelectionElement(c,_,f));let v=u-c-1;if(d.appendChild(this._createSelectionElement(c+1,0,this._bufferService.cols,v)),c!==u){let m=l===u?t[0]:this._bufferService.cols;d.appendChild(this._createSelectionElement(u,0,m))}}this._selectionContainer.appendChild(d)}_createSelectionElement(e,t,r,n=1){let l=this._document.createElement("div"),c=t*this.dimensions.css.cell.width,u=this.dimensions.css.cell.width*(r-t);return c+u>this.dimensions.css.canvas.width&&(u=this.dimensions.css.canvas.width-c),l.style.height=`${n*this.dimensions.css.cell.height}px`,l.style.top=`${e*this.dimensions.css.cell.height}px`,l.style.left=`${c}px`,l.style.width=`${u}px`,l}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,t){let r=this._bufferService.buffer,n=r.ybase+r.y,l=Math.min(r.x,this._bufferService.cols-1),c=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,u=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,d=this._optionsService.rawOptions.cursorInactiveStyle;for(let _=e;_<=t;_++){let f=_+r.ydisp,v=this._rowElements[_],m=r.lines.get(f);if(!v||!m)break;v.replaceChildren(...this._rowFactory.createRow(m,f,f===n,u,d,l,c,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${$d}${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,t,r,n,l,c){r<0&&(e=0),n<0&&(t=0);let u=this._bufferService.rows-1;r=Math.max(Math.min(r,u),0),n=Math.max(Math.min(n,u),0),l=Math.min(l,this._bufferService.cols);let d=this._bufferService.buffer,_=d.ybase+d.y,f=Math.min(d.x,l-1),v=this._optionsService.rawOptions.cursorBlink,m=this._optionsService.rawOptions.cursorStyle,y=this._optionsService.rawOptions.cursorInactiveStyle;for(let S=r;S<=n;++S){let b=S+d.ydisp,x=this._rowElements[S],T=d.lines.get(b);if(!x||!T)break;x.replaceChildren(...this._rowFactory.createRow(T,b,b===_,m,y,f,v,this.dimensions.css.cell.width,this._widthCache,c?S===r?e:0:-1,c?(S===n?t:l)-1:-1))}}};Uf=dt([de(7,b_),de(8,Zc),de(9,ri),de(10,ii),de(11,tn),de(12,Nr),de(13,ta)],Uf);var jf=class extends Me{constructor(e,t,r){super(),this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=this._register(new oe),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new HR(this._optionsService))}catch{this._measureStrategy=this._register(new IR(e,t,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())}};jf=dt([de(2,ri)],jf);var Pb=class extends Me{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},IR=class extends Pb{constructor(e,t,r){super(),this._document=e,this._parentElement=t,this._optionsService=r,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}},HR=class extends Pb{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))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}},UR=class extends Me{constructor(e,t,r){super(),this._textarea=e,this._window=t,this.mainDocument=r,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new jR(this._window)),this._onDprChange=this._register(new oe),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new oe),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this._register(Wt.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(Ce(this._textarea,"focus",()=>this._isFocused=!0)),this._register(Ce(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}},jR=class extends Me{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Zn),this._onDprChange=this._register(new oe),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(nt(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=Ce(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)}},VR=class extends Me{constructor(){super(),this.linkProviders=[],this._register(nt(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function R_(e,t,r){let n=r.getBoundingClientRect(),l=e.getComputedStyle(r),c=parseInt(l.getPropertyValue("padding-left")),u=parseInt(l.getPropertyValue("padding-top"));return[t.clientX-n.left-c,t.clientY-n.top-u]}function $R(e,t,r,n,l,c,u,d,_){if(!c)return;let f=R_(e,t,r);if(f)return f[0]=Math.ceil((f[0]+(_?u/2:0))/u),f[1]=Math.ceil(f[1]/d),f[0]=Math.min(Math.max(f[0],1),n+(_?1:0)),f[1]=Math.min(Math.max(f[1],1),l),f}var Vf=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,r,n,l){return $R(window,e,t,r,n,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(e,t){let r=R_(window,e,t);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};Vf=dt([de(0,Br),de(1,Zc)],Vf);var GR=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,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,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t,!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),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Ib={};eT(Ib,{getSafariVersion:()=>WR,isChromeOS:()=>Vb,isFirefox:()=>Hb,isIpad:()=>FR,isIphone:()=>YR,isLegacyEdge:()=>qR,isLinux:()=>D_,isMac:()=>Bc,isNode:()=>Qc,isSafari:()=>Ub,isWindows:()=>jb});var Qc=typeof process<"u"&&"title"in process,Dl=Qc?"node":navigator.userAgent,Ll=Qc?"node":navigator.platform,Hb=Dl.includes("Firefox"),qR=Dl.includes("Edge"),Ub=/^((?!chrome|android).)*safari/i.test(Dl);function WR(){if(!Ub)return 0;let e=Dl.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Bc=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(Ll),FR=Ll==="iPad",YR=Ll==="iPhone",jb=["Windows","Win16","Win32","WinCE"].includes(Ll),D_=Ll.indexOf("Linux")>=0,Vb=/\bCrOS\b/.test(Dl),$b=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),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(e){this._idleCallback=void 0;let t=0,r=0,n=e.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),r=Math.max(t,r),l=e.timeRemaining(),r*1.5>l){n-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-t))}ms`),this._start();return}n=l}this.clear()}},KR=class extends $b{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},XR=class extends $b{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},zc=!Qc&&"requestIdleCallback"in window?XR:KR,ZR=class{constructor(){this._queue=new zc}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},$f=class extends Me{constructor(e,t,r,n,l,c,u,d,_){super(),this._rowCount=e,this._optionsService=r,this._charSizeService=n,this._coreService=l,this._coreBrowserService=d,this._renderer=this._register(new Zn),this._pausedResizeTask=new ZR,this._observerDisposable=this._register(new Zn),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 oe),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new oe),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new oe),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new oe),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new GR((f,v)=>this._renderRows(f,v),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new QR(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(nt(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(u.onResize(()=>this._fullRefresh())),this._register(u.buffers.onBufferActivate(()=>{var f;return(f=this._renderer.value)==null?void 0:f.clear()})),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(c.onDecorationRegistered(()=>this._fullRefresh())),this._register(c.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(u.cols,u.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(u.buffer.y,u.buffer.y,!0))),this._register(_.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(f=>this._registerIntersectionObserver(f,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let r=new e.IntersectionObserver(n=>this._handleIntersectionChange(n[n.length-1]),{threshold:0});r.observe(t),this._observerDisposable.value=nt(()=>r.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,t,r=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let n=this._syncOutputHandler.flush();n&&(e=Math.min(e,n.start),t=Math.max(t,n.end)),r||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),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:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,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(t=>this.refreshRows(t.start,t.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,t;this._renderer.value&&((t=(e=this._renderer.value).clearTextureAtlas)==null||t.call(e),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var r;return(r=this._renderer.value)==null?void 0:r.handleResize(e,t)}):this._renderer.value.handleResize(e,t),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,t,r){var n;this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=r,(n=this._renderer.value)==null||n.handleSelectionChanged(e,t,r)}handleCursorMove(){var e;(e=this._renderer.value)==null||e.handleCursorMove()}clear(){var e;(e=this._renderer.value)==null||e.clear()}};$f=dt([de(2,ri),de(3,Zc),de(4,tn),de(5,Rl),de(6,ii),de(7,Nr),de(8,ta)],$f);var QR=class{constructor(e,t,r){this._coreBrowserService=e,this._coreService=t,this._onTimeout=r,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,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 e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function JR(e,t,r,n){let l=r.buffer.x,c=r.buffer.y;if(!r.buffer.hasScrollback)return iD(l,c,e,t,r,n)+Jc(c,t,r,n)+rD(l,c,e,t,r,n);let u;if(c===t)return u=l>e?"D":"C",wl(Math.abs(l-e),bl(u,n));u=c>t?"D":"C";let d=Math.abs(c-t),_=tD(c>t?e:l,r)+(d-1)*r.cols+1+eD(c>t?l:e);return wl(_,bl(u,n))}function eD(e,t){return e-1}function tD(e,t){return t.cols-e}function iD(e,t,r,n,l,c){return Jc(t,n,l,c).length===0?"":wl(qb(e,t,e,t-Js(t,l),!1,l).length,bl("D",c))}function Jc(e,t,r,n){let l=e-Js(e,r),c=t-Js(t,r),u=Math.abs(l-c)-sD(e,t,r);return wl(u,bl(Gb(e,t),n))}function rD(e,t,r,n,l,c){let u;Jc(t,n,l,c).length>0?u=n-Js(n,l):u=t;let d=n,_=nD(e,t,r,n,l,c);return wl(qb(e,u,r,d,_==="C",l).length,bl(_,c))}function sD(e,t,r){var u;let n=0,l=e-Js(e,r),c=t-Js(t,r);for(let d=0;d<Math.abs(l-c);d++){let _=Gb(e,t)==="A"?-1:1;(u=r.buffer.lines.get(l+_*d))!=null&&u.isWrapped&&n++}return n}function Js(e,t){let r=0,n=t.buffer.lines.get(e),l=n==null?void 0:n.isWrapped;for(;l&&e>=0&&e<t.rows;)r++,n=t.buffer.lines.get(--e),l=n==null?void 0:n.isWrapped;return r}function nD(e,t,r,n,l,c){let u;return Jc(r,n,l,c).length>0?u=n-Js(n,l):u=t,e<r&&u<=n||e>=r&&u<n?"C":"D"}function Gb(e,t){return e>t?"A":"B"}function qb(e,t,r,n,l,c){let u=e,d=t,_="";for(;(u!==r||d!==n)&&d>=0&&d<c.buffer.lines.length;)u+=l?1:-1,l&&u>c.cols-1?(_+=c.buffer.translateBufferLineToString(d,!1,e,u),u=0,e=0,d++):!l&&u<0&&(_+=c.buffer.translateBufferLineToString(d,!1,0,e+1),u=c.cols-1,e=u,d--);return _+c.buffer.translateBufferLineToString(d,!1,e,u)}function bl(e,t){let r=t?"O":"[";return Q.ESC+r+e}function wl(e,t){e=Math.floor(e);let r="";for(let n=0;n<e;n++)r+=t;return r}var aD=class{constructor(e){this._bufferService=e,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 e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function t0(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var Gd=50,lD=15,oD=50,cD=500,uD=" ",hD=new RegExp(uD,"g"),Gf=class extends Me{constructor(e,t,r,n,l,c,u,d,_){super(),this._element=e,this._screenElement=t,this._linkifier=r,this._bufferService=n,this._coreService=l,this._mouseService=c,this._optionsService=u,this._renderService=d,this._coreBrowserService=_,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new $i,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new oe),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new oe),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new oe),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new oe),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=f=>this._handleMouseMove(f),this._mouseUpListener=f=>this._handleMouseUp(f),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(f=>this._handleTrim(f)),this._register(this._bufferService.buffers.onBufferActivate(f=>this._handleBufferActivate(f))),this.enable(),this._model=new aD(this._bufferService),this._activeSelectionMode=0,this._register(nt(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(f=>{f.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,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let r=this._bufferService.buffer,n=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let l=e[0]<t[0]?e[0]:t[0],c=e[0]<t[0]?t[0]:e[0];for(let u=e[1];u<=t[1];u++){let d=r.translateBufferLineToString(u,!0,l,c);n.push(d)}}else{let l=e[1]===t[1]?t[0]:void 0;n.push(r.translateBufferLineToString(e[1],!0,e[0],l));for(let c=e[1]+1;c<=t[1]-1;c++){let u=r.lines.get(c),d=r.translateBufferLineToString(c,!0);u!=null&&u.isWrapped?n[n.length-1]+=d:n.push(d)}if(e[1]!==t[1]){let c=r.lines.get(t[1]),u=r.translateBufferLineToString(t[1],!0,0,t[0]);c&&c.isWrapped?n[n.length-1]+=u:n.push(u)}}return n.map(l=>l.replace(hD," ")).join(jb?`\r
|
|
223
223
|
`:`
|
|
224
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),R_&&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 t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n||!t?!1:this._areCoordsInSelection(t,r,n)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n?!1:this._areCoordsInSelection([e,t],r,n)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var l,c;let r=(c=(l=this._linkifier.currentLink)==null?void 0:l.link)==null?void 0:c.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=Jy(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=T_(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-$d),$d),t/=$d,t/Math.abs(t)+Math.round(t*(nD-1)))}shouldForceSelection(e){return Bc?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(),aD)}_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 t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Bc&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=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 r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let n=r.lines.get(this._model.selectionEnd[1]);n&&n.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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 t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<lD&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&r[0]!==void 0&&r[1]!==void 0){let n=ZR(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,r=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,t,r);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,r)}_fireOnSelectionChange(e,t,r){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let n=0;t>=n;n++){let l=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:l>1&&t!==n&&(r+=l-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let l=this._bufferService.buffer,c=l.lines.get(e[1]);if(!c)return;let u=l.translateBufferLineToString(e[1],!1),d=this._convertViewportColToCharacterIndex(c,e[0]),_=d,f=e[0]-d,v=0,m=0,y=0,S=0;if(u.charAt(d)===" "){for(;d>0&&u.charAt(d-1)===" ";)d--;for(;_<u.length&&u.charAt(_+1)===" ";)_++}else{let T=e[0],O=e[0];c.getWidth(T)===0&&(v++,T--),c.getWidth(O)===2&&(m++,O++);let H=c.getString(O).length;for(H>1&&(S+=H-1,_+=H-1);T>0&&d>0&&!this._isCharWordSeparator(c.loadCell(T-1,this._workCell));){c.loadCell(T-1,this._workCell);let B=this._workCell.getChars().length;this._workCell.getWidth()===0?(v++,T--):B>1&&(y+=B-1,d-=B-1),d--,T--}for(;O<c.length&&_+1<u.length&&!this._isCharWordSeparator(c.loadCell(O+1,this._workCell));){c.loadCell(O+1,this._workCell);let B=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,O++):B>1&&(S+=B-1,_+=B-1),_++,O++}}_++;let b=d+f-v+y,E=Math.min(this._bufferService.cols,_-d+v+m-y-S);if(!(!t&&u.slice(d,_).trim()==="")){if(r&&b===0&&c.getCodePoint(0)!==32){let T=l.lines.get(e[1]-1);if(T&&c.isWrapped&&T.getCodePoint(this._bufferService.cols-1)!==32){let O=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(O){let H=this._bufferService.cols-O.start;b-=H,E+=H}}}if(n&&b+E===this._bufferService.cols&&c.getCodePoint(this._bufferService.cols-1)!==32){let T=l.lines.get(e[1]+1);if(T!=null&&T.isWrapped&&T.getCodePoint(0)!==32){let O=this._getWordAt([0,e[1]+1],!1,!1,!0);O&&(E+=O.length)}}return{start:b,length:E}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Jy(r,this._bufferService.cols)}};$f=dt([de(3,ti),de(4,tn),de(5,b_),de(6,ii),de(7,Br),de(8,Nr)],$f);var e0=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},t0=class{constructor(){this._color=new e0,this._css=new e0}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},xt=Object.freeze((()=>{let e=[ot.toColor("#2e3436"),ot.toColor("#cc0000"),ot.toColor("#4e9a06"),ot.toColor("#c4a000"),ot.toColor("#3465a4"),ot.toColor("#75507b"),ot.toColor("#06989a"),ot.toColor("#d3d7cf"),ot.toColor("#555753"),ot.toColor("#ef2929"),ot.toColor("#8ae234"),ot.toColor("#fce94f"),ot.toColor("#729fcf"),ot.toColor("#ad7fa8"),ot.toColor("#34e2e2"),ot.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=t[r/36%6|0],l=t[r/6%6|0],c=t[r%6];e.push({css:Ct.toCss(n,l,c),rgba:Ct.toRgba(n,l,c)})}for(let r=0;r<24;r++){let n=8+r*10;e.push({css:Ct.toCss(n,n,n),rgba:Ct.toRgba(n,n,n)})}return e})()),js=ot.toColor("#ffffff"),ll=ot.toColor("#000000"),i0=ot.toColor("#ffffff"),r0=ll,tl={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},uD=js,Gf=class extends Me{constructor(e){super(),this._optionsService=e,this._contrastCache=new t0,this._halfContrastCache=new t0,this._onChangeColors=this._register(new le),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:js,background:ll,cursor:i0,cursorAccent:r0,selectionForeground:void 0,selectionBackgroundTransparent:tl,selectionBackgroundOpaque:rt.blend(ll,tl),selectionInactiveBackgroundTransparent:tl,selectionInactiveBackgroundOpaque:rt.blend(ll,tl),scrollbarSliderBackground:rt.opacity(js,.2),scrollbarSliderHoverBackground:rt.opacity(js,.4),scrollbarSliderActiveBackground:rt.opacity(js,.5),overviewRulerBorder:js,ansi:xt.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 t=this._colors;if(t.foreground=Ze(e.foreground,js),t.background=Ze(e.background,ll),t.cursor=rt.blend(t.background,Ze(e.cursor,i0)),t.cursorAccent=rt.blend(t.background,Ze(e.cursorAccent,r0)),t.selectionBackgroundTransparent=Ze(e.selectionBackground,tl),t.selectionBackgroundOpaque=rt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Ze(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=rt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Ze(e.selectionForeground,Xy):void 0,t.selectionForeground===Xy&&(t.selectionForeground=void 0),rt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=rt.opacity(t.selectionBackgroundTransparent,.3)),rt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=rt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Ze(e.scrollbarSliderBackground,rt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Ze(e.scrollbarSliderHoverBackground,rt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Ze(e.scrollbarSliderActiveBackground,rt.opacity(t.foreground,.5)),t.overviewRulerBorder=Ze(e.overviewRulerBorder,uD),t.ansi=xt.slice(),t.ansi[0]=Ze(e.black,xt[0]),t.ansi[1]=Ze(e.red,xt[1]),t.ansi[2]=Ze(e.green,xt[2]),t.ansi[3]=Ze(e.yellow,xt[3]),t.ansi[4]=Ze(e.blue,xt[4]),t.ansi[5]=Ze(e.magenta,xt[5]),t.ansi[6]=Ze(e.cyan,xt[6]),t.ansi[7]=Ze(e.white,xt[7]),t.ansi[8]=Ze(e.brightBlack,xt[8]),t.ansi[9]=Ze(e.brightRed,xt[9]),t.ansi[10]=Ze(e.brightGreen,xt[10]),t.ansi[11]=Ze(e.brightYellow,xt[11]),t.ansi[12]=Ze(e.brightBlue,xt[12]),t.ansi[13]=Ze(e.brightMagenta,xt[13]),t.ansi[14]=Ze(e.brightCyan,xt[14]),t.ansi[15]=Ze(e.brightWhite,xt[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r;n++)t.ansi[n+16]=Ze(e.extendedAnsi[n],xt[n+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 t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];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()}}};Gf=dt([de(0,ii)],Gf);function Ze(e,t){if(e!==void 0)try{return ot.toColor(e)}catch{}return t}var hD=class{constructor(...e){this._entries=new Map;for(let[t,r]of e)this.set(t,r)}set(e,t){let r=this._entries.get(e);return this._entries.set(e,t),r}forEach(e){for(let[t,r]of this._entries.entries())e(t,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},dD=class{constructor(){this._services=new hD,this._services.set(S_,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let r=nT(e).sort((c,u)=>c.index-u.index),n=[];for(let c of r){let u=this._services.get(c.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${c.id._id}.`);n.push(u)}let l=r.length>0?r[0].index:t.length;if(t.length!==l)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${l+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},fD={trace:0,debug:1,info:2,warn:3,error:4,off:5},_D="xterm.js: ",qf=class extends Me{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=fD[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":_D)+t,...r)}trace(e,...t){var r;this._logLevel<=0&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var r;this._logLevel<=1&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var r;this._logLevel<=2&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var r;this._logLevel<=3&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var r;this._logLevel<=4&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,e,t)}};qf=dt([de(0,ii)],qf);var s0=class extends Me{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new le),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new le),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new le),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 t=new Array(e);for(let r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}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,t,...r){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<r.length;n++)this._array[this._getCyclicIndex(e+n)]=r[n];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let n=this._length+r.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let l=t-1;l>=0;l--)this.set(e+l+r,this.get(e+l));let n=e+t+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+r,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Oe=3,wt=Object.freeze(new kl),cc=0,Gd=2,ol=class Vb{constructor(t,r,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Oe);let l=r||$i.fromCharData([0,lb,1,0]);for(let c=0;c<t;++c)this.setCell(c,l);this.length=t}get(t){let r=this._data[t*Oe+0],n=r&2097151;return[this._data[t*Oe+1],r&2097152?this._combined[t]:n?fs(n):"",r>>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,r){this._data[t*Oe+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Oe+0]=t|2097152|r[2]<<22):this._data[t*Oe+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Oe+0]>>22}hasWidth(t){return this._data[t*Oe+0]&12582912}getFg(t){return this._data[t*Oe+1]}getBg(t){return this._data[t*Oe+2]}hasContent(t){return this._data[t*Oe+0]&4194303}getCodePoint(t){let r=this._data[t*Oe+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Oe+0]&2097152}getString(t){let r=this._data[t*Oe+0];return r&2097152?this._combined[t]:r&2097151?fs(r&2097151):""}isProtected(t){return this._data[t*Oe+2]&536870912}loadCell(t,r){return cc=t*Oe,r.content=this._data[cc+0],r.fg=this._data[cc+1],r.bg=this._data[cc+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Oe+0]=r.content,this._data[t*Oe+1]=r.fg,this._data[t*Oe+2]=r.bg}setCellFromCodepoint(t,r,n,l){l.bg&268435456&&(this._extendedAttrs[t]=l.extended),this._data[t*Oe+0]=r|n<<22,this._data[t*Oe+1]=l.fg,this._data[t*Oe+2]=l.bg}addCodepointToCell(t,r,n){let l=this._data[t*Oe+0];l&2097152?this._combined[t]+=fs(r):l&2097151?(this._combined[t]=fs(l&2097151)+fs(r),l&=-2097152,l|=2097152):l=r|1<<22,n&&(l&=-12582913,l|=n<<22),this._data[t*Oe+0]=l}insertCells(t,r,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length-t){let l=new $i;for(let c=this.length-t-r-1;c>=0;--c)this.setCell(t+r+c,this.loadCell(t+c,l));for(let c=0;c<r;++c)this.setCell(t+c,n)}else for(let l=t;l<this.length;++l)this.setCell(l,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,r,n){if(t%=this.length,r<this.length-t){let l=new $i;for(let c=0;c<this.length-t-r;++c)this.setCell(t+c,this.loadCell(t+r+c,l));for(let c=this.length-r;c<this.length;++c)this.setCell(c,n)}else for(let l=t;l<this.length;++l)this.setCell(l,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,r,n,l=!1){if(l){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.setCell(t++,n)}resize(t,r){if(t===this.length)return this._data.length*4*Gd<this._data.buffer.byteLength;let n=t*Oe;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let l=new Uint32Array(n);l.set(this._data),this._data=l}for(let l=this.length;l<t;++l)this.setCell(l,r)}else{this._data=this._data.subarray(0,n);let l=Object.keys(this._combined);for(let u=0;u<l.length;u++){let d=parseInt(l[u],10);d>=t&&delete this._combined[d]}let c=Object.keys(this._extendedAttrs);for(let u=0;u<c.length;u++){let d=parseInt(c[u],10);d>=t&&delete this._extendedAttrs[d]}}return this.length=t,n*4*Gd<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*Gd<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(let r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){let t=new Vb(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let r in this._combined)t._combined[r]=this._combined[r];for(let r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Oe+0]&4194303)return t+(this._data[t*Oe+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Oe+0]&4194303||this._data[t*Oe+2]&50331648)return t+(this._data[t*Oe+0]>>22);return 0}copyCellsFrom(t,r,n,l,c){let u=t._data;if(c)for(let _=l-1;_>=0;_--){for(let f=0;f<Oe;f++)this._data[(n+_)*Oe+f]=u[(r+_)*Oe+f];u[(r+_)*Oe+2]&268435456&&(this._extendedAttrs[n+_]=t._extendedAttrs[r+_])}else for(let _=0;_<l;_++){for(let f=0;f<Oe;f++)this._data[(n+_)*Oe+f]=u[(r+_)*Oe+f];u[(r+_)*Oe+2]&268435456&&(this._extendedAttrs[n+_]=t._extendedAttrs[r+_])}let d=Object.keys(t._combined);for(let _=0;_<d.length;_++){let f=parseInt(d[_],10);f>=r&&(this._combined[f-r+n]=t._combined[f])}}translateToString(t,r,n,l){r=r??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),l&&(l.length=0);let c="";for(;r<n;){let u=this._data[r*Oe+0],d=u&2097151,_=u&2097152?this._combined[r]:d?fs(d):ms;if(c+=_,l)for(let f=0;f<_.length;++f)l.push(r);r+=u>>22||1}return l&&l.push(r),c}};function pD(e,t,r,n,l,c){let u=[];for(let d=0;d<e.length-1;d++){let _=d,f=e.get(++_);if(!f.isWrapped)continue;let v=[e.get(d)];for(;_<e.length&&f.isWrapped;)v.push(f),f=e.get(++_);if(!c&&n>=d&&n<_){d+=v.length-1;continue}let m=0,y=wl(v,m,t),S=1,b=0;for(;S<v.length;){let T=wl(v,S,t),O=T-b,H=r-y,B=Math.min(O,H);v[m].copyCellsFrom(v[S],b,y,B,!1),y+=B,y===r&&(m++,y=0),b+=B,b===T&&(S++,b=0),y===0&&m!==0&&v[m-1].getWidth(r-1)===2&&(v[m].copyCellsFrom(v[m-1],r-1,y++,1,!1),v[m-1].setCell(r-1,l))}v[m].replaceCells(y,r,l);let E=0;for(let T=v.length-1;T>0&&(T>m||v[T].getTrimmedLength()===0);T--)E++;E>0&&(u.push(d+v.length-E),u.push(E)),d+=v.length-1}return u}function mD(e,t){let r=[],n=0,l=t[n],c=0;for(let u=0;u<e.length;u++)if(l===u){let d=t[++n];e.onDeleteEmitter.fire({index:u-c,amount:d}),u+=d-1,c+=d,l=t[++n]}else r.push(u);return{layout:r,countRemoved:c}}function gD(e,t){let r=[];for(let n=0;n<t.length;n++)r.push(e.get(t[n]));for(let n=0;n<r.length;n++)e.set(n,r[n]);e.length=t.length}function vD(e,t,r){let n=[],l=e.map((_,f)=>wl(e,f,t)).reduce((_,f)=>_+f),c=0,u=0,d=0;for(;d<l;){if(l-d<r){n.push(l-d);break}c+=r;let _=wl(e,u,t);c>_&&(c-=_,u++);let f=e[u].getWidth(c-1)===2;f&&c--;let v=f?r-1:r;n.push(v),d+=v}return n}function wl(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,l=e[t+1].getWidth(0)===2;return n&&l?r-1:r}var $b=class Gb{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=Gb._nextId++,this._onDispose=this.register(new le),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Qs(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};$b._nextId=1;var yD=$b,Rt={},Vs=Rt.B;Rt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Rt.A={"#":"£"};Rt.B=void 0;Rt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Rt.C=Rt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Rt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Rt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Rt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Rt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Rt.E=Rt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Rt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Rt.H=Rt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Rt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var n0=4294967295,a0=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=wt.clone(),this.savedCharset=Vs,this.markers=[],this._nullCell=$i.fromCharData([0,lb,1,0]),this._whitespaceCell=$i.fromCharData([0,ms,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new zc,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new s0(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Oc),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Oc),this._whitespaceCell}getBlankLine(e,t){return new ol(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>n0?n0:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=wt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new s0(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(wt),n=0,l=this._getCorrectBufferLength(t);if(l>this.lines.maxLength&&(this.lines.maxLength=l),this.lines.length>0){if(this._cols<e)for(let u=0;u<this.lines.length;u++)n+=+this.lines.get(u).resize(e,r);let c=0;if(this._rows<t)for(let u=this._rows;u<t;u++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new ol(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+c+1?(this.ybase--,c++,this.ydisp>0&&this.ydisp--):this.lines.push(new ol(e,r)));else for(let u=this._rows;u>t;u--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(l<this.lines.maxLength){let u=this.lines.length-l;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=l}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),c&&(this.y+=c),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let c=0;c<this.lines.length;c++)n+=+this.lines.get(c).resize(e,r);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=pD(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(wt),r);if(n.length>0){let l=mD(this.lines,n);gD(this.lines,l.layout),this._reflowLargerAdjustViewport(e,t,l.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let n=this.getNullCell(wt),l=r;for(;l-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new ol(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(wt),l=[],c=0;for(let u=this.lines.length-1;u>=0;u--){let d=this.lines.get(u);if(!d||!d.isWrapped&&d.getTrimmedLength()<=e)continue;let _=[d];for(;d.isWrapped&&u>0;)d=this.lines.get(--u),_.unshift(d);if(!r){let B=this.ybase+this.y;if(B>=u&&B<u+_.length)continue}let f=_[_.length-1].getTrimmedLength(),v=vD(_,this._cols,e),m=v.length-_.length,y;this.ybase===0&&this.y!==this.lines.length-1?y=Math.max(0,this.y-this.lines.maxLength+m):y=Math.max(0,this.lines.length-this.lines.maxLength+m);let S=[];for(let B=0;B<m;B++){let I=this.getBlankLine(wt,!0);S.push(I)}S.length>0&&(l.push({start:u+_.length+c,newLines:S}),c+=S.length),_.push(...S);let b=v.length-1,E=v[b];E===0&&(b--,E=v[b]);let T=_.length-m-1,O=f;for(;T>=0;){let B=Math.min(O,E);if(_[b]===void 0)break;if(_[b].copyCellsFrom(_[T],O-B,E-B,B,!0),E-=B,E===0&&(b--,E=v[b]),O-=B,O===0){T--;let I=Math.max(T,0);O=wl(_,I,this._cols)}}for(let B=0;B<_.length;B++)v[B]<e&&_[B].setCell(v[B],n);let H=m-y;for(;H-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,this.ybase+t-1)}if(l.length>0){let u=[],d=[];for(let E=0;E<this.lines.length;E++)d.push(this.lines.get(E));let _=this.lines.length,f=_-1,v=0,m=l[v];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c);let y=0;for(let E=Math.min(this.lines.maxLength-1,_+c-1);E>=0;E--)if(m&&m.start>f+y){for(let T=m.newLines.length-1;T>=0;T--)this.lines.set(E--,m.newLines[T]);E++,u.push({index:f+1,amount:m.newLines.length}),y+=m.newLines.length,m=l[++v]}else this.lines.set(E,d[f--]);let S=0;for(let E=u.length-1;E>=0;E--)u[E].index+=S,this.lines.onInsertEmitter.fire(u[E]),S+=u[E].amount;let b=Math.max(0,_+c-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}translateBufferLineToString(e,t,r=0,n){let l=this.lines.get(e);return l?l.translateToString(t,r,n):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new yD(e);return this.markers.push(t),t.register(this.lines.onTrim(r=>{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.line<r.index+r.amount&&t.dispose(),t.line>r.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},SD=class extends Me{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new le),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 a0(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a0(!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,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},qb=2,Wb=1,Wf=class extends Me{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new le),this.onResize=this._onResize.event,this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,qb),this.rows=Math.max(e.rawOptions.rows||0,Wb),this.buffers=this._register(new SD(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=r.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let l=r.ybase+r.scrollTop,c=r.ybase+r.scrollBottom;if(r.scrollTop===0){let u=r.lines.isFull;c===r.lines.length-1?u?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(c+1,0,n.clone()),u?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let u=c-l+1;r.lines.shiftElements(l+1,u-1,-1),r.lines.set(c,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};Wf=dt([de(0,ii)],Wf);var Gn={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:Bc,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},bD=["normal","bold","100","200","300","400","500","600","700","800","900"],wD=class extends Me{constructor(e){super(),this._onOptionChange=this._register(new le),this.onOptionChange=this._onOptionChange.event;let t={...Gn};for(let r in e)if(r in t)try{let n=e[r];t[r]=this._sanitizeAndValidateOption(r,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(nt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in Gn))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,n)=>{if(!(r in Gn))throw new Error(`No option with key "${r}"`);n=this._sanitizeAndValidateOption(r,n),this.rawOptions[r]!==n&&(this.rawOptions[r]=n,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Gn[e]),!CD(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Gn[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=bD.includes(t)?t:Gn[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function CD(e){return e==="block"||e==="underline"||e==="bar"}function cl(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let n in e)r[n]=t<=1?e[n]:e[n]&&cl(e[n],t-1);return r}var l0=Object.freeze({insertMode:!1}),o0=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Ff=class extends Me{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new le),this.onData=this._onData.event,this._onUserInput=this._register(new le),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new le),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new le),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=cl(l0),this.decPrivateModes=cl(o0)}reset(){this.modes=cl(l0),this.decPrivateModes=cl(o0)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.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(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Ff=dt([de(0,ti),de(1,db),de(2,ii)],Ff);var c0={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function qd(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var Wd=String.fromCharCode,u0={DEFAULT:e=>{let t=[qd(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Wd(t[0])}${Wd(t[1])}${Wd(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${qd(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${qd(e,!0)};${e.x};${e.y}${t}`}},Yf=class extends Me{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new le),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(c0))this.addProtocol(n,c0[n]);for(let n of Object.keys(u0))this.addEncoding(n,u0[n]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let n=t/r,l=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=n+0,Math.abs(e.deltaY)<50&&(l*=.3),this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Yf=dt([de(0,ti),de(1,tn),de(2,ii)],Yf);var Fd=[[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]],ED=[[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]],At;function xD(e,t){let r=0,n=t.length-1,l;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=r;)if(l=r+n>>1,e>t[l][1])r=l+1;else if(e<t[l][0])n=l-1;else return!0;return!1}var AD=class{constructor(){if(this.version="6",!At){At=new Uint8Array(65536),At.fill(1),At[0]=0,At.fill(0,1,32),At.fill(0,127,160),At.fill(2,4352,4448),At[9001]=2,At[9002]=2,At.fill(2,11904,42192),At[12351]=1,At.fill(2,44032,55204),At.fill(2,63744,64256),At.fill(2,65040,65050),At.fill(2,65072,65136),At.fill(2,65280,65377),At.fill(2,65504,65511);for(let e=0;e<Fd.length;++e)At.fill(0,Fd[e][0],Fd[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?At[e]:xD(e,ED)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),n=r===0&&t!==0;if(n){let l=Ws.extractWidth(t);l===0?n=!1:l>r&&(r=l)}return Ws.createPropertyValue(0,r,n)}},Ws=class vc{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new le,this.onChange=this._onChange.event;let t=new AD;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,n=!1){return(t&16777215)<<3|(r&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,n=0,l=t.length;for(let c=0;c<l;++c){let u=t.charCodeAt(c);if(55296<=u&&u<=56319){if(++c>=l)return r+this.wcwidth(u);let f=t.charCodeAt(c);56320<=f&&f<=57343?u=(u-55296)*1024+f-56320+65536:r+=this.wcwidth(f)}let d=this.charProperties(u,n),_=vc.extractWidth(d);vc.extractShouldJoin(d)&&(_-=vc.extractWidth(n)),r+=_,n=d}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},kD=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,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function h0(e){var n;let t=(n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:n.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var il=2147483647,TD=256,Fb=class Kf{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>TD)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new Kf;if(!t.length)return r;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let l=t[n];if(Array.isArray(l))for(let c=0;c<l.length;++c)r.addSubParam(l[c]);else r.addParam(l)}return r}clone(){let t=new Kf(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let r=0;r<this.length;++r){t.push(this.params[r]);let n=this._subParamsIdx[r]>>8,l=this._subParamsIdx[r]&255;l-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,l))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>il?il:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>il?il:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-r>0?this._subParams.subarray(r,n):null}getSubParamsAll(){let t={};for(let r=0;r<this.length;++r){let n=this._subParamsIdx[r]>>8,l=this._subParamsIdx[r]&255;l-n>0&&(t[r]=this._subParams.slice(n,l))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,l=n[r-1];n[r-1]=~l?Math.min(l*10+t,il):t}},rl=[],RD=class{constructor(){this._state=0,this._active=rl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,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=rl}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=rl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||rl,!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,t,r){if(!this._active.length)this._handlerFb(this._id,"PUT",Xc(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t<r;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&r-t>0&&this._put(e,t,r)}}end(e,t=!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 r=!1,n=this._active.length-1,l=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,l=this._stack.fallThrough,this._stack.paused=!1),!l&&r===!1){for(;n>=0&&(r=this._active[n].end(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=rl,this._id=-1,this._state=0}}},Ei=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=Xc(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(r=>(this._data="",this._hitLimit=!1,r));return this._data="",this._hitLimit=!1,t}},sl=[],DD=class{constructor(){this._handlers=Object.create(null),this._active=sl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=sl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,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=sl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||sl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",Xc(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,n=this._active.length-1,l=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,l=this._stack.fallThrough,this._stack.paused=!1),!l&&r===!1){for(;n>=0&&(r=this._active[n].unhook(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=sl,this._ident=0}},ul=new Fb;ul.addParam(0);var d0=class{constructor(e){this._handler=e,this._data="",this._params=ul,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ul,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=Xc(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=ul,this._data="",this._hitLimit=!1,r));return this._params=ul,this._data="",this._hitLimit=!1,t}},LD=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,n){this.table[t<<8|e]=r<<4|n}addMany(e,t,r,n){for(let l=0;l<e.length;l++)this.table[t<<8|e[l]]=r<<4|n}},Hi=160,OD=(function(){let e=new LD(4095),t=Array.apply(null,Array(256)).map((d,_)=>_),r=(d,_)=>t.slice(d,_),n=r(32,127),l=r(0,24);l.push(25),l.push.apply(l,r(28,32));let c=r(0,14),u;e.setDefault(1,0),e.addMany(n,0,2,0);for(u in c)e.addMany([24,26,153,154],u,3,0),e.addMany(r(128,144),u,3,0),e.addMany(r(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,11,9);return e.addMany(l,0,3,0),e.addMany(l,1,3,1),e.add(127,1,0,1),e.addMany(l,8,0,8),e.addMany(l,3,3,3),e.add(127,3,0,3),e.addMany(l,4,3,4),e.add(127,4,0,4),e.addMany(l,6,3,6),e.addMany(l,5,3,5),e.add(127,5,0,5),e.addMany(l,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(l,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(l,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(l,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(l,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(l,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(l,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Hi,0,2,0),e.add(Hi,8,5,8),e.add(Hi,6,0,6),e.add(Hi,11,0,11),e.add(Hi,13,13,13),e})(),MD=class extends Me{constructor(e=OD){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 Fb,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(nt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new RD),this._dcsParser=this._register(new DD),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>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 l=0;l<e.intermediates.length;++l){let c=e.intermediates.charCodeAt(l);if(32>c||c>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=c}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=n,r}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(t),{dispose:()=>{let l=n.indexOf(t);l!==-1&&n.splice(l,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,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(t),{dispose:()=>{let l=n.indexOf(t);l!==-1&&n.splice(l,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}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,t,r,n,l){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=l}parse(e,t,r){let n=0,l=0,c=0,u;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,c=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let d=this._parseStack.handlers,_=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&_>-1){for(;_>=0&&(u=d[_](this._params),u!==!0);_--)if(u instanceof Promise)return this._parseStack.handlerPos=_,u}this._parseStack.handlers=[];break;case 4:if(r===!1&&_>-1){for(;_>=0&&(u=d[_](),u!==!0);_--)if(u instanceof Promise)return this._parseStack.handlerPos=_,u}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(n!==24&&n!==26,r),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],u=this._oscParser.end(n!==24&&n!==26,r),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,c=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let d=c;d<t;++d){switch(n=e[d],l=this._transitions.table[this.currentState<<8|(n<160?n:Hi)],l>>4){case 2:for(let y=d+1;;++y){if(y>=t||(n=e[y])<32||n>126&&n<Hi){this._printHandler(e,d,y),d=y-1;break}if(++y>=t||(n=e[y])<32||n>126&&n<Hi){this._printHandler(e,d,y),d=y-1;break}if(++y>=t||(n=e[y])<32||n>126&&n<Hi){this._printHandler(e,d,y),d=y-1;break}if(++y>=t||(n=e[y])<32||n>126&&n<Hi){this._printHandler(e,d,y),d=y-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:d,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let _=this._csiHandlers[this._collect<<8|n],f=_?_.length-1:-1;for(;f>=0&&(u=_[f](this._params),u!==!0);f--)if(u instanceof Promise)return this._preserveStack(3,_,f,l,d),u;f<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++d<t&&(n=e[d])>47&&n<60);d--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let v=this._escHandlers[this._collect<<8|n],m=v?v.length-1:-1;for(;m>=0&&(u=v[m](),u!==!0);m--)if(u instanceof Promise)return this._preserveStack(4,v,m,l,d),u;m<0&&this._escHandlerFb(this._collect<<8|n),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|n,this._params);break;case 13:for(let y=d+1;;++y)if(y>=t||(n=e[y])===24||n===26||n===27||n>127&&n<Hi){this._dcsParser.put(e,d,y),d=y-1;break}break;case 14:if(u=this._dcsParser.unhook(n!==24&&n!==26),u)return this._preserveStack(6,[],0,l,d),u;n===27&&(l|=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 y=d+1;;y++)if(y>=t||(n=e[y])<32||n>127&&n<Hi){this._oscParser.put(e,d,y),d=y-1;break}break;case 6:if(u=this._oscParser.end(n!==24&&n!==26),u)return this._preserveStack(5,[],0,l,d),u;n===27&&(l|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=l&15}}},ND=/^([\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})$/,BD=/^[\da-f]+$/;function f0(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let r=ND.exec(t);if(r){let n=r[1]?15:r[4]?255:r[7]?4095:65535;return[Math.round(parseInt(r[1]||r[4]||r[7]||r[10],16)/n*255),Math.round(parseInt(r[2]||r[5]||r[8]||r[11],16)/n*255),Math.round(parseInt(r[3]||r[6]||r[9]||r[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),BD.exec(t)&&[3,6,9,12].includes(t.length))){let r=t.length/3,n=[0,0,0];for(let l=0;l<3;++l){let c=parseInt(t.slice(r*l,r*l+r),16);n[l]=r===1?c<<4:r===2?c:r===3?c>>4:c>>8}return n}}function Yd(e,t){let r=e.toString(16),n=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function zD(e,t=16){let[r,n,l]=e;return`rgb:${Yd(r,t)}/${Yd(n,t)}/${Yd(l,t)}`}var PD={"(":0,")":1,"*":2,"+":3,"-":1,".":2},cs=131072,_0=10;function p0(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var m0=5e3,g0=0,ID=class extends Me{constructor(e,t,r,n,l,c,u,d,_=new MD){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=n,this._optionsService=l,this._oscLinkService=c,this._coreMouseService=u,this._unicodeService=d,this._parser=_,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new rT,this._utf8Decoder=new sT,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=wt.clone(),this._eraseAttrDataInternal=wt.clone(),this._onRequestBell=this._register(new le),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new le),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new le),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new le),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new le),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new le),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new le),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new le),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new le),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new le),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new le),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new le),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new le),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 Xf(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,v)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:v.toArray()})}),this._parser.setEscHandlerFallback(f=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(f)})}),this._parser.setExecuteHandlerFallback(f=>{this._logService.debug("Unknown EXECUTE code: ",{code:f})}),this._parser.setOscHandlerFallback((f,v,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:v,data:m})}),this._parser.setDcsHandlerFallback((f,v,m)=>{v==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:v,payload:m})}),this._parser.setPrintHandler((f,v,m)=>this.print(f,v,m)),this._parser.registerCsiHandler({final:"@"},f=>this.insertChars(f)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},f=>this.scrollLeft(f)),this._parser.registerCsiHandler({final:"A"},f=>this.cursorUp(f)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},f=>this.scrollRight(f)),this._parser.registerCsiHandler({final:"B"},f=>this.cursorDown(f)),this._parser.registerCsiHandler({final:"C"},f=>this.cursorForward(f)),this._parser.registerCsiHandler({final:"D"},f=>this.cursorBackward(f)),this._parser.registerCsiHandler({final:"E"},f=>this.cursorNextLine(f)),this._parser.registerCsiHandler({final:"F"},f=>this.cursorPrecedingLine(f)),this._parser.registerCsiHandler({final:"G"},f=>this.cursorCharAbsolute(f)),this._parser.registerCsiHandler({final:"H"},f=>this.cursorPosition(f)),this._parser.registerCsiHandler({final:"I"},f=>this.cursorForwardTab(f)),this._parser.registerCsiHandler({final:"J"},f=>this.eraseInDisplay(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},f=>this.eraseInDisplay(f,!0)),this._parser.registerCsiHandler({final:"K"},f=>this.eraseInLine(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},f=>this.eraseInLine(f,!0)),this._parser.registerCsiHandler({final:"L"},f=>this.insertLines(f)),this._parser.registerCsiHandler({final:"M"},f=>this.deleteLines(f)),this._parser.registerCsiHandler({final:"P"},f=>this.deleteChars(f)),this._parser.registerCsiHandler({final:"S"},f=>this.scrollUp(f)),this._parser.registerCsiHandler({final:"T"},f=>this.scrollDown(f)),this._parser.registerCsiHandler({final:"X"},f=>this.eraseChars(f)),this._parser.registerCsiHandler({final:"Z"},f=>this.cursorBackwardTab(f)),this._parser.registerCsiHandler({final:"`"},f=>this.charPosAbsolute(f)),this._parser.registerCsiHandler({final:"a"},f=>this.hPositionRelative(f)),this._parser.registerCsiHandler({final:"b"},f=>this.repeatPrecedingCharacter(f)),this._parser.registerCsiHandler({final:"c"},f=>this.sendDeviceAttributesPrimary(f)),this._parser.registerCsiHandler({prefix:">",final:"c"},f=>this.sendDeviceAttributesSecondary(f)),this._parser.registerCsiHandler({final:"d"},f=>this.linePosAbsolute(f)),this._parser.registerCsiHandler({final:"e"},f=>this.vPositionRelative(f)),this._parser.registerCsiHandler({final:"f"},f=>this.hVPosition(f)),this._parser.registerCsiHandler({final:"g"},f=>this.tabClear(f)),this._parser.registerCsiHandler({final:"h"},f=>this.setMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"h"},f=>this.setModePrivate(f)),this._parser.registerCsiHandler({final:"l"},f=>this.resetMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"l"},f=>this.resetModePrivate(f)),this._parser.registerCsiHandler({final:"m"},f=>this.charAttributes(f)),this._parser.registerCsiHandler({final:"n"},f=>this.deviceStatus(f)),this._parser.registerCsiHandler({prefix:"?",final:"n"},f=>this.deviceStatusPrivate(f)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},f=>this.softReset(f)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},f=>this.setCursorStyle(f)),this._parser.registerCsiHandler({final:"r"},f=>this.setScrollRegion(f)),this._parser.registerCsiHandler({final:"s"},f=>this.saveCursor(f)),this._parser.registerCsiHandler({final:"t"},f=>this.windowOptions(f)),this._parser.registerCsiHandler({final:"u"},f=>this.restoreCursor(f)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},f=>this.insertColumns(f)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},f=>this.deleteColumns(f)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},f=>this.selectProtected(f)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},f=>this.requestMode(f,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},f=>this.requestMode(f,!1)),this._parser.setExecuteHandler(Q.BEL,()=>this.bell()),this._parser.setExecuteHandler(Q.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(Q.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(Q.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(Q.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(Q.BS,()=>this.backspace()),this._parser.setExecuteHandler(Q.HT,()=>this.tab()),this._parser.setExecuteHandler(Q.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(Q.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(mc.IND,()=>this.index()),this._parser.setExecuteHandler(mc.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(mc.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Ei(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new Ei(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new Ei(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new Ei(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new Ei(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new Ei(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new Ei(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new Ei(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new Ei(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new Ei(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new Ei(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new Ei(f=>this.restoreCursorColor(f))),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 f in Rt)this._parser.registerEscHandler({intermediates:"(",final:f},()=>this.selectCharset("("+f)),this._parser.registerEscHandler({intermediates:")",final:f},()=>this.selectCharset(")"+f)),this._parser.registerEscHandler({intermediates:"*",final:f},()=>this.selectCharset("*"+f)),this._parser.registerEscHandler({intermediates:"+",final:f},()=>this.selectCharset("+"+f)),this._parser.registerEscHandler({intermediates:"-",final:f},()=>this.selectCharset("-"+f)),this._parser.registerEscHandler({intermediates:".",final:f},()=>this.selectCharset("."+f)),this._parser.registerEscHandler({intermediates:"/",final:f},()=>this.selectCharset("/"+f));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(f=>(this._logService.error("Parsing error: ",f),f)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new d0((f,v)=>this.requestStatusString(f,v)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),m0))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${m0} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,n=this._activeBuffer.x,l=this._activeBuffer.y,c=0,u=this._parseStack.paused;if(u){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,l=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>cs&&(c=this._parseStack.position+cs)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,f=>String.fromCharCode(f)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(f=>f.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<cs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,cs))),u||this._dirtyRowTracker.clearRange(),e.length>cs)for(let f=c;f<e.length;f+=cs){let v=f+cs<e.length?f+cs:e.length,m=typeof e=="string"?this._stringDecoder.decode(e.substring(f,v),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,v),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,m))return this._preserveStack(n,l,m,f),this._logSlowResolvingAsync(r),r}else if(!u){let f=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,f))return this._preserveStack(n,l,f,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==n||this._activeBuffer.y!==l)&&this._onCursorMove.fire();let d=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),_=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);_<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(_,this._bufferService.rows-1),end:Math.min(d,this._bufferService.rows-1)})}print(e,t,r){let n,l,c=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,d=this._bufferService.cols,_=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,v=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-t>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,v);let y=this._parser.precedingJoinState;for(let S=t;S<r;++S){if(n=e[S],n<127&&c){let O=c[String.fromCharCode(n)];O&&(n=O.charCodeAt(0))}let b=this._unicodeService.charProperties(n,y);l=Ws.extractWidth(b);let E=Ws.extractShouldJoin(b),T=E?Ws.extractWidth(y):0;if(y=b,u&&this._onA11yChar.fire(fs(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+l-T>d){if(_){let O=m,H=this._activeBuffer.x-T;for(this._activeBuffer.x=T,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),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),T>0&&m instanceof ol&&m.copyCellsFrom(O,H,0,T,!1);H<d;)O.setCellFromCodepoint(H++,0,1,v)}else if(this._activeBuffer.x=d-1,l===2)continue}if(E&&this._activeBuffer.x){let O=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-O,n,l);for(let H=l-T;--H>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,v);continue}if(f&&(m.insertCells(this._activeBuffer.x,l-T,this._activeBuffer.getNullCell(v)),m.getWidth(d-1)===2&&m.setCellFromCodepoint(d-1,0,1,v)),m.setCellFromCodepoint(this._activeBuffer.x++,n,l,v),l>0)for(;--l;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,v)}this._parser.precedingJoinState=y,this._activeBuffer.x<d&&r-t>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,v),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>p0(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new d0(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Ei(t))}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 e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,n=!1,l=!1){let c=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);c.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),l),n&&(c.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){var n;this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r<this._bufferService.rows;r++)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r))!=null&&n.getTrimmedLength()););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let l=this._activeBuffer.lines.length-this._bufferService.rows;l>0&&(this._activeBuffer.lines.trimStart(l),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-l,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-l,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,l=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(l-1,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=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;t--;)this._activeBuffer.lines.splice(r,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(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(wt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let r=e.params[0]||1,n=Ws.extractWidth(t),l=this._activeBuffer.x-n,c=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(l),u=new Uint32Array(c.length*r),d=0;for(let f=0;f<c.length;){let v=c.codePointAt(f)||0;u[d++]=v,f+=v>65535?2:1}let _=d;for(let f=1;f<r;++f)u.copyWithin(_,0,d),_+=d;return this.print(u,0,_),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(Q.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(Q.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(Q.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(Q.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(Q.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Vs),this._charsetService.setgCharset(1,Vs),this._charsetService.setgCharset(2,Vs),this._charsetService.setgCharset(3,Vs);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(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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(),e.params[t]===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(e,t){(E=>(E[E.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",E[E.SET=1]="SET",E[E.RESET=2]="RESET",E[E.PERMANENTLY_SET=3]="PERMANENTLY_SET",E[E.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r={}));let n=this._coreService.decPrivateModes,{activeProtocol:l,activeEncoding:c}=this._coreMouseService,u=this._coreService,{buffers:d,cols:_}=this._bufferService,{active:f,alt:v}=d,m=this._optionsService.rawOptions,y=(E,T)=>(u.triggerDataEvent(`${Q.ESC}[${t?"":"?"}${E};${T}$y`),!0),S=E=>E?1:2,b=e.params[0];return t?b===2?y(b,4):b===4?y(b,S(u.modes.insertMode)):b===12?y(b,3):b===20?y(b,S(m.convertEol)):y(b,0):b===1?y(b,S(n.applicationCursorKeys)):b===3?y(b,m.windowOptions.setWinLines?_===80?2:_===132?1:0:0):b===6?y(b,S(n.origin)):b===7?y(b,S(n.wraparound)):b===8?y(b,3):b===9?y(b,S(l==="X10")):b===12?y(b,S(m.cursorBlink)):b===25?y(b,S(!u.isCursorHidden)):b===45?y(b,S(n.reverseWraparound)):b===66?y(b,S(n.applicationKeypad)):b===67?y(b,4):b===1e3?y(b,S(l==="VT200")):b===1002?y(b,S(l==="DRAG")):b===1003?y(b,S(l==="ANY")):b===1004?y(b,S(n.sendFocus)):b===1005?y(b,4):b===1006?y(b,S(c==="SGR")):b===1015?y(b,4):b===1016?y(b,S(c==="SGR_PIXELS")):b===1048?y(b,1):b===47||b===1047||b===1049?y(b,S(f===v)):b===2004?y(b,S(n.bracketedPasteMode)):b===2026?y(b,S(n.synchronizedOutput)):y(b,0)}_updateAttrColor(e,t,r,n,l){return t===2?(e|=50331648,e&=-16777216,e|=kl.fromColorRGB([r,n,l])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let n=[0,0,-1,0,0,0],l=0,c=0;do{if(n[c+l]=e.params[t+c],e.hasSubParams(t+c)){let u=e.getSubParams(t+c),d=0;do n[1]===5&&(l=1),n[c+d+1+l]=u[d];while(++d<u.length&&d+c+1+l<n.length);break}if(n[1]===5&&c+l>=2||n[1]===2&&c+l>=5)break;n[1]&&(l=1)}while(++c+t<e.length&&c+l<n.length);for(let u=2;u<n.length;++u)n[u]===-1&&(n[u]=0);switch(n[0]){case 38:r.fg=this._updateAttrColor(r.fg,n[1],n[3],n[4],n[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,n[1],n[3],n[4],n[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,n[1],n[3],n[4],n[5])}return c}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=wt.fg,e.bg=wt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,r,n=this._curAttrData;for(let l=0;l<t;l++)r=e.params[l],r>=30&&r<=37?(n.fg&=-50331904,n.fg|=16777216|r-30):r>=40&&r<=47?(n.bg&=-50331904,n.bg|=16777216|r-40):r>=90&&r<=97?(n.fg&=-50331904,n.fg|=16777216|r-90|8):r>=100&&r<=107?(n.bg&=-50331904,n.bg|=16777216|r-100|8):r===0?this._processSGR0(n):r===1?n.fg|=134217728:r===3?n.bg|=67108864:r===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(l)?e.getSubParams(l)[0]:1,n)):r===5?n.fg|=536870912:r===7?n.fg|=67108864:r===8?n.fg|=1073741824:r===9?n.fg|=2147483648:r===2?n.bg|=134217728:r===21?this._processUnderline(2,n):r===22?(n.fg&=-134217729,n.bg&=-134217729):r===23?n.bg&=-67108865:r===24?(n.fg&=-268435457,this._processUnderline(0,n)):r===25?n.fg&=-536870913:r===27?n.fg&=-67108865:r===28?n.fg&=-1073741825:r===29?n.fg&=2147483647:r===39?(n.fg&=-67108864,n.fg|=wt.fg&16777215):r===49?(n.bg&=-67108864,n.bg|=wt.bg&16777215):r===38||r===48||r===58?l+=this._extractColor(e,l,n):r===53?n.bg|=1073741824:r===55?n.bg&=-1073741825:r===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):r===100?(n.fg&=-67108864,n.fg|=wt.fg&16777215,n.bg&=-67108864,n.bg|=wt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${Q.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Q.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Q.ESC}[?${t};${r}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=wt.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){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 r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!p0(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${Q.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>_0&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>_0&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],r=e.split(";");for(;r.length>1;){let n=r.shift(),l=r.shift();if(/^\d+$/.exec(n)){let c=parseInt(n);if(v0(c))if(l==="?")t.push({type:0,index:c});else{let u=f0(l);u&&t.push({type:1,index:c,color:u})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(r,n):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,l=r.findIndex(c=>c.startsWith("id="));return l!==-1&&(n=r[l].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let n=0;n<r.length&&!(t>=this._specialColors.length);++n,++t)if(r[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let l=f0(r[n]);l&&this._onColor.fire([{type:1,index:this._specialColors[t],color:l}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],r=e.split(";");for(let n=0;n<r.length;++n)if(/^\d+$/.exec(r[n])){let l=parseInt(r[n]);v0(l)&&t.push({type:2,index:l})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,Vs),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(PD[e[0]],Rt[e[1]]||Vs),!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 e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=wt.clone(),this._eraseAttrDataInternal=wt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new $i;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let r=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let r=u=>(this._coreService.triggerDataEvent(`${Q.ESC}${u}${Q.ESC}\\`),!0),n=this._bufferService.buffer,l=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[l.cursorStyle]-(l.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Xf=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(g0=e,e=t,t=g0),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Xf=dt([de(0,ti)],Xf);function v0(e){return 0<=e&&e<256}var HD=5e7,y0=12,UD=50,jD=class extends Me{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 le),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){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 r;for(;r=this._writeBuffer.shift();){this._action(r);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>HD)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(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],l=this._action(n,t);if(l){let u=d=>performance.now()-r>=y0?setTimeout(()=>this._innerWrite(0,d)):this._innerWrite(r,d);l.catch(d=>(queueMicrotask(()=>{throw d}),Promise.resolve(!1))).then(u);return}let c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-r>=y0)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>UD&&(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()}},Zf=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let d=t.addMarker(t.ybase+t.y),_={data:e,id:this._nextId++,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(_,d)),this._dataByLinkId.set(_.id,_),_.id}let r=e,n=this._getEntryIdKey(r),l=this._entriesWithId.get(n);if(l)return this.addLineToLink(l.id,t.ybase+t.y),l.id;let c=t.addMarker(t.ybase+t.y),u={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(u,c)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);r.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(r,n))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Zf=dt([de(0,ti)],Zf);var S0=!1,VD=class extends Me{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Zn),this._onBinary=this._register(new le),this.onBinary=this._onBinary.event,this._onData=this._register(new le),this.onData=this._onData.event,this._onLineFeed=this._register(new le),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new le),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new le),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new le),this._instantiationService=new dD,this.optionsService=this._register(new wD(e)),this._instantiationService.setService(ii,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Wf)),this._instantiationService.setService(ti,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(qf)),this._instantiationService.setService(db,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Ff)),this._instantiationService.setService(tn,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Yf)),this._instantiationService.setService(hb,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ws)),this._instantiationService.setService(oT,this.unicodeService),this._charsetService=this._instantiationService.createInstance(kD),this._instantiationService.setService(lT,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Zf),this._instantiationService.setService(fb,this._oscLinkService),this._inputHandler=this._register(new ID(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Wt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Wt.forward(this._bufferService.onResize,this._onResize)),this._register(Wt.forward(this.coreService.onData,this._onData)),this._register(Wt.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 jD((t,r)=>this._inputHandler.parse(t,r))),this._register(Wt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new le),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.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 t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!S0&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S0=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,qb),t=Math.max(t,Wb),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.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(h0.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(h0(this._bufferService),!1))),this._windowsWrappingHeuristics.value=nt(()=>{for(let t of e)t.dispose()})}}},$D={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 GD(e,t,r,n){var u;let l={type:0,cancel:!1,key:void 0},c=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?l.key=Q.ESC+"OA":l.key=Q.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?l.key=Q.ESC+"OD":l.key=Q.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?l.key=Q.ESC+"OC":l.key=Q.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?l.key=Q.ESC+"OB":l.key=Q.ESC+"[B");break;case 8:l.key=e.ctrlKey?"\b":Q.DEL,e.altKey&&(l.key=Q.ESC+l.key);break;case 9:if(e.shiftKey){l.key=Q.ESC+"[Z";break}l.key=Q.HT,l.cancel=!0;break;case 13:l.key=e.altKey?Q.ESC+Q.CR:Q.CR,l.cancel=!0;break;case 27:l.key=Q.ESC,e.altKey&&(l.key=Q.ESC+Q.ESC),l.cancel=!0;break;case 37:if(e.metaKey)break;c?l.key=Q.ESC+"[1;"+(c+1)+"D":t?l.key=Q.ESC+"OD":l.key=Q.ESC+"[D";break;case 39:if(e.metaKey)break;c?l.key=Q.ESC+"[1;"+(c+1)+"C":t?l.key=Q.ESC+"OC":l.key=Q.ESC+"[C";break;case 38:if(e.metaKey)break;c?l.key=Q.ESC+"[1;"+(c+1)+"A":t?l.key=Q.ESC+"OA":l.key=Q.ESC+"[A";break;case 40:if(e.metaKey)break;c?l.key=Q.ESC+"[1;"+(c+1)+"B":t?l.key=Q.ESC+"OB":l.key=Q.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(l.key=Q.ESC+"[2~");break;case 46:c?l.key=Q.ESC+"[3;"+(c+1)+"~":l.key=Q.ESC+"[3~";break;case 36:c?l.key=Q.ESC+"[1;"+(c+1)+"H":t?l.key=Q.ESC+"OH":l.key=Q.ESC+"[H";break;case 35:c?l.key=Q.ESC+"[1;"+(c+1)+"F":t?l.key=Q.ESC+"OF":l.key=Q.ESC+"[F";break;case 33:e.shiftKey?l.type=2:e.ctrlKey?l.key=Q.ESC+"[5;"+(c+1)+"~":l.key=Q.ESC+"[5~";break;case 34:e.shiftKey?l.type=3:e.ctrlKey?l.key=Q.ESC+"[6;"+(c+1)+"~":l.key=Q.ESC+"[6~";break;case 112:c?l.key=Q.ESC+"[1;"+(c+1)+"P":l.key=Q.ESC+"OP";break;case 113:c?l.key=Q.ESC+"[1;"+(c+1)+"Q":l.key=Q.ESC+"OQ";break;case 114:c?l.key=Q.ESC+"[1;"+(c+1)+"R":l.key=Q.ESC+"OR";break;case 115:c?l.key=Q.ESC+"[1;"+(c+1)+"S":l.key=Q.ESC+"OS";break;case 116:c?l.key=Q.ESC+"[15;"+(c+1)+"~":l.key=Q.ESC+"[15~";break;case 117:c?l.key=Q.ESC+"[17;"+(c+1)+"~":l.key=Q.ESC+"[17~";break;case 118:c?l.key=Q.ESC+"[18;"+(c+1)+"~":l.key=Q.ESC+"[18~";break;case 119:c?l.key=Q.ESC+"[19;"+(c+1)+"~":l.key=Q.ESC+"[19~";break;case 120:c?l.key=Q.ESC+"[20;"+(c+1)+"~":l.key=Q.ESC+"[20~";break;case 121:c?l.key=Q.ESC+"[21;"+(c+1)+"~":l.key=Q.ESC+"[21~";break;case 122:c?l.key=Q.ESC+"[23;"+(c+1)+"~":l.key=Q.ESC+"[23~";break;case 123:c?l.key=Q.ESC+"[24;"+(c+1)+"~":l.key=Q.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?l.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?l.key=Q.NUL:e.keyCode>=51&&e.keyCode<=55?l.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?l.key=Q.DEL:e.keyCode===219?l.key=Q.ESC:e.keyCode===220?l.key=Q.FS:e.keyCode===221&&(l.key=Q.GS);else if((!r||n)&&e.altKey&&!e.metaKey){let d=(u=$D[e.keyCode])==null?void 0:u[e.shiftKey?1:0];if(d)l.key=Q.ESC+d;else if(e.keyCode>=65&&e.keyCode<=90){let _=e.ctrlKey?e.keyCode-64:e.keyCode+32,f=String.fromCharCode(_);e.shiftKey&&(f=f.toUpperCase()),l.key=Q.ESC+f}else if(e.keyCode===32)l.key=Q.ESC+(e.ctrlKey?Q.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let _=e.code.slice(3,4);e.shiftKey||(_=_.toLowerCase()),l.key=Q.ESC+_,l.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(l.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?l.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(l.key=Q.US),e.key==="@"&&(l.key=Q.NUL));break}return l}var pt=0,qD=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new zc,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new zc,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((l,c)=>this._getKey(l)-this._getKey(c)),t=0,r=0,n=new Array(this._array.length+this._insertedValues.length);for(let l=0;l<n.length;l++)r>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(n[l]=e[t],t++):n[l]=this._array[r++];this._array=n,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 t=this._getKey(e);if(t===void 0||(pt=this._search(t),pt===-1)||this._getKey(this._array[pt])!==t)return!1;do if(this._array[pt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(pt),!0;while(++pt<this._array.length&&this._getKey(this._array[pt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((l,c)=>l-c),t=0,r=new Array(this._array.length-e.length),n=0;for(let l=0;l<this._array.length;l++)e[t]===l?t++:r[n++]=this._array[l];this._array=r,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&&(pt=this._search(e),!(pt<0||pt>=this._array.length)&&this._getKey(this._array[pt])===e))do yield this._array[pt];while(++pt<this._array.length&&this._getKey(this._array[pt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(pt=this._search(e),!(pt<0||pt>=this._array.length)&&this._getKey(this._array[pt])===e))do t(this._array[pt]);while(++pt<this._array.length&&this._getKey(this._array[pt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,r=this._array.length-1;for(;r>=t;){let n=t+r>>1,l=this._getKey(this._array[n]);if(l>e)r=n-1;else if(l<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},Kd=0,b0=0,WD=class extends Me{constructor(){super(),this._decorations=new qD(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new le),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new le),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(nt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new FD(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let n=0,l=0;for(let c of this._decorations.getKeyIterator(t))n=c.options.x??0,l=n+(c.options.width??1),e>=n&&e<l&&(!r||(c.options.layer??"bottom")===r)&&(yield c)}forEachDecorationAtCell(e,t,r,n){this._decorations.forEachByKey(t,l=>{Kd=l.options.x??0,b0=Kd+(l.options.width??1),e>=Kd&&e<b0&&(!r||(l.options.layer??"bottom")===r)&&n(l)})}},FD=class extends vs{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new le),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new le),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=ot.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=ot.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},YD=1e3,KD=class{constructor(e,t=YD){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let l=n-this._lastRefreshMs,c=this._debounceThresholdMS-l;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},c)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},w0=20,Pc=class extends Me{constructor(e,t,r,n){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let l=this._coreBrowserService.mainDocument;this._accessibilityContainer=l.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=l.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,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=l.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new KD(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(c=>this._handleResize(c.rows))),this._register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(c=>this._handleChar(c))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
225
|
-
`))),this._register(this._terminal.onA11yTab(c=>this._handleTab(c))),this._register(this._terminal.onKey(c=>this._handleKey(c.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ce(l,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(nt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<
|
|
226
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===w0+1&&(this._liveRegion.textContent+=gf.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,n=r.lines.length.toString();for(let l=e;l<=t;l++){let c=r.lines.get(r.ydisp+l),u=[],d=(c==null?void 0:c.translateToString(!0,void 0,void 0,u))||"",_=(r.ydisp+l+1).toString(),f=this._rowElements[l];f&&(d.length===0?(f.textContent=" ",this._rowColumns.set(f,[0,1])):(f.textContent=d,this._rowColumns.set(f,u)),f.setAttribute("aria-posinset",_),f.setAttribute("aria-setsize",n),this._alignRowWidth(f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],l=r.getAttribute("aria-posinset"),c=t===0?"1":`${this._terminal.buffer.lines.length}`;if(l===c||e.relatedTarget!==n)return;let u,d;if(t===0?(u=r,d=this._rowElements.pop(),this._rowContainer.removeChild(d)):(u=this._rowElements.shift(),d=r,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),d.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let _=this._createAccessibilityTreeNode();this._rowElements.unshift(_),this._rowContainer.insertAdjacentElement("afterbegin",_)}else{let _=this._createAccessibilityTreeNode();this._rowElements.push(_),this._rowContainer.appendChild(_)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var d;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:((d=n.textContent)==null?void 0:d.length)??0}),!this._rowContainer.contains(r.node))return;let l=({node:_,offset:f})=>{let v=_ instanceof Text?_.parentNode:_,m=parseInt(v==null?void 0:v.getAttribute("aria-posinset"),10)-1;if(isNaN(m))return console.warn("row is invalid. Race condition?"),null;let y=this._rowColumns.get(v);if(!y)return console.warn("columns is null. Race condition?"),null;let S=f<y.length?y[f]:y.slice(-1)[0]+1;return S>=this._terminal.cols&&(++m,S=0),{row:m,column:S}},c=l(t),u=l(r);if(!(!c||!u)){if(c.row>u.row||c.row===u.row&&c.column>=u.column)throw new Error("invalid range");this._terminal.select(c.column,c.row,(u.row-c.row)*this._terminal.cols-c.column+u.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var l,c;e.style.transform="";let t=e.getBoundingClientRect().width,r=(c=(l=this._rowColumns.get(e))==null?void 0:l.slice(-1))==null?void 0:c[0];if(!r)return;let n=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};Pc=dt([de(1,S_),de(2,Nr),de(3,Br)],Pc);var Qf=class extends Me{constructor(e,t,r,n,l){super(),this._element=e,this._mouseService=t,this._renderService=r,this._bufferService=n,this._linkProviderService=l,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new le),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new le),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(nt(()=>{var c;Qs(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(c=this._activeProviderReplies)==null||c.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ce(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ce(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ce(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ce(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let n=0;n<r.length;n++){let l=r[n];if(l.classList.contains("xterm"))break;if(l.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var n,l;(!this._activeProviderReplies||!t)&&((n=this._activeProviderReplies)==null||n.forEach(c=>{c==null||c.forEach(u=>{u.link.dispose&&u.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[c,u]of this._linkProviderService.linkProviders.entries())t?(l=this._activeProviderReplies)!=null&&l.get(c)&&(r=this._checkLinkProviderResult(c,e,r)):u.provideLinks(e.y,d=>{var f,v;if(this._isMouseOut)return;let _=d==null?void 0:d.map(m=>({link:m}));(f=this._activeProviderReplies)==null||f.set(c,_),r=this._checkLinkProviderResult(c,e,r),((v=this._activeProviderReplies)==null?void 0:v.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let n=0;n<t.size;n++){let l=t.get(n);if(l)for(let c=0;c<l.length;c++){let u=l[c],d=u.link.range.start.y<e?0:u.link.range.start.x,_=u.link.range.end.y>e?this._bufferService.cols:u.link.range.end.x;for(let f=d;f<=_;f++){if(r.has(f)){l.splice(c--,1);break}r.add(f)}}}}_checkLinkProviderResult(e,t,r){var c;if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),l=!1;for(let u=0;u<e;u++)(!this._activeProviderReplies.has(u)||this._activeProviderReplies.get(u))&&(l=!0);if(!l&&n){let u=n.find(d=>this._linkAtPosition(d.link,t));u&&(r=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let u=0;u<this._activeProviderReplies.size;u++){let d=(c=this._activeProviderReplies.get(u))==null?void 0:c.find(_=>this._linkAtPosition(_.link,t));if(d){r=!0,this._handleNewLink(d);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&XD(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Qs(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.pointerCursor},set:r=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.underline},set:r=>{var n,l,c;(n=this._currentLink)!=null&&n.state&&((c=(l=this._currentLink)==null?void 0:l.state)==null?void 0:c.decorations.underline)!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let n=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,l=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=l&&(this._clearCurrentLink(n,l),this._lastMouseEvent)){let c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,t,r){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,n=this._bufferService.buffer.ydisp,l=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(l)}_linkLeave(e,t,r){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,l=t.y*this._bufferService.cols+t.x;return r<=l&&l<=n}_positionFromMouseEvent(e,t,r){let n=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,n,l){return{x1:e,y1:t,x2:r,y2:n,cols:this._bufferService.cols,fg:l}}};Qf=dt([de(1,b_),de(2,Br),de(3,ti),de(4,pb)],Qf);function XD(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var ZD=class extends VD{constructor(e={}){super(e),this._linkifier=this._register(new Zn),this.browser=Nb,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Zn),this._onCursorMove=this._register(new le),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new le),this.onKey=this._onKey.event,this._onRender=this._register(new le),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new le),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new le),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new le),this.onBell=this._onBell.event,this._onFocus=this._register(new le),this._onBlur=this._register(new le),this._onA11yCharEmitter=this._register(new le),this._onA11yTabEmitter=this._register(new le),this._onWillOpen=this._register(new le),this._setup(),this._decorationService=this._instantiationService.createInstance(WD),this._instantiationService.setService(Tl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(UR),this._instantiationService.setService(pb,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(yf)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Wt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Wt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Wt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Wt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(nt(()=>{var t,r;this._customKeyEventHandler=void 0,(r=(t=this.element)==null?void 0:t.parentNode)==null||r.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 t of e){let r,n="";switch(t.index){case 256:r="foreground",n="10";break;case 257:r="background",n="11";break;case 258:r="cursor",n="12";break;default:r="ansi",n="4;"+t.index}switch(t.type){case 0:let l=rt.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${Q.ESC}]${n};${zD(l)}${Ob.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(c=>c.ansi[t.index]=Ct.toColor(...t.color));else{let c=r;this._themeService.modifyColors(u=>u[c]=Ct.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.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(Pc,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.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(Q.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,t=this.buffer.lines.get(e);if(!t)return;let r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,l=t.getWidth(r),c=this._renderService.dimensions.css.cell.width*l,u=this.buffer.y*this._renderService.dimensions.css.cell.height,d=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=d+"px",this.textarea.style.top=u+"px",this.textarea.style.width=c+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ce(this.element,"copy",t=>{this.hasSelection()&&tT(t,this._selectionService)}));let e=t=>iT(t,this.textarea,this.coreService,this.optionsService);this._register(Ce(this.textarea,"paste",e)),this._register(Ce(this.element,"paste",e)),Bb?this._register(Ce(this.element,"mousedown",t=>{t.button===2&&Oy(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ce(this.element,"contextmenu",t=>{Oy(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),R_&&this._register(Ce(this.element,"auxclick",t=>{t.button===1&&ab(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ce(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ce(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ce(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ce(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ce(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ce(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ce(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var l;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"),((l=this.element)==null?void 0:l.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 t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ce(this.screenElement,"mousemove",c=>this.updateCursorStyle(c))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",mf.get()),Ib||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",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(IR,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Nr,this._coreBrowserService),this._register(Ce(this.textarea,"focus",c=>this._handleTextAreaFocus(c))),this._register(Ce(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Uf,this._document,this._helperContainer),this._instantiationService.setService(Zc,this._charSizeService),this._themeService=this._instantiationService.createInstance(Gf),this._instantiationService.setService(ta,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Nc),this._instantiationService.setService(_b,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(Vf,this.rows,this.screenElement)),this._instantiationService.setService(Br,this._renderService),this._register(this._renderService.onRenderedViewportChange(c=>this._onRender.fire(c))),this.onResize(c=>this._renderService.resize(c.cols,c.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Pf,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(jf),this._instantiationService.setService(b_,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(Qf,this.screenElement));this.element.appendChild(t);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(Bf,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(c=>{super.scrollLines(c,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance($f,this.element,this.screenElement,n)),this._instantiationService.setService(uT,this._selectionService),this._register(this._selectionService.onRequestScrollLines(c=>this.scrollLines(c.amount,c.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(c=>this._renderService.handleSelectionChanged(c.start,c.end,c.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(c=>{this.textarea.value=c,this.textarea.focus(),this.textarea.select()})),this._register(Wt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var c;this._selectionService.refresh(),(c=this._viewport)==null||c.queueSync()})),this._register(this._instantiationService.createInstance(zf,this.screenElement)),this._register(Ce(this.element,"mousedown",c=>this._selectionService.handleMouseDown(c))),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(Pc,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",c=>this._handleScreenReaderModeOptionChange(c))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Mc,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",c=>{!this._overviewRulerRenderer&&c&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Mc,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Hf,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(c){var f,v,m,y,S;let u=e._mouseService.getMouseReportCoords(c,e.screenElement);if(!u)return!1;let d,_;switch(c.overrideType||c.type){case"mousemove":_=32,c.buttons===void 0?(d=3,c.button!==void 0&&(d=c.button<3?c.button:3)):d=c.buttons&1?0:c.buttons&4?1:c.buttons&2?2:3;break;case"mouseup":_=0,d=c.button<3?c.button:3;break;case"mousedown":_=1,d=c.button<3?c.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(c)===!1)return!1;let b=c.deltaY;if(b===0||e.coreMouseService.consumeWheelEvent(c,(y=(m=(v=(f=e._renderService)==null?void 0:f.dimensions)==null?void 0:v.device)==null?void 0:m.cell)==null?void 0:y.height,(S=e._coreBrowserService)==null?void 0:S.dpr)===0)return!1;_=b<0?0:1,d=4;break;default:return!1}return _===void 0||d===void 0||d>4?!1:e.coreMouseService.triggerMouseEvent({col:u.col,row:u.row,x:u.x,y:u.y,button:d,action:_,ctrl:c.ctrlKey,alt:c.altKey,shift:c.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},l={mouseup:c=>(r(c),c.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(c)),wheel:c=>(r(c),this.cancel(c,!0)),mousedrag:c=>{c.buttons&&r(c)},mousemove:c=>{c.buttons||r(c)}};this._register(this.coreMouseService.onProtocolChange(c=>{c?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(c)),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()),c&8?n.mousemove||(t.addEventListener("mousemove",l.mousemove),n.mousemove=l.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),c&16?n.wheel||(t.addEventListener("wheel",l.wheel,{passive:!1}),n.wheel=l.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),c&2?n.mouseup||(n.mouseup=l.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),c&4?n.mousedrag||(n.mousedrag=l.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ce(t,"mousedown",c=>{if(c.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(c)))return r(c),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(c)})),this._register(Ce(t,"wheel",c=>{var u,d,_,f,v;if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(c)===!1)return!1;if(!this.buffer.hasScrollback){if(c.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(c,(f=(_=(d=(u=e._renderService)==null?void 0:u.dimensions)==null?void 0:d.device)==null?void 0:_.cell)==null?void 0:f.height,(v=e._coreBrowserService)==null?void 0:v.dpr)===0)return this.cancel(c,!0);let m=Q.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(c.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(c,!0)}}},{passive:!1}))}refresh(e,t){var r;(r=this._renderService)==null||r.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.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,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){nb(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 t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}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,t,r){this._selectionService.setSelection(e,t,r)}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,t){var r;(r=this._selectionService)==null||r.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=GD(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let n=this.rows-1;return this.scrollLines(r.type===2?-n:n),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.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((r.key===Q.ETX||r.key===Q.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(QD(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!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 t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var r;(r=this._charSizeService)==null||r.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(wt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.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(Q.ESC+"[I"):this.coreService.triggerDataEvent(Q.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.ESC}[4;${r};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),l=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.ESC}[6;${l};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function QD(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var JD=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;break}if(t===-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(t,1)}},eL=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new $i)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},C0=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new eL(t)}getNullCell(){return new $i}},tL=class extends Me{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new le),this.onBufferChange=this._onBufferChange.event,this._normal=new C0(this._core.buffers.normal,"normal"),this._alternate=new C0(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)}},iL=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,n)=>t(r,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},rL=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}},sL=["cols","rows"],tr=0,nL=class extends Me{constructor(e){super(),this._core=this._register(new ZD(e)),this._addonManager=this._register(new JD),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],r=(n,l)=>{this._checkReadonlyOptions(n),this._core.options[n]=l};for(let n in this._core.options){let l={get:t.bind(this,n),set:r.bind(this,n)};Object.defineProperty(this._publicOptions,n,l)}}_checkReadonlyOptions(e){if(sL.includes(e))throw new Error(`Option "${e}" 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 iL(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new rL(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 tL(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
227
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return
|
|
224
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),D_&&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 t=this._getMouseBufferCoords(e),r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n||!t?!1:this._areCoordsInSelection(t,r,n)}isCellInSelection(e,t){let r=this._model.finalSelectionStart,n=this._model.finalSelectionEnd;return!r||!n?!1:this._areCoordsInSelection([e,t],r,n)}_areCoordsInSelection(e,t,r){return e[1]>t[1]&&e[1]<r[1]||t[1]===r[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<r[0]||t[1]<r[1]&&e[1]===r[1]&&e[0]<r[0]||t[1]<r[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){var l,c;let r=(c=(l=this._linkifier.currentLink)==null?void 0:l.link)==null?void 0:c.range;if(r)return this._model.selectionStart=[r.start.x-1,r.start.y-1],this._model.selectionStartLength=t0(r,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let n=this._getMouseBufferCoords(e);return n?(this._selectWordAt(n,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=R_(this._coreBrowserService.window,e,this._screenElement)[1],r=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=r?0:(t>r&&(t-=r),t=Math.min(Math.max(t,-Gd),Gd),t/=Gd,t/Math.abs(t)+Math.round(t*(lD-1)))}shouldForceSelection(e){return Bc?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(),oD)}_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 t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Bc&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=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 r=this._bufferService.buffer;if(this._model.selectionEnd[1]<r.lines.length){let n=r.lines.get(this._model.selectionEnd[1]);n&&n.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[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 t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<cD&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let r=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(r&&r[0]!==void 0&&r[1]!==void 0){let n=JR(r[0]-1,r[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(n,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,r=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);if(!r){this._oldHasSelection&&this._fireOnSelectionChange(e,t,r);return}!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,r)}_fireOnSelectionChange(e,t,r){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=r,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(t=>this._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let r=t;for(let n=0;t>=n;n++){let l=e.loadCell(n,this._workCell).getChars().length;this._workCell.getWidth()===0?r--:l>1&&t!==n&&(r+=l-1)}return r}setSelection(e,t,r){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=r,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,r=!0,n=!0){if(e[0]>=this._bufferService.cols)return;let l=this._bufferService.buffer,c=l.lines.get(e[1]);if(!c)return;let u=l.translateBufferLineToString(e[1],!1),d=this._convertViewportColToCharacterIndex(c,e[0]),_=d,f=e[0]-d,v=0,m=0,y=0,S=0;if(u.charAt(d)===" "){for(;d>0&&u.charAt(d-1)===" ";)d--;for(;_<u.length&&u.charAt(_+1)===" ";)_++}else{let T=e[0],O=e[0];c.getWidth(T)===0&&(v++,T--),c.getWidth(O)===2&&(m++,O++);let H=c.getString(O).length;for(H>1&&(S+=H-1,_+=H-1);T>0&&d>0&&!this._isCharWordSeparator(c.loadCell(T-1,this._workCell));){c.loadCell(T-1,this._workCell);let B=this._workCell.getChars().length;this._workCell.getWidth()===0?(v++,T--):B>1&&(y+=B-1,d-=B-1),d--,T--}for(;O<c.length&&_+1<u.length&&!this._isCharWordSeparator(c.loadCell(O+1,this._workCell));){c.loadCell(O+1,this._workCell);let B=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,O++):B>1&&(S+=B-1,_+=B-1),_++,O++}}_++;let b=d+f-v+y,x=Math.min(this._bufferService.cols,_-d+v+m-y-S);if(!(!t&&u.slice(d,_).trim()==="")){if(r&&b===0&&c.getCodePoint(0)!==32){let T=l.lines.get(e[1]-1);if(T&&c.isWrapped&&T.getCodePoint(this._bufferService.cols-1)!==32){let O=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(O){let H=this._bufferService.cols-O.start;b-=H,x+=H}}}if(n&&b+x===this._bufferService.cols&&c.getCodePoint(this._bufferService.cols-1)!==32){let T=l.lines.get(e[1]+1);if(T!=null&&T.isWrapped&&T.getCodePoint(0)!==32){let O=this._getWordAt([0,e[1]+1],!1,!1,!0);O&&(x+=O.length)}}return{start:b,length:x}}}_selectWordAt(e,t){let r=this._getWordAt(e,t);if(r){for(;r.start<0;)r.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[r.start,e[1]],this._model.selectionStartLength=r.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let r=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,r--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,r]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),r={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=t0(r,this._bufferService.cols)}};Gf=dt([de(3,ii),de(4,tn),de(5,w_),de(6,ri),de(7,Br),de(8,Nr)],Gf);var i0=class{constructor(){this._data={}}set(e,t,r){this._data[e]||(this._data[e]={}),this._data[e][t]=r}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},r0=class{constructor(){this._color=new i0,this._css=new i0}setCss(e,t,r){this._css.set(e,t,r)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,r){this._color.set(e,t,r)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},xt=Object.freeze((()=>{let e=[ot.toColor("#2e3436"),ot.toColor("#cc0000"),ot.toColor("#4e9a06"),ot.toColor("#c4a000"),ot.toColor("#3465a4"),ot.toColor("#75507b"),ot.toColor("#06989a"),ot.toColor("#d3d7cf"),ot.toColor("#555753"),ot.toColor("#ef2929"),ot.toColor("#8ae234"),ot.toColor("#fce94f"),ot.toColor("#729fcf"),ot.toColor("#ad7fa8"),ot.toColor("#34e2e2"),ot.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let r=0;r<216;r++){let n=t[r/36%6|0],l=t[r/6%6|0],c=t[r%6];e.push({css:Ct.toCss(n,l,c),rgba:Ct.toRgba(n,l,c)})}for(let r=0;r<24;r++){let n=8+r*10;e.push({css:Ct.toCss(n,n,n),rgba:Ct.toRgba(n,n,n)})}return e})()),js=ot.toColor("#ffffff"),ol=ot.toColor("#000000"),s0=ot.toColor("#ffffff"),n0=ol,il={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},dD=js,qf=class extends Me{constructor(e){super(),this._optionsService=e,this._contrastCache=new r0,this._halfContrastCache=new r0,this._onChangeColors=this._register(new oe),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:js,background:ol,cursor:s0,cursorAccent:n0,selectionForeground:void 0,selectionBackgroundTransparent:il,selectionBackgroundOpaque:rt.blend(ol,il),selectionInactiveBackgroundTransparent:il,selectionInactiveBackgroundOpaque:rt.blend(ol,il),scrollbarSliderBackground:rt.opacity(js,.2),scrollbarSliderHoverBackground:rt.opacity(js,.4),scrollbarSliderActiveBackground:rt.opacity(js,.5),overviewRulerBorder:js,ansi:xt.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 t=this._colors;if(t.foreground=Xe(e.foreground,js),t.background=Xe(e.background,ol),t.cursor=rt.blend(t.background,Xe(e.cursor,s0)),t.cursorAccent=rt.blend(t.background,Xe(e.cursorAccent,n0)),t.selectionBackgroundTransparent=Xe(e.selectionBackground,il),t.selectionBackgroundOpaque=rt.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=Xe(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=rt.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?Xe(e.selectionForeground,Qy):void 0,t.selectionForeground===Qy&&(t.selectionForeground=void 0),rt.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=rt.opacity(t.selectionBackgroundTransparent,.3)),rt.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=rt.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=Xe(e.scrollbarSliderBackground,rt.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=Xe(e.scrollbarSliderHoverBackground,rt.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=Xe(e.scrollbarSliderActiveBackground,rt.opacity(t.foreground,.5)),t.overviewRulerBorder=Xe(e.overviewRulerBorder,dD),t.ansi=xt.slice(),t.ansi[0]=Xe(e.black,xt[0]),t.ansi[1]=Xe(e.red,xt[1]),t.ansi[2]=Xe(e.green,xt[2]),t.ansi[3]=Xe(e.yellow,xt[3]),t.ansi[4]=Xe(e.blue,xt[4]),t.ansi[5]=Xe(e.magenta,xt[5]),t.ansi[6]=Xe(e.cyan,xt[6]),t.ansi[7]=Xe(e.white,xt[7]),t.ansi[8]=Xe(e.brightBlack,xt[8]),t.ansi[9]=Xe(e.brightRed,xt[9]),t.ansi[10]=Xe(e.brightGreen,xt[10]),t.ansi[11]=Xe(e.brightYellow,xt[11]),t.ansi[12]=Xe(e.brightBlue,xt[12]),t.ansi[13]=Xe(e.brightMagenta,xt[13]),t.ansi[14]=Xe(e.brightCyan,xt[14]),t.ansi[15]=Xe(e.brightWhite,xt[15]),e.extendedAnsi){let r=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let n=0;n<r;n++)t.ansi[n+16]=Xe(e.extendedAnsi[n],xt[n+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 t=0;t<this._restoreColors.ansi.length;++t)this._colors.ansi[t]=this._restoreColors.ansi[t];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()}}};qf=dt([de(0,ri)],qf);function Xe(e,t){if(e!==void 0)try{return ot.toColor(e)}catch{}return t}var fD=class{constructor(...e){this._entries=new Map;for(let[t,r]of e)this.set(t,r)}set(e,t){let r=this._entries.get(e);return this._entries.set(e,t),r}forEach(e){for(let[t,r]of this._entries.entries())e(t,r)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},_D=class{constructor(){this._services=new fD,this._services.set(b_,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let r=lT(e).sort((c,u)=>c.index-u.index),n=[];for(let c of r){let u=this._services.get(c.id);if(!u)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${c.id._id}.`);n.push(u)}let l=r.length>0?r[0].index:t.length;if(t.length!==l)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${l+1} conflicts with ${t.length} static arguments`);return new e(...t,...n)}},pD={trace:0,debug:1,info:2,warn:3,error:4,off:5},mD="xterm.js: ",Wf=class extends Me{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=pD[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]=="function"&&(e[t]=e[t]())}_log(e,t,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":mD)+t,...r)}trace(e,...t){var r;this._logLevel<=0&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.trace.bind(this._optionsService.options.logger))??console.log,e,t)}debug(e,...t){var r;this._logLevel<=1&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.debug.bind(this._optionsService.options.logger))??console.log,e,t)}info(e,...t){var r;this._logLevel<=2&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.info.bind(this._optionsService.options.logger))??console.info,e,t)}warn(e,...t){var r;this._logLevel<=3&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.warn.bind(this._optionsService.options.logger))??console.warn,e,t)}error(e,...t){var r;this._logLevel<=4&&this._log(((r=this._optionsService.options.logger)==null?void 0:r.error.bind(this._optionsService.options.logger))??console.error,e,t)}};Wf=dt([de(0,ri)],Wf);var a0=class extends Me{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new oe),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new oe),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new oe),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 t=new Array(e);for(let r=0;r<Math.min(e,this.length);r++)t[r]=this._array[this._getCyclicIndex(r)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}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,t,...r){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let n=this._length-1;n>=e;n--)this._array[this._getCyclicIndex(n+r.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<r.length;n++)this._array[this._getCyclicIndex(e+n)]=r[n];if(r.length&&this.onInsertEmitter.fire({index:e,amount:r.length}),this._length+r.length>this._maxLength){let n=this._length+r.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=r.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,r){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+r<0)throw new Error("Cannot shift elements in list beyond index 0");if(r>0){for(let l=t-1;l>=0;l--)this.set(e+l+r,this.get(e+l));let n=e+t+r-this._length;if(n>0)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let n=0;n<t;n++)this.set(e+n+r,this.get(e+n))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},Oe=3,wt=Object.freeze(new Tl),cc=0,qd=2,cl=class Wb{constructor(t,r,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(t*Oe);let l=r||$i.fromCharData([0,hb,1,0]);for(let c=0;c<t;++c)this.setCell(c,l);this.length=t}get(t){let r=this._data[t*Oe+0],n=r&2097151;return[this._data[t*Oe+1],r&2097152?this._combined[t]:n?fs(n):"",r>>22,r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):n]}set(t,r){this._data[t*Oe+1]=r[0],r[1].length>1?(this._combined[t]=r[1],this._data[t*Oe+0]=t|2097152|r[2]<<22):this._data[t*Oe+0]=r[1].charCodeAt(0)|r[2]<<22}getWidth(t){return this._data[t*Oe+0]>>22}hasWidth(t){return this._data[t*Oe+0]&12582912}getFg(t){return this._data[t*Oe+1]}getBg(t){return this._data[t*Oe+2]}hasContent(t){return this._data[t*Oe+0]&4194303}getCodePoint(t){let r=this._data[t*Oe+0];return r&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):r&2097151}isCombined(t){return this._data[t*Oe+0]&2097152}getString(t){let r=this._data[t*Oe+0];return r&2097152?this._combined[t]:r&2097151?fs(r&2097151):""}isProtected(t){return this._data[t*Oe+2]&536870912}loadCell(t,r){return cc=t*Oe,r.content=this._data[cc+0],r.fg=this._data[cc+1],r.bg=this._data[cc+2],r.content&2097152&&(r.combinedData=this._combined[t]),r.bg&268435456&&(r.extended=this._extendedAttrs[t]),r}setCell(t,r){r.content&2097152&&(this._combined[t]=r.combinedData),r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*Oe+0]=r.content,this._data[t*Oe+1]=r.fg,this._data[t*Oe+2]=r.bg}setCellFromCodepoint(t,r,n,l){l.bg&268435456&&(this._extendedAttrs[t]=l.extended),this._data[t*Oe+0]=r|n<<22,this._data[t*Oe+1]=l.fg,this._data[t*Oe+2]=l.bg}addCodepointToCell(t,r,n){let l=this._data[t*Oe+0];l&2097152?this._combined[t]+=fs(r):l&2097151?(this._combined[t]=fs(l&2097151)+fs(r),l&=-2097152,l|=2097152):l=r|1<<22,n&&(l&=-12582913,l|=n<<22),this._data[t*Oe+0]=l}insertCells(t,r,n){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length-t){let l=new $i;for(let c=this.length-t-r-1;c>=0;--c)this.setCell(t+r+c,this.loadCell(t+c,l));for(let c=0;c<r;++c)this.setCell(t+c,n)}else for(let l=t;l<this.length;++l)this.setCell(l,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(t,r,n){if(t%=this.length,r<this.length-t){let l=new $i;for(let c=0;c<this.length-t-r;++c)this.setCell(t+c,this.loadCell(t+r+c,l));for(let c=this.length-r;c<this.length;++c)this.setCell(c,n)}else for(let l=t;l<this.length;++l)this.setCell(l,n);t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),this.getWidth(t)===0&&!this.hasContent(t)&&this.setCellFromCodepoint(t,0,1,n)}replaceCells(t,r,n,l=!1){if(l){for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&!this.isProtected(r)&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.isProtected(t)||this.setCell(t,n),t++;return}for(t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,n),r<this.length&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r,0,1,n);t<r&&t<this.length;)this.setCell(t++,n)}resize(t,r){if(t===this.length)return this._data.length*4*qd<this._data.buffer.byteLength;let n=t*Oe;if(t>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let l=new Uint32Array(n);l.set(this._data),this._data=l}for(let l=this.length;l<t;++l)this.setCell(l,r)}else{this._data=this._data.subarray(0,n);let l=Object.keys(this._combined);for(let u=0;u<l.length;u++){let d=parseInt(l[u],10);d>=t&&delete this._combined[d]}let c=Object.keys(this._extendedAttrs);for(let u=0;u<c.length;u++){let d=parseInt(c[u],10);d>=t&&delete this._extendedAttrs[d]}}return this.length=t,n*4*qd<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*qd<this._data.buffer.byteLength){let t=new Uint32Array(this._data.length);return t.set(this._data),this._data=t,1}return 0}fill(t,r=!1){if(r){for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,t);return}this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,t)}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let r in t._combined)this._combined[r]=t._combined[r];this._extendedAttrs={};for(let r in t._extendedAttrs)this._extendedAttrs[r]=t._extendedAttrs[r];this.isWrapped=t.isWrapped}clone(){let t=new Wb(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let r in this._combined)t._combined[r]=this._combined[r];for(let r in this._extendedAttrs)t._extendedAttrs[r]=this._extendedAttrs[r];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Oe+0]&4194303)return t+(this._data[t*Oe+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*Oe+0]&4194303||this._data[t*Oe+2]&50331648)return t+(this._data[t*Oe+0]>>22);return 0}copyCellsFrom(t,r,n,l,c){let u=t._data;if(c)for(let _=l-1;_>=0;_--){for(let f=0;f<Oe;f++)this._data[(n+_)*Oe+f]=u[(r+_)*Oe+f];u[(r+_)*Oe+2]&268435456&&(this._extendedAttrs[n+_]=t._extendedAttrs[r+_])}else for(let _=0;_<l;_++){for(let f=0;f<Oe;f++)this._data[(n+_)*Oe+f]=u[(r+_)*Oe+f];u[(r+_)*Oe+2]&268435456&&(this._extendedAttrs[n+_]=t._extendedAttrs[r+_])}let d=Object.keys(t._combined);for(let _=0;_<d.length;_++){let f=parseInt(d[_],10);f>=r&&(this._combined[f-r+n]=t._combined[f])}}translateToString(t,r,n,l){r=r??0,n=n??this.length,t&&(n=Math.min(n,this.getTrimmedLength())),l&&(l.length=0);let c="";for(;r<n;){let u=this._data[r*Oe+0],d=u&2097151,_=u&2097152?this._combined[r]:d?fs(d):ms;if(c+=_,l)for(let f=0;f<_.length;++f)l.push(r);r+=u>>22||1}return l&&l.push(r),c}};function gD(e,t,r,n,l,c){let u=[];for(let d=0;d<e.length-1;d++){let _=d,f=e.get(++_);if(!f.isWrapped)continue;let v=[e.get(d)];for(;_<e.length&&f.isWrapped;)v.push(f),f=e.get(++_);if(!c&&n>=d&&n<_){d+=v.length-1;continue}let m=0,y=Cl(v,m,t),S=1,b=0;for(;S<v.length;){let T=Cl(v,S,t),O=T-b,H=r-y,B=Math.min(O,H);v[m].copyCellsFrom(v[S],b,y,B,!1),y+=B,y===r&&(m++,y=0),b+=B,b===T&&(S++,b=0),y===0&&m!==0&&v[m-1].getWidth(r-1)===2&&(v[m].copyCellsFrom(v[m-1],r-1,y++,1,!1),v[m-1].setCell(r-1,l))}v[m].replaceCells(y,r,l);let x=0;for(let T=v.length-1;T>0&&(T>m||v[T].getTrimmedLength()===0);T--)x++;x>0&&(u.push(d+v.length-x),u.push(x)),d+=v.length-1}return u}function vD(e,t){let r=[],n=0,l=t[n],c=0;for(let u=0;u<e.length;u++)if(l===u){let d=t[++n];e.onDeleteEmitter.fire({index:u-c,amount:d}),u+=d-1,c+=d,l=t[++n]}else r.push(u);return{layout:r,countRemoved:c}}function yD(e,t){let r=[];for(let n=0;n<t.length;n++)r.push(e.get(t[n]));for(let n=0;n<r.length;n++)e.set(n,r[n]);e.length=t.length}function SD(e,t,r){let n=[],l=e.map((_,f)=>Cl(e,f,t)).reduce((_,f)=>_+f),c=0,u=0,d=0;for(;d<l;){if(l-d<r){n.push(l-d);break}c+=r;let _=Cl(e,u,t);c>_&&(c-=_,u++);let f=e[u].getWidth(c-1)===2;f&&c--;let v=f?r-1:r;n.push(v),d+=v}return n}function Cl(e,t,r){if(t===e.length-1)return e[t].getTrimmedLength();let n=!e[t].hasContent(r-1)&&e[t].getWidth(r-1)===1,l=e[t+1].getWidth(0)===2;return n&&l?r-1:r}var Fb=class Yb{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=Yb._nextId++,this._onDispose=this.register(new oe),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Qs(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};Fb._nextId=1;var bD=Fb,Rt={},Vs=Rt.B;Rt[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:"≥","{":"π","|":"≠","}":"£","~":"·"};Rt.A={"#":"£"};Rt.B=void 0;Rt[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};Rt.C=Rt[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Rt.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};Rt.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};Rt.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};Rt.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};Rt.E=Rt[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};Rt.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};Rt.H=Rt[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};Rt["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var l0=4294967295,o0=class{constructor(e,t,r){this._hasScrollback=e,this._optionsService=t,this._bufferService=r,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=wt.clone(),this.savedCharset=Vs,this.markers=[],this._nullCell=$i.fromCharData([0,hb,1,0]),this._whitespaceCell=$i.fromCharData([0,ms,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new zc,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new a0(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Oc),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Oc),this._whitespaceCell}getBlankLine(e,t){return new cl(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>l0?l0:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=wt);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new a0(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let r=this.getNullCell(wt),n=0,l=this._getCorrectBufferLength(t);if(l>this.lines.maxLength&&(this.lines.maxLength=l),this.lines.length>0){if(this._cols<e)for(let u=0;u<this.lines.length;u++)n+=+this.lines.get(u).resize(e,r);let c=0;if(this._rows<t)for(let u=this._rows;u<t;u++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new cl(e,r)):this.ybase>0&&this.lines.length<=this.ybase+this.y+c+1?(this.ybase--,c++,this.ydisp>0&&this.ydisp--):this.lines.push(new cl(e,r)));else for(let u=this._rows;u>t;u--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(l<this.lines.maxLength){let u=this.lines.length-l;u>0&&(this.lines.trimStart(u),this.ybase=Math.max(this.ybase-u,0),this.ydisp=Math.max(this.ydisp-u,0),this.savedY=Math.max(this.savedY-u,0)),this.lines.maxLength=l}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),c&&(this.y+=c),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let c=0;c<this.lines.length;c++)n+=+this.lines.get(c).resize(e,r);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),n>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=gD(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(wt),r);if(n.length>0){let l=vD(this.lines,n);yD(this.lines,l.layout),this._reflowLargerAdjustViewport(e,t,l.countRemoved)}}_reflowLargerAdjustViewport(e,t,r){let n=this.getNullCell(wt),l=r;for(;l-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new cl(e,n))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-r,0)}_reflowSmaller(e,t){let r=this._optionsService.rawOptions.reflowCursorLine,n=this.getNullCell(wt),l=[],c=0;for(let u=this.lines.length-1;u>=0;u--){let d=this.lines.get(u);if(!d||!d.isWrapped&&d.getTrimmedLength()<=e)continue;let _=[d];for(;d.isWrapped&&u>0;)d=this.lines.get(--u),_.unshift(d);if(!r){let B=this.ybase+this.y;if(B>=u&&B<u+_.length)continue}let f=_[_.length-1].getTrimmedLength(),v=SD(_,this._cols,e),m=v.length-_.length,y;this.ybase===0&&this.y!==this.lines.length-1?y=Math.max(0,this.y-this.lines.maxLength+m):y=Math.max(0,this.lines.length-this.lines.maxLength+m);let S=[];for(let B=0;B<m;B++){let I=this.getBlankLine(wt,!0);S.push(I)}S.length>0&&(l.push({start:u+_.length+c,newLines:S}),c+=S.length),_.push(...S);let b=v.length-1,x=v[b];x===0&&(b--,x=v[b]);let T=_.length-m-1,O=f;for(;T>=0;){let B=Math.min(O,x);if(_[b]===void 0)break;if(_[b].copyCellsFrom(_[T],O-B,x-B,B,!0),x-=B,x===0&&(b--,x=v[b]),O-=B,O===0){T--;let I=Math.max(T,0);O=Cl(_,I,this._cols)}}for(let B=0;B<_.length;B++)v[B]<e&&_[B].setCell(v[B],n);let H=m-y;for(;H-- >0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+c)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+m,this.ybase+t-1)}if(l.length>0){let u=[],d=[];for(let x=0;x<this.lines.length;x++)d.push(this.lines.get(x));let _=this.lines.length,f=_-1,v=0,m=l[v];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+c);let y=0;for(let x=Math.min(this.lines.maxLength-1,_+c-1);x>=0;x--)if(m&&m.start>f+y){for(let T=m.newLines.length-1;T>=0;T--)this.lines.set(x--,m.newLines[T]);x++,u.push({index:f+1,amount:m.newLines.length}),y+=m.newLines.length,m=l[++v]}else this.lines.set(x,d[f--]);let S=0;for(let x=u.length-1;x>=0;x--)u[x].index+=S,this.lines.onInsertEmitter.fire(u[x]),S+=u[x].amount;let b=Math.max(0,_+c-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}translateBufferLineToString(e,t,r=0,n){let l=this.lines.get(e);return l?l.translateToString(t,r,n):""}getWrappedRangeForLine(e){let t=e,r=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;r+1<this.lines.length&&this.lines.get(r+1).isWrapped;)r++;return{first:t,last:r}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new bD(e);return this.markers.push(t),t.register(this.lines.onTrim(r=>{t.line-=r,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(r=>{t.line>=r.index&&(t.line+=r.amount)})),t.register(this.lines.onDelete(r=>{t.line>=r.index&&t.line<r.index+r.amount&&t.dispose(),t.line>r.index&&(t.line-=r.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},wD=class extends Me{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new oe),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 o0(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new o0(!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,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Kb=2,Xb=1,Ff=class extends Me{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new oe),this.onResize=this._onResize.event,this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Kb),this.rows=Math.max(e.rawOptions.rows||0,Xb),this.buffers=this._register(new wD(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let r=this.cols!==e,n=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:r,rowsChanged:n})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let r=this.buffer,n;n=this._cachedBlankLine,(!n||n.length!==this.cols||n.getFg(0)!==e.fg||n.getBg(0)!==e.bg)&&(n=r.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;let l=r.ybase+r.scrollTop,c=r.ybase+r.scrollBottom;if(r.scrollTop===0){let u=r.lines.isFull;c===r.lines.length-1?u?r.lines.recycle().copyFrom(n):r.lines.push(n.clone()):r.lines.splice(c+1,0,n.clone()),u?this.isUserScrolling&&(r.ydisp=Math.max(r.ydisp-1,0)):(r.ybase++,this.isUserScrolling||r.ydisp++)}else{let u=c-l+1;r.lines.shiftElements(l+1,u-1,-1),r.lines.set(c,n.clone())}this.isUserScrolling||(r.ydisp=r.ybase),this._onScroll.fire(r.ydisp)}scrollLines(e,t){let r=this.buffer;if(e<0){if(r.ydisp===0)return;this.isUserScrolling=!0}else e+r.ydisp>=r.ybase&&(this.isUserScrolling=!1);let n=r.ydisp;r.ydisp=Math.max(Math.min(r.ydisp+e,r.ybase),0),n!==r.ydisp&&(t||this._onScroll.fire(r.ydisp))}};Ff=dt([de(0,ri)],Ff);var Gn={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:Bc,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},CD=["normal","bold","100","200","300","400","500","600","700","800","900"],ED=class extends Me{constructor(e){super(),this._onOptionChange=this._register(new oe),this.onOptionChange=this._onOptionChange.event;let t={...Gn};for(let r in e)if(r in t)try{let n=e[r];t[r]=this._sanitizeAndValidateOption(r,n)}catch(n){console.error(n)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(nt(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(r=>{r===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(r=>{e.indexOf(r)!==-1&&t()})}_setupOptions(){let e=r=>{if(!(r in Gn))throw new Error(`No option with key "${r}"`);return this.rawOptions[r]},t=(r,n)=>{if(!(r in Gn))throw new Error(`No option with key "${r}"`);n=this._sanitizeAndValidateOption(r,n),this.rawOptions[r]!==n&&(this.rawOptions[r]=n,this._onOptionChange.fire(r))};for(let r in this.rawOptions){let n={get:e.bind(this,r),set:t.bind(this,r)};Object.defineProperty(this.options,r,n)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Gn[e]),!xD(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Gn[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=CD.includes(t)?t:Gn[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function xD(e){return e==="block"||e==="underline"||e==="bar"}function ul(e,t=5){if(typeof e!="object")return e;let r=Array.isArray(e)?[]:{};for(let n in e)r[n]=t<=1?e[n]:e[n]&&ul(e[n],t-1);return r}var c0=Object.freeze({insertMode:!1}),u0=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),Yf=class extends Me{constructor(e,t,r){super(),this._bufferService=e,this._logService=t,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new oe),this.onData=this._onData.event,this._onUserInput=this._register(new oe),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new oe),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new oe),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=ul(c0),this.decPrivateModes=ul(u0)}reset(){this.modes=ul(c0),this.decPrivateModes=ul(u0)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let r=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&r.ybase!==r.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(n=>n.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(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};Yf=dt([de(0,ii),de(1,mb),de(2,ri)],Yf);var h0={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function Wd(e,t){let r=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(r|=64,r|=e.action):(r|=e.button&3,e.button&4&&(r|=64),e.button&8&&(r|=128),e.action===32?r|=32:e.action===0&&!t&&(r|=3)),r}var Fd=String.fromCharCode,d0={DEFAULT:e=>{let t=[Wd(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${Fd(t[0])}${Fd(t[1])}${Fd(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Wd(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${Wd(e,!0)};${e.x};${e.y}${t}`}},Kf=class extends Me{constructor(e,t,r){super(),this._bufferService=e,this._coreService=t,this._optionsService=r,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new oe),this.onProtocolChange=this._onProtocolChange.event;for(let n of Object.keys(h0))this.addProtocol(n,h0[n]);for(let n of Object.keys(d0))this.addEncoding(n,d0[n]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,r){if(e.deltaY===0||e.shiftKey||t===void 0||r===void 0)return 0;let n=t/r,l=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=n+0,Math.abs(e.deltaY)<50&&(l*=.3),this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,r){if(r){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Kf=dt([de(0,ii),de(1,tn),de(2,ri)],Kf);var Yd=[[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]],AD=[[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]],At;function kD(e,t){let r=0,n=t.length-1,l;if(e<t[0][0]||e>t[n][1])return!1;for(;n>=r;)if(l=r+n>>1,e>t[l][1])r=l+1;else if(e<t[l][0])n=l-1;else return!0;return!1}var TD=class{constructor(){if(this.version="6",!At){At=new Uint8Array(65536),At.fill(1),At[0]=0,At.fill(0,1,32),At.fill(0,127,160),At.fill(2,4352,4448),At[9001]=2,At[9002]=2,At.fill(2,11904,42192),At[12351]=1,At.fill(2,44032,55204),At.fill(2,63744,64256),At.fill(2,65040,65050),At.fill(2,65072,65136),At.fill(2,65280,65377),At.fill(2,65504,65511);for(let e=0;e<Yd.length;++e)At.fill(0,Yd[e][0],Yd[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?At[e]:kD(e,AD)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let r=this.wcwidth(e),n=r===0&&t!==0;if(n){let l=Ws.extractWidth(t);l===0?n=!1:l>r&&(r=l)}return Ws.createPropertyValue(0,r,n)}},Ws=class vc{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new oe,this.onChange=this._onChange.event;let t=new TD;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,r,n=!1){return(t&16777215)<<3|(r&3)<<1|(n?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let r=0,n=0,l=t.length;for(let c=0;c<l;++c){let u=t.charCodeAt(c);if(55296<=u&&u<=56319){if(++c>=l)return r+this.wcwidth(u);let f=t.charCodeAt(c);56320<=f&&f<=57343?u=(u-55296)*1024+f-56320+65536:r+=this.wcwidth(f)}let d=this.charProperties(u,n),_=vc.extractWidth(d);vc.extractShouldJoin(d)&&(_-=vc.extractWidth(n)),r+=_,n=d}return r}charProperties(t,r){return this._activeProvider.charProperties(t,r)}},RD=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,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function f0(e){var n;let t=(n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))==null?void 0:n.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&t&&(r.isWrapped=t[3]!==0&&t[3]!==32)}var rl=2147483647,DD=256,Zb=class Xf{constructor(t=32,r=32){if(this.maxLength=t,this.maxSubParamsLength=r,r>DD)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(r),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let r=new Xf;if(!t.length)return r;for(let n=Array.isArray(t[0])?1:0;n<t.length;++n){let l=t[n];if(Array.isArray(l))for(let c=0;c<l.length;++c)r.addSubParam(l[c]);else r.addParam(l)}return r}clone(){let t=new Xf(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let t=[];for(let r=0;r<this.length;++r){t.push(this.params[r]);let n=this._subParamsIdx[r]>>8,l=this._subParamsIdx[r]&255;l-n>0&&t.push(Array.prototype.slice.call(this._subParams,n,l))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>rl?rl:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>rl?rl:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let r=this._subParamsIdx[t]>>8,n=this._subParamsIdx[t]&255;return n-r>0?this._subParams.subarray(r,n):null}getSubParamsAll(){let t={};for(let r=0;r<this.length;++r){let n=this._subParamsIdx[r]>>8,l=this._subParamsIdx[r]&255;l-n>0&&(t[r]=this._subParams.slice(n,l))}return t}addDigit(t){let r;if(this._rejectDigits||!(r=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,l=n[r-1];n[r-1]=~l?Math.min(l*10+t,rl):t}},sl=[],LD=class{constructor(){this._state=0,this._active=sl,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,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=sl}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=sl,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||sl,!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,t,r){if(!this._active.length)this._handlerFb(this._id,"PUT",Xc(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}start(){this.reset(),this._state=1}put(e,t,r){if(this._state!==3){if(this._state===1)for(;t<r;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&r-t>0&&this._put(e,t,r)}}end(e,t=!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 r=!1,n=this._active.length-1,l=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,l=this._stack.fallThrough,this._stack.paused=!1),!l&&r===!1){for(;n>=0&&(r=this._active[n].end(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].end(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=sl,this._id=-1,this._state=0}}},Ei=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=Xc(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(r=>(this._data="",this._hitLimit=!1,r));return this._data="",this._hitLimit=!1,t}},nl=[],OD=class{constructor(){this._handlers=Object.create(null),this._active=nl,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=nl}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let r=this._handlers[e];return r.push(t),{dispose:()=>{let n=r.indexOf(t);n!==-1&&r.splice(n,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=nl,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||nl,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(t)}put(e,t,r){if(!this._active.length)this._handlerFb(this._ident,"PUT",Xc(e,t,r));else for(let n=this._active.length-1;n>=0;n--)this._active[n].put(e,t,r)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let r=!1,n=this._active.length-1,l=!1;if(this._stack.paused&&(n=this._stack.loopPosition-1,r=t,l=this._stack.fallThrough,this._stack.paused=!1),!l&&r===!1){for(;n>=0&&(r=this._active[n].unhook(e),r!==!0);n--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!1,r;n--}for(;n>=0;n--)if(r=this._active[n].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=n,this._stack.fallThrough=!0,r}this._active=nl,this._ident=0}},hl=new Zb;hl.addParam(0);var _0=class{constructor(e){this._handler=e,this._data="",this._params=hl,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():hl,this._data="",this._hitLimit=!1}put(e,t,r){this._hitLimit||(this._data+=Xc(e,t,r),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(r=>(this._params=hl,this._data="",this._hitLimit=!1,r));return this._params=hl,this._data="",this._hitLimit=!1,t}},MD=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,r,n){this.table[t<<8|e]=r<<4|n}addMany(e,t,r,n){for(let l=0;l<e.length;l++)this.table[t<<8|e[l]]=r<<4|n}},Hi=160,ND=(function(){let e=new MD(4095),t=Array.apply(null,Array(256)).map((d,_)=>_),r=(d,_)=>t.slice(d,_),n=r(32,127),l=r(0,24);l.push(25),l.push.apply(l,r(28,32));let c=r(0,14),u;e.setDefault(1,0),e.addMany(n,0,2,0);for(u in c)e.addMany([24,26,153,154],u,3,0),e.addMany(r(128,144),u,3,0),e.addMany(r(144,152),u,3,0),e.add(156,u,0,0),e.add(27,u,11,1),e.add(157,u,4,8),e.addMany([152,158,159],u,0,7),e.add(155,u,11,3),e.add(144,u,11,9);return e.addMany(l,0,3,0),e.addMany(l,1,3,1),e.add(127,1,0,1),e.addMany(l,8,0,8),e.addMany(l,3,3,3),e.add(127,3,0,3),e.addMany(l,4,3,4),e.add(127,4,0,4),e.addMany(l,6,3,6),e.addMany(l,5,3,5),e.add(127,5,0,5),e.addMany(l,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(n,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(r(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(n,7,0,7),e.addMany(l,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(r(64,127),3,7,0),e.addMany(r(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(r(48,60),4,8,4),e.addMany(r(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(r(32,64),6,0,6),e.add(127,6,0,6),e.addMany(r(64,127),6,0,0),e.addMany(r(32,48),3,9,5),e.addMany(r(32,48),5,9,5),e.addMany(r(48,64),5,0,6),e.addMany(r(64,127),5,7,0),e.addMany(r(32,48),4,9,5),e.addMany(r(32,48),1,9,2),e.addMany(r(32,48),2,9,2),e.addMany(r(48,127),2,10,0),e.addMany(r(48,80),1,10,0),e.addMany(r(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(r(96,127),1,10,0),e.add(80,1,11,9),e.addMany(l,9,0,9),e.add(127,9,0,9),e.addMany(r(28,32),9,0,9),e.addMany(r(32,48),9,9,12),e.addMany(r(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(l,11,0,11),e.addMany(r(32,128),11,0,11),e.addMany(r(28,32),11,0,11),e.addMany(l,10,0,10),e.add(127,10,0,10),e.addMany(r(28,32),10,0,10),e.addMany(r(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(r(32,48),10,9,12),e.addMany(l,12,0,12),e.add(127,12,0,12),e.addMany(r(28,32),12,0,12),e.addMany(r(32,48),12,9,12),e.addMany(r(48,64),12,0,11),e.addMany(r(64,127),12,12,13),e.addMany(r(64,127),10,12,13),e.addMany(r(64,127),9,12,13),e.addMany(l,13,13,13),e.addMany(n,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Hi,0,2,0),e.add(Hi,8,5,8),e.add(Hi,6,0,6),e.add(Hi,11,0,11),e.add(Hi,13,13,13),e})(),BD=class extends Me{constructor(e=ND){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 Zb,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,r,n)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,r)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(nt(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new LD),this._dcsParser=this._register(new OD),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let r=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(r=e.prefix.charCodeAt(0),r&&60>r||r>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 l=0;l<e.intermediates.length;++l){let c=e.intermediates.charCodeAt(l);if(32>c||c>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");r<<=8,r|=c}}if(e.final.length!==1)throw new Error("final must be a single byte");let n=e.final.charCodeAt(0);if(t[0]>n||n>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return r<<=8,r|=n,r}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let r=this._identifier(e,[48,126]);this._escHandlers[r]===void 0&&(this._escHandlers[r]=[]);let n=this._escHandlers[r];return n.push(t),{dispose:()=>{let l=n.indexOf(t);l!==-1&&n.splice(l,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,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let r=this._identifier(e);this._csiHandlers[r]===void 0&&(this._csiHandlers[r]=[]);let n=this._csiHandlers[r];return n.push(t),{dispose:()=>{let l=n.indexOf(t);l!==-1&&n.splice(l,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}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,t,r,n,l){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=r,this._parseStack.transition=n,this._parseStack.chunkPos=l}parse(e,t,r){let n=0,l=0,c=0,u;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,c=this._parseStack.chunkPos+1;else{if(r===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let d=this._parseStack.handlers,_=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(r===!1&&_>-1){for(;_>=0&&(u=d[_](this._params),u!==!0);_--)if(u instanceof Promise)return this._parseStack.handlerPos=_,u}this._parseStack.handlers=[];break;case 4:if(r===!1&&_>-1){for(;_>=0&&(u=d[_](),u!==!0);_--)if(u instanceof Promise)return this._parseStack.handlerPos=_,u}this._parseStack.handlers=[];break;case 6:if(n=e[this._parseStack.chunkPos],u=this._dcsParser.unhook(n!==24&&n!==26,r),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(n=e[this._parseStack.chunkPos],u=this._oscParser.end(n!==24&&n!==26,r),u)return u;n===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,c=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let d=c;d<t;++d){switch(n=e[d],l=this._transitions.table[this.currentState<<8|(n<160?n:Hi)],l>>4){case 2:for(let y=d+1;;++y){if(y>=t||(n=e[y])<32||n>126&&n<Hi){this._printHandler(e,d,y),d=y-1;break}if(++y>=t||(n=e[y])<32||n>126&&n<Hi){this._printHandler(e,d,y),d=y-1;break}if(++y>=t||(n=e[y])<32||n>126&&n<Hi){this._printHandler(e,d,y),d=y-1;break}if(++y>=t||(n=e[y])<32||n>126&&n<Hi){this._printHandler(e,d,y),d=y-1;break}}break;case 3:this._executeHandlers[n]?this._executeHandlers[n]():this._executeHandlerFb(n),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:d,code:n,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let _=this._csiHandlers[this._collect<<8|n],f=_?_.length-1:-1;for(;f>=0&&(u=_[f](this._params),u!==!0);f--)if(u instanceof Promise)return this._preserveStack(3,_,f,l,d),u;f<0&&this._csiHandlerFb(this._collect<<8|n,this._params),this.precedingJoinState=0;break;case 8:do switch(n){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(n-48)}while(++d<t&&(n=e[d])>47&&n<60);d--;break;case 9:this._collect<<=8,this._collect|=n;break;case 10:let v=this._escHandlers[this._collect<<8|n],m=v?v.length-1:-1;for(;m>=0&&(u=v[m](),u!==!0);m--)if(u instanceof Promise)return this._preserveStack(4,v,m,l,d),u;m<0&&this._escHandlerFb(this._collect<<8|n),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|n,this._params);break;case 13:for(let y=d+1;;++y)if(y>=t||(n=e[y])===24||n===26||n===27||n>127&&n<Hi){this._dcsParser.put(e,d,y),d=y-1;break}break;case 14:if(u=this._dcsParser.unhook(n!==24&&n!==26),u)return this._preserveStack(6,[],0,l,d),u;n===27&&(l|=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 y=d+1;;y++)if(y>=t||(n=e[y])<32||n>127&&n<Hi){this._oscParser.put(e,d,y),d=y-1;break}break;case 6:if(u=this._oscParser.end(n!==24&&n!==26),u)return this._preserveStack(5,[],0,l,d),u;n===27&&(l|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break}this.currentState=l&15}}},zD=/^([\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})$/,PD=/^[\da-f]+$/;function p0(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf("rgb:")===0){t=t.slice(4);let r=zD.exec(t);if(r){let n=r[1]?15:r[4]?255:r[7]?4095:65535;return[Math.round(parseInt(r[1]||r[4]||r[7]||r[10],16)/n*255),Math.round(parseInt(r[2]||r[5]||r[8]||r[11],16)/n*255),Math.round(parseInt(r[3]||r[6]||r[9]||r[12],16)/n*255)]}}else if(t.indexOf("#")===0&&(t=t.slice(1),PD.exec(t)&&[3,6,9,12].includes(t.length))){let r=t.length/3,n=[0,0,0];for(let l=0;l<3;++l){let c=parseInt(t.slice(r*l,r*l+r),16);n[l]=r===1?c<<4:r===2?c:r===3?c>>4:c>>8}return n}}function Kd(e,t){let r=e.toString(16),n=r.length<2?"0"+r:r;switch(t){case 4:return r[0];case 8:return n;case 12:return(n+n).slice(0,3);default:return n+n}}function ID(e,t=16){let[r,n,l]=e;return`rgb:${Kd(r,t)}/${Kd(n,t)}/${Kd(l,t)}`}var HD={"(":0,")":1,"*":2,"+":3,"-":1,".":2},cs=131072,m0=10;function g0(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var v0=5e3,y0=0,UD=class extends Me{constructor(e,t,r,n,l,c,u,d,_=new BD){super(),this._bufferService=e,this._charsetService=t,this._coreService=r,this._logService=n,this._optionsService=l,this._oscLinkService=c,this._coreMouseService=u,this._unicodeService=d,this._parser=_,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new nT,this._utf8Decoder=new aT,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=wt.clone(),this._eraseAttrDataInternal=wt.clone(),this._onRequestBell=this._register(new oe),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new oe),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new oe),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new oe),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new oe),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new oe),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new oe),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new oe),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new oe),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new oe),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new oe),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new oe),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new oe),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 Zf(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(f=>this._activeBuffer=f.activeBuffer)),this._parser.setCsiHandlerFallback((f,v)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(f),params:v.toArray()})}),this._parser.setEscHandlerFallback(f=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(f)})}),this._parser.setExecuteHandlerFallback(f=>{this._logService.debug("Unknown EXECUTE code: ",{code:f})}),this._parser.setOscHandlerFallback((f,v,m)=>{this._logService.debug("Unknown OSC code: ",{identifier:f,action:v,data:m})}),this._parser.setDcsHandlerFallback((f,v,m)=>{v==="HOOK"&&(m=m.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(f),action:v,payload:m})}),this._parser.setPrintHandler((f,v,m)=>this.print(f,v,m)),this._parser.registerCsiHandler({final:"@"},f=>this.insertChars(f)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},f=>this.scrollLeft(f)),this._parser.registerCsiHandler({final:"A"},f=>this.cursorUp(f)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},f=>this.scrollRight(f)),this._parser.registerCsiHandler({final:"B"},f=>this.cursorDown(f)),this._parser.registerCsiHandler({final:"C"},f=>this.cursorForward(f)),this._parser.registerCsiHandler({final:"D"},f=>this.cursorBackward(f)),this._parser.registerCsiHandler({final:"E"},f=>this.cursorNextLine(f)),this._parser.registerCsiHandler({final:"F"},f=>this.cursorPrecedingLine(f)),this._parser.registerCsiHandler({final:"G"},f=>this.cursorCharAbsolute(f)),this._parser.registerCsiHandler({final:"H"},f=>this.cursorPosition(f)),this._parser.registerCsiHandler({final:"I"},f=>this.cursorForwardTab(f)),this._parser.registerCsiHandler({final:"J"},f=>this.eraseInDisplay(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},f=>this.eraseInDisplay(f,!0)),this._parser.registerCsiHandler({final:"K"},f=>this.eraseInLine(f,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},f=>this.eraseInLine(f,!0)),this._parser.registerCsiHandler({final:"L"},f=>this.insertLines(f)),this._parser.registerCsiHandler({final:"M"},f=>this.deleteLines(f)),this._parser.registerCsiHandler({final:"P"},f=>this.deleteChars(f)),this._parser.registerCsiHandler({final:"S"},f=>this.scrollUp(f)),this._parser.registerCsiHandler({final:"T"},f=>this.scrollDown(f)),this._parser.registerCsiHandler({final:"X"},f=>this.eraseChars(f)),this._parser.registerCsiHandler({final:"Z"},f=>this.cursorBackwardTab(f)),this._parser.registerCsiHandler({final:"`"},f=>this.charPosAbsolute(f)),this._parser.registerCsiHandler({final:"a"},f=>this.hPositionRelative(f)),this._parser.registerCsiHandler({final:"b"},f=>this.repeatPrecedingCharacter(f)),this._parser.registerCsiHandler({final:"c"},f=>this.sendDeviceAttributesPrimary(f)),this._parser.registerCsiHandler({prefix:">",final:"c"},f=>this.sendDeviceAttributesSecondary(f)),this._parser.registerCsiHandler({final:"d"},f=>this.linePosAbsolute(f)),this._parser.registerCsiHandler({final:"e"},f=>this.vPositionRelative(f)),this._parser.registerCsiHandler({final:"f"},f=>this.hVPosition(f)),this._parser.registerCsiHandler({final:"g"},f=>this.tabClear(f)),this._parser.registerCsiHandler({final:"h"},f=>this.setMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"h"},f=>this.setModePrivate(f)),this._parser.registerCsiHandler({final:"l"},f=>this.resetMode(f)),this._parser.registerCsiHandler({prefix:"?",final:"l"},f=>this.resetModePrivate(f)),this._parser.registerCsiHandler({final:"m"},f=>this.charAttributes(f)),this._parser.registerCsiHandler({final:"n"},f=>this.deviceStatus(f)),this._parser.registerCsiHandler({prefix:"?",final:"n"},f=>this.deviceStatusPrivate(f)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},f=>this.softReset(f)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},f=>this.setCursorStyle(f)),this._parser.registerCsiHandler({final:"r"},f=>this.setScrollRegion(f)),this._parser.registerCsiHandler({final:"s"},f=>this.saveCursor(f)),this._parser.registerCsiHandler({final:"t"},f=>this.windowOptions(f)),this._parser.registerCsiHandler({final:"u"},f=>this.restoreCursor(f)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},f=>this.insertColumns(f)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},f=>this.deleteColumns(f)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},f=>this.selectProtected(f)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},f=>this.requestMode(f,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},f=>this.requestMode(f,!1)),this._parser.setExecuteHandler(Q.BEL,()=>this.bell()),this._parser.setExecuteHandler(Q.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(Q.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(Q.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(Q.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(Q.BS,()=>this.backspace()),this._parser.setExecuteHandler(Q.HT,()=>this.tab()),this._parser.setExecuteHandler(Q.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(Q.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(mc.IND,()=>this.index()),this._parser.setExecuteHandler(mc.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(mc.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Ei(f=>(this.setTitle(f),this.setIconName(f),!0))),this._parser.registerOscHandler(1,new Ei(f=>this.setIconName(f))),this._parser.registerOscHandler(2,new Ei(f=>this.setTitle(f))),this._parser.registerOscHandler(4,new Ei(f=>this.setOrReportIndexedColor(f))),this._parser.registerOscHandler(8,new Ei(f=>this.setHyperlink(f))),this._parser.registerOscHandler(10,new Ei(f=>this.setOrReportFgColor(f))),this._parser.registerOscHandler(11,new Ei(f=>this.setOrReportBgColor(f))),this._parser.registerOscHandler(12,new Ei(f=>this.setOrReportCursorColor(f))),this._parser.registerOscHandler(104,new Ei(f=>this.restoreIndexedColor(f))),this._parser.registerOscHandler(110,new Ei(f=>this.restoreFgColor(f))),this._parser.registerOscHandler(111,new Ei(f=>this.restoreBgColor(f))),this._parser.registerOscHandler(112,new Ei(f=>this.restoreCursorColor(f))),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 f in Rt)this._parser.registerEscHandler({intermediates:"(",final:f},()=>this.selectCharset("("+f)),this._parser.registerEscHandler({intermediates:")",final:f},()=>this.selectCharset(")"+f)),this._parser.registerEscHandler({intermediates:"*",final:f},()=>this.selectCharset("*"+f)),this._parser.registerEscHandler({intermediates:"+",final:f},()=>this.selectCharset("+"+f)),this._parser.registerEscHandler({intermediates:"-",final:f},()=>this.selectCharset("-"+f)),this._parser.registerEscHandler({intermediates:".",final:f},()=>this.selectCharset("."+f)),this._parser.registerEscHandler({intermediates:"/",final:f},()=>this.selectCharset("/"+f));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(f=>(this._logService.error("Parsing error: ",f),f)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new _0((f,v)=>this.requestStatusString(f,v)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,r,n){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=r,this._parseStack.position=n}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,r)=>setTimeout(()=>r("#SLOW_TIMEOUT"),v0))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${v0} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let r,n=this._activeBuffer.x,l=this._activeBuffer.y,c=0,u=this._parseStack.paused;if(u){if(r=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(r),r;n=this._parseStack.cursorStartX,l=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>cs&&(c=this._parseStack.position+cs)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,f=>String.fromCharCode(f)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(f=>f.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<cs&&(this._parseBuffer=new Uint32Array(Math.min(e.length,cs))),u||this._dirtyRowTracker.clearRange(),e.length>cs)for(let f=c;f<e.length;f+=cs){let v=f+cs<e.length?f+cs:e.length,m=typeof e=="string"?this._stringDecoder.decode(e.substring(f,v),this._parseBuffer):this._utf8Decoder.decode(e.subarray(f,v),this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,m))return this._preserveStack(n,l,m,f),this._logSlowResolvingAsync(r),r}else if(!u){let f=typeof e=="string"?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(r=this._parser.parse(this._parseBuffer,f))return this._preserveStack(n,l,f,0),this._logSlowResolvingAsync(r),r}(this._activeBuffer.x!==n||this._activeBuffer.y!==l)&&this._onCursorMove.fire();let d=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),_=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);_<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(_,this._bufferService.rows-1),end:Math.min(d,this._bufferService.rows-1)})}print(e,t,r){let n,l,c=this._charsetService.charset,u=this._optionsService.rawOptions.screenReaderMode,d=this._bufferService.cols,_=this._coreService.decPrivateModes.wraparound,f=this._coreService.modes.insertMode,v=this._curAttrData,m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&r-t>0&&m.getWidth(this._activeBuffer.x-1)===2&&m.setCellFromCodepoint(this._activeBuffer.x-1,0,1,v);let y=this._parser.precedingJoinState;for(let S=t;S<r;++S){if(n=e[S],n<127&&c){let O=c[String.fromCharCode(n)];O&&(n=O.charCodeAt(0))}let b=this._unicodeService.charProperties(n,y);l=Ws.extractWidth(b);let x=Ws.extractShouldJoin(b),T=x?Ws.extractWidth(y):0;if(y=b,u&&this._onA11yChar.fire(fs(n)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+l-T>d){if(_){let O=m,H=this._activeBuffer.x-T;for(this._activeBuffer.x=T,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),m=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),T>0&&m instanceof cl&&m.copyCellsFrom(O,H,0,T,!1);H<d;)O.setCellFromCodepoint(H++,0,1,v)}else if(this._activeBuffer.x=d-1,l===2)continue}if(x&&this._activeBuffer.x){let O=m.getWidth(this._activeBuffer.x-1)?1:2;m.addCodepointToCell(this._activeBuffer.x-O,n,l);for(let H=l-T;--H>=0;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,v);continue}if(f&&(m.insertCells(this._activeBuffer.x,l-T,this._activeBuffer.getNullCell(v)),m.getWidth(d-1)===2&&m.setCellFromCodepoint(d-1,0,1,v)),m.setCellFromCodepoint(this._activeBuffer.x++,n,l,v),l>0)for(;--l;)m.setCellFromCodepoint(this._activeBuffer.x++,0,0,v)}this._parser.precedingJoinState=y,this._activeBuffer.x<d&&r-t>0&&m.getWidth(this._activeBuffer.x)===0&&!m.hasContent(this._activeBuffer.x)&&m.setCellFromCodepoint(this._activeBuffer.x,0,1,v),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,r=>g0(r.params[0],this._optionsService.rawOptions.windowOptions)?t(r):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new _0(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Ei(t))}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 e;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&&((e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&e.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);t.hasWidth(this._activeBuffer.x)&&!t.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,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(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,r,n=!1,l=!1){let c=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);c.replaceCells(t,r,this._activeBuffer.getNullCell(this._eraseAttrData()),l),n&&(c.isWrapped=!1)}_resetBufferLine(e,t=!1){let r=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);r&&(r.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),r.isWrapped=!1)}eraseInDisplay(e,t=!1){var n;this._restrictCursor(this._bufferService.cols);let r;switch(e.params[0]){case 0:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);r<this._bufferService.rows;r++)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(r);break;case 1:for(r=this._activeBuffer.y,this._dirtyRowTracker.markDirty(r),this._eraseInBufferLine(r,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(r+1).isWrapped=!1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(r=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,r-1);r--&&!((n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r))!=null&&n.getTrimmedLength()););for(;r>=0;r--)this._bufferService.scroll(this._eraseAttrData())}else{for(r=this._bufferService.rows,this._dirtyRowTracker.markDirty(r-1);r--;)this._resetBufferLine(r,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let l=this._activeBuffer.lines.length-this._bufferService.rows;l>0&&(this._activeBuffer.lines.trimStart(l),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-l,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-l,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=this._activeBuffer.ybase+this._activeBuffer.y,n=this._bufferService.rows-1-this._activeBuffer.scrollBottom,l=this._bufferService.rows-1+this._activeBuffer.ybase-n+1;for(;t--;)this._activeBuffer.lines.splice(l-1,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let r=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;t--;)this._activeBuffer.lines.splice(r,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(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)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(e){let t=e.params[0]||1;for(;t--;)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(wt));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let r=this._activeBuffer.scrollTop;r<=this._activeBuffer.scrollBottom;++r){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+r);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let r=e.params[0]||1,n=Ws.extractWidth(t),l=this._activeBuffer.x-n,c=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(l),u=new Uint32Array(c.length*r),d=0;for(let f=0;f<c.length;){let v=c.codePointAt(f)||0;u[d++]=v,f+=v>65535?2:1}let _=d;for(let f=1;f<r;++f)u.copyWithin(_,0,d),_+=d;return this.print(u,0,_),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(Q.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(Q.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(Q.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(Q.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(Q.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0;break}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,Vs),this._charsetService.setgCharset(1,Vs),this._charsetService.setgCharset(2,Vs),this._charsetService.setgCharset(3,Vs);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(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1;break}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){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(),e.params[t]===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(e,t){(x=>(x[x.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",x[x.SET=1]="SET",x[x.RESET=2]="RESET",x[x.PERMANENTLY_SET=3]="PERMANENTLY_SET",x[x.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(void 0||(r={}));let n=this._coreService.decPrivateModes,{activeProtocol:l,activeEncoding:c}=this._coreMouseService,u=this._coreService,{buffers:d,cols:_}=this._bufferService,{active:f,alt:v}=d,m=this._optionsService.rawOptions,y=(x,T)=>(u.triggerDataEvent(`${Q.ESC}[${t?"":"?"}${x};${T}$y`),!0),S=x=>x?1:2,b=e.params[0];return t?b===2?y(b,4):b===4?y(b,S(u.modes.insertMode)):b===12?y(b,3):b===20?y(b,S(m.convertEol)):y(b,0):b===1?y(b,S(n.applicationCursorKeys)):b===3?y(b,m.windowOptions.setWinLines?_===80?2:_===132?1:0:0):b===6?y(b,S(n.origin)):b===7?y(b,S(n.wraparound)):b===8?y(b,3):b===9?y(b,S(l==="X10")):b===12?y(b,S(m.cursorBlink)):b===25?y(b,S(!u.isCursorHidden)):b===45?y(b,S(n.reverseWraparound)):b===66?y(b,S(n.applicationKeypad)):b===67?y(b,4):b===1e3?y(b,S(l==="VT200")):b===1002?y(b,S(l==="DRAG")):b===1003?y(b,S(l==="ANY")):b===1004?y(b,S(n.sendFocus)):b===1005?y(b,4):b===1006?y(b,S(c==="SGR")):b===1015?y(b,4):b===1016?y(b,S(c==="SGR_PIXELS")):b===1048?y(b,1):b===47||b===1047||b===1049?y(b,S(f===v)):b===2004?y(b,S(n.bracketedPasteMode)):b===2026?y(b,S(n.synchronizedOutput)):y(b,0)}_updateAttrColor(e,t,r,n,l){return t===2?(e|=50331648,e&=-16777216,e|=Tl.fromColorRGB([r,n,l])):t===5&&(e&=-50331904,e|=33554432|r&255),e}_extractColor(e,t,r){let n=[0,0,-1,0,0,0],l=0,c=0;do{if(n[c+l]=e.params[t+c],e.hasSubParams(t+c)){let u=e.getSubParams(t+c),d=0;do n[1]===5&&(l=1),n[c+d+1+l]=u[d];while(++d<u.length&&d+c+1+l<n.length);break}if(n[1]===5&&c+l>=2||n[1]===2&&c+l>=5)break;n[1]&&(l=1)}while(++c+t<e.length&&c+l<n.length);for(let u=2;u<n.length;++u)n[u]===-1&&(n[u]=0);switch(n[0]){case 38:r.fg=this._updateAttrColor(r.fg,n[1],n[3],n[4],n[5]);break;case 48:r.bg=this._updateAttrColor(r.bg,n[1],n[3],n[4],n[5]);break;case 58:r.extended=r.extended.clone(),r.extended.underlineColor=this._updateAttrColor(r.extended.underlineColor,n[1],n[3],n[4],n[5])}return c}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=wt.fg,e.bg=wt.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,r,n=this._curAttrData;for(let l=0;l<t;l++)r=e.params[l],r>=30&&r<=37?(n.fg&=-50331904,n.fg|=16777216|r-30):r>=40&&r<=47?(n.bg&=-50331904,n.bg|=16777216|r-40):r>=90&&r<=97?(n.fg&=-50331904,n.fg|=16777216|r-90|8):r>=100&&r<=107?(n.bg&=-50331904,n.bg|=16777216|r-100|8):r===0?this._processSGR0(n):r===1?n.fg|=134217728:r===3?n.bg|=67108864:r===4?(n.fg|=268435456,this._processUnderline(e.hasSubParams(l)?e.getSubParams(l)[0]:1,n)):r===5?n.fg|=536870912:r===7?n.fg|=67108864:r===8?n.fg|=1073741824:r===9?n.fg|=2147483648:r===2?n.bg|=134217728:r===21?this._processUnderline(2,n):r===22?(n.fg&=-134217729,n.bg&=-134217729):r===23?n.bg&=-67108865:r===24?(n.fg&=-268435457,this._processUnderline(0,n)):r===25?n.fg&=-536870913:r===27?n.fg&=-67108865:r===28?n.fg&=-1073741825:r===29?n.fg&=2147483647:r===39?(n.fg&=-67108864,n.fg|=wt.fg&16777215):r===49?(n.bg&=-67108864,n.bg|=wt.bg&16777215):r===38||r===48||r===58?l+=this._extractColor(e,l,n):r===53?n.bg|=1073741824:r===55?n.bg&=-1073741825:r===59?(n.extended=n.extended.clone(),n.extended.underlineColor=-1,n.updateExtended()):r===100?(n.fg&=-67108864,n.fg|=wt.fg&16777215,n.bg&=-67108864,n.bg|=wt.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",r);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${Q.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Q.ESC}[${t};${r}R`);break}return!0}deviceStatusPrivate(e){switch(e.params[0]){case 6:let t=this._activeBuffer.y+1,r=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${Q.ESC}[?${t};${r}R`);break}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=wt.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(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){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 r=t%2===1;this._coreService.decPrivateModes.cursorBlink=r}return!0}setScrollRegion(e){let t=e.params[0]||1,r;return(e.length<2||(r=e.params[1])>this._bufferService.rows||r===0)&&(r=this._bufferService.rows),r>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=r-1,this._setCursor(0,0)),!0}windowOptions(e){if(!g0(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${Q.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>m0&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>m0&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){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(e){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(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],r=e.split(";");for(;r.length>1;){let n=r.shift(),l=r.shift();if(/^\d+$/.exec(n)){let c=parseInt(n);if(S0(c))if(l==="?")t.push({type:0,index:c});else{let u=p0(l);u&&t.push({type:1,index:c,color:u})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let r=e.slice(0,t).trim(),n=e.slice(t+1);return n?this._createHyperlink(r,n):r.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let r=e.split(":"),n,l=r.findIndex(c=>c.startsWith("id="));return l!==-1&&(n=r[l].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:n,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let r=e.split(";");for(let n=0;n<r.length&&!(t>=this._specialColors.length);++n,++t)if(r[n]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let l=p0(r[n]);l&&this._onColor.fire([{type:1,index:this._specialColors[t],color:l}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],r=e.split(";");for(let n=0;n<r.length;++n)if(/^\d+$/.exec(r[n])){let l=parseInt(r[n]);S0(l)&&t.push({type:2,index:l})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){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,Vs),!0}selectCharset(e){return e.length!==2?(this.selectDefaultCharset(),!0):(e[0]==="/"||this._charsetService.setgCharset(HD[e[0]],Rt[e[1]]||Vs),!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 e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,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=wt.clone(),this._eraseAttrDataInternal=wt.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new $i;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let r=this._activeBuffer.ybase+this._activeBuffer.y+t,n=this._activeBuffer.lines.get(r);n&&(n.fill(e),n.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let r=u=>(this._coreService.triggerDataEvent(`${Q.ESC}${u}${Q.ESC}\\`),!0),n=this._bufferService.buffer,l=this._optionsService.rawOptions;return r(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${n.scrollTop+1};${n.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[l.cursorStyle]-(l.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Zf=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(y0=e,e=t,t=y0),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Zf=dt([de(0,ii)],Zf);function S0(e){return 0<=e&&e<256}var jD=5e7,b0=12,VD=50,$D=class extends Me{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 oe),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){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 r;for(;r=this._writeBuffer.shift();){this._action(r);let n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>jD)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(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let r=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let n=this._writeBuffer[this._bufferOffset],l=this._action(n,t);if(l){let u=d=>performance.now()-r>=b0?setTimeout(()=>this._innerWrite(0,d)):this._innerWrite(r,d);l.catch(d=>(queueMicrotask(()=>{throw d}),Promise.resolve(!1))).then(u);return}let c=this._callbacks[this._bufferOffset];if(c&&c(),this._bufferOffset++,this._pendingData-=n.length,performance.now()-r>=b0)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>VD&&(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()}},Qf=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let d=t.addMarker(t.ybase+t.y),_={data:e,id:this._nextId++,lines:[d]};return d.onDispose(()=>this._removeMarkerFromLink(_,d)),this._dataByLinkId.set(_.id,_),_.id}let r=e,n=this._getEntryIdKey(r),l=this._entriesWithId.get(n);if(l)return this.addLineToLink(l.id,t.ybase+t.y),l.id;let c=t.addMarker(t.ybase+t.y),u={id:this._nextId++,key:this._getEntryIdKey(r),data:r,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(u,c)),this._entriesWithId.set(u.key,u),this._dataByLinkId.set(u.id,u),u.id}addLineToLink(e,t){let r=this._dataByLinkId.get(e);if(r&&r.lines.every(n=>n.line!==t)){let n=this._bufferService.buffer.addMarker(t);r.lines.push(n),n.onDispose(()=>this._removeMarkerFromLink(r,n))}}getLinkData(e){var t;return(t=this._dataByLinkId.get(e))==null?void 0:t.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let r=e.lines.indexOf(t);r!==-1&&(e.lines.splice(r,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Qf=dt([de(0,ii)],Qf);var w0=!1,GD=class extends Me{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Zn),this._onBinary=this._register(new oe),this.onBinary=this._onBinary.event,this._onData=this._register(new oe),this.onData=this._onData.event,this._onLineFeed=this._register(new oe),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new oe),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new oe),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new oe),this._instantiationService=new _D,this.optionsService=this._register(new ED(e)),this._instantiationService.setService(ri,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Ff)),this._instantiationService.setService(ii,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Wf)),this._instantiationService.setService(mb,this._logService),this.coreService=this._register(this._instantiationService.createInstance(Yf)),this._instantiationService.setService(tn,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Kf)),this._instantiationService.setService(pb,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Ws)),this._instantiationService.setService(uT,this.unicodeService),this._charsetService=this._instantiationService.createInstance(RD),this._instantiationService.setService(cT,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Qf),this._instantiationService.setService(gb,this._oscLinkService),this._inputHandler=this._register(new UD(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(Wt.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(Wt.forward(this._bufferService.onResize,this._onResize)),this._register(Wt.forward(this.coreService.onData,this._onData)),this._register(Wt.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 $D((t,r)=>this._inputHandler.parse(t,r))),this._register(Wt.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new oe),this._onScroll.event(e=>{var t;(t=this._onScrollApi)==null||t.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 t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!w0&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w0=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,Kb),t=Math.max(t,Xb),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.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(f0.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(f0(this._bufferService),!1))),this._windowsWrappingHeuristics.value=nt(()=>{for(let t of e)t.dispose()})}}},qD={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 WD(e,t,r,n){var u;let l={type:0,cancel:!1,key:void 0},c=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?l.key=Q.ESC+"OA":l.key=Q.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?l.key=Q.ESC+"OD":l.key=Q.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?l.key=Q.ESC+"OC":l.key=Q.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?l.key=Q.ESC+"OB":l.key=Q.ESC+"[B");break;case 8:l.key=e.ctrlKey?"\b":Q.DEL,e.altKey&&(l.key=Q.ESC+l.key);break;case 9:if(e.shiftKey){l.key=Q.ESC+"[Z";break}l.key=Q.HT,l.cancel=!0;break;case 13:l.key=e.altKey?Q.ESC+Q.CR:Q.CR,l.cancel=!0;break;case 27:l.key=Q.ESC,e.altKey&&(l.key=Q.ESC+Q.ESC),l.cancel=!0;break;case 37:if(e.metaKey)break;c?l.key=Q.ESC+"[1;"+(c+1)+"D":t?l.key=Q.ESC+"OD":l.key=Q.ESC+"[D";break;case 39:if(e.metaKey)break;c?l.key=Q.ESC+"[1;"+(c+1)+"C":t?l.key=Q.ESC+"OC":l.key=Q.ESC+"[C";break;case 38:if(e.metaKey)break;c?l.key=Q.ESC+"[1;"+(c+1)+"A":t?l.key=Q.ESC+"OA":l.key=Q.ESC+"[A";break;case 40:if(e.metaKey)break;c?l.key=Q.ESC+"[1;"+(c+1)+"B":t?l.key=Q.ESC+"OB":l.key=Q.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(l.key=Q.ESC+"[2~");break;case 46:c?l.key=Q.ESC+"[3;"+(c+1)+"~":l.key=Q.ESC+"[3~";break;case 36:c?l.key=Q.ESC+"[1;"+(c+1)+"H":t?l.key=Q.ESC+"OH":l.key=Q.ESC+"[H";break;case 35:c?l.key=Q.ESC+"[1;"+(c+1)+"F":t?l.key=Q.ESC+"OF":l.key=Q.ESC+"[F";break;case 33:e.shiftKey?l.type=2:e.ctrlKey?l.key=Q.ESC+"[5;"+(c+1)+"~":l.key=Q.ESC+"[5~";break;case 34:e.shiftKey?l.type=3:e.ctrlKey?l.key=Q.ESC+"[6;"+(c+1)+"~":l.key=Q.ESC+"[6~";break;case 112:c?l.key=Q.ESC+"[1;"+(c+1)+"P":l.key=Q.ESC+"OP";break;case 113:c?l.key=Q.ESC+"[1;"+(c+1)+"Q":l.key=Q.ESC+"OQ";break;case 114:c?l.key=Q.ESC+"[1;"+(c+1)+"R":l.key=Q.ESC+"OR";break;case 115:c?l.key=Q.ESC+"[1;"+(c+1)+"S":l.key=Q.ESC+"OS";break;case 116:c?l.key=Q.ESC+"[15;"+(c+1)+"~":l.key=Q.ESC+"[15~";break;case 117:c?l.key=Q.ESC+"[17;"+(c+1)+"~":l.key=Q.ESC+"[17~";break;case 118:c?l.key=Q.ESC+"[18;"+(c+1)+"~":l.key=Q.ESC+"[18~";break;case 119:c?l.key=Q.ESC+"[19;"+(c+1)+"~":l.key=Q.ESC+"[19~";break;case 120:c?l.key=Q.ESC+"[20;"+(c+1)+"~":l.key=Q.ESC+"[20~";break;case 121:c?l.key=Q.ESC+"[21;"+(c+1)+"~":l.key=Q.ESC+"[21~";break;case 122:c?l.key=Q.ESC+"[23;"+(c+1)+"~":l.key=Q.ESC+"[23~";break;case 123:c?l.key=Q.ESC+"[24;"+(c+1)+"~":l.key=Q.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?l.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?l.key=Q.NUL:e.keyCode>=51&&e.keyCode<=55?l.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?l.key=Q.DEL:e.keyCode===219?l.key=Q.ESC:e.keyCode===220?l.key=Q.FS:e.keyCode===221&&(l.key=Q.GS);else if((!r||n)&&e.altKey&&!e.metaKey){let d=(u=qD[e.keyCode])==null?void 0:u[e.shiftKey?1:0];if(d)l.key=Q.ESC+d;else if(e.keyCode>=65&&e.keyCode<=90){let _=e.ctrlKey?e.keyCode-64:e.keyCode+32,f=String.fromCharCode(_);e.shiftKey&&(f=f.toUpperCase()),l.key=Q.ESC+f}else if(e.keyCode===32)l.key=Q.ESC+(e.ctrlKey?Q.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let _=e.code.slice(3,4);e.shiftKey||(_=_.toLowerCase()),l.key=Q.ESC+_,l.cancel=!0}}else r&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(l.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?l.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(l.key=Q.US),e.key==="@"&&(l.key=Q.NUL));break}return l}var pt=0,FD=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new zc,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new zc,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((l,c)=>this._getKey(l)-this._getKey(c)),t=0,r=0,n=new Array(this._array.length+this._insertedValues.length);for(let l=0;l<n.length;l++)r>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[r])?(n[l]=e[t],t++):n[l]=this._array[r++];this._array=n,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 t=this._getKey(e);if(t===void 0||(pt=this._search(t),pt===-1)||this._getKey(this._array[pt])!==t)return!1;do if(this._array[pt]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(pt),!0;while(++pt<this._array.length&&this._getKey(this._array[pt])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((l,c)=>l-c),t=0,r=new Array(this._array.length-e.length),n=0;for(let l=0;l<this._array.length;l++)e[t]===l?t++:r[n++]=this._array[l];this._array=r,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&&(pt=this._search(e),!(pt<0||pt>=this._array.length)&&this._getKey(this._array[pt])===e))do yield this._array[pt];while(++pt<this._array.length&&this._getKey(this._array[pt])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(pt=this._search(e),!(pt<0||pt>=this._array.length)&&this._getKey(this._array[pt])===e))do t(this._array[pt]);while(++pt<this._array.length&&this._getKey(this._array[pt])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,r=this._array.length-1;for(;r>=t;){let n=t+r>>1,l=this._getKey(this._array[n]);if(l>e)r=n-1;else if(l<e)t=n+1;else{for(;n>0&&this._getKey(this._array[n-1])===e;)n--;return n}}return t}},Xd=0,C0=0,YD=class extends Me{constructor(){super(),this._decorations=new FD(e=>e==null?void 0:e.marker.line),this._onDecorationRegistered=this._register(new oe),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new oe),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(nt(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new KD(e);if(t){let r=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),r.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,r){let n=0,l=0;for(let c of this._decorations.getKeyIterator(t))n=c.options.x??0,l=n+(c.options.width??1),e>=n&&e<l&&(!r||(c.options.layer??"bottom")===r)&&(yield c)}forEachDecorationAtCell(e,t,r,n){this._decorations.forEachByKey(t,l=>{Xd=l.options.x??0,C0=Xd+(l.options.width??1),e>=Xd&&e<C0&&(!r||(l.options.layer??"bottom")===r)&&n(l)})}},KD=class extends vs{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new oe),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new oe),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=ot.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=ot.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},XD=1e3,ZD=class{constructor(e,t=XD){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,r){this._rowCount=r,e=e!==void 0?e:0,t=t!==void 0?t: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,t):t;let n=performance.now();if(n-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=n,this._innerRefresh();else if(!this._additionalRefreshRequested){let l=n-this._lastRefreshMs,c=this._debounceThresholdMS-l;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},c)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},E0=20,Pc=class extends Me{constructor(e,t,r,n){super(),this._terminal=e,this._coreBrowserService=r,this._renderService=n,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let l=this._coreBrowserService.mainDocument;this._accessibilityContainer=l.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=l.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._handleBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._handleBoundaryFocus(c,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=l.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new ZD(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(c=>this._handleResize(c.rows))),this._register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(c=>this._handleChar(c))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
225
|
+
`))),this._register(this._terminal.onA11yTab(c=>this._handleTab(c))),this._register(this._terminal.onKey(c=>this._handleKey(c.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(Ce(l,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(nt(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(" ")}_handleChar(e){this._liveRegionLineCount<E0+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
226
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===E0+1&&(this._liveRegion.textContent+=vf.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let r=this._terminal.buffer,n=r.lines.length.toString();for(let l=e;l<=t;l++){let c=r.lines.get(r.ydisp+l),u=[],d=(c==null?void 0:c.translateToString(!0,void 0,void 0,u))||"",_=(r.ydisp+l+1).toString(),f=this._rowElements[l];f&&(d.length===0?(f.textContent=" ",this._rowColumns.set(f,[0,1])):(f.textContent=d,this._rowColumns.set(f,u)),f.setAttribute("aria-posinset",_),f.setAttribute("aria-setsize",n),this._alignRowWidth(f))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let r=e.target,n=this._rowElements[t===0?1:this._rowElements.length-2],l=r.getAttribute("aria-posinset"),c=t===0?"1":`${this._terminal.buffer.lines.length}`;if(l===c||e.relatedTarget!==n)return;let u,d;if(t===0?(u=r,d=this._rowElements.pop(),this._rowContainer.removeChild(d)):(u=this._rowElements.shift(),d=r,this._rowContainer.removeChild(u)),u.removeEventListener("focus",this._topBoundaryFocusListener),d.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let _=this._createAccessibilityTreeNode();this._rowElements.unshift(_),this._rowContainer.insertAdjacentElement("afterbegin",_)}else{let _=this._createAccessibilityTreeNode();this._rowElements.push(_),this._rowContainer.appendChild(_)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){var d;if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},r={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(r.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===r.node&&t.offset>r.offset)&&([t,r]=[r,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let n=this._rowElements.slice(-1)[0];if(r.node.compareDocumentPosition(n)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(r={node:n,offset:((d=n.textContent)==null?void 0:d.length)??0}),!this._rowContainer.contains(r.node))return;let l=({node:_,offset:f})=>{let v=_ instanceof Text?_.parentNode:_,m=parseInt(v==null?void 0:v.getAttribute("aria-posinset"),10)-1;if(isNaN(m))return console.warn("row is invalid. Race condition?"),null;let y=this._rowColumns.get(v);if(!y)return console.warn("columns is null. Race condition?"),null;let S=f<y.length?y[f]:y.slice(-1)[0]+1;return S>=this._terminal.cols&&(++m,S=0),{row:m,column:S}},c=l(t),u=l(r);if(!(!c||!u)){if(c.row>u.row||c.row===u.row&&c.column>=u.column)throw new Error("invalid range");this._terminal.select(c.column,c.row,(u.row-c.row)*this._terminal.cols-c.column+u.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_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 e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){var l,c;e.style.transform="";let t=e.getBoundingClientRect().width,r=(c=(l=this._rowColumns.get(e))==null?void 0:l.slice(-1))==null?void 0:c[0];if(!r)return;let n=r*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${n/t})`}};Pc=dt([de(1,b_),de(2,Nr),de(3,Br)],Pc);var Jf=class extends Me{constructor(e,t,r,n,l){super(),this._element=e,this._mouseService=t,this._renderService=r,this._bufferService=n,this._linkProviderService=l,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new oe),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new oe),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(nt(()=>{var c;Qs(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,(c=this._activeProviderReplies)==null||c.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(Ce(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(Ce(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(Ce(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(Ce(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let r=e.composedPath();for(let n=0;n<r.length;n++){let l=r[n];if(l.classList.contains("xterm"))break;if(l.classList.contains("xterm-hover"))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){if(this._activeLine!==e.y||this._wasResized){this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1;return}this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){var n,l;(!this._activeProviderReplies||!t)&&((n=this._activeProviderReplies)==null||n.forEach(c=>{c==null||c.forEach(u=>{u.link.dispose&&u.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let r=!1;for(let[c,u]of this._linkProviderService.linkProviders.entries())t?(l=this._activeProviderReplies)!=null&&l.get(c)&&(r=this._checkLinkProviderResult(c,e,r)):u.provideLinks(e.y,d=>{var f,v;if(this._isMouseOut)return;let _=d==null?void 0:d.map(m=>({link:m}));(f=this._activeProviderReplies)==null||f.set(c,_),r=this._checkLinkProviderResult(c,e,r),((v=this._activeProviderReplies)==null?void 0:v.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let r=new Set;for(let n=0;n<t.size;n++){let l=t.get(n);if(l)for(let c=0;c<l.length;c++){let u=l[c],d=u.link.range.start.y<e?0:u.link.range.start.x,_=u.link.range.end.y>e?this._bufferService.cols:u.link.range.end.x;for(let f=d;f<=_;f++){if(r.has(f)){l.splice(c--,1);break}r.add(f)}}}}_checkLinkProviderResult(e,t,r){var c;if(!this._activeProviderReplies)return r;let n=this._activeProviderReplies.get(e),l=!1;for(let u=0;u<e;u++)(!this._activeProviderReplies.has(u)||this._activeProviderReplies.get(u))&&(l=!0);if(!l&&n){let u=n.find(d=>this._linkAtPosition(d.link,t));u&&(r=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!r)for(let u=0;u<this._activeProviderReplies.size;u++){let d=(c=this._activeProviderReplies.get(u))==null?void 0:c.find(_=>this._linkAtPosition(_.link,t));if(d){r=!0,this._handleNewLink(d);break}}return r}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&QD(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Qs(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.pointerCursor},set:r=>{var n;(n=this._currentLink)!=null&&n.state&&this._currentLink.state.decorations.pointerCursor!==r&&(this._currentLink.state.decorations.pointerCursor=r,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",r))}},underline:{get:()=>{var r,n;return(n=(r=this._currentLink)==null?void 0:r.state)==null?void 0:n.decorations.underline},set:r=>{var n,l,c;(n=this._currentLink)!=null&&n.state&&((c=(l=this._currentLink)==null?void 0:l.state)==null?void 0:c.decorations.underline)!==r&&(this._currentLink.state.decorations.underline=r,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,r))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(r=>{if(!this._currentLink)return;let n=r.start===0?0:r.start+1+this._bufferService.buffer.ydisp,l=this._bufferService.buffer.ydisp+1+r.end;if(this._currentLink.link.range.start.y>=n&&this._currentLink.link.range.end.y<=l&&(this._clearCurrentLink(n,l),this._lastMouseEvent)){let c=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);c&&this._askForLink(c,!1)}})))}_linkHover(e,t,r){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(r,t.text)}_fireUnderlineEvent(e,t){let r=e.range,n=this._bufferService.buffer.ydisp,l=this._createLinkUnderlineEvent(r.start.x-1,r.start.y-n-1,r.end.x,r.end.y-n-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(l)}_linkLeave(e,t,r){var n;(n=this._currentLink)!=null&&n.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(r,t.text)}_linkAtPosition(e,t){let r=e.range.start.y*this._bufferService.cols+e.range.start.x,n=e.range.end.y*this._bufferService.cols+e.range.end.x,l=t.y*this._bufferService.cols+t.x;return r<=l&&l<=n}_positionFromMouseEvent(e,t,r){let n=r.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(n)return{x:n[0],y:n[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,r,n,l){return{x1:e,y1:t,x2:r,y2:n,cols:this._bufferService.cols,fg:l}}};Jf=dt([de(1,w_),de(2,Br),de(3,ii),de(4,yb)],Jf);function QD(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var JD=class extends GD{constructor(e={}){super(e),this._linkifier=this._register(new Zn),this.browser=Ib,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Zn),this._onCursorMove=this._register(new oe),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new oe),this.onKey=this._onKey.event,this._onRender=this._register(new oe),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new oe),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new oe),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new oe),this.onBell=this._onBell.event,this._onFocus=this._register(new oe),this._onBlur=this._register(new oe),this._onA11yCharEmitter=this._register(new oe),this._onA11yTabEmitter=this._register(new oe),this._onWillOpen=this._register(new oe),this._setup(),this._decorationService=this._instantiationService.createInstance(YD),this._instantiationService.setService(Rl,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(VR),this._instantiationService.setService(yb,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(Sf)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh((t==null?void 0:t.start)??0,(t==null?void 0:t.end)??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(Wt.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(Wt.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(Wt.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(Wt.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(nt(()=>{var t,r;this._customKeyEventHandler=void 0,(r=(t=this.element)==null?void 0:t.parentNode)==null||r.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 t of e){let r,n="";switch(t.index){case 256:r="foreground",n="10";break;case 257:r="background",n="11";break;case 258:r="cursor",n="12";break;default:r="ansi",n="4;"+t.index}switch(t.type){case 0:let l=rt.toColorRGB(r==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[r]);this.coreService.triggerDataEvent(`${Q.ESC}]${n};${ID(l)}${zb.ST}`);break;case 1:if(r==="ansi")this._themeService.modifyColors(c=>c.ansi[t.index]=Ct.toColor(...t.color));else{let c=r;this._themeService.modifyColors(u=>u[c]=Ct.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.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(Pc,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Q.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(Q.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,t=this.buffer.lines.get(e);if(!t)return;let r=Math.min(this.buffer.x,this.cols-1),n=this._renderService.dimensions.css.cell.height,l=t.getWidth(r),c=this._renderService.dimensions.css.cell.width*l,u=this.buffer.y*this._renderService.dimensions.css.cell.height,d=r*this._renderService.dimensions.css.cell.width;this.textarea.style.left=d+"px",this.textarea.style.top=u+"px",this.textarea.style.width=c+"px",this.textarea.style.height=n+"px",this.textarea.style.lineHeight=n+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(Ce(this.element,"copy",t=>{this.hasSelection()&&rT(t,this._selectionService)}));let e=t=>sT(t,this.textarea,this.coreService,this.optionsService);this._register(Ce(this.textarea,"paste",e)),this._register(Ce(this.element,"paste",e)),Hb?this._register(Ce(this.element,"mousedown",t=>{t.button===2&&Ny(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(Ce(this.element,"contextmenu",t=>{Ny(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),D_&&this._register(Ce(this.element,"auxclick",t=>{t.button===1&&ub(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(Ce(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(Ce(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(Ce(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(Ce(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(Ce(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(Ce(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(Ce(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){var l;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"),((l=this.element)==null?void 0:l.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 t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(Ce(this.screenElement,"mousemove",c=>this.updateCursorStyle(c))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let r=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",gf.get()),Vb||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",()=>r.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(UR,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(Nr,this._coreBrowserService),this._register(Ce(this.textarea,"focus",c=>this._handleTextAreaFocus(c))),this._register(Ce(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(jf,this._document,this._helperContainer),this._instantiationService.setService(Zc,this._charSizeService),this._themeService=this._instantiationService.createInstance(qf),this._instantiationService.setService(ta,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Nc),this._instantiationService.setService(vb,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance($f,this.rows,this.screenElement)),this._instantiationService.setService(Br,this._renderService),this._register(this._renderService.onRenderedViewportChange(c=>this._onRender.fire(c))),this.onResize(c=>this._renderService.resize(c.cols,c.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(If,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Vf),this._instantiationService.setService(w_,this._mouseService);let n=this._linkifier.value=this._register(this._instantiationService.createInstance(Jf,this.screenElement));this.element.appendChild(t);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(zf,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(c=>{super.scrollLines(c,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Gf,this.element,this.screenElement,n)),this._instantiationService.setService(dT,this._selectionService),this._register(this._selectionService.onRequestScrollLines(c=>this.scrollLines(c.amount,c.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(c=>this._renderService.handleSelectionChanged(c.start,c.end,c.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(c=>{this.textarea.value=c,this.textarea.focus(),this.textarea.select()})),this._register(Wt.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{var c;this._selectionService.refresh(),(c=this._viewport)==null||c.queueSync()})),this._register(this._instantiationService.createInstance(Pf,this.screenElement)),this._register(Ce(this.element,"mousedown",c=>this._selectionService.handleMouseDown(c))),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(Pc,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",c=>this._handleScreenReaderModeOptionChange(c))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Mc,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",c=>{!this._overviewRulerRenderer&&c&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Mc,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(Uf,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function r(c){var f,v,m,y,S;let u=e._mouseService.getMouseReportCoords(c,e.screenElement);if(!u)return!1;let d,_;switch(c.overrideType||c.type){case"mousemove":_=32,c.buttons===void 0?(d=3,c.button!==void 0&&(d=c.button<3?c.button:3)):d=c.buttons&1?0:c.buttons&4?1:c.buttons&2?2:3;break;case"mouseup":_=0,d=c.button<3?c.button:3;break;case"mousedown":_=1,d=c.button<3?c.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(c)===!1)return!1;let b=c.deltaY;if(b===0||e.coreMouseService.consumeWheelEvent(c,(y=(m=(v=(f=e._renderService)==null?void 0:f.dimensions)==null?void 0:v.device)==null?void 0:m.cell)==null?void 0:y.height,(S=e._coreBrowserService)==null?void 0:S.dpr)===0)return!1;_=b<0?0:1,d=4;break;default:return!1}return _===void 0||d===void 0||d>4?!1:e.coreMouseService.triggerMouseEvent({col:u.col,row:u.row,x:u.x,y:u.y,button:d,action:_,ctrl:c.ctrlKey,alt:c.altKey,shift:c.shiftKey})}let n={mouseup:null,wheel:null,mousedrag:null,mousemove:null},l={mouseup:c=>(r(c),c.buttons||(this._document.removeEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.removeEventListener("mousemove",n.mousedrag)),this.cancel(c)),wheel:c=>(r(c),this.cancel(c,!0)),mousedrag:c=>{c.buttons&&r(c)},mousemove:c=>{c.buttons||r(c)}};this._register(this.coreMouseService.onProtocolChange(c=>{c?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(c)),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()),c&8?n.mousemove||(t.addEventListener("mousemove",l.mousemove),n.mousemove=l.mousemove):(t.removeEventListener("mousemove",n.mousemove),n.mousemove=null),c&16?n.wheel||(t.addEventListener("wheel",l.wheel,{passive:!1}),n.wheel=l.wheel):(t.removeEventListener("wheel",n.wheel),n.wheel=null),c&2?n.mouseup||(n.mouseup=l.mouseup):(this._document.removeEventListener("mouseup",n.mouseup),n.mouseup=null),c&4?n.mousedrag||(n.mousedrag=l.mousedrag):(this._document.removeEventListener("mousemove",n.mousedrag),n.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(Ce(t,"mousedown",c=>{if(c.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(c)))return r(c),n.mouseup&&this._document.addEventListener("mouseup",n.mouseup),n.mousedrag&&this._document.addEventListener("mousemove",n.mousedrag),this.cancel(c)})),this._register(Ce(t,"wheel",c=>{var u,d,_,f,v;if(!n.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(c)===!1)return!1;if(!this.buffer.hasScrollback){if(c.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(c,(f=(_=(d=(u=e._renderService)==null?void 0:u.dimensions)==null?void 0:d.device)==null?void 0:_.cell)==null?void 0:f.height,(v=e._coreBrowserService)==null?void 0:v.dpr)===0)return this.cancel(c,!0);let m=Q.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(c.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(m,!0),this.cancel(c,!0)}}},{passive:!1}))}refresh(e,t){var r;(r=this._renderService)==null||r.refreshRows(e,t)}updateCursorStyle(e){var t;(t=this._selectionService)!=null&&t.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,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),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 t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){cb(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 t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}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,t,r){this._selectionService.setSelection(e,t,r)}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,t){var r;(r=this._selectionService)==null||r.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let r=WD(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),r.type===3||r.type===2){let n=this.rows-1;return this.scrollLines(r.type===2?-n:n),this.cancel(e,!0)}if(r.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(r.cancel&&this.cancel(e,!0),!r.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((r.key===Q.ETX||r.key===Q.CR)&&(this.textarea.value=""),this._onKey.fire({key:r.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(r.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let r=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?r:r&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(eL(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!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 t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){var r;(r=this._charSizeService)==null||r.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(wt));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){var t;this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),(t=this._selectionService)==null||t.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(Q.ESC+"[I"):this.coreService.triggerDataEvent(Q.ESC+"[O")}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let t=this._renderService.dimensions.css.canvas.width.toFixed(0),r=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.ESC}[4;${r};${t}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),l=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Q.ESC}[6;${l};${n}t`);break}}cancel(e,t){if(!(!this.options.cancelEvents&&!t))return e.preventDefault(),e.stopPropagation(),!1}};function eL(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var tL=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=()=>this._wrappedAddonDispose(r),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let r=0;r<this._addons.length;r++)if(this._addons[r]===e){t=r;break}if(t===-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(t,1)}},iL=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new $i)}translateToString(e,t,r){return this._line.translateToString(e,t,r)}},x0=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,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(e){let t=this._buffer.lines.get(e);if(t)return new iL(t)}getNullCell(){return new $i}},rL=class extends Me{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new oe),this.onBufferChange=this._onBufferChange.event,this._normal=new x0(this._core.buffers.normal,"normal"),this._alternate=new x0(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)}},sL=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,r=>t(r.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(r,n)=>t(r,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},nL=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}},aL=["cols","rows"],tr=0,lL=class extends Me{constructor(e){super(),this._core=this._register(new JD(e)),this._addonManager=this._register(new tL),this._publicOptions={...this._core.options};let t=n=>this._core.options[n],r=(n,l)=>{this._checkReadonlyOptions(n),this._core.options[n]=l};for(let n in this._core.options){let l={get:t.bind(this,n),set:r.bind(this,n)};Object.defineProperty(this._publicOptions,n,l)}}_checkReadonlyOptions(e){if(aL.includes(e))throw new Error(`Option "${e}" 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 sL(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new nL(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 rL(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,r){this._verifyIntegers(e,t,r),this._core.select(e,t,r)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
227
|
+
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return gf.get()},set promptLabel(e){gf.set(e)},get tooMuchOutput(){return vf.get()},set tooMuchOutput(e){vf.set(e)}}}_verifyIntegers(...e){for(tr of e)if(tr===1/0||isNaN(tr)||tr%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(tr of e)if(tr&&(tr===1/0||isNaN(tr)||tr%1!==0||tr<0))throw new Error("This API only accepts positive integers")}};/**
|
|
228
228
|
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
229
229
|
* @license MIT
|
|
230
230
|
*
|
|
@@ -235,4 +235,4 @@ WARNING: This link could potentially be dangerous`)){let r=window.open();if(r){t
|
|
|
235
235
|
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
236
236
|
* http://bellard.org/jslinux/
|
|
237
237
|
* Copyright (c) 2011 Fabrice Bellard
|
|
238
|
-
*/var aL=2,lL=1,oL=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var m;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((m=this._terminal.options.overviewRuler)==null?void 0:m.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),l=Math.max(0,parseInt(r.getPropertyValue("width"))),c=window.getComputedStyle(this._terminal.element),u={top:parseInt(c.getPropertyValue("padding-top")),bottom:parseInt(c.getPropertyValue("padding-bottom")),right:parseInt(c.getPropertyValue("padding-right")),left:parseInt(c.getPropertyValue("padding-left"))},d=u.top+u.bottom,_=u.right+u.left,f=n-d,v=l-_-t;return{cols:Math.max(aL,Math.floor(v/e.css.cell.width)),rows:Math.max(lL,Math.floor(f/e.css.cell.height))}}};function cL({sessionId:e}){const t=$.useRef(null),r=$.useRef(null),n=$.useRef(null),[l,c]=$.useState(null);return $.useEffect(()=>{if(!t.current)return;const u=new nL({fontSize:11,fontFamily:"'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace",fontWeight:"400",letterSpacing:0,lineHeight:1.25,theme:{background:"#1e1e1e",foreground:"#e0e0e0",cursor:"rgba(255, 255, 255, 0.25)",cursorAccent:"transparent",selectionBackground:"rgba(255, 255, 255, 0.15)",selectionForeground:"#ffffff",black:"#1e1e1e",red:"#f47067",green:"#8ddb8c",yellow:"#e0af68",blue:"#6cb6ff",magenta:"#dcbdfb",cyan:"#76e3ea",white:"#e0e0e0",brightBlack:"#6e7681",brightRed:"#ff938a",brightGreen:"#a8e4a0",brightYellow:"#f0d399",brightBlue:"#96d0ff",brightMagenta:"#eedcff",brightCyan:"#a5f0f5",brightWhite:"#ffffff"},cursorBlink:!1,cursorInactiveStyle:"none",disableStdin:!0,scrollback:5e3,allowProposedApi:!0}),d=new oL;u.loadAddon(d),u.open(t.current),d.fit(),r.current=u,n.current=d;let _=null,f=null,v=!1,m=1e3;function y(){(_==null?void 0:_.readyState)===WebSocket.OPEN&&_.send(JSON.stringify({type:"terminal.resize",cols:u.cols,rows:u.rows}))}function S(){if(v)return;const E=location.protocol==="https:"?"wss:":"ws:";_=new WebSocket(`${E}//${location.host}/terminal?sessionId=${e}`),_.onopen=()=>{m=1e3,y()},_.onmessage=T=>{try{const O=JSON.parse(T.data);O.type==="terminal.output"?u.write(O.data):O.type==="terminal.ready"?(c(!0),y()):(O.type==="terminal.none"||O.type==="terminal.exited")&&c(!1)}catch{}},_.onclose=()=>{_=null,!v&&(f=setTimeout(()=>{f=null,m=Math.min(m*1.5,1e4),S()},m))},_.onerror=()=>{}}S();const b=new ResizeObserver(()=>{d.fit(),y()});return b.observe(t.current),()=>{v=!0,f&&clearTimeout(f),b.disconnect(),_&&_.close(),u.dispose(),r.current=null,n.current=null}},[e]),k.jsxs("div",{className:"terminal-tab",children:[k.jsx("div",{ref:t,className:"terminal-xterm",style:{display:l?"block":"none"}}),l===!1&&k.jsxs("div",{className:"terminal-empty",children:[k.jsx(O0,{size:36}),k.jsx("p",{children:"终端未启动"})]})]})}function uL({activeTab:e,topLevel:t,changes:r,directory:n,sessionId:l,previewPort:c,requestLs:u,requestFile:d,requestDiff:_,onFileContext:f}){const[v,m]=$.useState(!1);return $.useEffect(()=>{e==="terminal"&&m(!0)},[e]),k.jsxs("div",{className:"main-view",children:[k.jsx("div",{className:"main-path-bar",children:k.jsx("span",{className:"main-path-text",children:n})}),k.jsxs("div",{className:"main-tab-area",children:[k.jsx("div",{className:"main-tab-panel",style:{display:e==="files"?"flex":"none"},children:k.jsx(Wk,{topLevel:t,requestLs:u,requestFile:d,onFileContext:f})}),k.jsx("div",{className:"main-tab-panel",style:{display:e==="changes"?"flex":"none"},children:k.jsx(Kk,{changes:r,requestFile:d,requestDiff:_,onFileContext:f})}),k.jsx("div",{className:"main-tab-panel",style:{display:e==="terminal"?"flex":"none"},children:v&&k.jsx(cL,{sessionId:l})}),k.jsx("div",{className:"main-tab-panel",style:{display:e==="preview"?"flex":"none"},children:k.jsx(Xk,{previewPort:c})}),e!=="files"&&e!=="changes"&&e!=="terminal"&&e!=="preview"&&k.jsx("iframe",{className:"main-view-iframe",src:e,title:"Agent View"})]})]})}function E0(e){return e==null?"":e>=1e3?(e/1e3).toFixed(1)+"s":e+"ms"}function yc(e){if(e==null)return"";if(typeof e=="string")return e.replace(/\s+/g," ").trim();try{return JSON.stringify(e).replace(/\s+/g," ").trim()}catch{return String(e).replace(/\s+/g," ").trim()}}function Sc(e){const t=e.trim().replaceAll("\\","/").replace(/\/+/g,"/");if(!t)return"";const r=t.length>1&&t.endsWith("/"),n=t.split("/").filter(Boolean);if(n.length===0)return t;if(n.length===1)return r?`${n[0]}/`:n[0];const l=n[n.length-1];return r?`${l}/`:l}function us(e,t){if(!e)return"";for(const r of t){const n=e[r];if(typeof n=="string"&&n.trim())return n.trim()}return""}function hL(e){if(!e)return"";const t=e.split(/\r?\n/),r=[];for(const l of t){const c=l.match(/^\*\*\* (?:Add|Delete|Update) File: (.+)$/);if(c){r.push(c[1].trim());continue}const u=l.match(/^\*\*\* Move to: (.+)$/);if(u&&r.length>0){r[r.length-1]=u[1].trim();continue}const d=l.match(/^[AMD] (.+)$/);d&&r.push(d[1].trim())}if(r.length===0)return yc(e);const n=Sc(r[0]);return r.length===1?n:`${n} +${r.length-1}`}function dL(e){var t,r,n,l,c;if(e.status==="error")return e.error||"error";switch(e.name){case"apply_patch":return hL(e.title||us(e.args,["patchText"]));case"write":case"edit":case"multiedit":case"read":{const u=Sc(e.title||us(e.args,["filePath","path"])),d=Number((t=e.args)==null?void 0:t.offset)||0,_=Number((r=e.args)==null?void 0:r.limit)||0;if(d||_){const f=_?d+_:"…";return`${u} L${d+1}–${f}`}return u}case"ls":case"glob":return Sc(e.title||us(e.args,["filePath","path"]));case"set_working_directory":{const u=((n=e.title)==null?void 0:n.replace(/^Set directory:\s*/,""))||"";return Sc(u||us(e.args,["directory"]))}case"codesearch":return(((l=e.title)==null?void 0:l.replace(/^Code search:\s*/,""))||us(e.args,["query"])).trim();case"websearch":return(((c=e.title)==null?void 0:c.replace(/^Web search:\s*/,""))||us(e.args,["query"])).trim();case"grep":return us(e.args,["pattern","query","include"]);case"bash":return us(e.args,["command","description"])||yc(e.title);default:return yc(e.title)||yc(e.args)}}const x0=768,Yb="anycode-conv-pos",Kb="anycode-conv-size";function fL(){try{const e=JSON.parse(localStorage.getItem(Yb)||"null"),t=JSON.parse(localStorage.getItem(Kb)||"null");return{pos:e&&typeof e.x=="number"?e:{x:0,y:0},size:t&&typeof t.w=="number"?t:{w:220,h:280}}}catch{return{pos:{x:0,y:0},size:{w:220,h:280}}}}function _L(){const[e,t]=$.useState(()=>window.innerWidth>x0);return $.useEffect(()=>{const r=window.matchMedia(`(min-width: ${x0+1}px)`),n=l=>t(l.matches);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),e}function pL({sessionId:e,fileContext:t,chatHandlerRef:r,sendMessage:n}){const l=_L(),[c,u]=$.useState([]),[d,_]=$.useState(""),[f,v]=$.useState(!1),[m,y]=$.useState(!1),[S,b]=$.useState(!1),E=$.useRef(fL()),[T,O]=$.useState(E.current.pos),[H,B]=$.useState(E.current.size);$.useEffect(()=>{l||localStorage.setItem(Yb,JSON.stringify(T))},[T,l]),$.useEffect(()=>{l||localStorage.setItem(Kb,JSON.stringify(H))},[H,l]);const I=$.useRef(null),j=$.useRef(null),Y=$.useRef(0),[te,ge]=$.useState(0),ve=$.useRef(null),fe=$.useRef(new Map);$.useEffect(()=>{e&&(u([]),b(!1),fe.current.clear(),(async()=>{try{const ne=await fetch(`/api/messages?sessionId=${encodeURIComponent(e)}`);if(!ne.ok)return;const ce=await ne.json();if(!Array.isArray(ce)||ce.length===0)return;const Se=[];for(const Ee of ce)if(Ee.role==="user")Se.push({role:"user",text:Ee.text||""});else{const Ae=[];if(Array.isArray(Ee.parts))for(const Ge of Ee.parts)Ge.type==="text"?Ae.push({kind:"text",content:Ge.content||""}):Ge.type==="tool"?Ae.push({kind:"tool",id:"",name:Ge.tool||"",status:"done",title:Ge.content||""}):Ge.type==="thinking"&&Ae.push({kind:"thinking",content:Ge.content||""});Ae.length>0&&Se.push({role:"assistant",parts:Ae})}Se.length>0&&u(Se)}catch{}})())},[e]),$.useEffect(()=>{var ne;(ne=ve.current)==null||ne.scrollTo(0,ve.current.scrollHeight)},[c]),$.useEffect(()=>{if(!f){ge(0);return}const ne=setInterval(()=>ge(Math.floor((Date.now()-Y.current)/1e3)),100);return()=>clearInterval(ne)},[f]);const he=$.useCallback(ne=>{u(ce=>{const Se=ce[ce.length-1];return Se&&Se.role==="assistant"?[...ce.slice(0,-1),{...Se,parts:[...Se.parts,ne]}]:[...ce,{role:"assistant",parts:[ne]}]})},[]),J=$.useCallback((ne,ce)=>{u(Se=>{const Ee=Se[Se.length-1];if(!Ee||Ee.role!=="assistant")return Se;const Ae=[...Ee.parts];for(let Ge=Ae.length-1;Ge>=0;Ge--)if(Ae[Ge].kind===ne){Ae[Ge]=ce(Ae[Ge]);break}return[...Se.slice(0,-1),{...Ee,parts:Ae}]})},[]),G=$.useCallback((ne,ce)=>{u(Se=>{var Ll;const Ee=Se[Se.length-1];if(!Ee||Ee.role!=="assistant")return Se;const Ae=[...Ee.parts],Ge=fe.current.get(ne);return Ge!=null&&((Ll=Ae[Ge])==null?void 0:Ll.kind)==="tool"&&(Ae[Ge]=ce(Ae[Ge])),[...Se.slice(0,-1),{...Ee,parts:Ae}]})},[]),re=$.useCallback(ne=>{switch(ne.type){case"thinking.start":he({kind:"thinking",content:""});break;case"thinking.delta":J("thinking",ce=>({...ce,content:ce.content+(ne.thinkingContent||"")}));break;case"thinking.end":J("thinking",ce=>({...ce,duration:ne.thinkingDuration}));break;case"text.delta":u(ce=>{const Se=ce[ce.length-1];if(Se&&Se.role==="assistant"){const Ee=[...Se.parts],Ae=Ee[Ee.length-1];return(Ae==null?void 0:Ae.kind)==="text"?Ee[Ee.length-1]={...Ae,content:Ae.content+(ne.content||"")}:Ee.push({kind:"text",content:ne.content||""}),[...ce.slice(0,-1),{...Se,parts:Ee}]}return[...ce,{role:"assistant",parts:[{kind:"text",content:ne.content||""}]}]});break;case"tool.start":{const ce=ne.toolCallId||"";if(ce&&fe.current.has(ce))G(ce,Se=>({...Se,...ne.toolTitle!=null?{title:ne.toolTitle}:{}}));else{const Se={kind:"tool",id:ce,name:ne.toolName||"",args:ne.toolArgs,title:ne.toolTitle,status:"running"};u(Ee=>{const Ae=Ee[Ee.length-1];if(Ae&&Ae.role==="assistant"){const Ge=[...Ae.parts,Se];return ce&&fe.current.set(ce,Ge.length-1),[...Ee.slice(0,-1),{...Ae,parts:Ge}]}return ce&&fe.current.set(ce,0),[...Ee,{role:"assistant",parts:[Se]}]})}break}case"tool.done":ne.toolCallId&&G(ne.toolCallId,ce=>({...ce,status:"done",duration:ne.toolDuration,title:ne.toolTitle}));break;case"tool.error":ne.toolCallId&&G(ne.toolCallId,ce=>({...ce,status:"error",duration:ne.toolDuration,error:ne.error}));break;case"message.done":break;case"error":he({kind:"error",message:ne.error||"unknown error"});break;case"done":b(!1);break}},[he,J,G]);$.useEffect(()=>{if(r)return r.current=ne=>{switch(ne.type){case"chat.userMessage":fe.current.clear(),u(ce=>[...ce,{role:"user",text:ne.text},{role:"assistant",parts:[]}]),b(!0);break;case"chat.event":ne.event&&re(ne.event);break;case"chat.done":b(!1);break}},()=>{r.current=void 0}},[re,r]);const se=$.useCallback(()=>{const ne=d.trim();if(!ne||S)return;_(""),b(!0);const ce={type:"chat.send",message:ne};t&&(ce.fileContext=t),n(ce)},[d,S,t,n]),D=$.useCallback(()=>{n({type:"chat.stop"})},[n]),W=ne=>{ne.key==="Enter"&&!ne.shiftKey&&!ne.nativeEvent.isComposing&&(ne.preventDefault(),se())},q=()=>{v(!0),Y.current=Date.now()},ie=()=>{v(!1),Date.now()-Y.current<300},oe=ne=>{ne.preventDefault(),q();const ce=()=>{ie(),window.removeEventListener("mouseup",ce)};window.addEventListener("mouseup",ce)},x=ne=>{ne.preventDefault(),q();const ce=()=>{ie(),window.removeEventListener("touchend",ce)};window.addEventListener("touchend",ce)},M=$.useCallback((ne,ce)=>{I.current={startX:ne,startY:ce,origX:T.x,origY:T.y}},[T]),X=$.useCallback((ne,ce)=>{I.current&&O({x:I.current.origX+ne-I.current.startX,y:I.current.origY+ce-I.current.startY})},[]),ee=$.useCallback(()=>{I.current=null},[]),ue=ne=>{ne.preventDefault(),M(ne.clientX,ne.clientY);const ce=Ee=>X(Ee.clientX,Ee.clientY),Se=()=>{ee(),window.removeEventListener("mousemove",ce),window.removeEventListener("mouseup",Se)};window.addEventListener("mousemove",ce),window.addEventListener("mouseup",Se)},pe=ne=>{const ce=ne.touches[0];M(ce.clientX,ce.clientY);const Se=Ae=>{Ae.preventDefault(),X(Ae.touches[0].clientX,Ae.touches[0].clientY)},Ee=()=>{ee(),window.removeEventListener("touchmove",Se),window.removeEventListener("touchend",Ee)};window.addEventListener("touchmove",Se,{passive:!1}),window.addEventListener("touchend",Ee)},we=$.useRef("bl"),Fe=$.useCallback((ne,ce,Se)=>{we.current=Se,j.current={startX:ne,startY:ce,origW:H.w,origH:H.h}},[H]),ze=$.useCallback((ne,ce)=>{if(!j.current)return;const Se=ne-j.current.startX,Ee=ce-j.current.startY,Ae=we.current==="bl"?-Se:Se;B({w:Math.max(180,Math.min(600,j.current.origW+Ae)),h:Math.max(200,Math.min(800,j.current.origH+Ee))})},[]),Ft=$.useCallback(()=>{j.current=null},[]),$e=ne=>ce=>{ce.preventDefault(),ce.stopPropagation(),Fe(ce.clientX,ce.clientY,ne);const Se=Ae=>ze(Ae.clientX,Ae.clientY),Ee=()=>{Ft(),window.removeEventListener("mousemove",Se),window.removeEventListener("mouseup",Ee)};window.addEventListener("mousemove",Se),window.addEventListener("mouseup",Ee)},at=ne=>ce=>{ce.stopPropagation();const Se=ce.touches[0];Fe(Se.clientX,Se.clientY,ne);const Ee=Ge=>{Ge.preventDefault(),ze(Ge.touches[0].clientX,Ge.touches[0].clientY)},Ae=()=>{Ft(),window.removeEventListener("touchmove",Ee),window.removeEventListener("touchend",Ae)};window.addEventListener("touchmove",Ee,{passive:!1}),window.addEventListener("touchend",Ae)},Le=(ne,ce)=>{switch(ne.kind){case"thinking":return k.jsxs("details",{className:"co-thinking",children:[k.jsxs("summary",{children:["💭 Thinking ",k.jsx("span",{className:"co-thinking-dur",children:E0(ne.duration)||"…"})]}),k.jsx("div",{className:"co-thinking-content",children:ne.content})]},ce);case"tool":const Se=dL(ne);return k.jsxs("div",{className:`co-tool ${ne.status}`,title:Se,children:[k.jsx("span",{className:"co-tool-icon",children:ne.status==="running"?"⏳":ne.status==="done"?"✓":"✗"}),k.jsx("span",{className:"co-tool-name",children:ne.name}),k.jsx("span",{className:"co-tool-info",children:Se}),ne.duration!=null&&k.jsx("span",{className:"co-tool-dur",children:E0(ne.duration)})]},ce);case"text":return k.jsx("div",{className:"co-text",children:ne.content},ce);case"error":return k.jsxs("div",{className:"co-error",children:["⚠ ",ne.message]},ce)}},di=l?"conversation-panel conversation-sidebar":"conversation-panel conversation-floating",ra=l?void 0:{transform:`translate(${T.x}px, ${T.y}px)`,width:H.w,height:H.h};return k.jsxs("div",{className:di,style:ra,children:[k.jsxs("div",{className:"conversation-header",...l?{}:{onMouseDown:ue,onTouchStart:pe},children:[!l&&k.jsx("div",{className:"drag-grip"}),k.jsxs("div",{className:"conversation-header-content",children:[k.jsx(HC,{})," 对话"]})]}),k.jsxs("div",{className:"conversation-messages",ref:ve,children:[c.length===0&&k.jsx("div",{className:"co-text",style:{color:"var(--color-text-dim)"},children:"你好!告诉我你想做什么"}),c.map((ne,ce)=>ne.role==="user"?k.jsx("div",{className:"co-user",children:ne.text},ce):k.jsx("div",{className:"co-response",children:ne.parts.map(Le)},ce))]}),t&&k.jsx("div",{className:"co-file-context",children:k.jsxs("span",{className:"co-file-context-text",children:[t.file.split("/").pop()," L",t.lines[0],"–",t.lines[t.lines.length-1]]})}),k.jsx("div",{className:"conversation-input",children:m?k.jsxs(k.Fragment,{children:[k.jsx("input",{type:"text",value:S?"":d,onChange:ne=>_(ne.target.value),onKeyDown:W,placeholder:S?"正在处理中...":"输入消息...",autoFocus:!0,disabled:S}),S?k.jsx("button",{className:"text-send-btn text-stop-btn",onClick:D,children:k.jsx(UC,{size:18})}):k.jsx("button",{className:"text-send-btn",onClick:se,children:k.jsx(BC,{})}),k.jsx("button",{className:"text-close-btn",onClick:()=>y(!1),children:k.jsx(zC,{})})]}):k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"mic-wrapper",children:[f&&k.jsxs("div",{className:"mic-tooltip",children:["录音中 ",te,"s"]}),k.jsx("button",{className:`mic-btn ${f?"recording":""}`,onMouseDown:oe,onTouchStart:x,children:k.jsx(MC,{})})]}),k.jsx("button",{className:"text-toggle-btn",onClick:()=>y(!0),children:k.jsx(NC,{})})]})}),!l&&k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"co-resize-grip co-resize-bl",onMouseDown:$e("bl"),onTouchStart:at("bl")}),k.jsx("div",{className:"co-resize-grip co-resize-br",onMouseDown:$e("br"),onTouchStart:at("br")})]})]})}function mL(e){if(e.directory){const t=e.directory.split("/");return t[t.length-1]||e.directory}return e.isDefault?"默认":"新窗口"}function gL({windows:e,activeWindowId:t,onSwitch:r,onCreate:n,onDelete:l}){const[c,u]=$.useState(null),[d,_]=$.useState(null),f=$.useRef(null),v=$.useRef(new Map);$.useEffect(()=>{if(!c)return;const y=S=>{f.current&&!f.current.contains(S.target)&&u(null)};return document.addEventListener("mousedown",y),document.addEventListener("touchstart",y),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("touchstart",y)}},[c]);const m=$.useCallback(y=>{y.id===t?y.isDefault||u(S=>{if(S===y.id)return null;const b=v.current.get(y.id);if(b){const E=b.getBoundingClientRect();_({x:E.left+E.width/2,y:E.top})}return y.id}):(u(null),r(y.id))},[t,r]);return k.jsxs("nav",{className:"taskbar",ref:f,children:[k.jsx("div",{className:"taskbar-items",children:e.map(y=>k.jsx("button",{ref:S=>{S&&v.current.set(y.id,S)},className:`taskbar-item ${y.id===t?"active":""}`,onClick:()=>m(y),children:k.jsx("span",{className:"taskbar-label",children:mL(y)})},y.id))}),k.jsx("button",{className:"taskbar-add",onClick:n,title:"新建窗口",children:"+"}),c&&d&&k.jsx("div",{className:"taskbar-popover",style:{left:d.x,top:d.y},children:k.jsx("button",{className:"taskbar-popover-btn",onClick:()=>{const y=c;u(null),l(y)},children:"关闭窗口"})})]})}const Fs="";function vL({sessionId:e,visible:t,onWindowsChanged:r}){const[n,l]=$.useState("files"),[c,u]=$.useState(""),[d,_]=$.useState([]),[f,v]=$.useState([]),[m,y]=$.useState(null),[S,b]=$.useState(null),E=$.useRef(void 0),T=$.useRef(null),O=$.useCallback(j=>{var Y;(Y=T.current)==null||Y.send(j)},[]);$.useEffect(()=>{let j=!1,Y=1e3,te;function ge(){if(j)return;const ve=OC(e);T.current=ve,ve.onopen=()=>{Y=1e3,r()},ve.onmessage=fe=>{var he,J;fe.type==="state"?(fe.directory&&u(fe.directory),_(fe.topLevel||[]),v(fe.changes||[]),fe.previewPort!==void 0&&b(fe.previewPort)):(he=fe.type)!=null&&he.startsWith("chat.")&&((J=E.current)==null||J.call(E,fe))},ve.onclose=()=>{T.current=null,j||(te=setTimeout(()=>{Y=Math.min(Y*1.5,1e4),ge()},Y))}}return ge(),()=>{var ve;j=!0,clearTimeout(te),(ve=T.current)==null||ve.close(),T.current=null}},[e,r]);const H=$.useCallback(async j=>{try{const Y=await fetch(`${Fs}/api/sessions/${e}/ls?path=${encodeURIComponent(j)}`);return Y.ok?(await Y.json()).entries??[]:[]}catch{return[]}},[e]),B=$.useCallback(async j=>{try{const Y=await fetch(`${Fs}/api/sessions/${e}/file?path=${encodeURIComponent(j)}`);return Y.ok?(await Y.json()).content??null:null}catch{return null}},[e]),I=$.useCallback(async j=>{try{const Y=await fetch(`${Fs}/api/sessions/${e}/diff?path=${encodeURIComponent(j)}`);return Y.ok?await Y.json():{added:[],removed:[]}}catch{return{added:[],removed:[]}}},[e]);return k.jsxs("div",{className:"app-content",style:{display:t?"flex":"none"},children:[k.jsxs("div",{className:"app-main",children:[c?k.jsx(uL,{activeTab:n,topLevel:d,changes:f,directory:c,sessionId:e,previewPort:S,requestLs:H,requestFile:B,requestDiff:I,onFileContext:y}):k.jsx("div",{className:"main-view",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:k.jsxs("div",{style:{textAlign:"center"},children:[k.jsx("p",{style:{color:"var(--color-text-dim)",fontSize:"14px",opacity:.4,fontWeight:500},children:"通过对话面板"}),k.jsx("p",{style:{color:"var(--color-text-dim)",fontSize:"11px",opacity:.3,marginTop:"6px"},children:"打开一个项目并开始"})]})}),k.jsx(jC,{activeTab:n,onTabChange:l,changeCount:f.length})]}),k.jsx(pL,{sessionId:e,fileContext:m,chatHandlerRef:E,sendMessage:O})]})}function yL(){const[e,t]=$.useState(null),[r,n]=$.useState([]),[l,c]=$.useState(null),u=$.useCallback(async()=>{try{const v=await fetch(`${Fs}/api/windows`);if(v.ok){const m=await v.json();n(m)}}catch{}},[]);$.useEffect(()=>{(async()=>{try{const m=await(await fetch(`${Fs}/api/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})).json();if(m.error)throw new Error(m.error);t(m.id),u()}catch(v){c(v.message)}})()},[u]);const d=$.useCallback(v=>{t(v)},[]),_=$.useCallback(async()=>{try{const m=await(await fetch(`${Fs}/api/windows`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})).json();if(m.error)return;t(m.id),u()}catch{}},[u]),f=$.useCallback(async v=>{try{if(!(await fetch(`${Fs}/api/windows/${v}`,{method:"DELETE"})).ok)return;if(v===e){const y=r.filter(b=>b.id!==v),S=y.find(b=>b.isDefault)||y[0];S&&t(S.id)}u()}catch{}},[e,r,u]);return l?k.jsx("div",{className:"app",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:k.jsxs("p",{style:{color:"var(--red)",fontSize:"14px"},children:["连接失败: ",l]})}):e?k.jsxs("div",{className:"app-root",children:[r.map(v=>k.jsx(vL,{sessionId:v.id,visible:v.id===e,onWindowsChanged:u},v.id)),k.jsx(gL,{windows:r,activeWindowId:e,onSwitch:d,onCreate:_,onDelete:f})]}):k.jsx("div",{className:"app",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:k.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:"连接服务器中…"})})}DC.createRoot(document.getElementById("root")).render(k.jsx($.StrictMode,{children:k.jsx(yL,{})}));
|
|
238
|
+
*/var oL=2,cL=1,uL=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){var m;if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:((m=this._terminal.options.overviewRuler)==null?void 0:m.width)||14,r=window.getComputedStyle(this._terminal.element.parentElement),n=parseInt(r.getPropertyValue("height")),l=Math.max(0,parseInt(r.getPropertyValue("width"))),c=window.getComputedStyle(this._terminal.element),u={top:parseInt(c.getPropertyValue("padding-top")),bottom:parseInt(c.getPropertyValue("padding-bottom")),right:parseInt(c.getPropertyValue("padding-right")),left:parseInt(c.getPropertyValue("padding-left"))},d=u.top+u.bottom,_=u.right+u.left,f=n-d,v=l-_-t;return{cols:Math.max(oL,Math.floor(v/e.css.cell.width)),rows:Math.max(cL,Math.floor(f/e.css.cell.height))}}};function hL({sessionId:e}){const t=V.useRef(null),r=V.useRef(null),n=V.useRef(null),[l,c]=V.useState(null);return V.useEffect(()=>{if(!t.current)return;const u=new lL({fontSize:11,fontFamily:"'SF Mono', 'Menlo', 'Monaco', 'Consolas', monospace",fontWeight:"400",letterSpacing:0,lineHeight:1.25,theme:{background:"#1e1e1e",foreground:"#e0e0e0",cursor:"rgba(255, 255, 255, 0.25)",cursorAccent:"transparent",selectionBackground:"rgba(255, 255, 255, 0.15)",selectionForeground:"#ffffff",black:"#1e1e1e",red:"#f47067",green:"#8ddb8c",yellow:"#e0af68",blue:"#6cb6ff",magenta:"#dcbdfb",cyan:"#76e3ea",white:"#e0e0e0",brightBlack:"#6e7681",brightRed:"#ff938a",brightGreen:"#a8e4a0",brightYellow:"#f0d399",brightBlue:"#96d0ff",brightMagenta:"#eedcff",brightCyan:"#a5f0f5",brightWhite:"#ffffff"},cursorBlink:!1,cursorInactiveStyle:"none",disableStdin:!0,scrollback:5e3,allowProposedApi:!0}),d=new uL;u.loadAddon(d),u.open(t.current),d.fit(),r.current=u,n.current=d;let _=null,f=null,v=!1,m=1e3;function y(){(_==null?void 0:_.readyState)===WebSocket.OPEN&&_.send(JSON.stringify({type:"terminal.resize",cols:u.cols,rows:u.rows}))}function S(){if(v)return;const x=location.protocol==="https:"?"wss:":"ws:";_=new WebSocket(`${x}//${location.host}/terminal?sessionId=${e}`),_.onopen=()=>{m=1e3,y()},_.onmessage=T=>{try{const O=JSON.parse(T.data);O.type==="terminal.output"?u.write(O.data):O.type==="terminal.ready"?(c(!0),y()):(O.type==="terminal.none"||O.type==="terminal.exited")&&c(!1)}catch{}},_.onclose=()=>{_=null,!v&&(f=setTimeout(()=>{f=null,m=Math.min(m*1.5,1e4),S()},m))},_.onerror=()=>{}}S();const b=new ResizeObserver(()=>{d.fit(),y()});return b.observe(t.current),()=>{v=!0,f&&clearTimeout(f),b.disconnect(),_&&_.close(),u.dispose(),r.current=null,n.current=null}},[e]),k.jsxs("div",{className:"terminal-tab",children:[k.jsx("div",{ref:t,className:"terminal-xterm",style:{display:l?"block":"none"}}),l===!1&&k.jsxs("div",{className:"terminal-empty",children:[k.jsx(z0,{size:36}),k.jsx("p",{children:"终端未启动"})]})]})}function dL({activeTab:e,topLevel:t,changes:r,directory:n,sessionId:l,previewPort:c,requestLs:u,requestFile:d,requestDiff:_,onFileContext:f}){const[v,m]=V.useState(!1);return V.useEffect(()=>{e==="terminal"&&m(!0)},[e]),k.jsxs("div",{className:"main-view",children:[k.jsx("div",{className:"main-path-bar",children:k.jsx("span",{className:"main-path-text",children:n})}),k.jsxs("div",{className:"main-tab-area",children:[k.jsx("div",{className:"main-tab-panel",style:{display:e==="files"?"flex":"none"},children:k.jsx(Yk,{topLevel:t,requestLs:u,requestFile:d,onFileContext:f})}),k.jsx("div",{className:"main-tab-panel",style:{display:e==="changes"?"flex":"none"},children:k.jsx(Zk,{changes:r,requestFile:d,requestDiff:_,onFileContext:f})}),k.jsx("div",{className:"main-tab-panel",style:{display:e==="terminal"?"flex":"none"},children:v&&k.jsx(hL,{sessionId:l})}),k.jsx("div",{className:"main-tab-panel",style:{display:e==="preview"?"flex":"none"},children:k.jsx(Qk,{previewPort:c})}),e!=="files"&&e!=="changes"&&e!=="terminal"&&e!=="preview"&&k.jsx("iframe",{className:"main-view-iframe",src:e,title:"Agent View"})]})]})}function A0(e){return e==null?"":e>=1e3?(e/1e3).toFixed(1)+"s":e+"ms"}function yc(e){if(e==null)return"";if(typeof e=="string")return e.replace(/\s+/g," ").trim();try{return JSON.stringify(e).replace(/\s+/g," ").trim()}catch{return String(e).replace(/\s+/g," ").trim()}}function Sc(e){const t=e.trim().replaceAll("\\","/").replace(/\/+/g,"/");if(!t)return"";const r=t.length>1&&t.endsWith("/"),n=t.split("/").filter(Boolean);if(n.length===0)return t;if(n.length===1)return r?`${n[0]}/`:n[0];const l=n[n.length-1];return r?`${l}/`:l}function us(e,t){if(!e)return"";for(const r of t){const n=e[r];if(typeof n=="string"&&n.trim())return n.trim()}return""}function fL(e){if(!e)return"";const t=e.split(/\r?\n/),r=[];for(const l of t){const c=l.match(/^\*\*\* (?:Add|Delete|Update) File: (.+)$/);if(c){r.push(c[1].trim());continue}const u=l.match(/^\*\*\* Move to: (.+)$/);if(u&&r.length>0){r[r.length-1]=u[1].trim();continue}const d=l.match(/^[AMD] (.+)$/);d&&r.push(d[1].trim())}if(r.length===0)return yc(e);const n=Sc(r[0]);return r.length===1?n:`${n} +${r.length-1}`}function _L(e){var t,r,n,l,c;if(e.status==="error")return e.error||"error";switch(e.name){case"apply_patch":return fL(e.title||us(e.args,["patchText"]));case"write":case"edit":case"multiedit":case"read":{const u=Sc(e.title||us(e.args,["filePath","path"])),d=Number((t=e.args)==null?void 0:t.offset)||0,_=Number((r=e.args)==null?void 0:r.limit)||0;if(d||_){const f=_?d+_:"…";return`${u} L${d+1}–${f}`}return u}case"ls":case"glob":return Sc(e.title||us(e.args,["filePath","path"]));case"set_working_directory":{const u=((n=e.title)==null?void 0:n.replace(/^Set directory:\s*/,""))||"";return Sc(u||us(e.args,["directory"]))}case"codesearch":return(((l=e.title)==null?void 0:l.replace(/^Code search:\s*/,""))||us(e.args,["query"])).trim();case"websearch":return(((c=e.title)==null?void 0:c.replace(/^Web search:\s*/,""))||us(e.args,["query"])).trim();case"grep":return us(e.args,["pattern","query","include"]);case"bash":return us(e.args,["command","description"])||yc(e.title);default:return yc(e.title)||yc(e.args)}}const k0=768,Qb="anycode-conv-pos",Jb="anycode-conv-size",T0="anycode-conv-docked",R0=40;function pL(){try{const e=JSON.parse(localStorage.getItem(Qb)||"null"),t=JSON.parse(localStorage.getItem(Jb)||"null");return{pos:e&&typeof e.x=="number"?e:{x:0,y:0},size:t&&typeof t.w=="number"?t:{w:220,h:280}}}catch{return{pos:{x:0,y:0},size:{w:220,h:280}}}}function mL(){const[e,t]=V.useState(()=>window.innerWidth>k0);return V.useEffect(()=>{const r=window.matchMedia(`(min-width: ${k0+1}px)`),n=l=>t(l.matches);return r.addEventListener("change",n),()=>r.removeEventListener("change",n)},[]),e}function gL({sessionId:e,fileContext:t,chatHandlerRef:r,sendMessage:n}){const l=mL(),[c,u]=V.useState([]),[d,_]=V.useState(""),[f,v]=V.useState(!1),[m,y]=V.useState(!1),[S,b]=V.useState(!1),x=V.useRef(pL()),[T,O]=V.useState(x.current.pos),[H,B]=V.useState(x.current.size),[I,j]=V.useState(()=>{try{const ie=localStorage.getItem(T0);return ie==="left"||ie==="right"?ie:null}catch{return null}});V.useEffect(()=>{l||localStorage.setItem(Qb,JSON.stringify(T))},[T,l]),V.useEffect(()=>{l||localStorage.setItem(Jb,JSON.stringify(H))},[H,l]),V.useEffect(()=>{l||localStorage.setItem(T0,I||"")},[I,l]);const $=V.useRef(null),ee=V.useRef(null),ge=V.useRef(0),[Se,_e]=V.useState(0),he=V.useRef(null),J=V.useRef(new Map);V.useEffect(()=>{e&&(u([]),b(!1),J.current.clear(),(async()=>{try{const ie=await fetch(`/api/messages?sessionId=${encodeURIComponent(e)}`);if(!ie.ok)return;const ce=await ie.json();if(!Array.isArray(ce)||ce.length===0)return;const ve=[];for(const Ee of ce)if(Ee.role==="user")ve.push({role:"user",text:Ee.text||""});else{const Re=[];if(Array.isArray(Ee.parts))for(const Ze of Ee.parts)Ze.type==="text"?Re.push({kind:"text",content:Ze.content||""}):Ze.type==="tool"?Re.push({kind:"tool",id:"",name:Ze.tool||"",status:"done",title:Ze.content||""}):Ze.type==="thinking"&&Re.push({kind:"thinking",content:Ze.content||""});Re.length>0&&ve.push({role:"assistant",parts:Re})}ve.length>0&&u(ve)}catch{}})())},[e]),V.useEffect(()=>{var ie;(ie=he.current)==null||ie.scrollTo(0,he.current.scrollHeight)},[c]),V.useEffect(()=>{if(!f){_e(0);return}const ie=setInterval(()=>_e(Math.floor((Date.now()-ge.current)/1e3)),100);return()=>clearInterval(ie)},[f]);const W=V.useCallback(ie=>{u(ce=>{const ve=ce[ce.length-1];return ve&&ve.role==="assistant"?[...ce.slice(0,-1),{...ve,parts:[...ve.parts,ie]}]:[...ce,{role:"assistant",parts:[ie]}]})},[]),ne=V.useCallback((ie,ce)=>{u(ve=>{const Ee=ve[ve.length-1];if(!Ee||Ee.role!=="assistant")return ve;const Re=[...Ee.parts];for(let Ze=Re.length-1;Ze>=0;Ze--)if(Re[Ze].kind===ie){Re[Ze]=ce(Re[Ze]);break}return[...ve.slice(0,-1),{...Ee,parts:Re}]})},[]),se=V.useCallback((ie,ce)=>{u(ve=>{var Yt;const Ee=ve[ve.length-1];if(!Ee||Ee.role!=="assistant")return ve;const Re=[...Ee.parts],Ze=J.current.get(ie);return Ze!=null&&((Yt=Re[Ze])==null?void 0:Yt.kind)==="tool"&&(Re[Ze]=ce(Re[Ze])),[...ve.slice(0,-1),{...Ee,parts:Re}]})},[]),D=V.useCallback(ie=>{switch(ie.type){case"thinking.start":W({kind:"thinking",content:""});break;case"thinking.delta":ne("thinking",ce=>({...ce,content:ce.content+(ie.thinkingContent||"")}));break;case"thinking.end":ne("thinking",ce=>({...ce,duration:ie.thinkingDuration}));break;case"text.delta":u(ce=>{const ve=ce[ce.length-1];if(ve&&ve.role==="assistant"){const Ee=[...ve.parts],Re=Ee[Ee.length-1];return(Re==null?void 0:Re.kind)==="text"?Ee[Ee.length-1]={...Re,content:Re.content+(ie.content||"")}:Ee.push({kind:"text",content:ie.content||""}),[...ce.slice(0,-1),{...ve,parts:Ee}]}return[...ce,{role:"assistant",parts:[{kind:"text",content:ie.content||""}]}]});break;case"tool.start":{const ce=ie.toolCallId||"";if(ce&&J.current.has(ce))se(ce,ve=>({...ve,...ie.toolTitle!=null?{title:ie.toolTitle}:{}}));else{const ve={kind:"tool",id:ce,name:ie.toolName||"",args:ie.toolArgs,title:ie.toolTitle,status:"running"};u(Ee=>{const Re=Ee[Ee.length-1];if(Re&&Re.role==="assistant"){const Ze=[...Re.parts,ve];return ce&&J.current.set(ce,Ze.length-1),[...Ee.slice(0,-1),{...Re,parts:Ze}]}return ce&&J.current.set(ce,0),[...Ee,{role:"assistant",parts:[ve]}]})}break}case"tool.done":ie.toolCallId&&se(ie.toolCallId,ce=>({...ce,status:"done",duration:ie.toolDuration,title:ie.toolTitle}));break;case"tool.error":ie.toolCallId&&se(ie.toolCallId,ce=>({...ce,status:"error",duration:ie.toolDuration,error:ie.error}));break;case"message.done":break;case"error":W({kind:"error",message:ie.error||"unknown error"});break;case"done":b(!1);break}},[W,ne,se]);V.useEffect(()=>{if(r)return r.current=ie=>{switch(ie.type){case"chat.userMessage":J.current.clear(),u(ce=>[...ce,{role:"user",text:ie.text},{role:"assistant",parts:[]}]),b(!0);break;case"chat.event":ie.event&&D(ie.event);break;case"chat.done":b(!1);break}},()=>{r.current=void 0}},[D,r]);const q=V.useCallback(()=>{const ie=d.trim();if(!ie||S)return;_(""),b(!0);const ce={type:"chat.send",message:ie};t&&(ce.fileContext=t),n(ce)},[d,S,t,n]),F=V.useCallback(()=>{n({type:"chat.stop"})},[n]),re=ie=>{ie.key==="Enter"&&!ie.shiftKey&&!ie.nativeEvent.isComposing&&(ie.preventDefault(),q())},le=()=>{v(!0),ge.current=Date.now()},E=()=>{v(!1),Date.now()-ge.current<300},M=ie=>{ie.preventDefault(),le();const ce=()=>{E(),window.removeEventListener("mouseup",ce)};window.addEventListener("mouseup",ce)},X=ie=>{ie.preventDefault(),le();const ce=()=>{E(),window.removeEventListener("touchend",ce)};window.addEventListener("touchend",ce)},te=V.useCallback((ie,ce)=>{I&&j(null),$.current={startX:ie,startY:ce,origX:T.x,origY:T.y}},[T,I]),ue=V.useCallback((ie,ce)=>{$.current&&O({x:$.current.origX+ie-$.current.startX,y:$.current.origY+ce-$.current.startY})},[]),pe=V.useCallback(()=>{$.current&&($.current=null,O(ie=>{const ve=window.innerWidth-20+ie.x;return ve-H.w<R0?j("left"):window.innerWidth-ve<R0&&j("right"),ie}))},[H.w]),we=ie=>{ie.preventDefault(),te(ie.clientX,ie.clientY);const ce=Ee=>ue(Ee.clientX,Ee.clientY),ve=()=>{pe(),window.removeEventListener("mousemove",ce),window.removeEventListener("mouseup",ve)};window.addEventListener("mousemove",ce),window.addEventListener("mouseup",ve)},We=ie=>{const ce=ie.touches[0];te(ce.clientX,ce.clientY);const ve=Re=>{Re.preventDefault(),ue(Re.touches[0].clientX,Re.touches[0].clientY)},Ee=()=>{pe(),window.removeEventListener("touchmove",ve),window.removeEventListener("touchend",Ee)};window.addEventListener("touchmove",ve,{passive:!1}),window.addEventListener("touchend",Ee)},ze=V.useRef("bl"),Ft=V.useCallback((ie,ce,ve)=>{ze.current=ve,ee.current={startX:ie,startY:ce,origW:H.w,origH:H.h}},[H]),$e=V.useCallback((ie,ce)=>{if(!ee.current)return;const ve=ie-ee.current.startX,Ee=ce-ee.current.startY,Re=ze.current==="bl"?-ve:ve;B({w:Math.max(180,Math.min(600,ee.current.origW+Re)),h:Math.max(200,Math.min(800,ee.current.origH+Ee))})},[]),at=V.useCallback(()=>{ee.current=null},[]),Te=ie=>ce=>{ce.preventDefault(),ce.stopPropagation(),Ft(ce.clientX,ce.clientY,ie);const ve=Re=>$e(Re.clientX,Re.clientY),Ee=()=>{at(),window.removeEventListener("mousemove",ve),window.removeEventListener("mouseup",Ee)};window.addEventListener("mousemove",ve),window.addEventListener("mouseup",Ee)},si=ie=>ce=>{ce.stopPropagation();const ve=ce.touches[0];Ft(ve.clientX,ve.clientY,ie);const Ee=Ze=>{Ze.preventDefault(),$e(Ze.touches[0].clientX,Ze.touches[0].clientY)},Re=()=>{at(),window.removeEventListener("touchmove",Ee),window.removeEventListener("touchend",Re)};window.addEventListener("touchmove",Ee,{passive:!1}),window.addEventListener("touchend",Re)},ra=(ie,ce)=>{switch(ie.kind){case"thinking":return k.jsxs("details",{className:"co-thinking",children:[k.jsxs("summary",{children:["💭 Thinking ",k.jsx("span",{className:"co-thinking-dur",children:A0(ie.duration)||"…"})]}),k.jsx("div",{className:"co-thinking-content",children:ie.content})]},ce);case"tool":const ve=_L(ie);return k.jsxs("div",{className:`co-tool ${ie.status}`,title:ve,children:[k.jsx("span",{className:"co-tool-icon",children:ie.status==="running"?"⏳":ie.status==="done"?"✓":"✗"}),k.jsx("span",{className:"co-tool-name",children:ie.name}),k.jsx("span",{className:"co-tool-info",children:ve}),ie.duration!=null&&k.jsx("span",{className:"co-tool-dur",children:A0(ie.duration)})]},ce);case"text":return k.jsx("div",{className:"co-text",children:ie.content},ce);case"error":return k.jsxs("div",{className:"co-error",children:["⚠ ",ie.message]},ce)}},sa=l?"conversation-panel conversation-sidebar":"conversation-panel conversation-floating",eu=l?void 0:{transform:`translate(${T.x}px, ${T.y}px)`,width:H.w,height:H.h};if(!l&&I){const ie={position:"absolute",top:Math.max(20,Math.min(T.y+20,window.innerHeight-120)),[I]:0,zIndex:50};return k.jsxs("div",{className:`co-docked-tab co-docked-${I}`,style:ie,onClick:()=>j(null),onMouseDown:we,onTouchStart:We,children:[k.jsx(Vv,{}),S&&k.jsx("span",{className:"co-docked-dot"})]})}return k.jsxs("div",{className:sa,style:eu,children:[k.jsxs("div",{className:"conversation-header",...l?{}:{onMouseDown:we,onTouchStart:We},children:[!l&&k.jsx("div",{className:"drag-grip"}),k.jsxs("div",{className:"conversation-header-content",children:[k.jsx(Vv,{})," 对话"]})]}),k.jsxs("div",{className:"conversation-messages",ref:he,children:[c.length===0&&k.jsx("div",{className:"co-text",style:{color:"var(--color-text-dim)"},children:"你好!告诉我你想做什么"}),c.map((ie,ce)=>ie.role==="user"?k.jsx("div",{className:"co-user",children:ie.text},ce):k.jsx("div",{className:"co-response",children:ie.parts.map(ra)},ce))]}),t&&k.jsx("div",{className:"co-file-context",children:k.jsxs("span",{className:"co-file-context-text",children:[t.file.split("/").pop()," L",t.lines[0],"–",t.lines[t.lines.length-1]]})}),k.jsx("div",{className:"conversation-input",children:m?k.jsxs(k.Fragment,{children:[k.jsx("input",{type:"text",value:S?"":d,onChange:ie=>_(ie.target.value),onKeyDown:re,placeholder:S?"正在处理中...":"输入消息...",autoFocus:!0,disabled:S}),S?k.jsx("button",{className:"text-send-btn text-stop-btn",onClick:F,children:k.jsx(VC,{size:18})}):k.jsx("button",{className:"text-send-btn",onClick:q,children:k.jsx(IC,{})}),k.jsx("button",{className:"text-close-btn",onClick:()=>y(!1),children:k.jsx(HC,{})})]}):k.jsxs(k.Fragment,{children:[k.jsxs("div",{className:"mic-wrapper",children:[f&&k.jsxs("div",{className:"mic-tooltip",children:["录音中 ",Se,"s"]}),k.jsx("button",{className:`mic-btn ${f?"recording":""}`,onMouseDown:M,onTouchStart:X,children:k.jsx(zC,{})})]}),k.jsx("button",{className:"text-toggle-btn",onClick:()=>y(!0),children:k.jsx(PC,{})})]})}),!l&&k.jsxs(k.Fragment,{children:[k.jsx("div",{className:"co-resize-grip co-resize-bl",onMouseDown:Te("bl"),onTouchStart:si("bl")}),k.jsx("div",{className:"co-resize-grip co-resize-br",onMouseDown:Te("br"),onTouchStart:si("br")})]})]})}function vL(e){if(e.directory){const t=e.directory.split("/");return t[t.length-1]||e.directory}return e.isDefault?"默认":"新窗口"}function yL({windows:e,activeWindowId:t,onSwitch:r,onCreate:n,onDelete:l}){const[c,u]=V.useState(null),[d,_]=V.useState(null),f=V.useRef(null),v=V.useRef(new Map);V.useEffect(()=>{if(!c)return;const y=S=>{f.current&&!f.current.contains(S.target)&&u(null)};return document.addEventListener("mousedown",y),document.addEventListener("touchstart",y),()=>{document.removeEventListener("mousedown",y),document.removeEventListener("touchstart",y)}},[c]);const m=V.useCallback(y=>{y.id===t?y.isDefault||u(S=>{if(S===y.id)return null;const b=v.current.get(y.id);if(b){const x=b.getBoundingClientRect();_({x:x.left+x.width/2,y:x.top})}return y.id}):(u(null),r(y.id))},[t,r]);return k.jsxs("nav",{className:"taskbar",ref:f,children:[k.jsx("div",{className:"taskbar-items",children:e.map(y=>k.jsx("button",{ref:S=>{S&&v.current.set(y.id,S)},className:`taskbar-item ${y.id===t?"active":""}`,onClick:()=>m(y),children:k.jsx("span",{className:"taskbar-label",children:vL(y)})},y.id))}),k.jsx("button",{className:"taskbar-add",onClick:n,title:"新建窗口",children:"+"}),c&&d&&k.jsx("div",{className:"taskbar-popover",style:{left:d.x,top:d.y},children:k.jsx("button",{className:"taskbar-popover-btn",onClick:()=>{const y=c;u(null),l(y)},children:"关闭窗口"})})]})}const Fs="";function SL({sessionId:e,visible:t,onWindowsChanged:r}){const[n,l]=V.useState("files"),[c,u]=V.useState(""),[d,_]=V.useState([]),[f,v]=V.useState([]),[m,y]=V.useState(null),[S,b]=V.useState(null),x=V.useRef(void 0),T=V.useRef(null),O=V.useCallback(j=>{var $;($=T.current)==null||$.send(j)},[]);V.useEffect(()=>{let j=!1,$=1e3,ee;function ge(){if(j)return;const Se=BC(e);T.current=Se,Se.onopen=()=>{$=1e3,r()},Se.onmessage=_e=>{var he,J;_e.type==="state"?(_e.directory&&u(_e.directory),_(_e.topLevel||[]),v(_e.changes||[]),_e.previewPort!==void 0&&b(_e.previewPort)):(he=_e.type)!=null&&he.startsWith("chat.")&&((J=x.current)==null||J.call(x,_e))},Se.onclose=()=>{T.current=null,j||(ee=setTimeout(()=>{$=Math.min($*1.5,1e4),ge()},$))}}return ge(),()=>{var Se;j=!0,clearTimeout(ee),(Se=T.current)==null||Se.close(),T.current=null}},[e,r]);const H=V.useCallback(async j=>{try{const $=await fetch(`${Fs}/api/sessions/${e}/ls?path=${encodeURIComponent(j)}`);return $.ok?(await $.json()).entries??[]:[]}catch{return[]}},[e]),B=V.useCallback(async j=>{try{const $=await fetch(`${Fs}/api/sessions/${e}/file?path=${encodeURIComponent(j)}`);return $.ok?(await $.json()).content??null:null}catch{return null}},[e]),I=V.useCallback(async j=>{try{const $=await fetch(`${Fs}/api/sessions/${e}/diff?path=${encodeURIComponent(j)}`);return $.ok?await $.json():{added:[],removed:[]}}catch{return{added:[],removed:[]}}},[e]);return k.jsxs("div",{className:"app-content",style:{display:t?"flex":"none"},children:[k.jsxs("div",{className:"app-main",children:[c?k.jsx(dL,{activeTab:n,topLevel:d,changes:f,directory:c,sessionId:e,previewPort:S,requestLs:H,requestFile:B,requestDiff:I,onFileContext:y}):k.jsx("div",{className:"main-view",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:k.jsxs("div",{style:{textAlign:"center"},children:[k.jsx("p",{style:{color:"var(--color-text-dim)",fontSize:"14px",opacity:.4,fontWeight:500},children:"通过对话面板"}),k.jsx("p",{style:{color:"var(--color-text-dim)",fontSize:"11px",opacity:.3,marginTop:"6px"},children:"打开一个项目并开始"})]})}),k.jsx($C,{activeTab:n,onTabChange:l,changeCount:f.length})]}),k.jsx(gL,{sessionId:e,fileContext:m,chatHandlerRef:x,sendMessage:O})]})}function bL(){const[e,t]=V.useState(null),[r,n]=V.useState([]),[l,c]=V.useState(null),u=V.useCallback(async()=>{try{const v=await fetch(`${Fs}/api/windows`);if(v.ok){const m=await v.json();n(m)}}catch{}},[]);V.useEffect(()=>{(async()=>{try{const m=await(await fetch(`${Fs}/api/sessions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})).json();if(m.error)throw new Error(m.error);t(m.id),u()}catch(v){c(v.message)}})()},[u]);const d=V.useCallback(v=>{t(v)},[]),_=V.useCallback(async()=>{try{const m=await(await fetch(`${Fs}/api/windows`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})).json();if(m.error)return;t(m.id),u()}catch{}},[u]),f=V.useCallback(async v=>{try{if(!(await fetch(`${Fs}/api/windows/${v}`,{method:"DELETE"})).ok)return;if(v===e){const y=r.filter(b=>b.id!==v),S=y.find(b=>b.isDefault)||y[0];S&&t(S.id)}u()}catch{}},[e,r,u]);return l?k.jsx("div",{className:"app",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:k.jsxs("p",{style:{color:"var(--red)",fontSize:"14px"},children:["连接失败: ",l]})}):e?k.jsxs("div",{className:"app-root",children:[r.map(v=>k.jsx(SL,{sessionId:v.id,visible:v.id===e,onWindowsChanged:u},v.id)),k.jsx(yL,{windows:r,activeWindowId:e,onSwitch:d,onCreate:_,onDelete:f})]}):k.jsx("div",{className:"app",style:{display:"flex",alignItems:"center",justifyContent:"center"},children:k.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:"连接服务器中…"})})}MC.createRoot(document.getElementById("root")).render(k.jsx(V.StrictMode,{children:k.jsx(bL,{})}));
|