@caoruhua/open-claude-remote 0.3.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,152 +0,0 @@
1
- (function(){const C=document.createElement("link").relList;if(C&&C.supports&&C.supports("modulepreload"))return;for(const H of document.querySelectorAll('link[rel="modulepreload"]'))A(H);new MutationObserver(H=>{for(const N of H)if(N.type==="childList")for(const z of N.addedNodes)z.tagName==="LINK"&&z.rel==="modulepreload"&&A(z)}).observe(document,{childList:!0,subtree:!0});function D(H){const N={};return H.integrity&&(N.integrity=H.integrity),H.referrerPolicy&&(N.referrerPolicy=H.referrerPolicy),H.crossOrigin==="use-credentials"?N.credentials="include":H.crossOrigin==="anonymous"?N.credentials="omit":N.credentials="same-origin",N}function A(H){if(H.ep)return;H.ep=!0;const N=D(H);fetch(H.href,N)}})();function Fp(_){return _&&_.__esModule&&Object.prototype.hasOwnProperty.call(_,"default")?_.default:_}var Cc={exports:{}},xn={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Yf;function qp(){if(Yf)return xn;Yf=1;var _=Symbol.for("react.transitional.element"),C=Symbol.for("react.fragment");function D(A,H,N){var z=null;if(N!==void 0&&(z=""+N),H.key!==void 0&&(z=""+H.key),"key"in H){N={};for(var r in H)r!=="key"&&(N[r]=H[r])}else N=H;return H=N.ref,{$$typeof:_,type:A,key:z,ref:H!==void 0?H:null,props:N}}return xn.Fragment=C,xn.jsx=D,xn.jsxs=D,xn}var Vf;function Wp(){return Vf||(Vf=1,Cc.exports=qp()),Cc.exports}var V=Wp(),wc={exports:{}},Re={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Xf;function $p(){if(Xf)return Re;Xf=1;var _=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),H=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),z=Symbol.for("react.context"),r=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),l=Symbol.for("react.activity"),p=Symbol.iterator;function b(k){return k===null||typeof k!="object"?null:(k=p&&k[p]||k["@@iterator"],typeof k=="function"?k:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},f=Object.assign,n={};function a(k,P,Q){this.props=k,this.context=P,this.refs=n,this.updater=Q||w}a.prototype.isReactComponent={},a.prototype.setState=function(k,P){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,P,"setState")},a.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function o(){}o.prototype=a.prototype;function c(k,P,Q){this.props=k,this.context=P,this.refs=n,this.updater=Q||w}var S=c.prototype=new o;S.constructor=c,f(S,a.prototype),S.isPureReactComponent=!0;var x=Array.isArray;function m(){}var E={H:null,A:null,T:null,S:null},y=Object.prototype.hasOwnProperty;function R(k,P,Q){var ee=Q.ref;return{$$typeof:_,type:k,key:P,ref:ee!==void 0?ee:null,props:Q}}function T(k,P){return R(k.type,P,k.props)}function I(k){return typeof k=="object"&&k!==null&&k.$$typeof===_}function B(k){var P={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(Q){return P[Q]})}var M=/\/+/g;function $(k,P){return typeof k=="object"&&k!==null&&k.key!=null?B(""+k.key):P.toString(36)}function Y(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(m,m):(k.status="pending",k.then(function(P){k.status==="pending"&&(k.status="fulfilled",k.value=P)},function(P){k.status==="pending"&&(k.status="rejected",k.reason=P)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function G(k,P,Q,ee,he){var oe=typeof k;(oe==="undefined"||oe==="boolean")&&(k=null);var K=!1;if(k===null)K=!0;else switch(oe){case"bigint":case"string":case"number":K=!0;break;case"object":switch(k.$$typeof){case _:case C:K=!0;break;case g:return K=k._init,G(K(k._payload),P,Q,ee,he)}}if(K)return he=he(k),K=ee===""?"."+$(k,0):ee,x(he)?(Q="",K!=null&&(Q=K.replace(M,"$&/")+"/"),G(he,P,Q,"",function(te){return te})):he!=null&&(I(he)&&(he=T(he,Q+(he.key==null||k&&k.key===he.key?"":(""+he.key).replace(M,"$&/")+"/")+K)),P.push(he)),1;K=0;var U=ee===""?".":ee+":";if(x(k))for(var ne=0;ne<k.length;ne++)ee=k[ne],oe=U+$(ee,ne),K+=G(ee,P,Q,oe,he);else if(ne=b(k),typeof ne=="function")for(k=ne.call(k),ne=0;!(ee=k.next()).done;)ee=ee.value,oe=U+$(ee,ne++),K+=G(ee,P,Q,oe,he);else if(oe==="object"){if(typeof k.then=="function")return G(Y(k),P,Q,ee,he);throw P=String(k),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return K}function W(k,P,Q){if(k==null)return k;var ee=[],he=0;return G(k,ee,"","",function(oe){return P.call(Q,oe,he++)}),ee}function X(k){if(k._status===-1){var P=k._result;P=P(),P.then(function(Q){(k._status===0||k._status===-1)&&(k._status=1,k._result=Q)},function(Q){(k._status===0||k._status===-1)&&(k._status=2,k._result=Q)}),k._status===-1&&(k._status=0,k._result=P)}if(k._status===1)return k._result.default;throw k._result}var O=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},F={map:W,forEach:function(k,P,Q){W(k,function(){P.apply(this,arguments)},Q)},count:function(k){var P=0;return W(k,function(){P++}),P},toArray:function(k){return W(k,function(P){return P})||[]},only:function(k){if(!I(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return Re.Activity=l,Re.Children=F,Re.Component=a,Re.Fragment=D,Re.Profiler=H,Re.PureComponent=c,Re.StrictMode=A,Re.Suspense=u,Re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=E,Re.__COMPILER_RUNTIME={__proto__:null,c:function(k){return E.H.useMemoCache(k)}},Re.cache=function(k){return function(){return k.apply(null,arguments)}},Re.cacheSignal=function(){return null},Re.cloneElement=function(k,P,Q){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var ee=f({},k.props),he=k.key;if(P!=null)for(oe in P.key!==void 0&&(he=""+P.key),P)!y.call(P,oe)||oe==="key"||oe==="__self"||oe==="__source"||oe==="ref"&&P.ref===void 0||(ee[oe]=P[oe]);var oe=arguments.length-2;if(oe===1)ee.children=Q;else if(1<oe){for(var K=Array(oe),U=0;U<oe;U++)K[U]=arguments[U+2];ee.children=K}return R(k.type,he,ee)},Re.createContext=function(k){return k={$$typeof:z,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:N,_context:k},k},Re.createElement=function(k,P,Q){var ee,he={},oe=null;if(P!=null)for(ee in P.key!==void 0&&(oe=""+P.key),P)y.call(P,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(he[ee]=P[ee]);var K=arguments.length-2;if(K===1)he.children=Q;else if(1<K){for(var U=Array(K),ne=0;ne<K;ne++)U[ne]=arguments[ne+2];he.children=U}if(k&&k.defaultProps)for(ee in K=k.defaultProps,K)he[ee]===void 0&&(he[ee]=K[ee]);return R(k,oe,he)},Re.createRef=function(){return{current:null}},Re.forwardRef=function(k){return{$$typeof:r,render:k}},Re.isValidElement=I,Re.lazy=function(k){return{$$typeof:g,_payload:{_status:-1,_result:k},_init:X}},Re.memo=function(k,P){return{$$typeof:d,type:k,compare:P===void 0?null:P}},Re.startTransition=function(k){var P=E.T,Q={};E.T=Q;try{var ee=k(),he=E.S;he!==null&&he(Q,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(m,O)}catch(oe){O(oe)}finally{P!==null&&Q.types!==null&&(P.types=Q.types),E.T=P}},Re.unstable_useCacheRefresh=function(){return E.H.useCacheRefresh()},Re.use=function(k){return E.H.use(k)},Re.useActionState=function(k,P,Q){return E.H.useActionState(k,P,Q)},Re.useCallback=function(k,P){return E.H.useCallback(k,P)},Re.useContext=function(k){return E.H.useContext(k)},Re.useDebugValue=function(){},Re.useDeferredValue=function(k,P){return E.H.useDeferredValue(k,P)},Re.useEffect=function(k,P){return E.H.useEffect(k,P)},Re.useEffectEvent=function(k){return E.H.useEffectEvent(k)},Re.useId=function(){return E.H.useId()},Re.useImperativeHandle=function(k,P,Q){return E.H.useImperativeHandle(k,P,Q)},Re.useInsertionEffect=function(k,P){return E.H.useInsertionEffect(k,P)},Re.useLayoutEffect=function(k,P){return E.H.useLayoutEffect(k,P)},Re.useMemo=function(k,P){return E.H.useMemo(k,P)},Re.useOptimistic=function(k,P){return E.H.useOptimistic(k,P)},Re.useReducer=function(k,P,Q){return E.H.useReducer(k,P,Q)},Re.useRef=function(k){return E.H.useRef(k)},Re.useState=function(k){return E.H.useState(k)},Re.useSyncExternalStore=function(k,P,Q){return E.H.useSyncExternalStore(k,P,Q)},Re.useTransition=function(){return E.H.useTransition()},Re.version="19.2.4",Re}var Kf;function Gc(){return Kf||(Kf=1,wc.exports=$p()),wc.exports}var q=Gc();const xt=Fp(q);var xc={exports:{}},En={},Ec={exports:{}},Rc={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Zf;function Gp(){return Zf||(Zf=1,(function(_){function C(G,W){var X=G.length;G.push(W);e:for(;0<X;){var O=X-1>>>1,F=G[O];if(0<H(F,W))G[O]=W,G[X]=F,X=O;else break e}}function D(G){return G.length===0?null:G[0]}function A(G){if(G.length===0)return null;var W=G[0],X=G.pop();if(X!==W){G[0]=X;e:for(var O=0,F=G.length,k=F>>>1;O<k;){var P=2*(O+1)-1,Q=G[P],ee=P+1,he=G[ee];if(0>H(Q,X))ee<F&&0>H(he,Q)?(G[O]=he,G[ee]=X,O=ee):(G[O]=Q,G[P]=X,O=P);else if(ee<F&&0>H(he,X))G[O]=he,G[ee]=X,O=ee;else break e}}return W}function H(G,W){var X=G.sortIndex-W.sortIndex;return X!==0?X:G.id-W.id}if(_.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var N=performance;_.unstable_now=function(){return N.now()}}else{var z=Date,r=z.now();_.unstable_now=function(){return z.now()-r}}var u=[],d=[],g=1,l=null,p=3,b=!1,w=!1,f=!1,n=!1,a=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,c=typeof setImmediate<"u"?setImmediate:null;function S(G){for(var W=D(d);W!==null;){if(W.callback===null)A(d);else if(W.startTime<=G)A(d),W.sortIndex=W.expirationTime,C(u,W);else break;W=D(d)}}function x(G){if(f=!1,S(G),!w)if(D(u)!==null)w=!0,m||(m=!0,B());else{var W=D(d);W!==null&&Y(x,W.startTime-G)}}var m=!1,E=-1,y=5,R=-1;function T(){return n?!0:!(_.unstable_now()-R<y)}function I(){if(n=!1,m){var G=_.unstable_now();R=G;var W=!0;try{e:{w=!1,f&&(f=!1,o(E),E=-1),b=!0;var X=p;try{t:{for(S(G),l=D(u);l!==null&&!(l.expirationTime>G&&T());){var O=l.callback;if(typeof O=="function"){l.callback=null,p=l.priorityLevel;var F=O(l.expirationTime<=G);if(G=_.unstable_now(),typeof F=="function"){l.callback=F,S(G),W=!0;break t}l===D(u)&&A(u),S(G)}else A(u);l=D(u)}if(l!==null)W=!0;else{var k=D(d);k!==null&&Y(x,k.startTime-G),W=!1}}break e}finally{l=null,p=X,b=!1}W=void 0}}finally{W?B():m=!1}}}var B;if(typeof c=="function")B=function(){c(I)};else if(typeof MessageChannel<"u"){var M=new MessageChannel,$=M.port2;M.port1.onmessage=I,B=function(){$.postMessage(null)}}else B=function(){a(I,0)};function Y(G,W){E=a(function(){G(_.unstable_now())},W)}_.unstable_IdlePriority=5,_.unstable_ImmediatePriority=1,_.unstable_LowPriority=4,_.unstable_NormalPriority=3,_.unstable_Profiling=null,_.unstable_UserBlockingPriority=2,_.unstable_cancelCallback=function(G){G.callback=null},_.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):y=0<G?Math.floor(1e3/G):5},_.unstable_getCurrentPriorityLevel=function(){return p},_.unstable_next=function(G){switch(p){case 1:case 2:case 3:var W=3;break;default:W=p}var X=p;p=W;try{return G()}finally{p=X}},_.unstable_requestPaint=function(){n=!0},_.unstable_runWithPriority=function(G,W){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var X=p;p=G;try{return W()}finally{p=X}},_.unstable_scheduleCallback=function(G,W,X){var O=_.unstable_now();switch(typeof X=="object"&&X!==null?(X=X.delay,X=typeof X=="number"&&0<X?O+X:O):X=O,G){case 1:var F=-1;break;case 2:F=250;break;case 5:F=1073741823;break;case 4:F=1e4;break;default:F=5e3}return F=X+F,G={id:g++,callback:W,priorityLevel:G,startTime:X,expirationTime:F,sortIndex:-1},X>O?(G.sortIndex=X,C(d,G),D(u)===null&&G===D(d)&&(f?(o(E),E=-1):f=!0,Y(x,X-O))):(G.sortIndex=F,C(u,G),w||b||(w=!0,m||(m=!0,B()))),G},_.unstable_shouldYield=T,_.unstable_wrapCallback=function(G){var W=p;return function(){var X=p;p=W;try{return G.apply(this,arguments)}finally{p=X}}}})(Rc)),Rc}var Qf;function Yp(){return Qf||(Qf=1,Ec.exports=Gp()),Ec.exports}var Ac={exports:{}},Ot={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var Jf;function Vp(){if(Jf)return Ot;Jf=1;var _=Gc();function C(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)d+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function D(){}var A={d:{f:D,r:function(){throw Error(C(522))},D,C:D,L:D,m:D,X:D,S:D,M:D},p:0,findDOMNode:null},H=Symbol.for("react.portal");function N(u,d,g){var l=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:H,key:l==null?null:""+l,children:u,containerInfo:d,implementation:g}}var z=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function r(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Ot.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,Ot.createPortal=function(u,d){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(C(299));return N(u,d,null,g)},Ot.flushSync=function(u){var d=z.T,g=A.p;try{if(z.T=null,A.p=2,u)return u()}finally{z.T=d,A.p=g,A.d.f()}},Ot.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,A.d.C(u,d))},Ot.prefetchDNS=function(u){typeof u=="string"&&A.d.D(u)},Ot.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var g=d.as,l=r(g,d.crossOrigin),p=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;g==="style"?A.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:l,integrity:p,fetchPriority:b}):g==="script"&&A.d.X(u,{crossOrigin:l,integrity:p,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ot.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var g=r(d.as,d.crossOrigin);A.d.M(u,{crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&A.d.M(u)},Ot.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var g=d.as,l=r(g,d.crossOrigin);A.d.L(u,g,{crossOrigin:l,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ot.preloadModule=function(u,d){if(typeof u=="string")if(d){var g=r(d.as,d.crossOrigin);A.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:g,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else A.d.m(u)},Ot.requestFormReset=function(u){A.d.r(u)},Ot.unstable_batchedUpdates=function(u,d){return u(d)},Ot.useFormState=function(u,d,g){return z.H.useFormState(u,d,g)},Ot.useFormStatus=function(){return z.H.useHostTransitionStatus()},Ot.version="19.2.4",Ot}var e_;function N_(){if(e_)return Ac.exports;e_=1;function _(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_)}catch(C){console.error(C)}}return _(),Ac.exports=Vp(),Ac.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var t_;function Xp(){if(t_)return En;t_=1;var _=Yp(),C=Gc(),D=N_();function A(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function H(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function N(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function z(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function r(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(N(e)!==e)throw Error(A(188))}function d(e){var t=e.alternate;if(!t){if(t=N(e),t===null)throw Error(A(188));return t!==e?null:e}for(var i=e,s=t;;){var h=i.return;if(h===null)break;var v=h.alternate;if(v===null){if(s=h.return,s!==null){i=s;continue}break}if(h.child===v.child){for(v=h.child;v;){if(v===i)return u(h),e;if(v===s)return u(h),t;v=v.sibling}throw Error(A(188))}if(i.return!==s.return)i=h,s=v;else{for(var L=!1,j=h.child;j;){if(j===i){L=!0,i=h,s=v;break}if(j===s){L=!0,s=h,i=v;break}j=j.sibling}if(!L){for(j=v.child;j;){if(j===i){L=!0,i=v,s=h;break}if(j===s){L=!0,s=v,i=h;break}j=j.sibling}if(!L)throw Error(A(189))}}if(i.alternate!==s)throw Error(A(190))}if(i.tag!==3)throw Error(A(188));return i.stateNode.current===i?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var l=Object.assign,p=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),m=Symbol.for("react.suspense_list"),E=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),I=Symbol.iterator;function B(e){return e===null||typeof e!="object"?null:(e=I&&e[I]||e["@@iterator"],typeof e=="function"?e:null)}var M=Symbol.for("react.client.reference");function $(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===M?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case f:return"Fragment";case a:return"Profiler";case n:return"StrictMode";case x:return"Suspense";case m:return"SuspenseList";case R:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case c:return e.displayName||"Context";case o:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case E:return t=e.displayName||null,t!==null?t:$(e.type)||"Memo";case y:t=e._payload,e=e._init;try{return $(e(t))}catch{}}return null}var Y=Array.isArray,G=C.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=D.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X={pending:!1,data:null,method:null,action:null},O=[],F=-1;function k(e){return{current:e}}function P(e){0>F||(e.current=O[F],O[F]=null,F--)}function Q(e,t){F++,O[F]=e.current,e.current=t}var ee=k(null),he=k(null),oe=k(null),K=k(null);function U(e,t){switch(Q(oe,t),Q(he,e),Q(ee,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vf(t),e=pf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}P(ee),Q(ee,e)}function ne(){P(ee),P(he),P(oe)}function te(e){e.memoizedState!==null&&Q(K,e);var t=ee.current,i=pf(t,e.type);t!==i&&(Q(he,e),Q(ee,i))}function _e(e){he.current===e&&(P(ee),P(he)),K.current===e&&(P(K),Sn._currentValue=X)}var fe,be;function ge(e){if(fe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||"",be=-1<i.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+fe+e+be}var Te=!1;function Pe(e,t){if(!e||Te)return"";Te=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(le){var ae=le}Reflect.construct(e,[],de)}else{try{de.call()}catch(le){ae=le}e.call(de.prototype)}}else{try{throw Error()}catch(le){ae=le}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(le){if(le&&ae&&typeof le.stack=="string")return[le.stack,ae.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=s.DetermineComponentFrameRoot(),L=v[0],j=v[1];if(L&&j){var Z=L.split(`
44
- `),re=j.split(`
45
- `);for(h=s=0;s<Z.length&&!Z[s].includes("DetermineComponentFrameRoot");)s++;for(;h<re.length&&!re[h].includes("DetermineComponentFrameRoot");)h++;if(s===Z.length||h===re.length)for(s=Z.length-1,h=re.length-1;1<=s&&0<=h&&Z[s]!==re[h];)h--;for(;1<=s&&0<=h;s--,h--)if(Z[s]!==re[h]){if(s!==1||h!==1)do if(s--,h--,0>h||Z[s]!==re[h]){var ce=`
46
- `+Z[s].replace(" at new "," at ");return e.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",e.displayName)),ce}while(1<=s&&0<=h);break}}}finally{Te=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?ge(i):""}function Se(e,t){switch(e.tag){case 26:case 27:case 5:return ge(e.type);case 16:return ge("Lazy");case 13:return e.child!==t&&t!==null?ge("Suspense Fallback"):ge("Suspense");case 19:return ge("SuspenseList");case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return ge("Activity");default:return""}}function Mt(e){try{var t="",i=null;do t+=Se(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
47
- Error generating stack: `+s.message+`
48
- `+s.stack}}var It=Object.prototype.hasOwnProperty,xe=_.unstable_scheduleCallback,Ee=_.unstable_cancelCallback,Ae=_.unstable_shouldYield,ve=_.unstable_requestPaint,we=_.unstable_now,Ze=_.unstable_getCurrentPriorityLevel,qe=_.unstable_ImmediatePriority,gt=_.unstable_UserBlockingPriority,Qe=_.unstable_NormalPriority,ct=_.unstable_LowPriority,Je=_.unstable_IdlePriority,ke=_.log,De=_.unstable_setDisableYieldValue,Xt=null,ut=null;function Et(e){if(typeof ke=="function"&&De(e),ut&&typeof ut.setStrictMode=="function")try{ut.setStrictMode(Xt,e)}catch{}}var vt=Math.clz32?Math.clz32:Or,Qi=Math.log,qs=Math.LN2;function Or(e){return e>>>=0,e===0?32:31-(Qi(e)/qs|0)|0}var Ei=256,Mi=262144,it=4194304;function rt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function St(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var h=0,v=e.suspendedLanes,L=e.pingedLanes;e=e.warmLanes;var j=s&134217727;return j!==0?(s=j&~v,s!==0?h=rt(s):(L&=j,L!==0?h=rt(L):i||(i=j&~e,i!==0&&(h=rt(i))))):(j=s&~v,j!==0?h=rt(j):L!==0?h=rt(L):i||(i=s&~e,i!==0&&(h=rt(i)))),h===0?0:t!==0&&t!==h&&(t&v)===0&&(v=h&-h,i=t&-t,v>=i||v===32&&(i&4194048)!==0)?t:h}function Nt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ut(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function kt(){var e=it;return it<<=1,(it&62914560)===0&&(it=4194304),e}function jt(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function ri(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function pt(e,t,i,s,h,v){var L=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var j=e.entanglements,Z=e.expirationTimes,re=e.hiddenUpdates;for(i=L&~i;0<i;){var ce=31-vt(i),de=1<<ce;j[ce]=0,Z[ce]=-1;var ae=re[ce];if(ae!==null)for(re[ce]=null,ce=0;ce<ae.length;ce++){var le=ae[ce];le!==null&&(le.lane&=-536870913)}i&=~de}s!==0&&bi(e,s,0),v!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=v&~(L&~t))}function bi(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-vt(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function Kt(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-vt(i),h=1<<s;h&t|e[s]&t&&(e[s]|=t),i&=~h}}function ni(e,t){var i=t&-t;return i=(i&42)!==0?1:ki(i),(i&(e.suspendedLanes|t))!==0?0:i}function ki(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Oi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Si(){var e=W.p;return e!==0?e:(e=window.event,e===void 0?32:jf(e.type))}function Ji(e,t){var i=W.p;try{return W.p=e,t()}finally{W.p=i}}var ai=Math.random().toString(36).slice(2),Rt="__reactFiber$"+ai,Pt="__reactProps$"+ai,Ws="__reactContainer$"+ai,fo="__reactEvents$"+ai,Mg="__reactListeners$"+ai,kg="__reactHandles$"+ai,iu="__reactResources$"+ai,Br="__reactMarker$"+ai;function _o(e){delete e[Rt],delete e[Pt],delete e[fo],delete e[Mg],delete e[kg]}function $s(e){var t=e[Rt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Ws]||i[Rt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=xf(e);e!==null;){if(i=e[Rt])return i;e=xf(e)}return t}e=i,i=e.parentNode}return null}function Gs(e){if(e=e[Rt]||e[Ws]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Hr(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(A(33))}function Ys(e){var t=e[iu];return t||(t=e[iu]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function yt(e){e[Br]=!0}var su=new Set,ru={};function Es(e,t){Vs(e,t),Vs(e+"Capture",t)}function Vs(e,t){for(ru[e]=t,e=0;e<t.length;e++)su.add(t[e])}var Og=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]*$"),nu={},au={};function Bg(e){return It.call(au,e)?!0:It.call(nu,e)?!1:Og.test(e)?au[e]=!0:(nu[e]=!0,!1)}function Un(e,t,i){if(Bg(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function jn(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Bi(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function oi(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ou(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Hg(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var h=s.get,v=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return h.call(this)},set:function(L){i=""+L,v.call(this,L)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(L){i=""+L},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function go(e){if(!e._valueTracker){var t=ou(e)?"checked":"value";e._valueTracker=Hg(e,t,""+e[t])}}function lu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=ou(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Pn(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var zg=/[\n"\\]/g;function li(e){return e.replace(zg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function vo(e,t,i,s,h,v,L,j){e.name="",L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?e.type=L:e.removeAttribute("type"),t!=null?L==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+oi(t)):e.value!==""+oi(t)&&(e.value=""+oi(t)):L!=="submit"&&L!=="reset"||e.removeAttribute("value"),t!=null?po(e,L,oi(t)):i!=null?po(e,L,oi(i)):s!=null&&e.removeAttribute("value"),h==null&&v!=null&&(e.defaultChecked=!!v),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"?e.name=""+oi(j):e.removeAttribute("name")}function cu(e,t,i,s,h,v,L,j){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(e.type=v),t!=null||i!=null){if(!(v!=="submit"&&v!=="reset"||t!=null)){go(e);return}i=i!=null?""+oi(i):"",t=t!=null?""+oi(t):i,j||t===e.value||(e.value=t),e.defaultValue=t}s=s??h,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=j?e.checked:!!s,e.defaultChecked=!!s,L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"&&(e.name=L),go(e)}function po(e,t,i){t==="number"&&Pn(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Xs(e,t,i,s){if(e=e.options,t){t={};for(var h=0;h<i.length;h++)t["$"+i[h]]=!0;for(i=0;i<e.length;i++)h=t.hasOwnProperty("$"+e[i].value),e[i].selected!==h&&(e[i].selected=h),h&&s&&(e[i].defaultSelected=!0)}else{for(i=""+oi(i),t=null,h=0;h<e.length;h++){if(e[h].value===i){e[h].selected=!0,s&&(e[h].defaultSelected=!0);return}t!==null||e[h].disabled||(t=e[h])}t!==null&&(t.selected=!0)}}function uu(e,t,i){if(t!=null&&(t=""+oi(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+oi(i):""}function hu(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(A(92));if(Y(s)){if(1<s.length)throw Error(A(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=oi(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),go(e)}function Ks(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var Ig=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 du(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||Ig.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function fu(e,t,i){if(t!=null&&typeof t!="object")throw Error(A(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var h in t)s=t[h],t.hasOwnProperty(h)&&i[h]!==s&&du(e,h,s)}else for(var v in t)t.hasOwnProperty(v)&&du(e,v,t[v])}function mo(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Ng=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"]]),Ug=/^[\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 Fn(e){return Ug.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Hi(){}var bo=null;function So(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zs=null,Qs=null;function _u(e){var t=Gs(e);if(t&&(e=t.stateNode)){var i=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(vo(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+li(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var h=s[Pt]||null;if(!h)throw Error(A(90));vo(s,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&lu(s)}break e;case"textarea":uu(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Xs(e,!!i.multiple,t,!1)}}}var yo=!1;function gu(e,t,i){if(yo)return e(t,i);yo=!0;try{var s=e(t);return s}finally{if(yo=!1,(Zs!==null||Qs!==null)&&(La(),Zs&&(t=Zs,e=Qs,Qs=Zs=null,_u(t),e)))for(t=0;t<e.length;t++)_u(e[t])}}function zr(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Pt]||null;if(s===null)return null;i=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(A(231,t,typeof i));return i}var zi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Co=!1;if(zi)try{var Ir={};Object.defineProperty(Ir,"passive",{get:function(){Co=!0}}),window.addEventListener("test",Ir,Ir),window.removeEventListener("test",Ir,Ir)}catch{Co=!1}var es=null,wo=null,qn=null;function vu(){if(qn)return qn;var e,t=wo,i=t.length,s,h="value"in es?es.value:es.textContent,v=h.length;for(e=0;e<i&&t[e]===h[e];e++);var L=i-e;for(s=1;s<=L&&t[i-s]===h[v-s];s++);return qn=h.slice(e,1<s?1-s:void 0)}function Wn(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function $n(){return!0}function pu(){return!1}function Ft(e){function t(i,s,h,v,L){this._reactName=i,this._targetInst=h,this.type=s,this.nativeEvent=v,this.target=L,this.currentTarget=null;for(var j in e)e.hasOwnProperty(j)&&(i=e[j],this[j]=i?i(v):v[j]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?$n:pu,this.isPropagationStopped=pu,this}return l(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=$n)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=$n)},persist:function(){},isPersistent:$n}),t}var Rs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gn=Ft(Rs),Nr=l({},Rs,{view:0,detail:0}),jg=Ft(Nr),xo,Eo,Ur,Yn=l({},Nr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ao,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ur&&(Ur&&e.type==="mousemove"?(xo=e.screenX-Ur.screenX,Eo=e.screenY-Ur.screenY):Eo=xo=0,Ur=e),xo)},movementY:function(e){return"movementY"in e?e.movementY:Eo}}),mu=Ft(Yn),Pg=l({},Yn,{dataTransfer:0}),Fg=Ft(Pg),qg=l({},Nr,{relatedTarget:0}),Ro=Ft(qg),Wg=l({},Rs,{animationName:0,elapsedTime:0,pseudoElement:0}),$g=Ft(Wg),Gg=l({},Rs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yg=Ft(Gg),Vg=l({},Rs,{data:0}),bu=Ft(Vg),Xg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kg={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"},Zg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zg[e])?!!t[e]:!1}function Ao(){return Qg}var Jg=l({},Nr,{key:function(e){if(e.key){var t=Xg[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Wn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Kg[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ao,charCode:function(e){return e.type==="keypress"?Wn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Wn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ev=Ft(Jg),tv=l({},Yn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Su=Ft(tv),iv=l({},Nr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ao}),sv=Ft(iv),rv=l({},Rs,{propertyName:0,elapsedTime:0,pseudoElement:0}),nv=Ft(rv),av=l({},Yn,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ov=Ft(av),lv=l({},Rs,{newState:0,oldState:0}),cv=Ft(lv),uv=[9,13,27,32],Do=zi&&"CompositionEvent"in window,jr=null;zi&&"documentMode"in document&&(jr=document.documentMode);var hv=zi&&"TextEvent"in window&&!jr,yu=zi&&(!Do||jr&&8<jr&&11>=jr),Cu=" ",wu=!1;function xu(e,t){switch(e){case"keyup":return uv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Js=!1;function dv(e,t){switch(e){case"compositionend":return Eu(t);case"keypress":return t.which!==32?null:(wu=!0,Cu);case"textInput":return e=t.data,e===Cu&&wu?null:e;default:return null}}function fv(e,t){if(Js)return e==="compositionend"||!Do&&xu(e,t)?(e=vu(),qn=wo=es=null,Js=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return yu&&t.locale!=="ko"?null:t.data;default:return null}}var _v={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 Ru(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!_v[e.type]:t==="textarea"}function Au(e,t,i,s){Zs?Qs?Qs.push(s):Qs=[s]:Zs=s,t=za(t,"onChange"),0<t.length&&(i=new Gn("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var Pr=null,Fr=null;function gv(e){uf(e,0)}function Vn(e){var t=Hr(e);if(lu(t))return e}function Du(e,t){if(e==="change")return t}var Lu=!1;if(zi){var Lo;if(zi){var To="oninput"in document;if(!To){var Tu=document.createElement("div");Tu.setAttribute("oninput","return;"),To=typeof Tu.oninput=="function"}Lo=To}else Lo=!1;Lu=Lo&&(!document.documentMode||9<document.documentMode)}function Mu(){Pr&&(Pr.detachEvent("onpropertychange",ku),Fr=Pr=null)}function ku(e){if(e.propertyName==="value"&&Vn(Fr)){var t=[];Au(t,Fr,e,So(e)),gu(gv,t)}}function vv(e,t,i){e==="focusin"?(Mu(),Pr=t,Fr=i,Pr.attachEvent("onpropertychange",ku)):e==="focusout"&&Mu()}function pv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Vn(Fr)}function mv(e,t){if(e==="click")return Vn(t)}function bv(e,t){if(e==="input"||e==="change")return Vn(t)}function Sv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:Sv;function qr(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var h=i[s];if(!It.call(t,h)||!Zt(e[h],t[h]))return!1}return!0}function Ou(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bu(e,t){var i=Ou(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=Ou(i)}}function Hu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Hu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function zu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Pn(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Pn(e.document)}return t}function Mo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var yv=zi&&"documentMode"in document&&11>=document.documentMode,er=null,ko=null,Wr=null,Oo=!1;function Iu(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Oo||er==null||er!==Pn(s)||(s=er,"selectionStart"in s&&Mo(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Wr&&qr(Wr,s)||(Wr=s,s=za(ko,"onSelect"),0<s.length&&(t=new Gn("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=er)))}function As(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var tr={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionrun:As("Transition","TransitionRun"),transitionstart:As("Transition","TransitionStart"),transitioncancel:As("Transition","TransitionCancel"),transitionend:As("Transition","TransitionEnd")},Bo={},Nu={};zi&&(Nu=document.createElement("div").style,"AnimationEvent"in window||(delete tr.animationend.animation,delete tr.animationiteration.animation,delete tr.animationstart.animation),"TransitionEvent"in window||delete tr.transitionend.transition);function Ds(e){if(Bo[e])return Bo[e];if(!tr[e])return e;var t=tr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Nu)return Bo[e]=t[i];return e}var Uu=Ds("animationend"),ju=Ds("animationiteration"),Pu=Ds("animationstart"),Cv=Ds("transitionrun"),wv=Ds("transitionstart"),xv=Ds("transitioncancel"),Fu=Ds("transitionend"),qu=new Map,Ho="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(" ");Ho.push("scrollEnd");function yi(e,t){qu.set(e,t),Es(t,[e])}var Xn=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=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(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ci=[],ir=0,zo=0;function Kn(){for(var e=ir,t=zo=ir=0;t<e;){var i=ci[t];ci[t++]=null;var s=ci[t];ci[t++]=null;var h=ci[t];ci[t++]=null;var v=ci[t];if(ci[t++]=null,s!==null&&h!==null){var L=s.pending;L===null?h.next=h:(h.next=L.next,L.next=h),s.pending=h}v!==0&&Wu(i,h,v)}}function Zn(e,t,i,s){ci[ir++]=e,ci[ir++]=t,ci[ir++]=i,ci[ir++]=s,zo|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Io(e,t,i,s){return Zn(e,t,i,s),Qn(e)}function Ls(e,t){return Zn(e,null,null,t),Qn(e)}function Wu(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var h=!1,v=e.return;v!==null;)v.childLanes|=i,s=v.alternate,s!==null&&(s.childLanes|=i),v.tag===22&&(e=v.stateNode,e===null||e._visibility&1||(h=!0)),e=v,v=v.return;return e.tag===3?(v=e.stateNode,h&&t!==null&&(h=31-vt(i),e=v.hiddenUpdates,s=e[h],s===null?e[h]=[t]:s.push(t),t.lane=i|536870912),v):null}function Qn(e){if(50<fn)throw fn=0,Gl=null,Error(A(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var sr={};function Ev(e,t,i,s){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qt(e,t,i,s){return new Ev(e,t,i,s)}function No(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ii(e,t){var i=e.alternate;return i===null?(i=Qt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function $u(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Jn(e,t,i,s,h,v){var L=0;if(s=e,typeof e=="function")No(e)&&(L=1);else if(typeof e=="string")L=Tp(e,i,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case R:return e=Qt(31,i,t,h),e.elementType=R,e.lanes=v,e;case f:return Ts(i.children,h,v,t);case n:L=8,h|=24;break;case a:return e=Qt(12,i,t,h|2),e.elementType=a,e.lanes=v,e;case x:return e=Qt(13,i,t,h),e.elementType=x,e.lanes=v,e;case m:return e=Qt(19,i,t,h),e.elementType=m,e.lanes=v,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case c:L=10;break e;case o:L=9;break e;case S:L=11;break e;case E:L=14;break e;case y:L=16,s=null;break e}L=29,i=Error(A(130,e===null?"null":typeof e,"")),s=null}return t=Qt(L,i,t,h),t.elementType=e,t.type=s,t.lanes=v,t}function Ts(e,t,i,s){return e=Qt(7,e,s,t),e.lanes=i,e}function Uo(e,t,i){return e=Qt(6,e,null,t),e.lanes=i,e}function Gu(e){var t=Qt(18,null,null,0);return t.stateNode=e,t}function jo(e,t,i){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Yu=new WeakMap;function ui(e,t){if(typeof e=="object"&&e!==null){var i=Yu.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Mt(t)},Yu.set(e,t),t)}return{value:e,source:t,stack:Mt(t)}}var rr=[],nr=0,ea=null,$r=0,hi=[],di=0,ts=null,Ri=1,Ai="";function Ni(e,t){rr[nr++]=$r,rr[nr++]=ea,ea=e,$r=t}function Vu(e,t,i){hi[di++]=Ri,hi[di++]=Ai,hi[di++]=ts,ts=e;var s=Ri;e=Ai;var h=32-vt(s)-1;s&=~(1<<h),i+=1;var v=32-vt(t)+h;if(30<v){var L=h-h%5;v=(s&(1<<L)-1).toString(32),s>>=L,h-=L,Ri=1<<32-vt(t)+h|i<<h|s,Ai=v+e}else Ri=1<<v|i<<h|s,Ai=e}function Po(e){e.return!==null&&(Ni(e,1),Vu(e,1,0))}function Fo(e){for(;e===ea;)ea=rr[--nr],rr[nr]=null,$r=rr[--nr],rr[nr]=null;for(;e===ts;)ts=hi[--di],hi[di]=null,Ai=hi[--di],hi[di]=null,Ri=hi[--di],hi[di]=null}function Xu(e,t){hi[di++]=Ri,hi[di++]=Ai,hi[di++]=ts,Ri=t.id,Ai=t.overflow,ts=e}var At=null,et=null,Ie=!1,is=null,fi=!1,qo=Error(A(519));function ss(e){var t=Error(A(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gr(ui(t,e)),qo}function Ku(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[Rt]=e,t[Pt]=s,i){case"dialog":Be("cancel",t),Be("close",t);break;case"iframe":case"object":case"embed":Be("load",t);break;case"video":case"audio":for(i=0;i<gn.length;i++)Be(gn[i],t);break;case"source":Be("error",t);break;case"img":case"image":case"link":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"input":Be("invalid",t),cu(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Be("invalid",t);break;case"textarea":Be("invalid",t),hu(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||_f(t.textContent,i)?(s.popover!=null&&(Be("beforetoggle",t),Be("toggle",t)),s.onScroll!=null&&Be("scroll",t),s.onScrollEnd!=null&&Be("scrollend",t),s.onClick!=null&&(t.onclick=Hi),t=!0):t=!1,t||ss(e,!0)}function Zu(e){for(At=e.return;At;)switch(At.tag){case 5:case 31:case 13:fi=!1;return;case 27:case 3:fi=!0;return;default:At=At.return}}function ar(e){if(e!==At)return!1;if(!Ie)return Zu(e),Ie=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||oc(e.type,e.memoizedProps)),i=!i),i&&et&&ss(e),Zu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));et=wf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(317));et=wf(e)}else t===27?(t=et,ps(e.type)?(e=dc,dc=null,et=e):et=t):et=At?gi(e.stateNode.nextSibling):null;return!0}function Ms(){et=At=null,Ie=!1}function Wo(){var e=is;return e!==null&&(Gt===null?Gt=e:Gt.push.apply(Gt,e),is=null),e}function Gr(e){is===null?is=[e]:is.push(e)}var $o=k(null),ks=null,Ui=null;function rs(e,t,i){Q($o,t._currentValue),t._currentValue=i}function ji(e){e._currentValue=$o.current,P($o)}function Go(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Yo(e,t,i,s){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var v=h.dependencies;if(v!==null){var L=h.child;v=v.firstContext;e:for(;v!==null;){var j=v;v=h;for(var Z=0;Z<t.length;Z++)if(j.context===t[Z]){v.lanes|=i,j=v.alternate,j!==null&&(j.lanes|=i),Go(v.return,i,e),s||(L=null);break e}v=j.next}}else if(h.tag===18){if(L=h.return,L===null)throw Error(A(341));L.lanes|=i,v=L.alternate,v!==null&&(v.lanes|=i),Go(L,i,e),L=null}else L=h.child;if(L!==null)L.return=h;else for(L=h;L!==null;){if(L===e){L=null;break}if(h=L.sibling,h!==null){h.return=L.return,L=h;break}L=L.return}h=L}}function or(e,t,i,s){e=null;for(var h=t,v=!1;h!==null;){if(!v){if((h.flags&524288)!==0)v=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var L=h.alternate;if(L===null)throw Error(A(387));if(L=L.memoizedProps,L!==null){var j=h.type;Zt(h.pendingProps.value,L.value)||(e!==null?e.push(j):e=[j])}}else if(h===K.current){if(L=h.alternate,L===null)throw Error(A(387));L.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(Sn):e=[Sn])}h=h.return}e!==null&&Yo(t,e,i,s),t.flags|=262144}function ta(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Os(e){ks=e,Ui=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Dt(e){return Qu(ks,e)}function ia(e,t){return ks===null&&Os(e),Qu(e,t)}function Qu(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ui===null){if(e===null)throw Error(A(308));Ui=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ui=Ui.next=t;return i}var Rv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},Av=_.unstable_scheduleCallback,Dv=_.unstable_NormalPriority,ht={$$typeof:c,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Vo(){return{controller:new Rv,data:new Map,refCount:0}}function Yr(e){e.refCount--,e.refCount===0&&Av(Dv,function(){e.controller.abort()})}var Vr=null,Xo=0,lr=0,cr=null;function Lv(e,t){if(Vr===null){var i=Vr=[];Xo=0,lr=Ql(),cr={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Xo++,t.then(Ju,Ju),t}function Ju(){if(--Xo===0&&Vr!==null){cr!==null&&(cr.status="fulfilled");var e=Vr;Vr=null,lr=0,cr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Tv(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(h){i.push(h)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var h=0;h<i.length;h++)(0,i[h])(t)},function(h){for(s.status="rejected",s.reason=h,h=0;h<i.length;h++)(0,i[h])(void 0)}),s}var eh=G.S;G.S=function(e,t){Id=we(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Lv(e,t),eh!==null&&eh(e,t)};var Bs=k(null);function Ko(){var e=Bs.current;return e!==null?e:Ke.pooledCache}function sa(e,t){t===null?Q(Bs,Bs.current):Q(Bs,t.pool)}function th(){var e=Ko();return e===null?null:{parent:ht._currentValue,pool:e}}var ur=Error(A(460)),Zo=Error(A(474)),ra=Error(A(542)),na={then:function(){}};function ih(e){return e=e.status,e==="fulfilled"||e==="rejected"}function sh(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(Hi,Hi),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nh(e),e;default:if(typeof t.status=="string")t.then(Hi,Hi);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(A(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var h=t;h.status="fulfilled",h.value=s}},function(s){if(t.status==="pending"){var h=t;h.status="rejected",h.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,nh(e),e}throw zs=t,ur}}function Hs(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(zs=i,ur):i}}var zs=null;function rh(){if(zs===null)throw Error(A(459));var e=zs;return zs=null,e}function nh(e){if(e===ur||e===ra)throw Error(A(483))}var hr=null,Xr=0;function aa(e){var t=Xr;return Xr+=1,hr===null&&(hr=[]),sh(hr,e,t)}function Kr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function oa(e,t){throw t.$$typeof===p?Error(A(525)):(e=Object.prototype.toString.call(t),Error(A(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ah(e){function t(ie,J){if(e){var se=ie.deletions;se===null?(ie.deletions=[J],ie.flags|=16):se.push(J)}}function i(ie,J){if(!e)return null;for(;J!==null;)t(ie,J),J=J.sibling;return null}function s(ie){for(var J=new Map;ie!==null;)ie.key!==null?J.set(ie.key,ie):J.set(ie.index,ie),ie=ie.sibling;return J}function h(ie,J){return ie=Ii(ie,J),ie.index=0,ie.sibling=null,ie}function v(ie,J,se){return ie.index=se,e?(se=ie.alternate,se!==null?(se=se.index,se<J?(ie.flags|=67108866,J):se):(ie.flags|=67108866,J)):(ie.flags|=1048576,J)}function L(ie){return e&&ie.alternate===null&&(ie.flags|=67108866),ie}function j(ie,J,se,ue){return J===null||J.tag!==6?(J=Uo(se,ie.mode,ue),J.return=ie,J):(J=h(J,se),J.return=ie,J)}function Z(ie,J,se,ue){var ye=se.type;return ye===f?ce(ie,J,se.props.children,ue,se.key):J!==null&&(J.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===y&&Hs(ye)===J.type)?(J=h(J,se.props),Kr(J,se),J.return=ie,J):(J=Jn(se.type,se.key,se.props,null,ie.mode,ue),Kr(J,se),J.return=ie,J)}function re(ie,J,se,ue){return J===null||J.tag!==4||J.stateNode.containerInfo!==se.containerInfo||J.stateNode.implementation!==se.implementation?(J=jo(se,ie.mode,ue),J.return=ie,J):(J=h(J,se.children||[]),J.return=ie,J)}function ce(ie,J,se,ue,ye){return J===null||J.tag!==7?(J=Ts(se,ie.mode,ue,ye),J.return=ie,J):(J=h(J,se),J.return=ie,J)}function de(ie,J,se){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=Uo(""+J,ie.mode,se),J.return=ie,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return se=Jn(J.type,J.key,J.props,null,ie.mode,se),Kr(se,J),se.return=ie,se;case w:return J=jo(J,ie.mode,se),J.return=ie,J;case y:return J=Hs(J),de(ie,J,se)}if(Y(J)||B(J))return J=Ts(J,ie.mode,se,null),J.return=ie,J;if(typeof J.then=="function")return de(ie,aa(J),se);if(J.$$typeof===c)return de(ie,ia(ie,J),se);oa(ie,J)}return null}function ae(ie,J,se,ue){var ye=J!==null?J.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return ye!==null?null:j(ie,J,""+se,ue);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case b:return se.key===ye?Z(ie,J,se,ue):null;case w:return se.key===ye?re(ie,J,se,ue):null;case y:return se=Hs(se),ae(ie,J,se,ue)}if(Y(se)||B(se))return ye!==null?null:ce(ie,J,se,ue,null);if(typeof se.then=="function")return ae(ie,J,aa(se),ue);if(se.$$typeof===c)return ae(ie,J,ia(ie,se),ue);oa(ie,se)}return null}function le(ie,J,se,ue,ye){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ie=ie.get(se)||null,j(J,ie,""+ue,ye);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case b:return ie=ie.get(ue.key===null?se:ue.key)||null,Z(J,ie,ue,ye);case w:return ie=ie.get(ue.key===null?se:ue.key)||null,re(J,ie,ue,ye);case y:return ue=Hs(ue),le(ie,J,se,ue,ye)}if(Y(ue)||B(ue))return ie=ie.get(se)||null,ce(J,ie,ue,ye,null);if(typeof ue.then=="function")return le(ie,J,se,aa(ue),ye);if(ue.$$typeof===c)return le(ie,J,se,ia(J,ue),ye);oa(J,ue)}return null}function pe(ie,J,se,ue){for(var ye=null,Ue=null,me=J,Me=J=0,ze=null;me!==null&&Me<se.length;Me++){me.index>Me?(ze=me,me=null):ze=me.sibling;var je=ae(ie,me,se[Me],ue);if(je===null){me===null&&(me=ze);break}e&&me&&je.alternate===null&&t(ie,me),J=v(je,J,Me),Ue===null?ye=je:Ue.sibling=je,Ue=je,me=ze}if(Me===se.length)return i(ie,me),Ie&&Ni(ie,Me),ye;if(me===null){for(;Me<se.length;Me++)me=de(ie,se[Me],ue),me!==null&&(J=v(me,J,Me),Ue===null?ye=me:Ue.sibling=me,Ue=me);return Ie&&Ni(ie,Me),ye}for(me=s(me);Me<se.length;Me++)ze=le(me,ie,Me,se[Me],ue),ze!==null&&(e&&ze.alternate!==null&&me.delete(ze.key===null?Me:ze.key),J=v(ze,J,Me),Ue===null?ye=ze:Ue.sibling=ze,Ue=ze);return e&&me.forEach(function(Cs){return t(ie,Cs)}),Ie&&Ni(ie,Me),ye}function Ce(ie,J,se,ue){if(se==null)throw Error(A(151));for(var ye=null,Ue=null,me=J,Me=J=0,ze=null,je=se.next();me!==null&&!je.done;Me++,je=se.next()){me.index>Me?(ze=me,me=null):ze=me.sibling;var Cs=ae(ie,me,je.value,ue);if(Cs===null){me===null&&(me=ze);break}e&&me&&Cs.alternate===null&&t(ie,me),J=v(Cs,J,Me),Ue===null?ye=Cs:Ue.sibling=Cs,Ue=Cs,me=ze}if(je.done)return i(ie,me),Ie&&Ni(ie,Me),ye;if(me===null){for(;!je.done;Me++,je=se.next())je=de(ie,je.value,ue),je!==null&&(J=v(je,J,Me),Ue===null?ye=je:Ue.sibling=je,Ue=je);return Ie&&Ni(ie,Me),ye}for(me=s(me);!je.done;Me++,je=se.next())je=le(me,ie,Me,je.value,ue),je!==null&&(e&&je.alternate!==null&&me.delete(je.key===null?Me:je.key),J=v(je,J,Me),Ue===null?ye=je:Ue.sibling=je,Ue=je);return e&&me.forEach(function(Pp){return t(ie,Pp)}),Ie&&Ni(ie,Me),ye}function Xe(ie,J,se,ue){if(typeof se=="object"&&se!==null&&se.type===f&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case b:e:{for(var ye=se.key;J!==null;){if(J.key===ye){if(ye=se.type,ye===f){if(J.tag===7){i(ie,J.sibling),ue=h(J,se.props.children),ue.return=ie,ie=ue;break e}}else if(J.elementType===ye||typeof ye=="object"&&ye!==null&&ye.$$typeof===y&&Hs(ye)===J.type){i(ie,J.sibling),ue=h(J,se.props),Kr(ue,se),ue.return=ie,ie=ue;break e}i(ie,J);break}else t(ie,J);J=J.sibling}se.type===f?(ue=Ts(se.props.children,ie.mode,ue,se.key),ue.return=ie,ie=ue):(ue=Jn(se.type,se.key,se.props,null,ie.mode,ue),Kr(ue,se),ue.return=ie,ie=ue)}return L(ie);case w:e:{for(ye=se.key;J!==null;){if(J.key===ye)if(J.tag===4&&J.stateNode.containerInfo===se.containerInfo&&J.stateNode.implementation===se.implementation){i(ie,J.sibling),ue=h(J,se.children||[]),ue.return=ie,ie=ue;break e}else{i(ie,J);break}else t(ie,J);J=J.sibling}ue=jo(se,ie.mode,ue),ue.return=ie,ie=ue}return L(ie);case y:return se=Hs(se),Xe(ie,J,se,ue)}if(Y(se))return pe(ie,J,se,ue);if(B(se)){if(ye=B(se),typeof ye!="function")throw Error(A(150));return se=ye.call(se),Ce(ie,J,se,ue)}if(typeof se.then=="function")return Xe(ie,J,aa(se),ue);if(se.$$typeof===c)return Xe(ie,J,ia(ie,se),ue);oa(ie,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,J!==null&&J.tag===6?(i(ie,J.sibling),ue=h(J,se),ue.return=ie,ie=ue):(i(ie,J),ue=Uo(se,ie.mode,ue),ue.return=ie,ie=ue),L(ie)):i(ie,J)}return function(ie,J,se,ue){try{Xr=0;var ye=Xe(ie,J,se,ue);return hr=null,ye}catch(me){if(me===ur||me===ra)throw me;var Ue=Qt(29,me,null,ie.mode);return Ue.lanes=ue,Ue.return=ie,Ue}finally{}}}var Is=ah(!0),oh=ah(!1),ns=!1;function Qo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function as(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function os(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Fe&2)!==0){var h=s.pending;return h===null?t.next=t:(t.next=h.next,h.next=t),s.pending=t,t=Qn(e),Wu(e,null,i),t}return Zn(e,s,t,i),Qn(e)}function Zr(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Kt(e,i)}}function el(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var h=null,v=null;if(i=i.firstBaseUpdate,i!==null){do{var L={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};v===null?h=v=L:v=v.next=L,i=i.next}while(i!==null);v===null?h=v=t:v=v.next=t}else h=v=t;i={baseState:s.baseState,firstBaseUpdate:h,lastBaseUpdate:v,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var tl=!1;function Qr(){if(tl){var e=cr;if(e!==null)throw e}}function Jr(e,t,i,s){tl=!1;var h=e.updateQueue;ns=!1;var v=h.firstBaseUpdate,L=h.lastBaseUpdate,j=h.shared.pending;if(j!==null){h.shared.pending=null;var Z=j,re=Z.next;Z.next=null,L===null?v=re:L.next=re,L=Z;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,j=ce.lastBaseUpdate,j!==L&&(j===null?ce.firstBaseUpdate=re:j.next=re,ce.lastBaseUpdate=Z))}if(v!==null){var de=h.baseState;L=0,ce=re=Z=null,j=v;do{var ae=j.lane&-536870913,le=ae!==j.lane;if(le?(He&ae)===ae:(s&ae)===ae){ae!==0&&ae===lr&&(tl=!0),ce!==null&&(ce=ce.next={lane:0,tag:j.tag,payload:j.payload,callback:null,next:null});e:{var pe=e,Ce=j;ae=t;var Xe=i;switch(Ce.tag){case 1:if(pe=Ce.payload,typeof pe=="function"){de=pe.call(Xe,de,ae);break e}de=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=Ce.payload,ae=typeof pe=="function"?pe.call(Xe,de,ae):pe,ae==null)break e;de=l({},de,ae);break e;case 2:ns=!0}}ae=j.callback,ae!==null&&(e.flags|=64,le&&(e.flags|=8192),le=h.callbacks,le===null?h.callbacks=[ae]:le.push(ae))}else le={lane:ae,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ce===null?(re=ce=le,Z=de):ce=ce.next=le,L|=ae;if(j=j.next,j===null){if(j=h.shared.pending,j===null)break;le=j,j=le.next,le.next=null,h.lastBaseUpdate=le,h.shared.pending=null}}while(!0);ce===null&&(Z=de),h.baseState=Z,h.firstBaseUpdate=re,h.lastBaseUpdate=ce,v===null&&(h.shared.lanes=0),ds|=L,e.lanes=L,e.memoizedState=de}}function lh(e,t){if(typeof e!="function")throw Error(A(191,e));e.call(t)}function ch(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)lh(i[e],t)}var dr=k(null),la=k(0);function uh(e,t){e=Xi,Q(la,e),Q(dr,t),Xi=e|t.baseLanes}function il(){Q(la,Xi),Q(dr,dr.current)}function sl(){Xi=la.current,P(dr),P(la)}var Jt=k(null),_i=null;function ls(e){var t=e.alternate;Q(ot,ot.current&1),Q(Jt,e),_i===null&&(t===null||dr.current!==null||t.memoizedState!==null)&&(_i=e)}function rl(e){Q(ot,ot.current),Q(Jt,e),_i===null&&(_i=e)}function hh(e){e.tag===22?(Q(ot,ot.current),Q(Jt,e),_i===null&&(_i=e)):cs()}function cs(){Q(ot,ot.current),Q(Jt,Jt.current)}function ei(e){P(Jt),_i===e&&(_i=null),P(ot)}var ot=k(0);function ca(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||uc(i)||hc(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Pi=0,Le=null,Ye=null,dt=null,ua=!1,fr=!1,Ns=!1,ha=0,en=0,_r=null,Mv=0;function nt(){throw Error(A(321))}function nl(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!Zt(e[i],t[i]))return!1;return!0}function al(e,t,i,s,h,v){return Pi=v,Le=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,G.H=e===null||e.memoizedState===null?Vh:yl,Ns=!1,v=i(s,h),Ns=!1,fr&&(v=fh(t,i,s,h)),dh(e),v}function dh(e){G.H=rn;var t=Ye!==null&&Ye.next!==null;if(Pi=0,dt=Ye=Le=null,ua=!1,en=0,_r=null,t)throw Error(A(300));e===null||ft||(e=e.dependencies,e!==null&&ta(e)&&(ft=!0))}function fh(e,t,i,s){Le=e;var h=0;do{if(fr&&(_r=null),en=0,fr=!1,25<=h)throw Error(A(301));if(h+=1,dt=Ye=null,e.updateQueue!=null){var v=e.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}G.H=Xh,v=t(i,s)}while(fr);return v}function kv(){var e=G.H,t=e.useState()[0];return t=typeof t.then=="function"?tn(t):t,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(Le.flags|=1024),t}function ol(){var e=ha!==0;return ha=0,e}function ll(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function cl(e){if(ua){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ua=!1}Pi=0,dt=Ye=Le=null,fr=!1,en=ha=0,_r=null}function zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?Le.memoizedState=dt=e:dt=dt.next=e,dt}function lt(){if(Ye===null){var e=Le.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var t=dt===null?Le.memoizedState:dt.next;if(t!==null)dt=t,Ye=e;else{if(e===null)throw Le.alternate===null?Error(A(467)):Error(A(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},dt===null?Le.memoizedState=dt=e:dt=dt.next=e}return dt}function da(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function tn(e){var t=en;return en+=1,_r===null&&(_r=[]),e=sh(_r,e,t),t=Le,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,G.H=t===null||t.memoizedState===null?Vh:yl),e}function fa(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return tn(e);if(e.$$typeof===c)return Dt(e)}throw Error(A(438,String(e)))}function ul(e){var t=null,i=Le.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Le.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(h){return h.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=da(),Le.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=T;return t.index++,i}function Fi(e,t){return typeof t=="function"?t(e):t}function _a(e){var t=lt();return hl(t,Ye,e)}function hl(e,t,i){var s=e.queue;if(s===null)throw Error(A(311));s.lastRenderedReducer=i;var h=e.baseQueue,v=s.pending;if(v!==null){if(h!==null){var L=h.next;h.next=v.next,v.next=L}t.baseQueue=h=v,s.pending=null}if(v=e.baseState,h===null)e.memoizedState=v;else{t=h.next;var j=L=null,Z=null,re=t,ce=!1;do{var de=re.lane&-536870913;if(de!==re.lane?(He&de)===de:(Pi&de)===de){var ae=re.revertLane;if(ae===0)Z!==null&&(Z=Z.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),de===lr&&(ce=!0);else if((Pi&ae)===ae){re=re.next,ae===lr&&(ce=!0);continue}else de={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Z===null?(j=Z=de,L=v):Z=Z.next=de,Le.lanes|=ae,ds|=ae;de=re.action,Ns&&i(v,de),v=re.hasEagerState?re.eagerState:i(v,de)}else ae={lane:de,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Z===null?(j=Z=ae,L=v):Z=Z.next=ae,Le.lanes|=de,ds|=de;re=re.next}while(re!==null&&re!==t);if(Z===null?L=v:Z.next=j,!Zt(v,e.memoizedState)&&(ft=!0,ce&&(i=cr,i!==null)))throw i;e.memoizedState=v,e.baseState=L,e.baseQueue=Z,s.lastRenderedState=v}return h===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function dl(e){var t=lt(),i=t.queue;if(i===null)throw Error(A(311));i.lastRenderedReducer=e;var s=i.dispatch,h=i.pending,v=t.memoizedState;if(h!==null){i.pending=null;var L=h=h.next;do v=e(v,L.action),L=L.next;while(L!==h);Zt(v,t.memoizedState)||(ft=!0),t.memoizedState=v,t.baseQueue===null&&(t.baseState=v),i.lastRenderedState=v}return[v,s]}function _h(e,t,i){var s=Le,h=lt(),v=Ie;if(v){if(i===void 0)throw Error(A(407));i=i()}else i=t();var L=!Zt((Ye||h).memoizedState,i);if(L&&(h.memoizedState=i,ft=!0),h=h.queue,gl(ph.bind(null,s,h,e),[e]),h.getSnapshot!==t||L||dt!==null&&dt.memoizedState.tag&1){if(s.flags|=2048,gr(9,{destroy:void 0},vh.bind(null,s,h,i,t),null),Ke===null)throw Error(A(349));v||(Pi&127)!==0||gh(s,t,i)}return i}function gh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Le.updateQueue,t===null?(t=da(),Le.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function vh(e,t,i,s){t.value=i,t.getSnapshot=s,mh(t)&&bh(e)}function ph(e,t,i){return i(function(){mh(t)&&bh(e)})}function mh(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!Zt(e,i)}catch{return!0}}function bh(e){var t=Ls(e,2);t!==null&&Yt(t,e,2)}function fl(e){var t=zt();if(typeof e=="function"){var i=e;if(e=i(),Ns){Et(!0);try{i()}finally{Et(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:e},t}function Sh(e,t,i,s){return e.baseState=i,hl(e,Ye,typeof s=="function"?s:Fi)}function Ov(e,t,i,s,h){if(pa(e))throw Error(A(485));if(e=t.action,e!==null){var v={payload:h,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(L){v.listeners.push(L)}};G.T!==null?i(!0):v.isTransition=!1,s(v),i=t.pending,i===null?(v.next=t.pending=v,yh(t,v)):(v.next=i.next,t.pending=i.next=v)}}function yh(e,t){var i=t.action,s=t.payload,h=e.state;if(t.isTransition){var v=G.T,L={};G.T=L;try{var j=i(h,s),Z=G.S;Z!==null&&Z(L,j),Ch(e,t,j)}catch(re){_l(e,t,re)}finally{v!==null&&L.types!==null&&(v.types=L.types),G.T=v}}else try{v=i(h,s),Ch(e,t,v)}catch(re){_l(e,t,re)}}function Ch(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){wh(e,t,s)},function(s){return _l(e,t,s)}):wh(e,t,i)}function wh(e,t,i){t.status="fulfilled",t.value=i,xh(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,yh(e,i)))}function _l(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,xh(t),t=t.next;while(t!==s)}e.action=null}function xh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Eh(e,t){return t}function Rh(e,t){if(Ie){var i=Ke.formState;if(i!==null){e:{var s=Le;if(Ie){if(et){t:{for(var h=et,v=fi;h.nodeType!==8;){if(!v){h=null;break t}if(h=gi(h.nextSibling),h===null){h=null;break t}}v=h.data,h=v==="F!"||v==="F"?h:null}if(h){et=gi(h.nextSibling),s=h.data==="F!";break e}}ss(s)}s=!1}s&&(t=i[0])}}return i=zt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eh,lastRenderedState:t},i.queue=s,i=$h.bind(null,Le,s),s.dispatch=i,s=fl(!1),v=Sl.bind(null,Le,!1,s.queue),s=zt(),h={state:t,dispatch:null,action:e,pending:null},s.queue=h,i=Ov.bind(null,Le,h,v,i),h.dispatch=i,s.memoizedState=e,[t,i,!1]}function Ah(e){var t=lt();return Dh(t,Ye,e)}function Dh(e,t,i){if(t=hl(e,t,Eh)[0],e=_a(Fi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=tn(t)}catch(L){throw L===ur?ra:L}else s=t;t=lt();var h=t.queue,v=h.dispatch;return i!==t.memoizedState&&(Le.flags|=2048,gr(9,{destroy:void 0},Bv.bind(null,h,i),null)),[s,v,e]}function Bv(e,t){e.action=t}function Lh(e){var t=lt(),i=Ye;if(i!==null)return Dh(t,i,e);lt(),t=t.memoizedState,i=lt();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function gr(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Le.updateQueue,t===null&&(t=da(),Le.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function Th(){return lt().memoizedState}function ga(e,t,i,s){var h=zt();Le.flags|=e,h.memoizedState=gr(1|t,{destroy:void 0},i,s===void 0?null:s)}function va(e,t,i,s){var h=lt();s=s===void 0?null:s;var v=h.memoizedState.inst;Ye!==null&&s!==null&&nl(s,Ye.memoizedState.deps)?h.memoizedState=gr(t,v,i,s):(Le.flags|=e,h.memoizedState=gr(1|t,v,i,s))}function Mh(e,t){ga(8390656,8,e,t)}function gl(e,t){va(2048,8,e,t)}function Hv(e){Le.flags|=4;var t=Le.updateQueue;if(t===null)t=da(),Le.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function kh(e){var t=lt().memoizedState;return Hv({ref:t,nextImpl:e}),function(){if((Fe&2)!==0)throw Error(A(440));return t.impl.apply(void 0,arguments)}}function Oh(e,t){return va(4,2,e,t)}function Bh(e,t){return va(4,4,e,t)}function Hh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function zh(e,t,i){i=i!=null?i.concat([e]):null,va(4,4,Hh.bind(null,t,e),i)}function vl(){}function Ih(e,t){var i=lt();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&nl(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function Nh(e,t){var i=lt();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&nl(t,s[1]))return s[0];if(s=e(),Ns){Et(!0);try{e()}finally{Et(!1)}}return i.memoizedState=[s,t],s}function pl(e,t,i){return i===void 0||(Pi&1073741824)!==0&&(He&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Ud(),Le.lanes|=e,ds|=e,i)}function Uh(e,t,i,s){return Zt(i,t)?i:dr.current!==null?(e=pl(e,i,s),Zt(e,t)||(ft=!0),e):(Pi&42)===0||(Pi&1073741824)!==0&&(He&261930)===0?(ft=!0,e.memoizedState=i):(e=Ud(),Le.lanes|=e,ds|=e,t)}function jh(e,t,i,s,h){var v=W.p;W.p=v!==0&&8>v?v:8;var L=G.T,j={};G.T=j,Sl(e,!1,t,i);try{var Z=h(),re=G.S;if(re!==null&&re(j,Z),Z!==null&&typeof Z=="object"&&typeof Z.then=="function"){var ce=Tv(Z,s);sn(e,t,ce,si(e))}else sn(e,t,s,si(e))}catch(de){sn(e,t,{then:function(){},status:"rejected",reason:de},si())}finally{W.p=v,L!==null&&j.types!==null&&(L.types=j.types),G.T=L}}function zv(){}function ml(e,t,i,s){if(e.tag!==5)throw Error(A(476));var h=Ph(e).queue;jh(e,h,t,X,i===null?zv:function(){return Fh(e),i(s)})}function Ph(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:X,baseState:X,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:X},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Fh(e){var t=Ph(e);t.next===null&&(t=e.alternate.memoizedState),sn(e,t.next.queue,{},si())}function bl(){return Dt(Sn)}function qh(){return lt().memoizedState}function Wh(){return lt().memoizedState}function Iv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=si();e=as(i);var s=os(t,e,i);s!==null&&(Yt(s,t,i),Zr(s,t,i)),t={cache:Vo()},e.payload=t;return}t=t.return}}function Nv(e,t,i){var s=si();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},pa(e)?Gh(t,i):(i=Io(e,t,i,s),i!==null&&(Yt(i,e,s),Yh(i,t,s)))}function $h(e,t,i){var s=si();sn(e,t,i,s)}function sn(e,t,i,s){var h={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(pa(e))Gh(t,h);else{var v=e.alternate;if(e.lanes===0&&(v===null||v.lanes===0)&&(v=t.lastRenderedReducer,v!==null))try{var L=t.lastRenderedState,j=v(L,i);if(h.hasEagerState=!0,h.eagerState=j,Zt(j,L))return Zn(e,t,h,0),Ke===null&&Kn(),!1}catch{}finally{}if(i=Io(e,t,h,s),i!==null)return Yt(i,e,s),Yh(i,t,s),!0}return!1}function Sl(e,t,i,s){if(s={lane:2,revertLane:Ql(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},pa(e)){if(t)throw Error(A(479))}else t=Io(e,i,s,2),t!==null&&Yt(t,e,2)}function pa(e){var t=e.alternate;return e===Le||t!==null&&t===Le}function Gh(e,t){fr=ua=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Yh(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,Kt(e,i)}}var rn={readContext:Dt,use:fa,useCallback:nt,useContext:nt,useEffect:nt,useImperativeHandle:nt,useLayoutEffect:nt,useInsertionEffect:nt,useMemo:nt,useReducer:nt,useRef:nt,useState:nt,useDebugValue:nt,useDeferredValue:nt,useTransition:nt,useSyncExternalStore:nt,useId:nt,useHostTransitionStatus:nt,useFormState:nt,useActionState:nt,useOptimistic:nt,useMemoCache:nt,useCacheRefresh:nt};rn.useEffectEvent=nt;var Vh={readContext:Dt,use:fa,useCallback:function(e,t){return zt().memoizedState=[e,t===void 0?null:t],e},useContext:Dt,useEffect:Mh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ga(4194308,4,Hh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ga(4194308,4,e,t)},useInsertionEffect:function(e,t){ga(4,2,e,t)},useMemo:function(e,t){var i=zt();t=t===void 0?null:t;var s=e();if(Ns){Et(!0);try{e()}finally{Et(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=zt();if(i!==void 0){var h=i(t);if(Ns){Et(!0);try{i(t)}finally{Et(!1)}}}else h=t;return s.memoizedState=s.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},s.queue=e,e=e.dispatch=Nv.bind(null,Le,e),[s.memoizedState,e]},useRef:function(e){var t=zt();return e={current:e},t.memoizedState=e},useState:function(e){e=fl(e);var t=e.queue,i=$h.bind(null,Le,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:vl,useDeferredValue:function(e,t){var i=zt();return pl(i,e,t)},useTransition:function(){var e=fl(!1);return e=jh.bind(null,Le,e.queue,!0,!1),zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Le,h=zt();if(Ie){if(i===void 0)throw Error(A(407));i=i()}else{if(i=t(),Ke===null)throw Error(A(349));(He&127)!==0||gh(s,t,i)}h.memoizedState=i;var v={value:i,getSnapshot:t};return h.queue=v,Mh(ph.bind(null,s,v,e),[e]),s.flags|=2048,gr(9,{destroy:void 0},vh.bind(null,s,v,i,t),null),i},useId:function(){var e=zt(),t=Ke.identifierPrefix;if(Ie){var i=Ai,s=Ri;i=(s&~(1<<32-vt(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=ha++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Mv++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:bl,useFormState:Rh,useActionState:Rh,useOptimistic:function(e){var t=zt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Sl.bind(null,Le,!0,i),i.dispatch=t,[e,t]},useMemoCache:ul,useCacheRefresh:function(){return zt().memoizedState=Iv.bind(null,Le)},useEffectEvent:function(e){var t=zt(),i={impl:e};return t.memoizedState=i,function(){if((Fe&2)!==0)throw Error(A(440));return i.impl.apply(void 0,arguments)}}},yl={readContext:Dt,use:fa,useCallback:Ih,useContext:Dt,useEffect:gl,useImperativeHandle:zh,useInsertionEffect:Oh,useLayoutEffect:Bh,useMemo:Nh,useReducer:_a,useRef:Th,useState:function(){return _a(Fi)},useDebugValue:vl,useDeferredValue:function(e,t){var i=lt();return Uh(i,Ye.memoizedState,e,t)},useTransition:function(){var e=_a(Fi)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:tn(e),t]},useSyncExternalStore:_h,useId:qh,useHostTransitionStatus:bl,useFormState:Ah,useActionState:Ah,useOptimistic:function(e,t){var i=lt();return Sh(i,Ye,e,t)},useMemoCache:ul,useCacheRefresh:Wh};yl.useEffectEvent=kh;var Xh={readContext:Dt,use:fa,useCallback:Ih,useContext:Dt,useEffect:gl,useImperativeHandle:zh,useInsertionEffect:Oh,useLayoutEffect:Bh,useMemo:Nh,useReducer:dl,useRef:Th,useState:function(){return dl(Fi)},useDebugValue:vl,useDeferredValue:function(e,t){var i=lt();return Ye===null?pl(i,e,t):Uh(i,Ye.memoizedState,e,t)},useTransition:function(){var e=dl(Fi)[0],t=lt().memoizedState;return[typeof e=="boolean"?e:tn(e),t]},useSyncExternalStore:_h,useId:qh,useHostTransitionStatus:bl,useFormState:Lh,useActionState:Lh,useOptimistic:function(e,t){var i=lt();return Ye!==null?Sh(i,Ye,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:ul,useCacheRefresh:Wh};Xh.useEffectEvent=kh;function Cl(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:l({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var wl={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=si(),h=as(s);h.payload=t,i!=null&&(h.callback=i),t=os(e,h,s),t!==null&&(Yt(t,e,s),Zr(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=si(),h=as(s);h.tag=1,h.payload=t,i!=null&&(h.callback=i),t=os(e,h,s),t!==null&&(Yt(t,e,s),Zr(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=si(),s=as(i);s.tag=2,t!=null&&(s.callback=t),t=os(e,s,i),t!==null&&(Yt(t,e,i),Zr(t,e,i))}};function Kh(e,t,i,s,h,v,L){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,v,L):t.prototype&&t.prototype.isPureReactComponent?!qr(i,s)||!qr(h,v):!0}function Zh(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&wl.enqueueReplaceState(t,t.state,null)}function Us(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=l({},i));for(var h in e)i[h]===void 0&&(i[h]=e[h])}return i}function Qh(e){Xn(e)}function Jh(e){console.error(e)}function ed(e){Xn(e)}function ma(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function td(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function xl(e,t,i){return i=as(i),i.tag=3,i.payload={element:null},i.callback=function(){ma(e,t)},i}function id(e){return e=as(e),e.tag=3,e}function sd(e,t,i,s){var h=i.type.getDerivedStateFromError;if(typeof h=="function"){var v=s.value;e.payload=function(){return h(v)},e.callback=function(){td(t,i,s)}}var L=i.stateNode;L!==null&&typeof L.componentDidCatch=="function"&&(e.callback=function(){td(t,i,s),typeof h!="function"&&(fs===null?fs=new Set([this]):fs.add(this));var j=s.stack;this.componentDidCatch(s.value,{componentStack:j!==null?j:""})})}function Uv(e,t,i,s,h){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&or(t,i,h,!0),i=Jt.current,i!==null){switch(i.tag){case 31:case 13:return _i===null?Ta():i.alternate===null&&at===0&&(at=3),i.flags&=-257,i.flags|=65536,i.lanes=h,s===na?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Xl(e,s,h)),!1;case 22:return i.flags|=65536,s===na?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),Xl(e,s,h)),!1}throw Error(A(435,i.tag))}return Xl(e,s,h),Ta(),!1}if(Ie)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=h,s!==qo&&(e=Error(A(422),{cause:s}),Gr(ui(e,i)))):(s!==qo&&(t=Error(A(423),{cause:s}),Gr(ui(t,i))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,s=ui(s,i),h=xl(e.stateNode,s,h),el(e,h),at!==4&&(at=2)),!1;var v=Error(A(520),{cause:s});if(v=ui(v,i),dn===null?dn=[v]:dn.push(v),at!==4&&(at=2),t===null)return!0;s=ui(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=h&-h,i.lanes|=e,e=xl(i.stateNode,s,e),el(i,e),!1;case 1:if(t=i.type,v=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(fs===null||!fs.has(v))))return i.flags|=65536,h&=-h,i.lanes|=h,h=id(h),sd(h,e,i,s),el(i,h),!1}i=i.return}while(i!==null);return!1}var El=Error(A(461)),ft=!1;function Lt(e,t,i,s){t.child=e===null?oh(t,null,i,s):Is(t,e.child,i,s)}function rd(e,t,i,s,h){i=i.render;var v=t.ref;if("ref"in s){var L={};for(var j in s)j!=="ref"&&(L[j]=s[j])}else L=s;return Os(t),s=al(e,t,i,L,v,h),j=ol(),e!==null&&!ft?(ll(e,t,h),qi(e,t,h)):(Ie&&j&&Po(t),t.flags|=1,Lt(e,t,s,h),t.child)}function nd(e,t,i,s,h){if(e===null){var v=i.type;return typeof v=="function"&&!No(v)&&v.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=v,ad(e,t,v,s,h)):(e=Jn(i.type,null,s,t,t.mode,h),e.ref=t.ref,e.return=t,t.child=e)}if(v=e.child,!Ol(e,h)){var L=v.memoizedProps;if(i=i.compare,i=i!==null?i:qr,i(L,s)&&e.ref===t.ref)return qi(e,t,h)}return t.flags|=1,e=Ii(v,s),e.ref=t.ref,e.return=t,t.child=e}function ad(e,t,i,s,h){if(e!==null){var v=e.memoizedProps;if(qr(v,s)&&e.ref===t.ref)if(ft=!1,t.pendingProps=s=v,Ol(e,h))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,qi(e,t,h)}return Rl(e,t,i,s,h)}function od(e,t,i,s){var h=s.children,v=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(v=v!==null?v.baseLanes|i:i,e!==null){for(s=t.child=e.child,h=0;s!==null;)h=h|s.lanes|s.childLanes,s=s.sibling;s=h&~v}else s=0,t.child=null;return ld(e,t,v,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&sa(t,v!==null?v.cachePool:null),v!==null?uh(t,v):il(),hh(t);else return s=t.lanes=536870912,ld(e,t,v!==null?v.baseLanes|i:i,i,s)}else v!==null?(sa(t,v.cachePool),uh(t,v),cs(),t.memoizedState=null):(e!==null&&sa(t,null),il(),cs());return Lt(e,t,h,i),t.child}function nn(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ld(e,t,i,s,h){var v=Ko();return v=v===null?null:{parent:ht._currentValue,pool:v},t.memoizedState={baseLanes:i,cachePool:v},e!==null&&sa(t,null),il(),hh(t),e!==null&&or(e,t,s,!0),t.childLanes=h,null}function ba(e,t){return t=ya({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cd(e,t,i){return Is(t,e.child,null,i),e=ba(t,t.pendingProps),e.flags|=2,ei(t),t.memoizedState=null,e}function jv(e,t,i){var s=t.pendingProps,h=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ie){if(s.mode==="hidden")return e=ba(t,s),t.lanes=536870912,nn(null,e);if(rl(t),(e=et)?(e=Cf(e,fi),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ts!==null?{id:Ri,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},i=Gu(e),i.return=t,t.child=i,At=t,et=null)):e=null,e===null)throw ss(t);return t.lanes=536870912,null}return ba(t,s)}var v=e.memoizedState;if(v!==null){var L=v.dehydrated;if(rl(t),h)if(t.flags&256)t.flags&=-257,t=cd(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(A(558));else if(ft||or(e,t,i,!1),h=(i&e.childLanes)!==0,ft||h){if(s=Ke,s!==null&&(L=ni(s,i),L!==0&&L!==v.retryLane))throw v.retryLane=L,Ls(e,L),Yt(s,e,L),El;Ta(),t=cd(e,t,i)}else e=v.treeContext,et=gi(L.nextSibling),At=t,Ie=!0,is=null,fi=!1,e!==null&&Xu(t,e),t=ba(t,s),t.flags|=4096;return t}return e=Ii(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Sa(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(A(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Rl(e,t,i,s,h){return Os(t),i=al(e,t,i,s,void 0,h),s=ol(),e!==null&&!ft?(ll(e,t,h),qi(e,t,h)):(Ie&&s&&Po(t),t.flags|=1,Lt(e,t,i,h),t.child)}function ud(e,t,i,s,h,v){return Os(t),t.updateQueue=null,i=fh(t,s,i,h),dh(e),s=ol(),e!==null&&!ft?(ll(e,t,v),qi(e,t,v)):(Ie&&s&&Po(t),t.flags|=1,Lt(e,t,i,v),t.child)}function hd(e,t,i,s,h){if(Os(t),t.stateNode===null){var v=sr,L=i.contextType;typeof L=="object"&&L!==null&&(v=Dt(L)),v=new i(s,v),t.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=wl,t.stateNode=v,v._reactInternals=t,v=t.stateNode,v.props=s,v.state=t.memoizedState,v.refs={},Qo(t),L=i.contextType,v.context=typeof L=="object"&&L!==null?Dt(L):sr,v.state=t.memoizedState,L=i.getDerivedStateFromProps,typeof L=="function"&&(Cl(t,i,L,s),v.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(L=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),L!==v.state&&wl.enqueueReplaceState(v,v.state,null),Jr(t,s,v,h),Qr(),v.state=t.memoizedState),typeof v.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){v=t.stateNode;var j=t.memoizedProps,Z=Us(i,j);v.props=Z;var re=v.context,ce=i.contextType;L=sr,typeof ce=="object"&&ce!==null&&(L=Dt(ce));var de=i.getDerivedStateFromProps;ce=typeof de=="function"||typeof v.getSnapshotBeforeUpdate=="function",j=t.pendingProps!==j,ce||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(j||re!==L)&&Zh(t,v,s,L),ns=!1;var ae=t.memoizedState;v.state=ae,Jr(t,s,v,h),Qr(),re=t.memoizedState,j||ae!==re||ns?(typeof de=="function"&&(Cl(t,i,de,s),re=t.memoizedState),(Z=ns||Kh(t,i,Z,s,ae,re,L))?(ce||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=re),v.props=s,v.state=re,v.context=L,s=Z):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{v=t.stateNode,Jo(e,t),L=t.memoizedProps,ce=Us(i,L),v.props=ce,de=t.pendingProps,ae=v.context,re=i.contextType,Z=sr,typeof re=="object"&&re!==null&&(Z=Dt(re)),j=i.getDerivedStateFromProps,(re=typeof j=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(L!==de||ae!==Z)&&Zh(t,v,s,Z),ns=!1,ae=t.memoizedState,v.state=ae,Jr(t,s,v,h),Qr();var le=t.memoizedState;L!==de||ae!==le||ns||e!==null&&e.dependencies!==null&&ta(e.dependencies)?(typeof j=="function"&&(Cl(t,i,j,s),le=t.memoizedState),(ce=ns||Kh(t,i,ce,s,ae,le,Z)||e!==null&&e.dependencies!==null&&ta(e.dependencies))?(re||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(s,le,Z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(s,le,Z)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||L===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=le),v.props=s,v.state=le,v.context=Z,s=ce):(typeof v.componentDidUpdate!="function"||L===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||L===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),s=!1)}return v=s,Sa(e,t),s=(t.flags&128)!==0,v||s?(v=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:v.render(),t.flags|=1,e!==null&&s?(t.child=Is(t,e.child,null,h),t.child=Is(t,null,i,h)):Lt(e,t,i,h),t.memoizedState=v.state,e=t.child):e=qi(e,t,h),e}function dd(e,t,i,s){return Ms(),t.flags|=256,Lt(e,t,i,s),t.child}var Al={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Dl(e){return{baseLanes:e,cachePool:th()}}function Ll(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=ii),e}function fd(e,t,i){var s=t.pendingProps,h=!1,v=(t.flags&128)!==0,L;if((L=v)||(L=e!==null&&e.memoizedState===null?!1:(ot.current&2)!==0),L&&(h=!0,t.flags&=-129),L=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ie){if(h?ls(t):cs(),(e=et)?(e=Cf(e,fi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ts!==null?{id:Ri,overflow:Ai}:null,retryLane:536870912,hydrationErrors:null},i=Gu(e),i.return=t,t.child=i,At=t,et=null)):e=null,e===null)throw ss(t);return hc(e)?t.lanes=32:t.lanes=536870912,null}var j=s.children;return s=s.fallback,h?(cs(),h=t.mode,j=ya({mode:"hidden",children:j},h),s=Ts(s,h,i,null),j.return=t,s.return=t,j.sibling=s,t.child=j,s=t.child,s.memoizedState=Dl(i),s.childLanes=Ll(e,L,i),t.memoizedState=Al,nn(null,s)):(ls(t),Tl(t,j))}var Z=e.memoizedState;if(Z!==null&&(j=Z.dehydrated,j!==null)){if(v)t.flags&256?(ls(t),t.flags&=-257,t=Ml(e,t,i)):t.memoizedState!==null?(cs(),t.child=e.child,t.flags|=128,t=null):(cs(),j=s.fallback,h=t.mode,s=ya({mode:"visible",children:s.children},h),j=Ts(j,h,i,null),j.flags|=2,s.return=t,j.return=t,s.sibling=j,t.child=s,Is(t,e.child,null,i),s=t.child,s.memoizedState=Dl(i),s.childLanes=Ll(e,L,i),t.memoizedState=Al,t=nn(null,s));else if(ls(t),hc(j)){if(L=j.nextSibling&&j.nextSibling.dataset,L)var re=L.dgst;L=re,s=Error(A(419)),s.stack="",s.digest=L,Gr({value:s,source:null,stack:null}),t=Ml(e,t,i)}else if(ft||or(e,t,i,!1),L=(i&e.childLanes)!==0,ft||L){if(L=Ke,L!==null&&(s=ni(L,i),s!==0&&s!==Z.retryLane))throw Z.retryLane=s,Ls(e,s),Yt(L,e,s),El;uc(j)||Ta(),t=Ml(e,t,i)}else uc(j)?(t.flags|=192,t.child=e.child,t=null):(e=Z.treeContext,et=gi(j.nextSibling),At=t,Ie=!0,is=null,fi=!1,e!==null&&Xu(t,e),t=Tl(t,s.children),t.flags|=4096);return t}return h?(cs(),j=s.fallback,h=t.mode,Z=e.child,re=Z.sibling,s=Ii(Z,{mode:"hidden",children:s.children}),s.subtreeFlags=Z.subtreeFlags&65011712,re!==null?j=Ii(re,j):(j=Ts(j,h,i,null),j.flags|=2),j.return=t,s.return=t,s.sibling=j,t.child=s,nn(null,s),s=t.child,j=e.child.memoizedState,j===null?j=Dl(i):(h=j.cachePool,h!==null?(Z=ht._currentValue,h=h.parent!==Z?{parent:Z,pool:Z}:h):h=th(),j={baseLanes:j.baseLanes|i,cachePool:h}),s.memoizedState=j,s.childLanes=Ll(e,L,i),t.memoizedState=Al,nn(e.child,s)):(ls(t),i=e.child,e=i.sibling,i=Ii(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(L=t.deletions,L===null?(t.deletions=[e],t.flags|=16):L.push(e)),t.child=i,t.memoizedState=null,i)}function Tl(e,t){return t=ya({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ya(e,t){return e=Qt(22,e,null,t),e.lanes=0,e}function Ml(e,t,i){return Is(t,e.child,null,i),e=Tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function _d(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Go(e.return,t,i)}function kl(e,t,i,s,h,v){var L=e.memoizedState;L===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:h,treeForkCount:v}:(L.isBackwards=t,L.rendering=null,L.renderingStartTime=0,L.last=s,L.tail=i,L.tailMode=h,L.treeForkCount=v)}function gd(e,t,i){var s=t.pendingProps,h=s.revealOrder,v=s.tail;s=s.children;var L=ot.current,j=(L&2)!==0;if(j?(L=L&1|2,t.flags|=128):L&=1,Q(ot,L),Lt(e,t,s,i),s=Ie?$r:0,!j&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&_d(e,i,t);else if(e.tag===19)_d(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(h){case"forwards":for(i=t.child,h=null;i!==null;)e=i.alternate,e!==null&&ca(e)===null&&(h=i),i=i.sibling;i=h,i===null?(h=t.child,t.child=null):(h=i.sibling,i.sibling=null),kl(t,!1,h,i,v,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,h=t.child,t.child=null;h!==null;){if(e=h.alternate,e!==null&&ca(e)===null){t.child=h;break}e=h.sibling,h.sibling=i,i=h,h=e}kl(t,!0,i,null,v,s);break;case"together":kl(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function qi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ds|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(or(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(A(153));if(t.child!==null){for(e=t.child,i=Ii(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ii(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Ol(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ta(e)))}function Pv(e,t,i){switch(t.tag){case 3:U(t,t.stateNode.containerInfo),rs(t,ht,e.memoizedState.cache),Ms();break;case 27:case 5:te(t);break;case 4:U(t,t.stateNode.containerInfo);break;case 10:rs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,rl(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(ls(t),t.flags|=128,null):(i&t.child.childLanes)!==0?fd(e,t,i):(ls(t),e=qi(e,t,i),e!==null?e.sibling:null);ls(t);break;case 19:var h=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(or(e,t,i,!1),s=(i&t.childLanes)!==0),h){if(s)return gd(e,t,i);t.flags|=128}if(h=t.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Q(ot,ot.current),s)break;return null;case 22:return t.lanes=0,od(e,t,i,t.pendingProps);case 24:rs(t,ht,e.memoizedState.cache)}return qi(e,t,i)}function vd(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!Ol(e,i)&&(t.flags&128)===0)return ft=!1,Pv(e,t,i);ft=(e.flags&131072)!==0}else ft=!1,Ie&&(t.flags&1048576)!==0&&Vu(t,$r,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Hs(t.elementType),t.type=e,typeof e=="function")No(e)?(s=Us(e,s),t.tag=1,t=hd(null,t,e,s,i)):(t.tag=0,t=Rl(null,t,e,s,i));else{if(e!=null){var h=e.$$typeof;if(h===S){t.tag=11,t=rd(null,t,e,s,i);break e}else if(h===E){t.tag=14,t=nd(null,t,e,s,i);break e}}throw t=$(e)||e,Error(A(306,t,""))}}return t;case 0:return Rl(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,h=Us(s,t.pendingProps),hd(e,t,s,h,i);case 3:e:{if(U(t,t.stateNode.containerInfo),e===null)throw Error(A(387));s=t.pendingProps;var v=t.memoizedState;h=v.element,Jo(e,t),Jr(t,s,null,i);var L=t.memoizedState;if(s=L.cache,rs(t,ht,s),s!==v.cache&&Yo(t,[ht],i,!0),Qr(),s=L.element,v.isDehydrated)if(v={element:s,isDehydrated:!1,cache:L.cache},t.updateQueue.baseState=v,t.memoizedState=v,t.flags&256){t=dd(e,t,s,i);break e}else if(s!==h){h=ui(Error(A(424)),t),Gr(h),t=dd(e,t,s,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(et=gi(e.firstChild),At=t,Ie=!0,is=null,fi=!0,i=oh(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(Ms(),s===h){t=qi(e,t,i);break e}Lt(e,t,s,i)}t=t.child}return t;case 26:return Sa(e,t),e===null?(i=Df(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ie||(i=t.type,e=t.pendingProps,s=Ia(oe.current).createElement(i),s[Rt]=t,s[Pt]=e,Tt(s,i,e),yt(s),t.stateNode=s):t.memoizedState=Df(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return te(t),e===null&&Ie&&(s=t.stateNode=Ef(t.type,t.pendingProps,oe.current),At=t,fi=!0,h=et,ps(t.type)?(dc=h,et=gi(s.firstChild)):et=h),Lt(e,t,t.pendingProps.children,i),Sa(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ie&&((h=s=et)&&(s=pp(s,t.type,t.pendingProps,fi),s!==null?(t.stateNode=s,At=t,et=gi(s.firstChild),fi=!1,h=!0):h=!1),h||ss(t)),te(t),h=t.type,v=t.pendingProps,L=e!==null?e.memoizedProps:null,s=v.children,oc(h,v)?s=null:L!==null&&oc(h,L)&&(t.flags|=32),t.memoizedState!==null&&(h=al(e,t,kv,null,null,i),Sn._currentValue=h),Sa(e,t),Lt(e,t,s,i),t.child;case 6:return e===null&&Ie&&((e=i=et)&&(i=mp(i,t.pendingProps,fi),i!==null?(t.stateNode=i,At=t,et=null,e=!0):e=!1),e||ss(t)),null;case 13:return fd(e,t,i);case 4:return U(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Is(t,null,s,i):Lt(e,t,s,i),t.child;case 11:return rd(e,t,t.type,t.pendingProps,i);case 7:return Lt(e,t,t.pendingProps,i),t.child;case 8:return Lt(e,t,t.pendingProps.children,i),t.child;case 12:return Lt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,rs(t,t.type,s.value),Lt(e,t,s.children,i),t.child;case 9:return h=t.type._context,s=t.pendingProps.children,Os(t),h=Dt(h),s=s(h),t.flags|=1,Lt(e,t,s,i),t.child;case 14:return nd(e,t,t.type,t.pendingProps,i);case 15:return ad(e,t,t.type,t.pendingProps,i);case 19:return gd(e,t,i);case 31:return jv(e,t,i);case 22:return od(e,t,i,t.pendingProps);case 24:return Os(t),s=Dt(ht),e===null?(h=Ko(),h===null&&(h=Ke,v=Vo(),h.pooledCache=v,v.refCount++,v!==null&&(h.pooledCacheLanes|=i),h=v),t.memoizedState={parent:s,cache:h},Qo(t),rs(t,ht,h)):((e.lanes&i)!==0&&(Jo(e,t),Jr(t,null,null,i),Qr()),h=e.memoizedState,v=t.memoizedState,h.parent!==s?(h={parent:s,cache:s},t.memoizedState=h,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=h),rs(t,ht,s)):(s=v.cache,rs(t,ht,s),s!==h.cache&&Yo(t,[ht],i,!0))),Lt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(A(156,t.tag))}function Wi(e){e.flags|=4}function Bl(e,t,i,s,h){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(h&335544128)===h)if(e.stateNode.complete)e.flags|=8192;else if(qd())e.flags|=8192;else throw zs=na,Zo}else e.flags&=-16777217}function pd(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Of(t))if(qd())e.flags|=8192;else throw zs=na,Zo}function Ca(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?kt():536870912,e.lanes|=t,br|=t)}function an(e,t){if(!Ie)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function tt(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var h=e.child;h!==null;)i|=h.lanes|h.childLanes,s|=h.subtreeFlags&65011712,s|=h.flags&65011712,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)i|=h.lanes|h.childLanes,s|=h.subtreeFlags,s|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function Fv(e,t,i){var s=t.pendingProps;switch(Fo(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(t),null;case 1:return tt(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ji(ht),ne(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(ar(t)?Wi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Wo())),tt(t),null;case 26:var h=t.type,v=t.memoizedState;return e===null?(Wi(t),v!==null?(tt(t),pd(t,v)):(tt(t),Bl(t,h,null,s,i))):v?v!==e.memoizedState?(Wi(t),tt(t),pd(t,v)):(tt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Wi(t),tt(t),Bl(t,h,e,s,i)),null;case 27:if(_e(t),i=oe.current,h=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Wi(t);else{if(!s){if(t.stateNode===null)throw Error(A(166));return tt(t),null}e=ee.current,ar(t)?Ku(t):(e=Ef(h,s,i),t.stateNode=e,Wi(t))}return tt(t),null;case 5:if(_e(t),h=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Wi(t);else{if(!s){if(t.stateNode===null)throw Error(A(166));return tt(t),null}if(v=ee.current,ar(t))Ku(t);else{var L=Ia(oe.current);switch(v){case 1:v=L.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:v=L.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":v=L.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":v=L.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":v=L.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof s.is=="string"?L.createElement("select",{is:s.is}):L.createElement("select"),s.multiple?v.multiple=!0:s.size&&(v.size=s.size);break;default:v=typeof s.is=="string"?L.createElement(h,{is:s.is}):L.createElement(h)}}v[Rt]=t,v[Pt]=s;e:for(L=t.child;L!==null;){if(L.tag===5||L.tag===6)v.appendChild(L.stateNode);else if(L.tag!==4&&L.tag!==27&&L.child!==null){L.child.return=L,L=L.child;continue}if(L===t)break e;for(;L.sibling===null;){if(L.return===null||L.return===t)break e;L=L.return}L.sibling.return=L.return,L=L.sibling}t.stateNode=v;e:switch(Tt(v,h,s),h){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Wi(t)}}return tt(t),Bl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Wi(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(A(166));if(e=oe.current,ar(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,h=At,h!==null)switch(h.tag){case 27:case 5:s=h.memoizedProps}e[Rt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||_f(e.nodeValue,i)),e||ss(t,!0)}else e=Ia(e).createTextNode(s),e[Rt]=t,t.stateNode=e}return tt(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=ar(t),i!==null){if(e===null){if(!s)throw Error(A(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(A(557));e[Rt]=t}else Ms(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),e=!1}else i=Wo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(ei(t),t):(ei(t),null);if((t.flags&128)!==0)throw Error(A(558))}return tt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=ar(t),s!==null&&s.dehydrated!==null){if(e===null){if(!h)throw Error(A(318));if(h=t.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(A(317));h[Rt]=t}else Ms(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;tt(t),h=!1}else h=Wo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=h),h=!0;if(!h)return t.flags&256?(ei(t),t):(ei(t),null)}return ei(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,h=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(h=s.alternate.memoizedState.cachePool.pool),v=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(v=s.memoizedState.cachePool.pool),v!==h&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Ca(t,t.updateQueue),tt(t),null);case 4:return ne(),e===null&&ic(t.stateNode.containerInfo),tt(t),null;case 10:return ji(t.type),tt(t),null;case 19:if(P(ot),s=t.memoizedState,s===null)return tt(t),null;if(h=(t.flags&128)!==0,v=s.rendering,v===null)if(h)an(s,!1);else{if(at!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(v=ca(e),v!==null){for(t.flags|=128,an(s,!1),e=v.updateQueue,t.updateQueue=e,Ca(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)$u(i,e),i=i.sibling;return Q(ot,ot.current&1|2),Ie&&Ni(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&we()>Aa&&(t.flags|=128,h=!0,an(s,!1),t.lanes=4194304)}else{if(!h)if(e=ca(v),e!==null){if(t.flags|=128,h=!0,e=e.updateQueue,t.updateQueue=e,Ca(t,e),an(s,!0),s.tail===null&&s.tailMode==="hidden"&&!v.alternate&&!Ie)return tt(t),null}else 2*we()-s.renderingStartTime>Aa&&i!==536870912&&(t.flags|=128,h=!0,an(s,!1),t.lanes=4194304);s.isBackwards?(v.sibling=t.child,t.child=v):(e=s.last,e!==null?e.sibling=v:t.child=v,s.last=v)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=we(),e.sibling=null,i=ot.current,Q(ot,h?i&1|2:i&1),Ie&&Ni(t,s.treeForkCount),e):(tt(t),null);case 22:case 23:return ei(t),sl(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(tt(t),t.subtreeFlags&6&&(t.flags|=8192)):tt(t),i=t.updateQueue,i!==null&&Ca(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&P(Bs),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),ji(ht),tt(t),null;case 25:return null;case 30:return null}throw Error(A(156,t.tag))}function qv(e,t){switch(Fo(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ji(ht),ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(ei(t),t.alternate===null)throw Error(A(340));Ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ei(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(A(340));Ms()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return P(ot),null;case 4:return ne(),null;case 10:return ji(t.type),null;case 22:case 23:return ei(t),sl(),e!==null&&P(Bs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ji(ht),null;case 25:return null;default:return null}}function md(e,t){switch(Fo(t),t.tag){case 3:ji(ht),ne();break;case 26:case 27:case 5:_e(t);break;case 4:ne();break;case 31:t.memoizedState!==null&&ei(t);break;case 13:ei(t);break;case 19:P(ot);break;case 10:ji(t.type);break;case 22:case 23:ei(t),sl(),e!==null&&P(Bs);break;case 24:ji(ht)}}function on(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var h=s.next;i=h;do{if((i.tag&e)===e){s=void 0;var v=i.create,L=i.inst;s=v(),L.destroy=s}i=i.next}while(i!==h)}}catch(j){Ge(t,t.return,j)}}function us(e,t,i){try{var s=t.updateQueue,h=s!==null?s.lastEffect:null;if(h!==null){var v=h.next;s=v;do{if((s.tag&e)===e){var L=s.inst,j=L.destroy;if(j!==void 0){L.destroy=void 0,h=t;var Z=i,re=j;try{re()}catch(ce){Ge(h,Z,ce)}}}s=s.next}while(s!==v)}}catch(ce){Ge(t,t.return,ce)}}function bd(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{ch(t,i)}catch(s){Ge(e,e.return,s)}}}function Sd(e,t,i){i.props=Us(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Ge(e,t,s)}}function ln(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(h){Ge(e,t,h)}}function Di(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(h){Ge(e,t,h)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(h){Ge(e,t,h)}else i.current=null}function yd(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(h){Ge(e,e.return,h)}}function Hl(e,t,i){try{var s=e.stateNode;hp(s,e.type,i,t),s[Pt]=t}catch(h){Ge(e,e.return,h)}}function Cd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ps(e.type)||e.tag===4}function zl(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Cd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ps(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Il(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=Hi));else if(s!==4&&(s===27&&ps(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Il(e,t,i),e=e.sibling;e!==null;)Il(e,t,i),e=e.sibling}function wa(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&ps(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(wa(e,t,i),e=e.sibling;e!==null;)wa(e,t,i),e=e.sibling}function wd(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,h=t.attributes;h.length;)t.removeAttributeNode(h[0]);Tt(t,s,i),t[Rt]=e,t[Pt]=i}catch(v){Ge(e,e.return,v)}}var $i=!1,_t=!1,Nl=!1,xd=typeof WeakSet=="function"?WeakSet:Set,Ct=null;function Wv(e,t){if(e=e.containerInfo,nc=Wa,e=zu(e),Mo(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var h=s.anchorOffset,v=s.focusNode;s=s.focusOffset;try{i.nodeType,v.nodeType}catch{i=null;break e}var L=0,j=-1,Z=-1,re=0,ce=0,de=e,ae=null;t:for(;;){for(var le;de!==i||h!==0&&de.nodeType!==3||(j=L+h),de!==v||s!==0&&de.nodeType!==3||(Z=L+s),de.nodeType===3&&(L+=de.nodeValue.length),(le=de.firstChild)!==null;)ae=de,de=le;for(;;){if(de===e)break t;if(ae===i&&++re===h&&(j=L),ae===v&&++ce===s&&(Z=L),(le=de.nextSibling)!==null)break;de=ae,ae=de.parentNode}de=le}i=j===-1||Z===-1?null:{start:j,end:Z}}else i=null}i=i||{start:0,end:0}}else i=null;for(ac={focusedElem:e,selectionRange:i},Wa=!1,Ct=t;Ct!==null;)if(t=Ct,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ct=e;else for(;Ct!==null;){switch(t=Ct,v=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)h=e[i],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&v!==null){e=void 0,i=t,h=v.memoizedProps,v=v.memoizedState,s=i.stateNode;try{var pe=Us(i.type,h);e=s.getSnapshotBeforeUpdate(pe,v),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ce){Ge(i,i.return,Ce)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)cc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":cc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(A(163))}if(e=t.sibling,e!==null){e.return=t.return,Ct=e;break}Ct=t.return}}function Ed(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:Yi(e,i),s&4&&on(5,i);break;case 1:if(Yi(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(L){Ge(i,i.return,L)}else{var h=Us(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(h,t,e.__reactInternalSnapshotBeforeUpdate)}catch(L){Ge(i,i.return,L)}}s&64&&bd(i),s&512&&ln(i,i.return);break;case 3:if(Yi(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{ch(e,t)}catch(L){Ge(i,i.return,L)}}break;case 27:t===null&&s&4&&wd(i);case 26:case 5:Yi(e,i),t===null&&s&4&&yd(i),s&512&&ln(i,i.return);break;case 12:Yi(e,i);break;case 31:Yi(e,i),s&4&&Dd(e,i);break;case 13:Yi(e,i),s&4&&Ld(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Jv.bind(null,i),bp(e,i))));break;case 22:if(s=i.memoizedState!==null||$i,!s){t=t!==null&&t.memoizedState!==null||_t,h=$i;var v=_t;$i=s,(_t=t)&&!v?Vi(e,i,(i.subtreeFlags&8772)!==0):Yi(e,i),$i=h,_t=v}break;case 30:break;default:Yi(e,i)}}function Rd(e){var t=e.alternate;t!==null&&(e.alternate=null,Rd(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&_o(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var st=null,qt=!1;function Gi(e,t,i){for(i=i.child;i!==null;)Ad(e,t,i),i=i.sibling}function Ad(e,t,i){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(Xt,i)}catch{}switch(i.tag){case 26:_t||Di(i,t),Gi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:_t||Di(i,t);var s=st,h=qt;ps(i.type)&&(st=i.stateNode,qt=!1),Gi(e,t,i),pn(i.stateNode),st=s,qt=h;break;case 5:_t||Di(i,t);case 6:if(s=st,h=qt,st=null,Gi(e,t,i),st=s,qt=h,st!==null)if(qt)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(i.stateNode)}catch(v){Ge(i,t,v)}else try{st.removeChild(i.stateNode)}catch(v){Ge(i,t,v)}break;case 18:st!==null&&(qt?(e=st,Sf(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ar(e)):Sf(st,i.stateNode));break;case 4:s=st,h=qt,st=i.stateNode.containerInfo,qt=!0,Gi(e,t,i),st=s,qt=h;break;case 0:case 11:case 14:case 15:us(2,i,t),_t||us(4,i,t),Gi(e,t,i);break;case 1:_t||(Di(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&Sd(i,t,s)),Gi(e,t,i);break;case 21:Gi(e,t,i);break;case 22:_t=(s=_t)||i.memoizedState!==null,Gi(e,t,i),_t=s;break;default:Gi(e,t,i)}}function Dd(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ar(e)}catch(i){Ge(t,t.return,i)}}}function Ld(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ar(e)}catch(i){Ge(t,t.return,i)}}function $v(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new xd),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new xd),t;default:throw Error(A(435,e.tag))}}function xa(e,t){var i=$v(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var h=ep.bind(null,e,s);s.then(h,h)}})}function Wt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var h=i[s],v=e,L=t,j=L;e:for(;j!==null;){switch(j.tag){case 27:if(ps(j.type)){st=j.stateNode,qt=!1;break e}break;case 5:st=j.stateNode,qt=!1;break e;case 3:case 4:st=j.stateNode.containerInfo,qt=!0;break e}j=j.return}if(st===null)throw Error(A(160));Ad(v,L,h),st=null,qt=!1,v=h.alternate,v!==null&&(v.return=null),h.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Td(t,e),t=t.sibling}var Ci=null;function Td(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Wt(t,e),$t(e),s&4&&(us(3,e,e.return),on(3,e),us(5,e,e.return));break;case 1:Wt(t,e),$t(e),s&512&&(_t||i===null||Di(i,i.return)),s&64&&$i&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var h=Ci;if(Wt(t,e),$t(e),s&512&&(_t||i===null||Di(i,i.return)),s&4){var v=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,h=h.ownerDocument||h;t:switch(s){case"title":v=h.getElementsByTagName("title")[0],(!v||v[Br]||v[Rt]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=h.createElement(s),h.head.insertBefore(v,h.querySelector("head > title"))),Tt(v,s,i),v[Rt]=e,yt(v),s=v;break e;case"link":var L=Mf("link","href",h).get(s+(i.href||""));if(L){for(var j=0;j<L.length;j++)if(v=L[j],v.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&v.getAttribute("rel")===(i.rel==null?null:i.rel)&&v.getAttribute("title")===(i.title==null?null:i.title)&&v.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){L.splice(j,1);break t}}v=h.createElement(s),Tt(v,s,i),h.head.appendChild(v);break;case"meta":if(L=Mf("meta","content",h).get(s+(i.content||""))){for(j=0;j<L.length;j++)if(v=L[j],v.getAttribute("content")===(i.content==null?null:""+i.content)&&v.getAttribute("name")===(i.name==null?null:i.name)&&v.getAttribute("property")===(i.property==null?null:i.property)&&v.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&v.getAttribute("charset")===(i.charSet==null?null:i.charSet)){L.splice(j,1);break t}}v=h.createElement(s),Tt(v,s,i),h.head.appendChild(v);break;default:throw Error(A(468,s))}v[Rt]=e,yt(v),s=v}e.stateNode=s}else kf(h,e.type,e.stateNode);else e.stateNode=Tf(h,s,e.memoizedProps);else v!==s?(v===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):v.count--,s===null?kf(h,e.type,e.stateNode):Tf(h,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Hl(e,e.memoizedProps,i.memoizedProps)}break;case 27:Wt(t,e),$t(e),s&512&&(_t||i===null||Di(i,i.return)),i!==null&&s&4&&Hl(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Wt(t,e),$t(e),s&512&&(_t||i===null||Di(i,i.return)),e.flags&32){h=e.stateNode;try{Ks(h,"")}catch(pe){Ge(e,e.return,pe)}}s&4&&e.stateNode!=null&&(h=e.memoizedProps,Hl(e,h,i!==null?i.memoizedProps:h)),s&1024&&(Nl=!0);break;case 6:if(Wt(t,e),$t(e),s&4){if(e.stateNode===null)throw Error(A(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(pe){Ge(e,e.return,pe)}}break;case 3:if(ja=null,h=Ci,Ci=Na(t.containerInfo),Wt(t,e),Ci=h,$t(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Ar(t.containerInfo)}catch(pe){Ge(e,e.return,pe)}Nl&&(Nl=!1,Md(e));break;case 4:s=Ci,Ci=Na(e.stateNode.containerInfo),Wt(t,e),$t(e),Ci=s;break;case 12:Wt(t,e),$t(e);break;case 31:Wt(t,e),$t(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,xa(e,s)));break;case 13:Wt(t,e),$t(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Ra=we()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,xa(e,s)));break;case 22:h=e.memoizedState!==null;var Z=i!==null&&i.memoizedState!==null,re=$i,ce=_t;if($i=re||h,_t=ce||Z,Wt(t,e),_t=ce,$i=re,$t(e),s&8192)e:for(t=e.stateNode,t._visibility=h?t._visibility&-2:t._visibility|1,h&&(i===null||Z||$i||_t||js(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){Z=i=t;try{if(v=Z.stateNode,h)L=v.style,typeof L.setProperty=="function"?L.setProperty("display","none","important"):L.display="none";else{j=Z.stateNode;var de=Z.memoizedProps.style,ae=de!=null&&de.hasOwnProperty("display")?de.display:null;j.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(pe){Ge(Z,Z.return,pe)}}}else if(t.tag===6){if(i===null){Z=t;try{Z.stateNode.nodeValue=h?"":Z.memoizedProps}catch(pe){Ge(Z,Z.return,pe)}}}else if(t.tag===18){if(i===null){Z=t;try{var le=Z.stateNode;h?yf(le,!0):yf(Z.stateNode,!1)}catch(pe){Ge(Z,Z.return,pe)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,xa(e,i))));break;case 19:Wt(t,e),$t(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,xa(e,s)));break;case 30:break;case 21:break;default:Wt(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(Cd(s)){i=s;break}s=s.return}if(i==null)throw Error(A(160));switch(i.tag){case 27:var h=i.stateNode,v=zl(e);wa(e,v,h);break;case 5:var L=i.stateNode;i.flags&32&&(Ks(L,""),i.flags&=-33);var j=zl(e);wa(e,j,L);break;case 3:case 4:var Z=i.stateNode.containerInfo,re=zl(e);Il(e,re,Z);break;default:throw Error(A(161))}}catch(ce){Ge(e,e.return,ce)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Md(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Md(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Yi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ed(e,t.alternate,t),t=t.sibling}function js(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:us(4,t,t.return),js(t);break;case 1:Di(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Sd(t,t.return,i),js(t);break;case 27:pn(t.stateNode);case 26:case 5:Di(t,t.return),js(t);break;case 22:t.memoizedState===null&&js(t);break;case 30:js(t);break;default:js(t)}e=e.sibling}}function Vi(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,h=e,v=t,L=v.flags;switch(v.tag){case 0:case 11:case 15:Vi(h,v,i),on(4,v);break;case 1:if(Vi(h,v,i),s=v,h=s.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(re){Ge(s,s.return,re)}if(s=v,h=s.updateQueue,h!==null){var j=s.stateNode;try{var Z=h.shared.hiddenCallbacks;if(Z!==null)for(h.shared.hiddenCallbacks=null,h=0;h<Z.length;h++)lh(Z[h],j)}catch(re){Ge(s,s.return,re)}}i&&L&64&&bd(v),ln(v,v.return);break;case 27:wd(v);case 26:case 5:Vi(h,v,i),i&&s===null&&L&4&&yd(v),ln(v,v.return);break;case 12:Vi(h,v,i);break;case 31:Vi(h,v,i),i&&L&4&&Dd(h,v);break;case 13:Vi(h,v,i),i&&L&4&&Ld(h,v);break;case 22:v.memoizedState===null&&Vi(h,v,i),ln(v,v.return);break;case 30:break;default:Vi(h,v,i)}t=t.sibling}}function Ul(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Yr(i))}function jl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Yr(e))}function wi(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kd(e,t,i,s),t=t.sibling}function kd(e,t,i,s){var h=t.flags;switch(t.tag){case 0:case 11:case 15:wi(e,t,i,s),h&2048&&on(9,t);break;case 1:wi(e,t,i,s);break;case 3:wi(e,t,i,s),h&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Yr(e)));break;case 12:if(h&2048){wi(e,t,i,s),e=t.stateNode;try{var v=t.memoizedProps,L=v.id,j=v.onPostCommit;typeof j=="function"&&j(L,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(Z){Ge(t,t.return,Z)}}else wi(e,t,i,s);break;case 31:wi(e,t,i,s);break;case 13:wi(e,t,i,s);break;case 23:break;case 22:v=t.stateNode,L=t.alternate,t.memoizedState!==null?v._visibility&2?wi(e,t,i,s):cn(e,t):v._visibility&2?wi(e,t,i,s):(v._visibility|=2,vr(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),h&2048&&Ul(L,t);break;case 24:wi(e,t,i,s),h&2048&&jl(t.alternate,t);break;default:wi(e,t,i,s)}}function vr(e,t,i,s,h){for(h=h&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var v=e,L=t,j=i,Z=s,re=L.flags;switch(L.tag){case 0:case 11:case 15:vr(v,L,j,Z,h),on(8,L);break;case 23:break;case 22:var ce=L.stateNode;L.memoizedState!==null?ce._visibility&2?vr(v,L,j,Z,h):cn(v,L):(ce._visibility|=2,vr(v,L,j,Z,h)),h&&re&2048&&Ul(L.alternate,L);break;case 24:vr(v,L,j,Z,h),h&&re&2048&&jl(L.alternate,L);break;default:vr(v,L,j,Z,h)}t=t.sibling}}function cn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,h=s.flags;switch(s.tag){case 22:cn(i,s),h&2048&&Ul(s.alternate,s);break;case 24:cn(i,s),h&2048&&jl(s.alternate,s);break;default:cn(i,s)}t=t.sibling}}var un=8192;function pr(e,t,i){if(e.subtreeFlags&un)for(e=e.child;e!==null;)Od(e,t,i),e=e.sibling}function Od(e,t,i){switch(e.tag){case 26:pr(e,t,i),e.flags&un&&e.memoizedState!==null&&Mp(i,Ci,e.memoizedState,e.memoizedProps);break;case 5:pr(e,t,i);break;case 3:case 4:var s=Ci;Ci=Na(e.stateNode.containerInfo),pr(e,t,i),Ci=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=un,un=16777216,pr(e,t,i),un=s):pr(e,t,i));break;default:pr(e,t,i)}}function Bd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function hn(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Ct=s,zd(s,e)}Bd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hd(e),e=e.sibling}function Hd(e){switch(e.tag){case 0:case 11:case 15:hn(e),e.flags&2048&&us(9,e,e.return);break;case 3:hn(e);break;case 12:hn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ea(e)):hn(e);break;default:hn(e)}}function Ea(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];Ct=s,zd(s,e)}Bd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:us(8,t,t.return),Ea(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Ea(t));break;default:Ea(t)}e=e.sibling}}function zd(e,t){for(;Ct!==null;){var i=Ct;switch(i.tag){case 0:case 11:case 15:us(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:Yr(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Ct=s;else e:for(i=e;Ct!==null;){s=Ct;var h=s.sibling,v=s.return;if(Rd(s),s===i){Ct=null;break e}if(h!==null){h.return=v,Ct=h;break e}Ct=v}}}var Gv={getCacheForType:function(e){var t=Dt(ht),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Dt(ht).controller.signal}},Yv=typeof WeakMap=="function"?WeakMap:Map,Fe=0,Ke=null,Oe=null,He=0,$e=0,ti=null,hs=!1,mr=!1,Pl=!1,Xi=0,at=0,ds=0,Ps=0,Fl=0,ii=0,br=0,dn=null,Gt=null,ql=!1,Ra=0,Id=0,Aa=1/0,Da=null,fs=null,mt=0,_s=null,Sr=null,Ki=0,Wl=0,$l=null,Nd=null,fn=0,Gl=null;function si(){return(Fe&2)!==0&&He!==0?He&-He:G.T!==null?Ql():Si()}function Ud(){if(ii===0)if((He&536870912)===0||Ie){var e=Mi;Mi<<=1,(Mi&3932160)===0&&(Mi=262144),ii=e}else ii=536870912;return e=Jt.current,e!==null&&(e.flags|=32),ii}function Yt(e,t,i){(e===Ke&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(yr(e,0),gs(e,He,ii,!1)),ri(e,i),((Fe&2)===0||e!==Ke)&&(e===Ke&&((Fe&2)===0&&(Ps|=i),at===4&&gs(e,He,ii,!1)),Li(e))}function jd(e,t,i){if((Fe&6)!==0)throw Error(A(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Nt(e,t),h=s?Kv(e,t):Vl(e,t,!0),v=s;do{if(h===0){mr&&!s&&gs(e,t,0,!1);break}else{if(i=e.current.alternate,v&&!Vv(i)){h=Vl(e,t,!1),v=!1;continue}if(h===2){if(v=t,e.errorRecoveryDisabledLanes&v)var L=0;else L=e.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){t=L;e:{var j=e;h=dn;var Z=j.current.memoizedState.isDehydrated;if(Z&&(yr(j,L).flags|=256),L=Vl(j,L,!1),L!==2){if(Pl&&!Z){j.errorRecoveryDisabledLanes|=v,Ps|=v,h=4;break e}v=Gt,Gt=h,v!==null&&(Gt===null?Gt=v:Gt.push.apply(Gt,v))}h=L}if(v=!1,h!==2)continue}}if(h===1){yr(e,0),gs(e,t,0,!0);break}e:{switch(s=e,v=h,v){case 0:case 1:throw Error(A(345));case 4:if((t&4194048)!==t)break;case 6:gs(s,t,ii,!hs);break e;case 2:Gt=null;break;case 3:case 5:break;default:throw Error(A(329))}if((t&62914560)===t&&(h=Ra+300-we(),10<h)){if(gs(s,t,ii,!hs),St(s,0,!0)!==0)break e;Ki=t,s.timeoutHandle=mf(Pd.bind(null,s,i,Gt,Da,ql,t,ii,Ps,br,hs,v,"Throttled",-0,0),h);break e}Pd(s,i,Gt,Da,ql,t,ii,Ps,br,hs,v,null,-0,0)}}break}while(!0);Li(e)}function Pd(e,t,i,s,h,v,L,j,Z,re,ce,de,ae,le){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Hi},Od(t,v,de);var pe=(v&62914560)===v?Ra-we():(v&4194048)===v?Id-we():0;if(pe=kp(de,pe),pe!==null){Ki=v,e.cancelPendingCommit=pe(Xd.bind(null,e,t,v,i,s,h,L,j,Z,ce,de,null,ae,le)),gs(e,v,L,!re);return}}Xd(e,t,v,i,s,h,L,j,Z)}function Vv(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var h=i[s],v=h.getSnapshot;h=h.value;try{if(!Zt(v(),h))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function gs(e,t,i,s){t&=~Fl,t&=~Ps,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var h=t;0<h;){var v=31-vt(h),L=1<<v;s[v]=-1,h&=~L}i!==0&&bi(e,i,t)}function La(){return(Fe&6)===0?(_n(0),!1):!0}function Yl(){if(Oe!==null){if($e===0)var e=Oe.return;else e=Oe,Ui=ks=null,cl(e),hr=null,Xr=0,e=Oe;for(;e!==null;)md(e.alternate,e),e=e.return;Oe=null}}function yr(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,_p(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Ki=0,Yl(),Ke=e,Oe=i=Ii(e.current,null),He=t,$e=0,ti=null,hs=!1,mr=Nt(e,t),Pl=!1,br=ii=Fl=Ps=ds=at=0,Gt=dn=null,ql=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var h=31-vt(s),v=1<<h;t|=e[h],s&=~v}return Xi=t,Kn(),i}function Fd(e,t){Le=null,G.H=rn,t===ur||t===ra?(t=rh(),$e=3):t===Zo?(t=rh(),$e=4):$e=t===El?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ti=t,Oe===null&&(at=1,ma(e,ui(t,e.current)))}function qd(){var e=Jt.current;return e===null?!0:(He&4194048)===He?_i===null:(He&62914560)===He||(He&536870912)!==0?e===_i:!1}function Wd(){var e=G.H;return G.H=rn,e===null?rn:e}function $d(){var e=G.A;return G.A=Gv,e}function Ta(){at=4,hs||(He&4194048)!==He&&Jt.current!==null||(mr=!0),(ds&134217727)===0&&(Ps&134217727)===0||Ke===null||gs(Ke,He,ii,!1)}function Vl(e,t,i){var s=Fe;Fe|=2;var h=Wd(),v=$d();(Ke!==e||He!==t)&&(Da=null,yr(e,t)),t=!1;var L=at;e:do try{if($e!==0&&Oe!==null){var j=Oe,Z=ti;switch($e){case 8:Yl(),L=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var re=$e;if($e=0,ti=null,Cr(e,j,Z,re),i&&mr){L=0;break e}break;default:re=$e,$e=0,ti=null,Cr(e,j,Z,re)}}Xv(),L=at;break}catch(ce){Fd(e,ce)}while(!0);return t&&e.shellSuspendCounter++,Ui=ks=null,Fe=s,G.H=h,G.A=v,Oe===null&&(Ke=null,He=0,Kn()),L}function Xv(){for(;Oe!==null;)Gd(Oe)}function Kv(e,t){var i=Fe;Fe|=2;var s=Wd(),h=$d();Ke!==e||He!==t?(Da=null,Aa=we()+500,yr(e,t)):mr=Nt(e,t);e:do try{if($e!==0&&Oe!==null){t=Oe;var v=ti;t:switch($e){case 1:$e=0,ti=null,Cr(e,t,v,1);break;case 2:case 9:if(ih(v)){$e=0,ti=null,Yd(t);break}t=function(){$e!==2&&$e!==9||Ke!==e||($e=7),Li(e)},v.then(t,t);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:ih(v)?($e=0,ti=null,Yd(t)):($e=0,ti=null,Cr(e,t,v,7));break;case 5:var L=null;switch(Oe.tag){case 26:L=Oe.memoizedState;case 5:case 27:var j=Oe;if(L?Of(L):j.stateNode.complete){$e=0,ti=null;var Z=j.sibling;if(Z!==null)Oe=Z;else{var re=j.return;re!==null?(Oe=re,Ma(re)):Oe=null}break t}}$e=0,ti=null,Cr(e,t,v,5);break;case 6:$e=0,ti=null,Cr(e,t,v,6);break;case 8:Yl(),at=6;break e;default:throw Error(A(462))}}Zv();break}catch(ce){Fd(e,ce)}while(!0);return Ui=ks=null,G.H=s,G.A=h,Fe=i,Oe!==null?0:(Ke=null,He=0,Kn(),at)}function Zv(){for(;Oe!==null&&!Ae();)Gd(Oe)}function Gd(e){var t=vd(e.alternate,e,Xi);e.memoizedProps=e.pendingProps,t===null?Ma(e):Oe=t}function Yd(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=ud(i,t,t.pendingProps,t.type,void 0,He);break;case 11:t=ud(i,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:cl(t);default:md(i,t),t=Oe=$u(t,Xi),t=vd(i,t,Xi)}e.memoizedProps=e.pendingProps,t===null?Ma(e):Oe=t}function Cr(e,t,i,s){Ui=ks=null,cl(t),hr=null,Xr=0;var h=t.return;try{if(Uv(e,h,t,i,He)){at=1,ma(e,ui(i,e.current)),Oe=null;return}}catch(v){if(h!==null)throw Oe=h,v;at=1,ma(e,ui(i,e.current)),Oe=null;return}t.flags&32768?(Ie||s===1?e=!0:mr||(He&536870912)!==0?e=!1:(hs=e=!0,(s===2||s===9||s===3||s===6)&&(s=Jt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Vd(t,e)):Ma(t)}function Ma(e){var t=e;do{if((t.flags&32768)!==0){Vd(t,hs);return}e=t.return;var i=Fv(t.alternate,t,Xi);if(i!==null){Oe=i;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);at===0&&(at=5)}function Vd(e,t){do{var i=qv(e.alternate,e);if(i!==null){i.flags&=32767,Oe=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=i}while(e!==null);at=6,Oe=null}function Xd(e,t,i,s,h,v,L,j,Z){e.cancelPendingCommit=null;do ka();while(mt!==0);if((Fe&6)!==0)throw Error(A(327));if(t!==null){if(t===e.current)throw Error(A(177));if(v=t.lanes|t.childLanes,v|=zo,pt(e,i,v,L,j,Z),e===Ke&&(Oe=Ke=null,He=0),Sr=t,_s=e,Ki=i,Wl=v,$l=h,Nd=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,tp(Qe,function(){return ef(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=G.T,G.T=null,h=W.p,W.p=2,L=Fe,Fe|=4;try{Wv(e,t,i)}finally{Fe=L,W.p=h,G.T=s}}mt=1,Kd(),Zd(),Qd()}}function Kd(){if(mt===1){mt=0;var e=_s,t=Sr,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=G.T,G.T=null;var s=W.p;W.p=2;var h=Fe;Fe|=4;try{Td(t,e);var v=ac,L=zu(e.containerInfo),j=v.focusedElem,Z=v.selectionRange;if(L!==j&&j&&j.ownerDocument&&Hu(j.ownerDocument.documentElement,j)){if(Z!==null&&Mo(j)){var re=Z.start,ce=Z.end;if(ce===void 0&&(ce=re),"selectionStart"in j)j.selectionStart=re,j.selectionEnd=Math.min(ce,j.value.length);else{var de=j.ownerDocument||document,ae=de&&de.defaultView||window;if(ae.getSelection){var le=ae.getSelection(),pe=j.textContent.length,Ce=Math.min(Z.start,pe),Xe=Z.end===void 0?Ce:Math.min(Z.end,pe);!le.extend&&Ce>Xe&&(L=Xe,Xe=Ce,Ce=L);var ie=Bu(j,Ce),J=Bu(j,Xe);if(ie&&J&&(le.rangeCount!==1||le.anchorNode!==ie.node||le.anchorOffset!==ie.offset||le.focusNode!==J.node||le.focusOffset!==J.offset)){var se=de.createRange();se.setStart(ie.node,ie.offset),le.removeAllRanges(),Ce>Xe?(le.addRange(se),le.extend(J.node,J.offset)):(se.setEnd(J.node,J.offset),le.addRange(se))}}}}for(de=[],le=j;le=le.parentNode;)le.nodeType===1&&de.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof j.focus=="function"&&j.focus(),j=0;j<de.length;j++){var ue=de[j];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Wa=!!nc,ac=nc=null}finally{Fe=h,W.p=s,G.T=i}}e.current=t,mt=2}}function Zd(){if(mt===2){mt=0;var e=_s,t=Sr,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=G.T,G.T=null;var s=W.p;W.p=2;var h=Fe;Fe|=4;try{Ed(e,t.alternate,t)}finally{Fe=h,W.p=s,G.T=i}}mt=3}}function Qd(){if(mt===4||mt===3){mt=0,ve();var e=_s,t=Sr,i=Ki,s=Nd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?mt=5:(mt=0,Sr=_s=null,Jd(e,e.pendingLanes));var h=e.pendingLanes;if(h===0&&(fs=null),Oi(i),t=t.stateNode,ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot(Xt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=G.T,h=W.p,W.p=2,G.T=null;try{for(var v=e.onRecoverableError,L=0;L<s.length;L++){var j=s[L];v(j.value,{componentStack:j.stack})}}finally{G.T=t,W.p=h}}(Ki&3)!==0&&ka(),Li(e),h=e.pendingLanes,(i&261930)!==0&&(h&42)!==0?e===Gl?fn++:(fn=0,Gl=e):fn=0,_n(0)}}function Jd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Yr(t)))}function ka(){return Kd(),Zd(),Qd(),ef()}function ef(){if(mt!==5)return!1;var e=_s,t=Wl;Wl=0;var i=Oi(Ki),s=G.T,h=W.p;try{W.p=32>i?32:i,G.T=null,i=$l,$l=null;var v=_s,L=Ki;if(mt=0,Sr=_s=null,Ki=0,(Fe&6)!==0)throw Error(A(331));var j=Fe;if(Fe|=4,Hd(v.current),kd(v,v.current,L,i),Fe=j,_n(0,!1),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot(Xt,v)}catch{}return!0}finally{W.p=h,G.T=s,Jd(e,t)}}function tf(e,t,i){t=ui(i,t),t=xl(e.stateNode,t,2),e=os(e,t,2),e!==null&&(ri(e,2),Li(e))}function Ge(e,t,i){if(e.tag===3)tf(e,e,i);else for(;t!==null;){if(t.tag===3){tf(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(fs===null||!fs.has(s))){e=ui(i,e),i=id(2),s=os(t,i,2),s!==null&&(sd(i,s,t,e),ri(s,2),Li(s));break}}t=t.return}}function Xl(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new Yv;var h=new Set;s.set(t,h)}else h=s.get(t),h===void 0&&(h=new Set,s.set(t,h));h.has(i)||(Pl=!0,h.add(i),e=Qv.bind(null,e,t,i),t.then(e,e))}function Qv(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ke===e&&(He&i)===i&&(at===4||at===3&&(He&62914560)===He&&300>we()-Ra?(Fe&2)===0&&yr(e,0):Fl|=i,br===He&&(br=0)),Li(e)}function sf(e,t){t===0&&(t=kt()),e=Ls(e,t),e!==null&&(ri(e,t),Li(e))}function Jv(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),sf(e,i)}function ep(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,h=e.memoizedState;h!==null&&(i=h.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(A(314))}s!==null&&s.delete(t),sf(e,i)}function tp(e,t){return xe(e,t)}var Oa=null,wr=null,Kl=!1,Ba=!1,Zl=!1,vs=0;function Li(e){e!==wr&&e.next===null&&(wr===null?Oa=wr=e:wr=wr.next=e),Ba=!0,Kl||(Kl=!0,sp())}function _n(e,t){if(!Zl&&Ba){Zl=!0;do for(var i=!1,s=Oa;s!==null;){if(e!==0){var h=s.pendingLanes;if(h===0)var v=0;else{var L=s.suspendedLanes,j=s.pingedLanes;v=(1<<31-vt(42|e)+1)-1,v&=h&~(L&~j),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(i=!0,of(s,v))}else v=He,v=St(s,s===Ke?v:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(v&3)===0||Nt(s,v)||(i=!0,of(s,v));s=s.next}while(i);Zl=!1}}function ip(){rf()}function rf(){Ba=Kl=!1;var e=0;vs!==0&&fp()&&(e=vs);for(var t=we(),i=null,s=Oa;s!==null;){var h=s.next,v=nf(s,t);v===0?(s.next=null,i===null?Oa=h:i.next=h,h===null&&(wr=i)):(i=s,(e!==0||(v&3)!==0)&&(Ba=!0)),s=h}mt!==0&&mt!==5||_n(e),vs!==0&&(vs=0)}function nf(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,h=e.expirationTimes,v=e.pendingLanes&-62914561;0<v;){var L=31-vt(v),j=1<<L,Z=h[L];Z===-1?((j&i)===0||(j&s)!==0)&&(h[L]=Ut(j,t)):Z<=t&&(e.expiredLanes|=j),v&=~j}if(t=Ke,i=He,i=St(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&($e===2||$e===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Ee(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Nt(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Ee(s),Oi(i)){case 2:case 8:i=gt;break;case 32:i=Qe;break;case 268435456:i=Je;break;default:i=Qe}return s=af.bind(null,e),i=xe(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Ee(s),e.callbackPriority=2,e.callbackNode=null,2}function af(e,t){if(mt!==0&&mt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(ka()&&e.callbackNode!==i)return null;var s=He;return s=St(e,e===Ke?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(jd(e,s,t),nf(e,we()),e.callbackNode!=null&&e.callbackNode===i?af.bind(null,e):null)}function of(e,t){if(ka())return null;jd(e,t,!0)}function sp(){gp(function(){(Fe&6)!==0?xe(qe,ip):rf()})}function Ql(){if(vs===0){var e=lr;e===0&&(e=Ei,Ei<<=1,(Ei&261888)===0&&(Ei=256)),vs=e}return vs}function lf(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Fn(""+e)}function cf(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function rp(e,t,i,s,h){if(t==="submit"&&i&&i.stateNode===h){var v=lf((h[Pt]||null).action),L=s.submitter;L&&(t=(t=L[Pt]||null)?lf(t.formAction):L.getAttribute("formAction"),t!==null&&(v=t,L=null));var j=new Gn("action","action",null,s,h);e.push({event:j,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(vs!==0){var Z=L?cf(h,L):new FormData(h);ml(i,{pending:!0,data:Z,method:h.method,action:v},null,Z)}}else typeof v=="function"&&(j.preventDefault(),Z=L?cf(h,L):new FormData(h),ml(i,{pending:!0,data:Z,method:h.method,action:v},v,Z))},currentTarget:h}]})}}for(var Jl=0;Jl<Ho.length;Jl++){var ec=Ho[Jl],np=ec.toLowerCase(),ap=ec[0].toUpperCase()+ec.slice(1);yi(np,"on"+ap)}yi(Uu,"onAnimationEnd"),yi(ju,"onAnimationIteration"),yi(Pu,"onAnimationStart"),yi("dblclick","onDoubleClick"),yi("focusin","onFocus"),yi("focusout","onBlur"),yi(Cv,"onTransitionRun"),yi(wv,"onTransitionStart"),yi(xv,"onTransitionCancel"),yi(Fu,"onTransitionEnd"),Vs("onMouseEnter",["mouseout","mouseover"]),Vs("onMouseLeave",["mouseout","mouseover"]),Vs("onPointerEnter",["pointerout","pointerover"]),Vs("onPointerLeave",["pointerout","pointerover"]),Es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Es("onBeforeInput",["compositionend","keypress","textInput","paste"]),Es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gn="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(" "),op=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(gn));function uf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],h=s.event;s=s.listeners;e:{var v=void 0;if(t)for(var L=s.length-1;0<=L;L--){var j=s[L],Z=j.instance,re=j.currentTarget;if(j=j.listener,Z!==v&&h.isPropagationStopped())break e;v=j,h.currentTarget=re;try{v(h)}catch(ce){Xn(ce)}h.currentTarget=null,v=Z}else for(L=0;L<s.length;L++){if(j=s[L],Z=j.instance,re=j.currentTarget,j=j.listener,Z!==v&&h.isPropagationStopped())break e;v=j,h.currentTarget=re;try{v(h)}catch(ce){Xn(ce)}h.currentTarget=null,v=Z}}}}function Be(e,t){var i=t[fo];i===void 0&&(i=t[fo]=new Set);var s=e+"__bubble";i.has(s)||(hf(t,e,2,!1),i.add(s))}function tc(e,t,i){var s=0;t&&(s|=4),hf(i,e,s,t)}var Ha="_reactListening"+Math.random().toString(36).slice(2);function ic(e){if(!e[Ha]){e[Ha]=!0,su.forEach(function(i){i!=="selectionchange"&&(op.has(i)||tc(i,!1,e),tc(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ha]||(t[Ha]=!0,tc("selectionchange",!1,t))}}function hf(e,t,i,s){switch(jf(t)){case 2:var h=Hp;break;case 8:h=zp;break;default:h=pc}i=h.bind(null,t,i,e),h=void 0,!Co||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(h=!0),s?h!==void 0?e.addEventListener(t,i,{capture:!0,passive:h}):e.addEventListener(t,i,!0):h!==void 0?e.addEventListener(t,i,{passive:h}):e.addEventListener(t,i,!1)}function sc(e,t,i,s,h){var v=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var L=s.tag;if(L===3||L===4){var j=s.stateNode.containerInfo;if(j===h)break;if(L===4)for(L=s.return;L!==null;){var Z=L.tag;if((Z===3||Z===4)&&L.stateNode.containerInfo===h)return;L=L.return}for(;j!==null;){if(L=$s(j),L===null)return;if(Z=L.tag,Z===5||Z===6||Z===26||Z===27){s=v=L;continue e}j=j.parentNode}}s=s.return}gu(function(){var re=v,ce=So(i),de=[];e:{var ae=qu.get(e);if(ae!==void 0){var le=Gn,pe=e;switch(e){case"keypress":if(Wn(i)===0)break e;case"keydown":case"keyup":le=ev;break;case"focusin":pe="focus",le=Ro;break;case"focusout":pe="blur",le=Ro;break;case"beforeblur":case"afterblur":le=Ro;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=mu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=Fg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=sv;break;case Uu:case ju:case Pu:le=$g;break;case Fu:le=nv;break;case"scroll":case"scrollend":le=jg;break;case"wheel":le=ov;break;case"copy":case"cut":case"paste":le=Yg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Su;break;case"toggle":case"beforetoggle":le=cv}var Ce=(t&4)!==0,Xe=!Ce&&(e==="scroll"||e==="scrollend"),ie=Ce?ae!==null?ae+"Capture":null:ae;Ce=[];for(var J=re,se;J!==null;){var ue=J;if(se=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||se===null||ie===null||(ue=zr(J,ie),ue!=null&&Ce.push(vn(J,ue,se))),Xe)break;J=J.return}0<Ce.length&&(ae=new le(ae,pe,null,i,ce),de.push({event:ae,listeners:Ce}))}}if((t&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",le=e==="mouseout"||e==="pointerout",ae&&i!==bo&&(pe=i.relatedTarget||i.fromElement)&&($s(pe)||pe[Ws]))break e;if((le||ae)&&(ae=ce.window===ce?ce:(ae=ce.ownerDocument)?ae.defaultView||ae.parentWindow:window,le?(pe=i.relatedTarget||i.toElement,le=re,pe=pe?$s(pe):null,pe!==null&&(Xe=N(pe),Ce=pe.tag,pe!==Xe||Ce!==5&&Ce!==27&&Ce!==6)&&(pe=null)):(le=null,pe=re),le!==pe)){if(Ce=mu,ue="onMouseLeave",ie="onMouseEnter",J="mouse",(e==="pointerout"||e==="pointerover")&&(Ce=Su,ue="onPointerLeave",ie="onPointerEnter",J="pointer"),Xe=le==null?ae:Hr(le),se=pe==null?ae:Hr(pe),ae=new Ce(ue,J+"leave",le,i,ce),ae.target=Xe,ae.relatedTarget=se,ue=null,$s(ce)===re&&(Ce=new Ce(ie,J+"enter",pe,i,ce),Ce.target=se,Ce.relatedTarget=Xe,ue=Ce),Xe=ue,le&&pe)t:{for(Ce=lp,ie=le,J=pe,se=0,ue=ie;ue;ue=Ce(ue))se++;ue=0;for(var ye=J;ye;ye=Ce(ye))ue++;for(;0<se-ue;)ie=Ce(ie),se--;for(;0<ue-se;)J=Ce(J),ue--;for(;se--;){if(ie===J||J!==null&&ie===J.alternate){Ce=ie;break t}ie=Ce(ie),J=Ce(J)}Ce=null}else Ce=null;le!==null&&df(de,ae,le,Ce,!1),pe!==null&&Xe!==null&&df(de,Xe,pe,Ce,!0)}}e:{if(ae=re?Hr(re):window,le=ae.nodeName&&ae.nodeName.toLowerCase(),le==="select"||le==="input"&&ae.type==="file")var Ue=Du;else if(Ru(ae))if(Lu)Ue=bv;else{Ue=pv;var me=vv}else le=ae.nodeName,!le||le.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?re&&mo(re.elementType)&&(Ue=Du):Ue=mv;if(Ue&&(Ue=Ue(e,re))){Au(de,Ue,i,ce);break e}me&&me(e,ae,re),e==="focusout"&&re&&ae.type==="number"&&re.memoizedProps.value!=null&&po(ae,"number",ae.value)}switch(me=re?Hr(re):window,e){case"focusin":(Ru(me)||me.contentEditable==="true")&&(er=me,ko=re,Wr=null);break;case"focusout":Wr=ko=er=null;break;case"mousedown":Oo=!0;break;case"contextmenu":case"mouseup":case"dragend":Oo=!1,Iu(de,i,ce);break;case"selectionchange":if(yv)break;case"keydown":case"keyup":Iu(de,i,ce)}var Me;if(Do)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Js?xu(e,i)&&(ze="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(ze="onCompositionStart");ze&&(yu&&i.locale!=="ko"&&(Js||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Js&&(Me=vu()):(es=ce,wo="value"in es?es.value:es.textContent,Js=!0)),me=za(re,ze),0<me.length&&(ze=new bu(ze,e,null,i,ce),de.push({event:ze,listeners:me}),Me?ze.data=Me:(Me=Eu(i),Me!==null&&(ze.data=Me)))),(Me=hv?dv(e,i):fv(e,i))&&(ze=za(re,"onBeforeInput"),0<ze.length&&(me=new bu("onBeforeInput","beforeinput",null,i,ce),de.push({event:me,listeners:ze}),me.data=Me)),rp(de,e,re,i,ce)}uf(de,t)})}function vn(e,t,i){return{instance:e,listener:t,currentTarget:i}}function za(e,t){for(var i=t+"Capture",s=[];e!==null;){var h=e,v=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||v===null||(h=zr(e,i),h!=null&&s.unshift(vn(e,h,v)),h=zr(e,t),h!=null&&s.push(vn(e,h,v))),e.tag===3)return s;e=e.return}return[]}function lp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function df(e,t,i,s,h){for(var v=t._reactName,L=[];i!==null&&i!==s;){var j=i,Z=j.alternate,re=j.stateNode;if(j=j.tag,Z!==null&&Z===s)break;j!==5&&j!==26&&j!==27||re===null||(Z=re,h?(re=zr(i,v),re!=null&&L.unshift(vn(i,re,Z))):h||(re=zr(i,v),re!=null&&L.push(vn(i,re,Z)))),i=i.return}L.length!==0&&e.push({event:t,listeners:L})}var cp=/\r\n?/g,up=/\u0000|\uFFFD/g;function ff(e){return(typeof e=="string"?e:""+e).replace(cp,`
49
- `).replace(up,"")}function _f(e,t){return t=ff(t),ff(e)===t}function Ve(e,t,i,s,h,v){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||Ks(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&Ks(e,""+s);break;case"className":jn(e,"class",s);break;case"tabIndex":jn(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":jn(e,i,s);break;case"style":fu(e,s,v);break;case"data":if(t!=="object"){jn(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Fn(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"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 v=="function"&&(i==="formAction"?(t!=="input"&&Ve(e,t,"name",h.name,h,null),Ve(e,t,"formEncType",h.formEncType,h,null),Ve(e,t,"formMethod",h.formMethod,h,null),Ve(e,t,"formTarget",h.formTarget,h,null)):(Ve(e,t,"encType",h.encType,h,null),Ve(e,t,"method",h.method,h,null),Ve(e,t,"target",h.target,h,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=Fn(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=Hi);break;case"onScroll":s!=null&&Be("scroll",e);break;case"onScrollEnd":s!=null&&Be("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(A(61));if(i=s.__html,i!=null){if(h.children!=null)throw Error(A(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=Fn(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):e.removeAttribute(i);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":Be("beforetoggle",e),Be("toggle",e),Un(e,"popover",s);break;case"xlinkActuate":Bi(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Bi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Bi(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Bi(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Bi(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Bi(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Bi(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Un(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Ng.get(i)||i,Un(e,i,s))}}function rc(e,t,i,s,h,v){switch(i){case"style":fu(e,s,v);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(A(61));if(i=s.__html,i!=null){if(h.children!=null)throw Error(A(60));e.innerHTML=i}}break;case"children":typeof s=="string"?Ks(e,s):(typeof s=="number"||typeof s=="bigint")&&Ks(e,""+s);break;case"onScroll":s!=null&&Be("scroll",e);break;case"onScrollEnd":s!=null&&Be("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Hi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ru.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(h=i.endsWith("Capture"),t=i.slice(2,h?i.length-7:void 0),v=e[Pt]||null,v=v!=null?v[i]:null,typeof v=="function"&&e.removeEventListener(t,v,h),typeof s=="function")){typeof v!="function"&&v!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,h);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Un(e,i,s)}}}function Tt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",e),Be("load",e);var s=!1,h=!1,v;for(v in i)if(i.hasOwnProperty(v)){var L=i[v];if(L!=null)switch(v){case"src":s=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(A(137,t));default:Ve(e,t,v,L,i,null)}}h&&Ve(e,t,"srcSet",i.srcSet,i,null),s&&Ve(e,t,"src",i.src,i,null);return;case"input":Be("invalid",e);var j=v=L=h=null,Z=null,re=null;for(s in i)if(i.hasOwnProperty(s)){var ce=i[s];if(ce!=null)switch(s){case"name":h=ce;break;case"type":L=ce;break;case"checked":Z=ce;break;case"defaultChecked":re=ce;break;case"value":v=ce;break;case"defaultValue":j=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(A(137,t));break;default:Ve(e,t,s,ce,i,null)}}cu(e,v,j,Z,re,L,h,!1);return;case"select":Be("invalid",e),s=L=v=null;for(h in i)if(i.hasOwnProperty(h)&&(j=i[h],j!=null))switch(h){case"value":v=j;break;case"defaultValue":L=j;break;case"multiple":s=j;default:Ve(e,t,h,j,i,null)}t=v,i=L,e.multiple=!!s,t!=null?Xs(e,!!s,t,!1):i!=null&&Xs(e,!!s,i,!0);return;case"textarea":Be("invalid",e),v=h=s=null;for(L in i)if(i.hasOwnProperty(L)&&(j=i[L],j!=null))switch(L){case"value":s=j;break;case"defaultValue":h=j;break;case"children":v=j;break;case"dangerouslySetInnerHTML":if(j!=null)throw Error(A(91));break;default:Ve(e,t,L,j,i,null)}hu(e,s,h,v);return;case"option":for(Z in i)if(i.hasOwnProperty(Z)&&(s=i[Z],s!=null))switch(Z){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ve(e,t,Z,s,i,null)}return;case"dialog":Be("beforetoggle",e),Be("toggle",e),Be("cancel",e),Be("close",e);break;case"iframe":case"object":Be("load",e);break;case"video":case"audio":for(s=0;s<gn.length;s++)Be(gn[s],e);break;case"image":Be("error",e),Be("load",e);break;case"details":Be("toggle",e);break;case"embed":case"source":case"link":Be("error",e),Be("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(re in i)if(i.hasOwnProperty(re)&&(s=i[re],s!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(A(137,t));default:Ve(e,t,re,s,i,null)}return;default:if(mo(t)){for(ce in i)i.hasOwnProperty(ce)&&(s=i[ce],s!==void 0&&rc(e,t,ce,s,i,void 0));return}}for(j in i)i.hasOwnProperty(j)&&(s=i[j],s!=null&&Ve(e,t,j,s,i,null))}function hp(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,v=null,L=null,j=null,Z=null,re=null,ce=null;for(le in i){var de=i[le];if(i.hasOwnProperty(le)&&de!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":Z=de;default:s.hasOwnProperty(le)||Ve(e,t,le,null,s,de)}}for(var ae in s){var le=s[ae];if(de=i[ae],s.hasOwnProperty(ae)&&(le!=null||de!=null))switch(ae){case"type":v=le;break;case"name":h=le;break;case"checked":re=le;break;case"defaultChecked":ce=le;break;case"value":L=le;break;case"defaultValue":j=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(A(137,t));break;default:le!==de&&Ve(e,t,ae,le,s,de)}}vo(e,L,j,Z,re,ce,v,h);return;case"select":le=L=j=ae=null;for(v in i)if(Z=i[v],i.hasOwnProperty(v)&&Z!=null)switch(v){case"value":break;case"multiple":le=Z;default:s.hasOwnProperty(v)||Ve(e,t,v,null,s,Z)}for(h in s)if(v=s[h],Z=i[h],s.hasOwnProperty(h)&&(v!=null||Z!=null))switch(h){case"value":ae=v;break;case"defaultValue":j=v;break;case"multiple":L=v;default:v!==Z&&Ve(e,t,h,v,s,Z)}t=j,i=L,s=le,ae!=null?Xs(e,!!i,ae,!1):!!s!=!!i&&(t!=null?Xs(e,!!i,t,!0):Xs(e,!!i,i?[]:"",!1));return;case"textarea":le=ae=null;for(j in i)if(h=i[j],i.hasOwnProperty(j)&&h!=null&&!s.hasOwnProperty(j))switch(j){case"value":break;case"children":break;default:Ve(e,t,j,null,s,h)}for(L in s)if(h=s[L],v=i[L],s.hasOwnProperty(L)&&(h!=null||v!=null))switch(L){case"value":ae=h;break;case"defaultValue":le=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(A(91));break;default:h!==v&&Ve(e,t,L,h,s,v)}uu(e,ae,le);return;case"option":for(var pe in i)if(ae=i[pe],i.hasOwnProperty(pe)&&ae!=null&&!s.hasOwnProperty(pe))switch(pe){case"selected":e.selected=!1;break;default:Ve(e,t,pe,null,s,ae)}for(Z in s)if(ae=s[Z],le=i[Z],s.hasOwnProperty(Z)&&ae!==le&&(ae!=null||le!=null))switch(Z){case"selected":e.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:Ve(e,t,Z,ae,s,le)}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 Ce in i)ae=i[Ce],i.hasOwnProperty(Ce)&&ae!=null&&!s.hasOwnProperty(Ce)&&Ve(e,t,Ce,null,s,ae);for(re in s)if(ae=s[re],le=i[re],s.hasOwnProperty(re)&&ae!==le&&(ae!=null||le!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(A(137,t));break;default:Ve(e,t,re,ae,s,le)}return;default:if(mo(t)){for(var Xe in i)ae=i[Xe],i.hasOwnProperty(Xe)&&ae!==void 0&&!s.hasOwnProperty(Xe)&&rc(e,t,Xe,void 0,s,ae);for(ce in s)ae=s[ce],le=i[ce],!s.hasOwnProperty(ce)||ae===le||ae===void 0&&le===void 0||rc(e,t,ce,ae,s,le);return}}for(var ie in i)ae=i[ie],i.hasOwnProperty(ie)&&ae!=null&&!s.hasOwnProperty(ie)&&Ve(e,t,ie,null,s,ae);for(de in s)ae=s[de],le=i[de],!s.hasOwnProperty(de)||ae===le||ae==null&&le==null||Ve(e,t,de,ae,s,le)}function gf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function dp(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var h=i[s],v=h.transferSize,L=h.initiatorType,j=h.duration;if(v&&j&&gf(L)){for(L=0,j=h.responseEnd,s+=1;s<i.length;s++){var Z=i[s],re=Z.startTime;if(re>j)break;var ce=Z.transferSize,de=Z.initiatorType;ce&&gf(de)&&(Z=Z.responseEnd,L+=ce*(Z<j?1:(j-re)/(Z-re)))}if(--s,t+=8*(v+L)/(h.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var nc=null,ac=null;function Ia(e){return e.nodeType===9?e:e.ownerDocument}function vf(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function pf(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function oc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var lc=null;function fp(){var e=window.event;return e&&e.type==="popstate"?e===lc?!1:(lc=e,!0):(lc=null,!1)}var mf=typeof setTimeout=="function"?setTimeout:void 0,_p=typeof clearTimeout=="function"?clearTimeout:void 0,bf=typeof Promise=="function"?Promise:void 0,gp=typeof queueMicrotask=="function"?queueMicrotask:typeof bf<"u"?function(e){return bf.resolve(null).then(e).catch(vp)}:mf;function vp(e){setTimeout(function(){throw e})}function ps(e){return e==="head"}function Sf(e,t){var i=t,s=0;do{var h=i.nextSibling;if(e.removeChild(i),h&&h.nodeType===8)if(i=h.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(h),Ar(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")pn(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,pn(i);for(var v=i.firstChild;v;){var L=v.nextSibling,j=v.nodeName;v[Br]||j==="SCRIPT"||j==="STYLE"||j==="LINK"&&v.rel.toLowerCase()==="stylesheet"||i.removeChild(v),v=L}}else i==="body"&&pn(e.ownerDocument.body);i=h}while(i);Ar(t)}function yf(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function cc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":cc(i),_o(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function pp(e,t,i,s){for(;e.nodeType===1;){var h=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Br])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(v=e.getAttribute("rel"),v==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(v!==h.rel||e.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(v=e.getAttribute("src"),(v!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&v&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var v=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===v)return e}else return e;if(e=gi(e.nextSibling),e===null)break}return null}function mp(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=gi(e.nextSibling),e===null))return null;return e}function Cf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=gi(e.nextSibling),e===null))return null;return e}function uc(e){return e.data==="$?"||e.data==="$~"}function hc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function bp(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function gi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var dc=null;function wf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return gi(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function xf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function Ef(e,t,i){switch(t=Ia(i),e){case"html":if(e=t.documentElement,!e)throw Error(A(452));return e;case"head":if(e=t.head,!e)throw Error(A(453));return e;case"body":if(e=t.body,!e)throw Error(A(454));return e;default:throw Error(A(451))}}function pn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);_o(e)}var vi=new Map,Rf=new Set;function Na(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Zi=W.d;W.d={f:Sp,r:yp,D:Cp,C:wp,L:xp,m:Ep,X:Ap,S:Rp,M:Dp};function Sp(){var e=Zi.f(),t=La();return e||t}function yp(e){var t=Gs(e);t!==null&&t.tag===5&&t.type==="form"?Fh(t):Zi.r(e)}var xr=typeof document>"u"?null:document;function Af(e,t,i){var s=xr;if(s&&typeof t=="string"&&t){var h=li(t);h='link[rel="'+e+'"][href="'+h+'"]',typeof i=="string"&&(h+='[crossorigin="'+i+'"]'),Rf.has(h)||(Rf.add(h),e={rel:e,crossOrigin:i,href:t},s.querySelector(h)===null&&(t=s.createElement("link"),Tt(t,"link",e),yt(t),s.head.appendChild(t)))}}function Cp(e){Zi.D(e),Af("dns-prefetch",e,null)}function wp(e,t){Zi.C(e,t),Af("preconnect",e,t)}function xp(e,t,i){Zi.L(e,t,i);var s=xr;if(s&&e&&t){var h='link[rel="preload"][as="'+li(t)+'"]';t==="image"&&i&&i.imageSrcSet?(h+='[imagesrcset="'+li(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(h+='[imagesizes="'+li(i.imageSizes)+'"]')):h+='[href="'+li(e)+'"]';var v=h;switch(t){case"style":v=Er(e);break;case"script":v=Rr(e)}vi.has(v)||(e=l({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),vi.set(v,e),s.querySelector(h)!==null||t==="style"&&s.querySelector(mn(v))||t==="script"&&s.querySelector(bn(v))||(t=s.createElement("link"),Tt(t,"link",e),yt(t),s.head.appendChild(t)))}}function Ep(e,t){Zi.m(e,t);var i=xr;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",h='link[rel="modulepreload"][as="'+li(s)+'"][href="'+li(e)+'"]',v=h;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Rr(e)}if(!vi.has(v)&&(e=l({rel:"modulepreload",href:e},t),vi.set(v,e),i.querySelector(h)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(bn(v)))return}s=i.createElement("link"),Tt(s,"link",e),yt(s),i.head.appendChild(s)}}}function Rp(e,t,i){Zi.S(e,t,i);var s=xr;if(s&&e){var h=Ys(s).hoistableStyles,v=Er(e);t=t||"default";var L=h.get(v);if(!L){var j={loading:0,preload:null};if(L=s.querySelector(mn(v)))j.loading=5;else{e=l({rel:"stylesheet",href:e,"data-precedence":t},i),(i=vi.get(v))&&fc(e,i);var Z=L=s.createElement("link");yt(Z),Tt(Z,"link",e),Z._p=new Promise(function(re,ce){Z.onload=re,Z.onerror=ce}),Z.addEventListener("load",function(){j.loading|=1}),Z.addEventListener("error",function(){j.loading|=2}),j.loading|=4,Ua(L,t,s)}L={type:"stylesheet",instance:L,count:1,state:j},h.set(v,L)}}}function Ap(e,t){Zi.X(e,t);var i=xr;if(i&&e){var s=Ys(i).hoistableScripts,h=Rr(e),v=s.get(h);v||(v=i.querySelector(bn(h)),v||(e=l({src:e,async:!0},t),(t=vi.get(h))&&_c(e,t),v=i.createElement("script"),yt(v),Tt(v,"link",e),i.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},s.set(h,v))}}function Dp(e,t){Zi.M(e,t);var i=xr;if(i&&e){var s=Ys(i).hoistableScripts,h=Rr(e),v=s.get(h);v||(v=i.querySelector(bn(h)),v||(e=l({src:e,async:!0,type:"module"},t),(t=vi.get(h))&&_c(e,t),v=i.createElement("script"),yt(v),Tt(v,"link",e),i.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},s.set(h,v))}}function Df(e,t,i,s){var h=(h=oe.current)?Na(h):null;if(!h)throw Error(A(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Er(i.href),i=Ys(h).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Er(i.href);var v=Ys(h).hoistableStyles,L=v.get(e);if(L||(h=h.ownerDocument||h,L={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(e,L),(v=h.querySelector(mn(e)))&&!v._p&&(L.instance=v,L.state.loading=5),vi.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},vi.set(e,i),v||Lp(h,e,i,L.state))),t&&s===null)throw Error(A(528,""));return L}if(t&&s!==null)throw Error(A(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Rr(i),i=Ys(h).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(A(444,e))}}function Er(e){return'href="'+li(e)+'"'}function mn(e){return'link[rel="stylesheet"]['+e+"]"}function Lf(e){return l({},e,{"data-precedence":e.precedence,precedence:null})}function Lp(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),Tt(t,"link",i),yt(t),e.head.appendChild(t))}function Rr(e){return'[src="'+li(e)+'"]'}function bn(e){return"script[async]"+e}function Tf(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+li(i.href)+'"]');if(s)return t.instance=s,yt(s),s;var h=l({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),yt(s),Tt(s,"style",h),Ua(s,i.precedence,e),t.instance=s;case"stylesheet":h=Er(i.href);var v=e.querySelector(mn(h));if(v)return t.state.loading|=4,t.instance=v,yt(v),v;s=Lf(i),(h=vi.get(h))&&fc(s,h),v=(e.ownerDocument||e).createElement("link"),yt(v);var L=v;return L._p=new Promise(function(j,Z){L.onload=j,L.onerror=Z}),Tt(v,"link",s),t.state.loading|=4,Ua(v,i.precedence,e),t.instance=v;case"script":return v=Rr(i.src),(h=e.querySelector(bn(v)))?(t.instance=h,yt(h),h):(s=i,(h=vi.get(v))&&(s=l({},i),_c(s,h)),e=e.ownerDocument||e,h=e.createElement("script"),yt(h),Tt(h,"link",s),e.head.appendChild(h),t.instance=h);case"void":return null;default:throw Error(A(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Ua(s,i.precedence,e));return t.instance}function Ua(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=s.length?s[s.length-1]:null,v=h,L=0;L<s.length;L++){var j=s[L];if(j.dataset.precedence===t)v=j;else if(v!==h)break}v?v.parentNode.insertBefore(e,v.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function fc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function _c(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ja=null;function Mf(e,t,i){if(ja===null){var s=new Map,h=ja=new Map;h.set(i,s)}else h=ja,s=h.get(i),s||(s=new Map,h.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),h=0;h<i.length;h++){var v=i[h];if(!(v[Br]||v[Rt]||e==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var L=v.getAttribute(t)||"";L=e+L;var j=s.get(L);j?j.push(v):s.set(L,[v])}}return s}function kf(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Tp(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Of(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Mp(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var h=Er(s.href),v=t.querySelector(mn(h));if(v){t=v._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Pa.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=v,yt(v);return}v=t.ownerDocument||t,s=Lf(s),(h=vi.get(h))&&fc(s,h),v=v.createElement("link"),yt(v);var L=v;L._p=new Promise(function(j,Z){L.onload=j,L.onerror=Z}),Tt(v,"link",s),i.instance=v}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Pa.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var gc=0;function kp(e,t){return e.stylesheets&&e.count===0&&qa(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&qa(e,e.stylesheets),e.unsuspend){var v=e.unsuspend;e.unsuspend=null,v()}},6e4+t);0<e.imgBytes&&gc===0&&(gc=62500*dp());var h=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&qa(e,e.stylesheets),e.unsuspend)){var v=e.unsuspend;e.unsuspend=null,v()}},(e.imgBytes>gc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(h)}}:null}function Pa(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)qa(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Fa=null;function qa(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Fa=new Map,t.forEach(Op,e),Fa=null,Pa.call(e))}function Op(e,t){if(!(t.state.loading&4)){var i=Fa.get(e);if(i)var s=i.get(null);else{i=new Map,Fa.set(e,i);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<h.length;v++){var L=h[v];(L.nodeName==="LINK"||L.getAttribute("media")!=="not all")&&(i.set(L.dataset.precedence,L),s=L)}s&&i.set(null,s)}h=t.instance,L=h.getAttribute("data-precedence"),v=i.get(L)||s,v===s&&i.set(null,h),i.set(L,h),this.count++,s=Pa.bind(this),h.addEventListener("load",s),h.addEventListener("error",s),v?v.parentNode.insertBefore(h,v.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),t.state.loading|=4}}var Sn={$$typeof:c,Provider:null,Consumer:null,_currentValue:X,_currentValue2:X,_threadCount:0};function Bp(e,t,i,s,h,v,L,j,Z){this.tag=1,this.containerInfo=e,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=jt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jt(0),this.hiddenUpdates=jt(null),this.identifierPrefix=s,this.onUncaughtError=h,this.onCaughtError=v,this.onRecoverableError=L,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Z,this.incompleteTransitions=new Map}function Bf(e,t,i,s,h,v,L,j,Z,re,ce,de){return e=new Bp(e,t,i,L,Z,re,ce,de,j),t=1,v===!0&&(t|=24),v=Qt(3,null,null,t),e.current=v,v.stateNode=e,t=Vo(),t.refCount++,e.pooledCache=t,t.refCount++,v.memoizedState={element:s,isDehydrated:i,cache:t},Qo(v),e}function Hf(e){return e?(e=sr,e):sr}function zf(e,t,i,s,h,v){h=Hf(h),s.context===null?s.context=h:s.pendingContext=h,s=as(t),s.payload={element:i},v=v===void 0?null:v,v!==null&&(s.callback=v),i=os(e,s,t),i!==null&&(Yt(i,e,t),Zr(i,e,t))}function If(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function vc(e,t){If(e,t),(e=e.alternate)&&If(e,t)}function Nf(e){if(e.tag===13||e.tag===31){var t=Ls(e,67108864);t!==null&&Yt(t,e,67108864),vc(e,67108864)}}function Uf(e){if(e.tag===13||e.tag===31){var t=si();t=ki(t);var i=Ls(e,t);i!==null&&Yt(i,e,t),vc(e,t)}}var Wa=!0;function Hp(e,t,i,s){var h=G.T;G.T=null;var v=W.p;try{W.p=2,pc(e,t,i,s)}finally{W.p=v,G.T=h}}function zp(e,t,i,s){var h=G.T;G.T=null;var v=W.p;try{W.p=8,pc(e,t,i,s)}finally{W.p=v,G.T=h}}function pc(e,t,i,s){if(Wa){var h=mc(s);if(h===null)sc(e,t,s,$a,i),Pf(e,s);else if(Np(h,e,t,i,s))s.stopPropagation();else if(Pf(e,s),t&4&&-1<Ip.indexOf(e)){for(;h!==null;){var v=Gs(h);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var L=rt(v.pendingLanes);if(L!==0){var j=v;for(j.pendingLanes|=2,j.entangledLanes|=2;L;){var Z=1<<31-vt(L);j.entanglements[1]|=Z,L&=~Z}Li(v),(Fe&6)===0&&(Aa=we()+500,_n(0))}}break;case 31:case 13:j=Ls(v,2),j!==null&&Yt(j,v,2),La(),vc(v,2)}if(v=mc(s),v===null&&sc(e,t,s,$a,i),v===h)break;h=v}h!==null&&s.stopPropagation()}else sc(e,t,s,null,i)}}function mc(e){return e=So(e),bc(e)}var $a=null;function bc(e){if($a=null,e=$s(e),e!==null){var t=N(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=z(t),e!==null)return e;e=null}else if(i===31){if(e=r(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return $a=e,null}function jf(e){switch(e){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(Ze()){case qe:return 2;case gt:return 8;case Qe:case ct:return 32;case Je:return 268435456;default:return 32}default:return 32}}var Sc=!1,ms=null,bs=null,Ss=null,yn=new Map,Cn=new Map,ys=[],Ip="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 Pf(e,t){switch(e){case"focusin":case"focusout":ms=null;break;case"dragenter":case"dragleave":bs=null;break;case"mouseover":case"mouseout":Ss=null;break;case"pointerover":case"pointerout":yn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Cn.delete(t.pointerId)}}function wn(e,t,i,s,h,v){return e===null||e.nativeEvent!==v?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:v,targetContainers:[h]},t!==null&&(t=Gs(t),t!==null&&Nf(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,h!==null&&t.indexOf(h)===-1&&t.push(h),e)}function Np(e,t,i,s,h){switch(t){case"focusin":return ms=wn(ms,e,t,i,s,h),!0;case"dragenter":return bs=wn(bs,e,t,i,s,h),!0;case"mouseover":return Ss=wn(Ss,e,t,i,s,h),!0;case"pointerover":var v=h.pointerId;return yn.set(v,wn(yn.get(v)||null,e,t,i,s,h)),!0;case"gotpointercapture":return v=h.pointerId,Cn.set(v,wn(Cn.get(v)||null,e,t,i,s,h)),!0}return!1}function Ff(e){var t=$s(e.target);if(t!==null){var i=N(t);if(i!==null){if(t=i.tag,t===13){if(t=z(i),t!==null){e.blockedOn=t,Ji(e.priority,function(){Uf(i)});return}}else if(t===31){if(t=r(i),t!==null){e.blockedOn=t,Ji(e.priority,function(){Uf(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ga(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=mc(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);bo=s,i.target.dispatchEvent(s),bo=null}else return t=Gs(i),t!==null&&Nf(t),e.blockedOn=i,!1;t.shift()}return!0}function qf(e,t,i){Ga(e)&&i.delete(t)}function Up(){Sc=!1,ms!==null&&Ga(ms)&&(ms=null),bs!==null&&Ga(bs)&&(bs=null),Ss!==null&&Ga(Ss)&&(Ss=null),yn.forEach(qf),Cn.forEach(qf)}function Ya(e,t){e.blockedOn===t&&(e.blockedOn=null,Sc||(Sc=!0,_.unstable_scheduleCallback(_.unstable_NormalPriority,Up)))}var Va=null;function Wf(e){Va!==e&&(Va=e,_.unstable_scheduleCallback(_.unstable_NormalPriority,function(){Va===e&&(Va=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],h=e[t+2];if(typeof s!="function"){if(bc(s||i)===null)continue;break}var v=Gs(i);v!==null&&(e.splice(t,3),t-=3,ml(v,{pending:!0,data:h,method:i.method,action:s},s,h))}}))}function Ar(e){function t(Z){return Ya(Z,e)}ms!==null&&Ya(ms,e),bs!==null&&Ya(bs,e),Ss!==null&&Ya(Ss,e),yn.forEach(t),Cn.forEach(t);for(var i=0;i<ys.length;i++){var s=ys[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<ys.length&&(i=ys[0],i.blockedOn===null);)Ff(i),i.blockedOn===null&&ys.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var h=i[s],v=i[s+1],L=h[Pt]||null;if(typeof v=="function")L||Wf(i);else if(L){var j=null;if(v&&v.hasAttribute("formAction")){if(h=v,L=v[Pt]||null)j=L.formAction;else if(bc(h)!==null)continue}else j=L.action;typeof j=="function"?i[s+1]=j:(i.splice(s,3),s-=3),Wf(i)}}}function $f(){function e(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(L){return h=L})},focusReset:"manual",scroll:"manual"})}function t(){h!==null&&(h(),h=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,h=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),h!==null&&(h(),h=null)}}}function yc(e){this._internalRoot=e}Xa.prototype.render=yc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(A(409));var i=t.current,s=si();zf(i,s,e,t,null,null)},Xa.prototype.unmount=yc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;zf(e.current,2,null,e,null,null),La(),t[Ws]=null}};function Xa(e){this._internalRoot=e}Xa.prototype.unstable_scheduleHydration=function(e){if(e){var t=Si();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ys.length&&t!==0&&t<ys[i].priority;i++);ys.splice(i,0,e),i===0&&Ff(e)}};var Gf=C.version;if(Gf!=="19.2.4")throw Error(A(527,Gf,"19.2.4"));W.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(A(188)):(e=Object.keys(e).join(","),Error(A(268,e)));return e=d(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var jp={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ka=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ka.isDisabled&&Ka.supportsFiber)try{Xt=Ka.inject(jp),ut=Ka}catch{}}return En.createRoot=function(e,t){if(!H(e))throw Error(A(299));var i=!1,s="",h=Qh,v=Jh,L=ed;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(h=t.onUncaughtError),t.onCaughtError!==void 0&&(v=t.onCaughtError),t.onRecoverableError!==void 0&&(L=t.onRecoverableError)),t=Bf(e,1,!1,null,null,i,s,null,h,v,L,$f),e[Ws]=t.current,ic(e),new yc(t)},En.hydrateRoot=function(e,t,i){if(!H(e))throw Error(A(299));var s=!1,h="",v=Qh,L=Jh,j=ed,Z=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(v=i.onUncaughtError),i.onCaughtError!==void 0&&(L=i.onCaughtError),i.onRecoverableError!==void 0&&(j=i.onRecoverableError),i.formState!==void 0&&(Z=i.formState)),t=Bf(e,1,!0,t,i??null,s,h,Z,v,L,j,$f),t.context=Hf(null),i=t.current,s=si(),s=ki(s),h=as(s),h.callback=null,os(i,h,s),i=s,t.current.lanes=i,ri(t,i),Li(t),e[Ws]=t.current,ic(e),new Xa(t)},En.version="19.2.4",En}var i_;function Kp(){if(i_)return xc.exports;i_=1;function _(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_)}catch(C){console.error(C)}}return _(),xc.exports=Xp(),xc.exports}var Zp=Kp();const s_=_=>{let C;const D=new Set,A=(d,g)=>{const l=typeof d=="function"?d(C):d;if(!Object.is(l,C)){const p=C;C=g??(typeof l!="object"||l===null)?l:Object.assign({},C,l),D.forEach(b=>b(C,p))}},H=()=>C,r={setState:A,getState:H,getInitialState:()=>u,subscribe:d=>(D.add(d),()=>D.delete(d))},u=C=_(A,H,r);return r},Qp=(_=>_?s_(_):s_),Jp=_=>_;function e0(_,C=Jp){const D=xt.useSyncExternalStore(_.subscribe,xt.useCallback(()=>C(_.getState()),[_,C]),xt.useCallback(()=>C(_.getInitialState()),[_,C]));return xt.useDebugValue(D),D}const r_=_=>{const C=Qp(_),D=A=>e0(C,A);return Object.assign(D,C),D},U_=(_=>_?r_(_):r_),We=U_(_=>({isAuthenticated:!1,isCheckingAuth:!0,setAuthenticated:C=>_({isAuthenticated:C,isCheckingAuth:!1}),setCheckingAuth:C=>_({isCheckingAuth:C}),serverAvailable:null,setServerAvailable:C=>_({serverAvailable:C}),connectionStatus:"disconnected",instanceConnectionStatus:{},setConnectionStatus:C=>_({connectionStatus:C}),setInstanceConnectionStatus:(C,D)=>_(A=>({instanceConnectionStatus:{...A.instanceConnectionStatus,[C]:D}})),removeInstanceConnectionStatus:C=>_(D=>{const{[C]:A,...H}=D.instanceConnectionStatus;return{instanceConnectionStatus:H}}),sessionStatus:"idle",setSessionStatus:C=>_({sessionStatus:C}),cachedToken:null,setCachedToken:C=>_({cachedToken:C}),ipChangeInfo:null,setIpChangeInfo:C=>_({ipChangeInfo:C}),toastMessage:null,showToast:C=>_({toastMessage:C}),hideToast:()=>_({toastMessage:null})})),Fs="/api";async function xs(_){const C=await fetch(`${Fs}/auth`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({token:_})});if(C.status===429)throw new Error("Too many attempts. Try again later.");return C.ok}async function t0(){const _=await fetch(`${Fs}/status`,{credentials:"include"});if(_.status===401)throw new Error("Unauthorized");return _.json()}async function j_(_){const C=_?`${Fs}/config?instanceId=${encodeURIComponent(_)}`:`${Fs}/config`,D=await fetch(C,{credentials:"include"});if(D.status===401)throw new Error("Unauthorized");if(!D.ok)throw new Error(`Config fetch failed: ${D.status}`);return D.json()}async function i0(_,C){const D=C?`${Fs}/config?instanceId=${encodeURIComponent(C)}`:`${Fs}/config`,A=await fetch(D,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(_)});if(A.status===401)throw new Error("Unauthorized");return A.ok}async function s0(_,C){const D=await fetch(`${Fs}/config/notifications/${_}/enabled`,{method:"PATCH",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({enabled:C})});if(D.status===401)throw new Error("Unauthorized");if(!D.ok){const A=await D.json().catch(()=>({}));throw new Error(A.error||`Failed to update channel status: ${D.status}`)}return D.json()}const Yc="claude_remote_token";function P_(_){sessionStorage.setItem(Yc,_)}function Mn(){return sessionStorage.getItem(Yc)}function F_(){sessionStorage.removeItem(Yc)}function r0(){const[_,C]=q.useState(null),[D,A]=q.useState(!1),H=We(u=>u.setAuthenticated),N=We(u=>u.setCachedToken),z=q.useCallback(async u=>{C(null),A(!0);try{await xs(u)?(H(!0),N(u),P_(u)):C("Invalid token")}catch(d){C(d instanceof Error?d.message:"Authentication failed")}finally{A(!1)}},[H,N]),r=q.useCallback(()=>{H(!1),N(null),F_()},[H,N]);return{login:z,logout:r,error:_,loading:D}}function n0(){const[_,C]=q.useState(""),[D,A]=q.useState(!1),{login:H,error:N,loading:z}=r0();q.useEffect(()=>{const d=sessionStorage.getItem("prefill_token");d&&(C(d),sessionStorage.removeItem("prefill_token"))},[]);const r=d=>{d.preventDefault(),_.trim()&&H(_.trim())},u=d=>{d.key==="Enter"&&_.trim()&&H(_.trim())};return V.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",padding:24,background:"var(--bg-primary)"},children:V.jsxs("form",{onSubmit:r,autoComplete:"off",style:{width:"100%",maxWidth:400,display:"flex",flexDirection:"column",gap:16},children:[V.jsxs("div",{style:{textAlign:"center",marginBottom:8},children:[V.jsx("h1",{"data-testid":"auth--title",style:{fontSize:24,fontWeight:700,marginBottom:8},children:"Claude Code Remote"}),V.jsx("p",{"data-testid":"auth--subtitle",style:{fontSize:14,color:"var(--text-secondary)"},children:"Enter the token shown on your PC terminal"})]}),V.jsxs("div",{style:{position:"relative"},children:[V.jsx("input",{type:"text",value:_,onChange:d=>C(d.target.value),onKeyDown:u,placeholder:"Paste token here…","aria-label":"Authentication token","data-testid":"auth--input--token",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",style:{width:"100%",height:48,padding:"0 48px 0 16px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",fontSize:16,lineHeight:"48px",boxSizing:"border-box",WebkitTextSecurity:D?"none":"disc"}}),V.jsx("button",{type:"button",onClick:()=>A(!D),"aria-label":D?"Hide token":"Show token",style:{position:"absolute",right:12,top:"50%",transform:"translateY(-50%)",background:"none",border:"none",padding:8,cursor:"pointer",color:"var(--text-secondary)",display:"flex",alignItems:"center",justifyContent:"center"},children:D?V.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[V.jsx("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"}),V.jsx("line",{x1:"1",y1:"1",x2:"23",y2:"23"})]}):V.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[V.jsx("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),V.jsx("circle",{cx:"12",cy:"12",r:"3"})]})})]}),N&&V.jsx("div",{"data-testid":"auth--error",style:{color:"var(--status-error)",fontSize:14,textAlign:"center"},children:N}),V.jsx("button",{type:"submit",disabled:z||!_.trim(),"data-testid":"auth--button--connect",style:{height:48,borderRadius:8,background:_.trim()?"var(--status-running)":"var(--bg-tertiary)",color:_.trim()?"#fff":"var(--text-muted)",fontWeight:600,fontSize:16,transition:"background 0.15s",opacity:z?.7:1},children:z?"Authenticating…":"Connect"})]})})}const Ht=U_(_=>({instances:[],activeInstanceId:null,setInstances:C=>_({instances:C}),setActiveInstanceId:C=>_({activeInstanceId:C})})),a0=[{label:"Esc",data:"\x1B",enabled:!0},{label:"Enter",data:"\r",enabled:!0},{label:"Tab",data:" ",enabled:!0},{label:"↑",data:"\x1B[A",enabled:!0},{label:"↓",data:"\x1B[B",enabled:!0},{label:"←",data:"\x1B[D",enabled:!0},{label:"→",data:"\x1B[C",enabled:!0},{label:"S-Tab",data:"\x1B[Z",enabled:!0,desc:"Shift+Tab, 向前切换"},{label:"Ctrl+O",data:"",enabled:!0},{label:"Ctrl+E",data:"",enabled:!0}],o0=[{label:"/clear",command:"/clear",enabled:!0},{label:"/compact",command:"/compact",enabled:!0},{label:"/resume",command:"/resume",enabled:!0},{label:"/stats",command:"/stats",enabled:!0},{label:"/exit",command:"/exit",enabled:!0}],l0={dingtalk:{displayName:"DingTalk",icon:"dingtalk",description:"Send notifications to DingTalk group via robot webhook",helpUrl:"https://open.dingtalk.com/document/robots/custom-robot-access",implemented:!0},email:{displayName:"Email",icon:"email",description:"Send notifications via email",implemented:!1},slack:{displayName:"Slack",icon:"slack",description:"Send notifications to Slack channel via webhook",implemented:!1},wechat_work:{displayName:"WeChat",icon:"wechat-work",description:"Send notifications to WeChat via Server酱³",helpUrl:"https://sct.ftqq.com/sendkey",implemented:!0}},q_=/^https:\/\/oapi\.dingtalk\.com\/robot\/send\?access_token=/,W_=/^SCT[a-zA-Z0-9]{10,}$/,$_=a0.map(({enabled:_,desc:C,...D})=>D),G_=o0.map(({enabled:_,desc:C,...D})=>D);function n_(_){return _.filter(C=>C.enabled).map(({enabled:C,desc:D,...A})=>A)}let Y_=0;const Uc=new Set;function c0(_){return Uc.add(_),()=>Uc.delete(_)}function u0(){return Y_}function V_(){Y_++,Uc.forEach(_=>_())}function h0(){const[_,C]=q.useState(null),[D,A]=q.useState(null),[H,N]=q.useState(!0),z=q.useSyncExternalStore(c0,u0),r=Ht(p=>p.activeInstanceId),u=q.useCallback(async()=>{N(!0);try{const p=await j_(r??void 0);C(p.config),A(p.configPath)}catch{C(null)}finally{N(!1)}},[r]);q.useEffect(()=>{u()},[u,z]);const d=_!=null&&_.shortcuts?n_(_.shortcuts):$_,g=_!=null&&_.commands?n_(_.commands):G_,l=q.useCallback(()=>{V_()},[]);return{shortcuts:d,commands:g,configPath:D,isLoading:H,reload:l}}var Rn=N_();function d0(){for(var _=arguments.length,C=new Array(_),D=0;D<_;D++)C[D]=arguments[D];return q.useMemo(()=>A=>{C.forEach(H=>H(A))},C)}const lo=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Tr(_){const C=Object.prototype.toString.call(_);return C==="[object Window]"||C==="[object global]"}function Vc(_){return"nodeType"in _}function Vt(_){var C,D;return _?Tr(_)?_:Vc(_)&&(C=(D=_.ownerDocument)==null?void 0:D.defaultView)!=null?C:window:window}function Xc(_){const{Document:C}=Vt(_);return _ instanceof C}function zn(_){return Tr(_)?!1:_ instanceof Vt(_).HTMLElement}function X_(_){return _ instanceof Vt(_).SVGElement}function Mr(_){return _?Tr(_)?_.document:Vc(_)?Xc(_)?_:zn(_)||X_(_)?_.ownerDocument:document:document:document}const Ti=lo?q.useLayoutEffect:q.useEffect;function Kc(_){const C=q.useRef(_);return Ti(()=>{C.current=_}),q.useCallback(function(){for(var D=arguments.length,A=new Array(D),H=0;H<D;H++)A[H]=arguments[H];return C.current==null?void 0:C.current(...A)},[])}function f0(){const _=q.useRef(null),C=q.useCallback((A,H)=>{_.current=setInterval(A,H)},[]),D=q.useCallback(()=>{_.current!==null&&(clearInterval(_.current),_.current=null)},[]);return[C,D]}function kn(_,C){C===void 0&&(C=[_]);const D=q.useRef(_);return Ti(()=>{D.current!==_&&(D.current=_)},C),D}function In(_,C){const D=q.useRef();return q.useMemo(()=>{const A=_(D.current);return D.current=A,A},[...C])}function ro(_){const C=Kc(_),D=q.useRef(null),A=q.useCallback(H=>{H!==D.current&&(C==null||C(H,D.current)),D.current=H},[]);return[D,A]}function jc(_){const C=q.useRef();return q.useEffect(()=>{C.current=_},[_]),C.current}let Dc={};function Nn(_,C){return q.useMemo(()=>{if(C)return C;const D=Dc[_]==null?0:Dc[_]+1;return Dc[_]=D,_+"-"+D},[_,C])}function K_(_){return function(C){for(var D=arguments.length,A=new Array(D>1?D-1:0),H=1;H<D;H++)A[H-1]=arguments[H];return A.reduce((N,z)=>{const r=Object.entries(z);for(const[u,d]of r){const g=N[u];g!=null&&(N[u]=g+_*d)}return N},{...C})}}const Dr=K_(1),On=K_(-1);function _0(_){return"clientX"in _&&"clientY"in _}function Zc(_){if(!_)return!1;const{KeyboardEvent:C}=Vt(_.target);return C&&_ instanceof C}function g0(_){if(!_)return!1;const{TouchEvent:C}=Vt(_.target);return C&&_ instanceof C}function Pc(_){if(g0(_)){if(_.touches&&_.touches.length){const{clientX:C,clientY:D}=_.touches[0];return{x:C,y:D}}else if(_.changedTouches&&_.changedTouches.length){const{clientX:C,clientY:D}=_.changedTouches[0];return{x:C,y:D}}}return _0(_)?{x:_.clientX,y:_.clientY}:null}const Bn=Object.freeze({Translate:{toString(_){if(!_)return;const{x:C,y:D}=_;return"translate3d("+(C?Math.round(C):0)+"px, "+(D?Math.round(D):0)+"px, 0)"}},Scale:{toString(_){if(!_)return;const{scaleX:C,scaleY:D}=_;return"scaleX("+C+") scaleY("+D+")"}},Transform:{toString(_){if(_)return[Bn.Translate.toString(_),Bn.Scale.toString(_)].join(" ")}},Transition:{toString(_){let{property:C,duration:D,easing:A}=_;return C+" "+D+"ms "+A}}}),a_="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function v0(_){return _.matches(a_)?_:_.querySelector(a_)}const p0={display:"none"};function m0(_){let{id:C,value:D}=_;return xt.createElement("div",{id:C,style:p0},D)}function b0(_){let{id:C,announcement:D,ariaLiveType:A="assertive"}=_;const H={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return xt.createElement("div",{id:C,style:H,role:"status","aria-live":A,"aria-atomic":!0},D)}function S0(){const[_,C]=q.useState("");return{announce:q.useCallback(A=>{A!=null&&C(A)},[]),announcement:_}}const Z_=q.createContext(null);function y0(_){const C=q.useContext(Z_);q.useEffect(()=>{if(!C)throw new Error("useDndMonitor must be used within a children of <DndContext>");return C(_)},[_,C])}function C0(){const[_]=q.useState(()=>new Set),C=q.useCallback(A=>(_.add(A),()=>_.delete(A)),[_]);return[q.useCallback(A=>{let{type:H,event:N}=A;_.forEach(z=>{var r;return(r=z[H])==null?void 0:r.call(z,N)})},[_]),C]}const w0={draggable:`
50
- To pick up a draggable item, press the space bar.
51
- While dragging, use the arrow keys to move the item.
52
- Press space again to drop the item in its new position, or press escape to cancel.
53
- `},x0={onDragStart(_){let{active:C}=_;return"Picked up draggable item "+C.id+"."},onDragOver(_){let{active:C,over:D}=_;return D?"Draggable item "+C.id+" was moved over droppable area "+D.id+".":"Draggable item "+C.id+" is no longer over a droppable area."},onDragEnd(_){let{active:C,over:D}=_;return D?"Draggable item "+C.id+" was dropped over droppable area "+D.id:"Draggable item "+C.id+" was dropped."},onDragCancel(_){let{active:C}=_;return"Dragging was cancelled. Draggable item "+C.id+" was dropped."}};function E0(_){let{announcements:C=x0,container:D,hiddenTextDescribedById:A,screenReaderInstructions:H=w0}=_;const{announce:N,announcement:z}=S0(),r=Nn("DndLiveRegion"),[u,d]=q.useState(!1);if(q.useEffect(()=>{d(!0)},[]),y0(q.useMemo(()=>({onDragStart(l){let{active:p}=l;N(C.onDragStart({active:p}))},onDragMove(l){let{active:p,over:b}=l;C.onDragMove&&N(C.onDragMove({active:p,over:b}))},onDragOver(l){let{active:p,over:b}=l;N(C.onDragOver({active:p,over:b}))},onDragEnd(l){let{active:p,over:b}=l;N(C.onDragEnd({active:p,over:b}))},onDragCancel(l){let{active:p,over:b}=l;N(C.onDragCancel({active:p,over:b}))}}),[N,C])),!u)return null;const g=xt.createElement(xt.Fragment,null,xt.createElement(m0,{id:A,value:H.draggable}),xt.createElement(b0,{id:r,announcement:z}));return D?Rn.createPortal(g,D):g}var bt;(function(_){_.DragStart="dragStart",_.DragMove="dragMove",_.DragEnd="dragEnd",_.DragCancel="dragCancel",_.DragOver="dragOver",_.RegisterDroppable="registerDroppable",_.SetDroppableDisabled="setDroppableDisabled",_.UnregisterDroppable="unregisterDroppable"})(bt||(bt={}));function no(){}function o_(_,C){return q.useMemo(()=>({sensor:_,options:C??{}}),[_,C])}function R0(){for(var _=arguments.length,C=new Array(_),D=0;D<_;D++)C[D]=arguments[D];return q.useMemo(()=>[...C].filter(A=>A!=null),[...C])}const xi=Object.freeze({x:0,y:0});function Q_(_,C){return Math.sqrt(Math.pow(_.x-C.x,2)+Math.pow(_.y-C.y,2))}function J_(_,C){let{data:{value:D}}=_,{data:{value:A}}=C;return D-A}function A0(_,C){let{data:{value:D}}=_,{data:{value:A}}=C;return A-D}function l_(_){let{left:C,top:D,height:A,width:H}=_;return[{x:C,y:D},{x:C+H,y:D},{x:C,y:D+A},{x:C+H,y:D+A}]}function eg(_,C){if(!_||_.length===0)return null;const[D]=_;return D[C]}function c_(_,C,D){return C===void 0&&(C=_.left),D===void 0&&(D=_.top),{x:C+_.width*.5,y:D+_.height*.5}}const tg=_=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=_;const H=c_(C,C.left,C.top),N=[];for(const z of A){const{id:r}=z,u=D.get(r);if(u){const d=Q_(c_(u),H);N.push({id:r,data:{droppableContainer:z,value:d}})}}return N.sort(J_)},D0=_=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=_;const H=l_(C),N=[];for(const z of A){const{id:r}=z,u=D.get(r);if(u){const d=l_(u),g=H.reduce((p,b,w)=>p+Q_(d[w],b),0),l=Number((g/4).toFixed(4));N.push({id:r,data:{droppableContainer:z,value:l}})}}return N.sort(J_)};function L0(_,C){const D=Math.max(C.top,_.top),A=Math.max(C.left,_.left),H=Math.min(C.left+C.width,_.left+_.width),N=Math.min(C.top+C.height,_.top+_.height),z=H-A,r=N-D;if(A<H&&D<N){const u=C.width*C.height,d=_.width*_.height,g=z*r,l=g/(u+d-g);return Number(l.toFixed(4))}return 0}const T0=_=>{let{collisionRect:C,droppableRects:D,droppableContainers:A}=_;const H=[];for(const N of A){const{id:z}=N,r=D.get(z);if(r){const u=L0(r,C);u>0&&H.push({id:z,data:{droppableContainer:N,value:u}})}}return H.sort(A0)};function M0(_,C,D){return{..._,scaleX:C&&D?C.width/D.width:1,scaleY:C&&D?C.height/D.height:1}}function ig(_,C){return _&&C?{x:_.left-C.left,y:_.top-C.top}:xi}function k0(_){return function(D){for(var A=arguments.length,H=new Array(A>1?A-1:0),N=1;N<A;N++)H[N-1]=arguments[N];return H.reduce((z,r)=>({...z,top:z.top+_*r.y,bottom:z.bottom+_*r.y,left:z.left+_*r.x,right:z.right+_*r.x}),{...D})}}const O0=k0(1);function B0(_){if(_.startsWith("matrix3d(")){const C=_.slice(9,-1).split(/, /);return{x:+C[12],y:+C[13],scaleX:+C[0],scaleY:+C[5]}}else if(_.startsWith("matrix(")){const C=_.slice(7,-1).split(/, /);return{x:+C[4],y:+C[5],scaleX:+C[0],scaleY:+C[3]}}return null}function H0(_,C,D){const A=B0(C);if(!A)return _;const{scaleX:H,scaleY:N,x:z,y:r}=A,u=_.left-z-(1-H)*parseFloat(D),d=_.top-r-(1-N)*parseFloat(D.slice(D.indexOf(" ")+1)),g=H?_.width/H:_.width,l=N?_.height/N:_.height;return{width:g,height:l,top:d,right:u+g,bottom:d+l,left:u}}const z0={ignoreTransform:!1};function kr(_,C){C===void 0&&(C=z0);let D=_.getBoundingClientRect();if(C.ignoreTransform){const{transform:d,transformOrigin:g}=Vt(_).getComputedStyle(_);d&&(D=H0(D,d,g))}const{top:A,left:H,width:N,height:z,bottom:r,right:u}=D;return{top:A,left:H,width:N,height:z,bottom:r,right:u}}function u_(_){return kr(_,{ignoreTransform:!0})}function I0(_){const C=_.innerWidth,D=_.innerHeight;return{top:0,left:0,right:C,bottom:D,width:C,height:D}}function N0(_,C){return C===void 0&&(C=Vt(_).getComputedStyle(_)),C.position==="fixed"}function U0(_,C){C===void 0&&(C=Vt(_).getComputedStyle(_));const D=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(H=>{const N=C[H];return typeof N=="string"?D.test(N):!1})}function co(_,C){const D=[];function A(H){if(C!=null&&D.length>=C||!H)return D;if(Xc(H)&&H.scrollingElement!=null&&!D.includes(H.scrollingElement))return D.push(H.scrollingElement),D;if(!zn(H)||X_(H)||D.includes(H))return D;const N=Vt(_).getComputedStyle(H);return H!==_&&U0(H,N)&&D.push(H),N0(H,N)?D:A(H.parentNode)}return _?A(_):D}function sg(_){const[C]=co(_,1);return C??null}function Lc(_){return!lo||!_?null:Tr(_)?_:Vc(_)?Xc(_)||_===Mr(_).scrollingElement?window:zn(_)?_:null:null}function rg(_){return Tr(_)?_.scrollX:_.scrollLeft}function ng(_){return Tr(_)?_.scrollY:_.scrollTop}function Fc(_){return{x:rg(_),y:ng(_)}}var wt;(function(_){_[_.Forward=1]="Forward",_[_.Backward=-1]="Backward"})(wt||(wt={}));function ag(_){return!lo||!_?!1:_===document.scrollingElement}function og(_){const C={x:0,y:0},D=ag(_)?{height:window.innerHeight,width:window.innerWidth}:{height:_.clientHeight,width:_.clientWidth},A={x:_.scrollWidth-D.width,y:_.scrollHeight-D.height},H=_.scrollTop<=C.y,N=_.scrollLeft<=C.x,z=_.scrollTop>=A.y,r=_.scrollLeft>=A.x;return{isTop:H,isLeft:N,isBottom:z,isRight:r,maxScroll:A,minScroll:C}}const j0={x:.2,y:.2};function P0(_,C,D,A,H){let{top:N,left:z,right:r,bottom:u}=D;A===void 0&&(A=10),H===void 0&&(H=j0);const{isTop:d,isBottom:g,isLeft:l,isRight:p}=og(_),b={x:0,y:0},w={x:0,y:0},f={height:C.height*H.y,width:C.width*H.x};return!d&&N<=C.top+f.height?(b.y=wt.Backward,w.y=A*Math.abs((C.top+f.height-N)/f.height)):!g&&u>=C.bottom-f.height&&(b.y=wt.Forward,w.y=A*Math.abs((C.bottom-f.height-u)/f.height)),!p&&r>=C.right-f.width?(b.x=wt.Forward,w.x=A*Math.abs((C.right-f.width-r)/f.width)):!l&&z<=C.left+f.width&&(b.x=wt.Backward,w.x=A*Math.abs((C.left+f.width-z)/f.width)),{direction:b,speed:w}}function F0(_){if(_===document.scrollingElement){const{innerWidth:N,innerHeight:z}=window;return{top:0,left:0,right:N,bottom:z,width:N,height:z}}const{top:C,left:D,right:A,bottom:H}=_.getBoundingClientRect();return{top:C,left:D,right:A,bottom:H,width:_.clientWidth,height:_.clientHeight}}function lg(_){return _.reduce((C,D)=>Dr(C,Fc(D)),xi)}function q0(_){return _.reduce((C,D)=>C+rg(D),0)}function W0(_){return _.reduce((C,D)=>C+ng(D),0)}function $0(_,C){if(C===void 0&&(C=kr),!_)return;const{top:D,left:A,bottom:H,right:N}=C(_);sg(_)&&(H<=0||N<=0||D>=window.innerHeight||A>=window.innerWidth)&&_.scrollIntoView({block:"center",inline:"center"})}const G0=[["x",["left","right"],q0],["y",["top","bottom"],W0]];class Qc{constructor(C,D){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const A=co(D),H=lg(A);this.rect={...C},this.width=C.width,this.height=C.height;for(const[N,z,r]of G0)for(const u of z)Object.defineProperty(this,u,{get:()=>{const d=r(A),g=H[N]-d;return this.rect[u]+g},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Dn{constructor(C){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(D=>{var A;return(A=this.target)==null?void 0:A.removeEventListener(...D)})},this.target=C}add(C,D,A){var H;(H=this.target)==null||H.addEventListener(C,D,A),this.listeners.push([C,D,A])}}function Y0(_){const{EventTarget:C}=Vt(_);return _ instanceof C?_:Mr(_)}function Tc(_,C){const D=Math.abs(_.x),A=Math.abs(_.y);return typeof C=="number"?Math.sqrt(D**2+A**2)>C:"x"in C&&"y"in C?D>C.x&&A>C.y:"x"in C?D>C.x:"y"in C?A>C.y:!1}var mi;(function(_){_.Click="click",_.DragStart="dragstart",_.Keydown="keydown",_.ContextMenu="contextmenu",_.Resize="resize",_.SelectionChange="selectionchange",_.VisibilityChange="visibilitychange"})(mi||(mi={}));function h_(_){_.preventDefault()}function V0(_){_.stopPropagation()}var Ne;(function(_){_.Space="Space",_.Down="ArrowDown",_.Right="ArrowRight",_.Left="ArrowLeft",_.Up="ArrowUp",_.Esc="Escape",_.Enter="Enter",_.Tab="Tab"})(Ne||(Ne={}));const cg={start:[Ne.Space,Ne.Enter],cancel:[Ne.Esc],end:[Ne.Space,Ne.Enter,Ne.Tab]},X0=(_,C)=>{let{currentCoordinates:D}=C;switch(_.code){case Ne.Right:return{...D,x:D.x+25};case Ne.Left:return{...D,x:D.x-25};case Ne.Down:return{...D,y:D.y+25};case Ne.Up:return{...D,y:D.y-25}}};class Jc{constructor(C){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=C;const{event:{target:D}}=C;this.props=C,this.listeners=new Dn(Mr(D)),this.windowListeners=new Dn(Vt(D)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(mi.Resize,this.handleCancel),this.windowListeners.add(mi.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(mi.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:C,onStart:D}=this.props,A=C.node.current;A&&$0(A),D(xi)}handleKeyDown(C){if(Zc(C)){const{active:D,context:A,options:H}=this.props,{keyboardCodes:N=cg,coordinateGetter:z=X0,scrollBehavior:r="smooth"}=H,{code:u}=C;if(N.end.includes(u)){this.handleEnd(C);return}if(N.cancel.includes(u)){this.handleCancel(C);return}const{collisionRect:d}=A.current,g=d?{x:d.left,y:d.top}:xi;this.referenceCoordinates||(this.referenceCoordinates=g);const l=z(C,{active:D,context:A.current,currentCoordinates:g});if(l){const p=On(l,g),b={x:0,y:0},{scrollableAncestors:w}=A.current;for(const f of w){const n=C.code,{isTop:a,isRight:o,isLeft:c,isBottom:S,maxScroll:x,minScroll:m}=og(f),E=F0(f),y={x:Math.min(n===Ne.Right?E.right-E.width/2:E.right,Math.max(n===Ne.Right?E.left:E.left+E.width/2,l.x)),y:Math.min(n===Ne.Down?E.bottom-E.height/2:E.bottom,Math.max(n===Ne.Down?E.top:E.top+E.height/2,l.y))},R=n===Ne.Right&&!o||n===Ne.Left&&!c,T=n===Ne.Down&&!S||n===Ne.Up&&!a;if(R&&y.x!==l.x){const I=f.scrollLeft+p.x,B=n===Ne.Right&&I<=x.x||n===Ne.Left&&I>=m.x;if(B&&!p.y){f.scrollTo({left:I,behavior:r});return}B?b.x=f.scrollLeft-I:b.x=n===Ne.Right?f.scrollLeft-x.x:f.scrollLeft-m.x,b.x&&f.scrollBy({left:-b.x,behavior:r});break}else if(T&&y.y!==l.y){const I=f.scrollTop+p.y,B=n===Ne.Down&&I<=x.y||n===Ne.Up&&I>=m.y;if(B&&!p.x){f.scrollTo({top:I,behavior:r});return}B?b.y=f.scrollTop-I:b.y=n===Ne.Down?f.scrollTop-x.y:f.scrollTop-m.y,b.y&&f.scrollBy({top:-b.y,behavior:r});break}}this.handleMove(C,Dr(On(l,this.referenceCoordinates),b))}}}handleMove(C,D){const{onMove:A}=this.props;C.preventDefault(),A(D)}handleEnd(C){const{onEnd:D}=this.props;C.preventDefault(),this.detach(),D()}handleCancel(C){const{onCancel:D}=this.props;C.preventDefault(),this.detach(),D()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Jc.activators=[{eventName:"onKeyDown",handler:(_,C,D)=>{let{keyboardCodes:A=cg,onActivation:H}=C,{active:N}=D;const{code:z}=_.nativeEvent;if(A.start.includes(z)){const r=N.activatorNode.current;return r&&_.target!==r?!1:(_.preventDefault(),H==null||H({event:_.nativeEvent}),!0)}return!1}}];function d_(_){return!!(_&&"distance"in _)}function f_(_){return!!(_&&"delay"in _)}class eu{constructor(C,D,A){var H;A===void 0&&(A=Y0(C.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=C,this.events=D;const{event:N}=C,{target:z}=N;this.props=C,this.events=D,this.document=Mr(z),this.documentListeners=new Dn(this.document),this.listeners=new Dn(A),this.windowListeners=new Dn(Vt(z)),this.initialCoordinates=(H=Pc(N))!=null?H:xi,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:C,props:{options:{activationConstraint:D,bypassActivationConstraint:A}}}=this;if(this.listeners.add(C.move.name,this.handleMove,{passive:!1}),this.listeners.add(C.end.name,this.handleEnd),C.cancel&&this.listeners.add(C.cancel.name,this.handleCancel),this.windowListeners.add(mi.Resize,this.handleCancel),this.windowListeners.add(mi.DragStart,h_),this.windowListeners.add(mi.VisibilityChange,this.handleCancel),this.windowListeners.add(mi.ContextMenu,h_),this.documentListeners.add(mi.Keydown,this.handleKeydown),D){if(A!=null&&A({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(f_(D)){this.timeoutId=setTimeout(this.handleStart,D.delay),this.handlePending(D);return}if(d_(D)){this.handlePending(D);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(C,D){const{active:A,onPending:H}=this.props;H(A,C,this.initialCoordinates,D)}handleStart(){const{initialCoordinates:C}=this,{onStart:D}=this.props;C&&(this.activated=!0,this.documentListeners.add(mi.Click,V0,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(mi.SelectionChange,this.removeTextSelection),D(C))}handleMove(C){var D;const{activated:A,initialCoordinates:H,props:N}=this,{onMove:z,options:{activationConstraint:r}}=N;if(!H)return;const u=(D=Pc(C))!=null?D:xi,d=On(H,u);if(!A&&r){if(d_(r)){if(r.tolerance!=null&&Tc(d,r.tolerance))return this.handleCancel();if(Tc(d,r.distance))return this.handleStart()}if(f_(r)&&Tc(d,r.tolerance))return this.handleCancel();this.handlePending(r,d);return}C.cancelable&&C.preventDefault(),z(u)}handleEnd(){const{onAbort:C,onEnd:D}=this.props;this.detach(),this.activated||C(this.props.active),D()}handleCancel(){const{onAbort:C,onCancel:D}=this.props;this.detach(),this.activated||C(this.props.active),D()}handleKeydown(C){C.code===Ne.Esc&&this.handleCancel()}removeTextSelection(){var C;(C=this.document.getSelection())==null||C.removeAllRanges()}}const K0={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class tu extends eu{constructor(C){const{event:D}=C,A=Mr(D.target);super(C,K0,A)}}tu.activators=[{eventName:"onPointerDown",handler:(_,C)=>{let{nativeEvent:D}=_,{onActivation:A}=C;return!D.isPrimary||D.button!==0?!1:(A==null||A({event:D}),!0)}}];const Z0={move:{name:"mousemove"},end:{name:"mouseup"}};var qc;(function(_){_[_.RightClick=2]="RightClick"})(qc||(qc={}));class Q0 extends eu{constructor(C){super(C,Z0,Mr(C.event.target))}}Q0.activators=[{eventName:"onMouseDown",handler:(_,C)=>{let{nativeEvent:D}=_,{onActivation:A}=C;return D.button===qc.RightClick?!1:(A==null||A({event:D}),!0)}}];const Mc={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class J0 extends eu{constructor(C){super(C,Mc)}static setup(){return window.addEventListener(Mc.move.name,C,{capture:!1,passive:!1}),function(){window.removeEventListener(Mc.move.name,C)};function C(){}}}J0.activators=[{eventName:"onTouchStart",handler:(_,C)=>{let{nativeEvent:D}=_,{onActivation:A}=C;const{touches:H}=D;return H.length>1?!1:(A==null||A({event:D}),!0)}}];var Ln;(function(_){_[_.Pointer=0]="Pointer",_[_.DraggableRect=1]="DraggableRect"})(Ln||(Ln={}));var ao;(function(_){_[_.TreeOrder=0]="TreeOrder",_[_.ReversedTreeOrder=1]="ReversedTreeOrder"})(ao||(ao={}));function e1(_){let{acceleration:C,activator:D=Ln.Pointer,canScroll:A,draggingRect:H,enabled:N,interval:z=5,order:r=ao.TreeOrder,pointerCoordinates:u,scrollableAncestors:d,scrollableAncestorRects:g,delta:l,threshold:p}=_;const b=i1({delta:l,disabled:!N}),[w,f]=f0(),n=q.useRef({x:0,y:0}),a=q.useRef({x:0,y:0}),o=q.useMemo(()=>{switch(D){case Ln.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case Ln.DraggableRect:return H}},[D,H,u]),c=q.useRef(null),S=q.useCallback(()=>{const m=c.current;if(!m)return;const E=n.current.x*a.current.x,y=n.current.y*a.current.y;m.scrollBy(E,y)},[]),x=q.useMemo(()=>r===ao.TreeOrder?[...d].reverse():d,[r,d]);q.useEffect(()=>{if(!N||!d.length||!o){f();return}for(const m of x){if((A==null?void 0:A(m))===!1)continue;const E=d.indexOf(m),y=g[E];if(!y)continue;const{direction:R,speed:T}=P0(m,y,o,C,p);for(const I of["x","y"])b[I][R[I]]||(T[I]=0,R[I]=0);if(T.x>0||T.y>0){f(),c.current=m,w(S,z),n.current=T,a.current=R;return}}n.current={x:0,y:0},a.current={x:0,y:0},f()},[C,S,A,f,N,z,JSON.stringify(o),JSON.stringify(b),w,d,x,g,JSON.stringify(p)])}const t1={x:{[wt.Backward]:!1,[wt.Forward]:!1},y:{[wt.Backward]:!1,[wt.Forward]:!1}};function i1(_){let{delta:C,disabled:D}=_;const A=jc(C);return In(H=>{if(D||!A||!H)return t1;const N={x:Math.sign(C.x-A.x),y:Math.sign(C.y-A.y)};return{x:{[wt.Backward]:H.x[wt.Backward]||N.x===-1,[wt.Forward]:H.x[wt.Forward]||N.x===1},y:{[wt.Backward]:H.y[wt.Backward]||N.y===-1,[wt.Forward]:H.y[wt.Forward]||N.y===1}}},[D,C,A])}function s1(_,C){const D=C!=null?_.get(C):void 0,A=D?D.node.current:null;return In(H=>{var N;return C==null?null:(N=A??H)!=null?N:null},[A,C])}function r1(_,C){return q.useMemo(()=>_.reduce((D,A)=>{const{sensor:H}=A,N=H.activators.map(z=>({eventName:z.eventName,handler:C(z.handler,A)}));return[...D,...N]},[]),[_,C])}var Hn;(function(_){_[_.Always=0]="Always",_[_.BeforeDragging=1]="BeforeDragging",_[_.WhileDragging=2]="WhileDragging"})(Hn||(Hn={}));var Wc;(function(_){_.Optimized="optimized"})(Wc||(Wc={}));const __=new Map;function n1(_,C){let{dragging:D,dependencies:A,config:H}=C;const[N,z]=q.useState(null),{frequency:r,measure:u,strategy:d}=H,g=q.useRef(_),l=n(),p=kn(l),b=q.useCallback(function(a){a===void 0&&(a=[]),!p.current&&z(o=>o===null?a:o.concat(a.filter(c=>!o.includes(c))))},[p]),w=q.useRef(null),f=In(a=>{if(l&&!D)return __;if(!a||a===__||g.current!==_||N!=null){const o=new Map;for(let c of _){if(!c)continue;if(N&&N.length>0&&!N.includes(c.id)&&c.rect.current){o.set(c.id,c.rect.current);continue}const S=c.node.current,x=S?new Qc(u(S),S):null;c.rect.current=x,x&&o.set(c.id,x)}return o}return a},[_,N,D,l,u]);return q.useEffect(()=>{g.current=_},[_]),q.useEffect(()=>{l||b()},[D,l]),q.useEffect(()=>{N&&N.length>0&&z(null)},[JSON.stringify(N)]),q.useEffect(()=>{l||typeof r!="number"||w.current!==null||(w.current=setTimeout(()=>{b(),w.current=null},r))},[r,l,b,...A]),{droppableRects:f,measureDroppableContainers:b,measuringScheduled:N!=null};function n(){switch(d){case Hn.Always:return!1;case Hn.BeforeDragging:return D;default:return!D}}}function ug(_,C){return In(D=>_?D||(typeof C=="function"?C(_):_):null,[C,_])}function a1(_,C){return ug(_,C)}function o1(_){let{callback:C,disabled:D}=_;const A=Kc(C),H=q.useMemo(()=>{if(D||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:N}=window;return new N(A)},[A,D]);return q.useEffect(()=>()=>H==null?void 0:H.disconnect(),[H]),H}function uo(_){let{callback:C,disabled:D}=_;const A=Kc(C),H=q.useMemo(()=>{if(D||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:N}=window;return new N(A)},[D]);return q.useEffect(()=>()=>H==null?void 0:H.disconnect(),[H]),H}function l1(_){return new Qc(kr(_),_)}function g_(_,C,D){C===void 0&&(C=l1);const[A,H]=q.useState(null);function N(){H(u=>{if(!_)return null;if(_.isConnected===!1){var d;return(d=u??D)!=null?d:null}const g=C(_);return JSON.stringify(u)===JSON.stringify(g)?u:g})}const z=o1({callback(u){if(_)for(const d of u){const{type:g,target:l}=d;if(g==="childList"&&l instanceof HTMLElement&&l.contains(_)){N();break}}}}),r=uo({callback:N});return Ti(()=>{N(),_?(r==null||r.observe(_),z==null||z.observe(document.body,{childList:!0,subtree:!0})):(r==null||r.disconnect(),z==null||z.disconnect())},[_]),A}function c1(_){const C=ug(_);return ig(_,C)}const v_=[];function u1(_){const C=q.useRef(_),D=In(A=>_?A&&A!==v_&&_&&C.current&&_.parentNode===C.current.parentNode?A:co(_):v_,[_]);return q.useEffect(()=>{C.current=_},[_]),D}function h1(_){const[C,D]=q.useState(null),A=q.useRef(_),H=q.useCallback(N=>{const z=Lc(N.target);z&&D(r=>r?(r.set(z,Fc(z)),new Map(r)):null)},[]);return q.useEffect(()=>{const N=A.current;if(_!==N){z(N);const r=_.map(u=>{const d=Lc(u);return d?(d.addEventListener("scroll",H,{passive:!0}),[d,Fc(d)]):null}).filter(u=>u!=null);D(r.length?new Map(r):null),A.current=_}return()=>{z(_),z(N)};function z(r){r.forEach(u=>{const d=Lc(u);d==null||d.removeEventListener("scroll",H)})}},[H,_]),q.useMemo(()=>_.length?C?Array.from(C.values()).reduce((N,z)=>Dr(N,z),xi):lg(_):xi,[_,C])}function p_(_,C){C===void 0&&(C=[]);const D=q.useRef(null);return q.useEffect(()=>{D.current=null},C),q.useEffect(()=>{const A=_!==xi;A&&!D.current&&(D.current=_),!A&&D.current&&(D.current=null)},[_]),D.current?On(_,D.current):xi}function d1(_){q.useEffect(()=>{if(!lo)return;const C=_.map(D=>{let{sensor:A}=D;return A.setup==null?void 0:A.setup()});return()=>{for(const D of C)D==null||D()}},_.map(C=>{let{sensor:D}=C;return D}))}function f1(_,C){return q.useMemo(()=>_.reduce((D,A)=>{let{eventName:H,handler:N}=A;return D[H]=z=>{N(z,C)},D},{}),[_,C])}function hg(_){return q.useMemo(()=>_?I0(_):null,[_])}const m_=[];function _1(_,C){C===void 0&&(C=kr);const[D]=_,A=hg(D?Vt(D):null),[H,N]=q.useState(m_);function z(){N(()=>_.length?_.map(u=>ag(u)?A:new Qc(C(u),u)):m_)}const r=uo({callback:z});return Ti(()=>{r==null||r.disconnect(),z(),_.forEach(u=>r==null?void 0:r.observe(u))},[_]),H}function g1(_){if(!_)return null;if(_.children.length>1)return _;const C=_.children[0];return zn(C)?C:_}function v1(_){let{measure:C}=_;const[D,A]=q.useState(null),H=q.useCallback(d=>{for(const{target:g}of d)if(zn(g)){A(l=>{const p=C(g);return l?{...l,width:p.width,height:p.height}:p});break}},[C]),N=uo({callback:H}),z=q.useCallback(d=>{const g=g1(d);N==null||N.disconnect(),g&&(N==null||N.observe(g)),A(g?C(g):null)},[C,N]),[r,u]=ro(z);return q.useMemo(()=>({nodeRef:r,rect:D,setRef:u}),[D,r,u])}const p1=[{sensor:tu,options:{}},{sensor:Jc,options:{}}],m1={current:{}},io={draggable:{measure:u_},droppable:{measure:u_,strategy:Hn.WhileDragging,frequency:Wc.Optimized},dragOverlay:{measure:kr}};class Tn extends Map{get(C){var D;return C!=null&&(D=super.get(C))!=null?D:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(C=>{let{disabled:D}=C;return!D})}getNodeFor(C){var D,A;return(D=(A=this.get(C))==null?void 0:A.node.current)!=null?D:void 0}}const b1={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Tn,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:no},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:io,measureDroppableContainers:no,windowRect:null,measuringScheduled:!1},S1={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:no,draggableNodes:new Map,over:null,measureDroppableContainers:no},ho=q.createContext(S1),dg=q.createContext(b1);function y1(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Tn}}}function C1(_,C){switch(C.type){case bt.DragStart:return{..._,draggable:{..._.draggable,initialCoordinates:C.initialCoordinates,active:C.active}};case bt.DragMove:return _.draggable.active==null?_:{..._,draggable:{..._.draggable,translate:{x:C.coordinates.x-_.draggable.initialCoordinates.x,y:C.coordinates.y-_.draggable.initialCoordinates.y}}};case bt.DragEnd:case bt.DragCancel:return{..._,draggable:{..._.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case bt.RegisterDroppable:{const{element:D}=C,{id:A}=D,H=new Tn(_.droppable.containers);return H.set(A,D),{..._,droppable:{..._.droppable,containers:H}}}case bt.SetDroppableDisabled:{const{id:D,key:A,disabled:H}=C,N=_.droppable.containers.get(D);if(!N||A!==N.key)return _;const z=new Tn(_.droppable.containers);return z.set(D,{...N,disabled:H}),{..._,droppable:{..._.droppable,containers:z}}}case bt.UnregisterDroppable:{const{id:D,key:A}=C,H=_.droppable.containers.get(D);if(!H||A!==H.key)return _;const N=new Tn(_.droppable.containers);return N.delete(D),{..._,droppable:{..._.droppable,containers:N}}}default:return _}}function w1(_){let{disabled:C}=_;const{active:D,activatorEvent:A,draggableNodes:H}=q.useContext(ho),N=jc(A),z=jc(D==null?void 0:D.id);return q.useEffect(()=>{if(!C&&!A&&N&&z!=null){if(!Zc(N)||document.activeElement===N.target)return;const r=H.get(z);if(!r)return;const{activatorNode:u,node:d}=r;if(!u.current&&!d.current)return;requestAnimationFrame(()=>{for(const g of[u.current,d.current]){if(!g)continue;const l=v0(g);if(l){l.focus();break}}})}},[A,C,H,z,N]),null}function x1(_,C){let{transform:D,...A}=C;return _!=null&&_.length?_.reduce((H,N)=>N({transform:H,...A}),D):D}function E1(_){return q.useMemo(()=>({draggable:{...io.draggable,..._==null?void 0:_.draggable},droppable:{...io.droppable,..._==null?void 0:_.droppable},dragOverlay:{...io.dragOverlay,..._==null?void 0:_.dragOverlay}}),[_==null?void 0:_.draggable,_==null?void 0:_.droppable,_==null?void 0:_.dragOverlay])}function R1(_){let{activeNode:C,measure:D,initialRect:A,config:H=!0}=_;const N=q.useRef(!1),{x:z,y:r}=typeof H=="boolean"?{x:H,y:H}:H;Ti(()=>{if(!z&&!r||!C){N.current=!1;return}if(N.current||!A)return;const d=C==null?void 0:C.node.current;if(!d||d.isConnected===!1)return;const g=D(d),l=ig(g,A);if(z||(l.x=0),r||(l.y=0),N.current=!0,Math.abs(l.x)>0||Math.abs(l.y)>0){const p=sg(d);p&&p.scrollBy({top:l.y,left:l.x})}},[C,z,r,A,D])}const fg=q.createContext({...xi,scaleX:1,scaleY:1});var ws;(function(_){_[_.Uninitialized=0]="Uninitialized",_[_.Initializing=1]="Initializing",_[_.Initialized=2]="Initialized"})(ws||(ws={}));const _g=q.memo(function(C){var D,A,H,N;let{id:z,accessibility:r,autoScroll:u=!0,children:d,sensors:g=p1,collisionDetection:l=T0,measuring:p,modifiers:b,...w}=C;const f=q.useReducer(C1,void 0,y1),[n,a]=f,[o,c]=C0(),[S,x]=q.useState(ws.Uninitialized),m=S===ws.Initialized,{draggable:{active:E,nodes:y,translate:R},droppable:{containers:T}}=n,I=E!=null?y.get(E):null,B=q.useRef({initial:null,translated:null}),M=q.useMemo(()=>{var it;return E!=null?{id:E,data:(it=I==null?void 0:I.data)!=null?it:m1,rect:B}:null},[E,I]),$=q.useRef(null),[Y,G]=q.useState(null),[W,X]=q.useState(null),O=kn(w,Object.values(w)),F=Nn("DndDescribedBy",z),k=q.useMemo(()=>T.getEnabled(),[T]),P=E1(p),{droppableRects:Q,measureDroppableContainers:ee,measuringScheduled:he}=n1(k,{dragging:m,dependencies:[R.x,R.y],config:P.droppable}),oe=s1(y,E),K=q.useMemo(()=>W?Pc(W):null,[W]),U=Mi(),ne=a1(oe,P.draggable.measure);R1({activeNode:E!=null?y.get(E):null,config:U.layoutShiftCompensation,initialRect:ne,measure:P.draggable.measure});const te=g_(oe,P.draggable.measure,ne),_e=g_(oe?oe.parentElement:null),fe=q.useRef({activatorEvent:null,active:null,activeNode:oe,collisionRect:null,collisions:null,droppableRects:Q,draggableNodes:y,draggingNode:null,draggingNodeRect:null,droppableContainers:T,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),be=T.getNodeFor((D=fe.current.over)==null?void 0:D.id),ge=v1({measure:P.dragOverlay.measure}),Te=(A=ge.nodeRef.current)!=null?A:oe,Pe=m?(H=ge.rect)!=null?H:te:null,Se=!!(ge.nodeRef.current&&ge.rect),Mt=c1(Se?null:te),It=hg(Te?Vt(Te):null),xe=u1(m?be??oe:null),Ee=_1(xe),Ae=x1(b,{transform:{x:R.x-Mt.x,y:R.y-Mt.y,scaleX:1,scaleY:1},activatorEvent:W,active:M,activeNodeRect:te,containerNodeRect:_e,draggingNodeRect:Pe,over:fe.current.over,overlayNodeRect:ge.rect,scrollableAncestors:xe,scrollableAncestorRects:Ee,windowRect:It}),ve=K?Dr(K,R):null,we=h1(xe),Ze=p_(we),qe=p_(we,[te]),gt=Dr(Ae,Ze),Qe=Pe?O0(Pe,Ae):null,ct=M&&Qe?l({active:M,collisionRect:Qe,droppableRects:Q,droppableContainers:k,pointerCoordinates:ve}):null,Je=eg(ct,"id"),[ke,De]=q.useState(null),Xt=Se?Ae:Dr(Ae,qe),ut=M0(Xt,(N=ke==null?void 0:ke.rect)!=null?N:null,te),Et=q.useRef(null),vt=q.useCallback((it,rt)=>{let{sensor:St,options:Nt}=rt;if($.current==null)return;const Ut=y.get($.current);if(!Ut)return;const kt=it.nativeEvent,jt=new St({active:$.current,activeNode:Ut,event:kt,options:Nt,context:fe,onAbort(pt){if(!y.get(pt))return;const{onDragAbort:Kt}=O.current,ni={id:pt};Kt==null||Kt(ni),o({type:"onDragAbort",event:ni})},onPending(pt,bi,Kt,ni){if(!y.get(pt))return;const{onDragPending:Oi}=O.current,Si={id:pt,constraint:bi,initialCoordinates:Kt,offset:ni};Oi==null||Oi(Si),o({type:"onDragPending",event:Si})},onStart(pt){const bi=$.current;if(bi==null)return;const Kt=y.get(bi);if(!Kt)return;const{onDragStart:ni}=O.current,ki={activatorEvent:kt,active:{id:bi,data:Kt.data,rect:B}};Rn.unstable_batchedUpdates(()=>{ni==null||ni(ki),x(ws.Initializing),a({type:bt.DragStart,initialCoordinates:pt,active:bi}),o({type:"onDragStart",event:ki}),G(Et.current),X(kt)})},onMove(pt){a({type:bt.DragMove,coordinates:pt})},onEnd:ri(bt.DragEnd),onCancel:ri(bt.DragCancel)});Et.current=jt;function ri(pt){return async function(){const{active:Kt,collisions:ni,over:ki,scrollAdjustedTranslate:Oi}=fe.current;let Si=null;if(Kt&&Oi){const{cancelDrop:Ji}=O.current;Si={activatorEvent:kt,active:Kt,collisions:ni,delta:Oi,over:ki},pt===bt.DragEnd&&typeof Ji=="function"&&await Promise.resolve(Ji(Si))&&(pt=bt.DragCancel)}$.current=null,Rn.unstable_batchedUpdates(()=>{a({type:pt}),x(ws.Uninitialized),De(null),G(null),X(null),Et.current=null;const Ji=pt===bt.DragEnd?"onDragEnd":"onDragCancel";if(Si){const ai=O.current[Ji];ai==null||ai(Si),o({type:Ji,event:Si})}})}}},[y]),Qi=q.useCallback((it,rt)=>(St,Nt)=>{const Ut=St.nativeEvent,kt=y.get(Nt);if($.current!==null||!kt||Ut.dndKit||Ut.defaultPrevented)return;const jt={active:kt};it(St,rt.options,jt)===!0&&(Ut.dndKit={capturedBy:rt.sensor},$.current=Nt,vt(St,rt))},[y,vt]),qs=r1(g,Qi);d1(g),Ti(()=>{te&&S===ws.Initializing&&x(ws.Initialized)},[te,S]),q.useEffect(()=>{const{onDragMove:it}=O.current,{active:rt,activatorEvent:St,collisions:Nt,over:Ut}=fe.current;if(!rt||!St)return;const kt={active:rt,activatorEvent:St,collisions:Nt,delta:{x:gt.x,y:gt.y},over:Ut};Rn.unstable_batchedUpdates(()=>{it==null||it(kt),o({type:"onDragMove",event:kt})})},[gt.x,gt.y]),q.useEffect(()=>{const{active:it,activatorEvent:rt,collisions:St,droppableContainers:Nt,scrollAdjustedTranslate:Ut}=fe.current;if(!it||$.current==null||!rt||!Ut)return;const{onDragOver:kt}=O.current,jt=Nt.get(Je),ri=jt&&jt.rect.current?{id:jt.id,rect:jt.rect.current,data:jt.data,disabled:jt.disabled}:null,pt={active:it,activatorEvent:rt,collisions:St,delta:{x:Ut.x,y:Ut.y},over:ri};Rn.unstable_batchedUpdates(()=>{De(ri),kt==null||kt(pt),o({type:"onDragOver",event:pt})})},[Je]),Ti(()=>{fe.current={activatorEvent:W,active:M,activeNode:oe,collisionRect:Qe,collisions:ct,droppableRects:Q,draggableNodes:y,draggingNode:Te,draggingNodeRect:Pe,droppableContainers:T,over:ke,scrollableAncestors:xe,scrollAdjustedTranslate:gt},B.current={initial:Pe,translated:Qe}},[M,oe,ct,Qe,y,Te,Pe,Q,T,ke,xe,gt]),e1({...U,delta:R,draggingRect:Qe,pointerCoordinates:ve,scrollableAncestors:xe,scrollableAncestorRects:Ee});const Or=q.useMemo(()=>({active:M,activeNode:oe,activeNodeRect:te,activatorEvent:W,collisions:ct,containerNodeRect:_e,dragOverlay:ge,draggableNodes:y,droppableContainers:T,droppableRects:Q,over:ke,measureDroppableContainers:ee,scrollableAncestors:xe,scrollableAncestorRects:Ee,measuringConfiguration:P,measuringScheduled:he,windowRect:It}),[M,oe,te,W,ct,_e,ge,y,T,Q,ke,ee,xe,Ee,P,he,It]),Ei=q.useMemo(()=>({activatorEvent:W,activators:qs,active:M,activeNodeRect:te,ariaDescribedById:{draggable:F},dispatch:a,draggableNodes:y,over:ke,measureDroppableContainers:ee}),[W,qs,M,te,a,F,y,ke,ee]);return xt.createElement(Z_.Provider,{value:c},xt.createElement(ho.Provider,{value:Ei},xt.createElement(dg.Provider,{value:Or},xt.createElement(fg.Provider,{value:ut},d)),xt.createElement(w1,{disabled:(r==null?void 0:r.restoreFocus)===!1})),xt.createElement(E0,{...r,hiddenTextDescribedById:F}));function Mi(){const it=(Y==null?void 0:Y.autoScrollEnabled)===!1,rt=typeof u=="object"?u.enabled===!1:u===!1,St=m&&!it&&!rt;return typeof u=="object"?{...u,enabled:St}:{enabled:St}}}),A1=q.createContext(null),b_="button",D1="Draggable";function L1(_){let{id:C,data:D,disabled:A=!1,attributes:H}=_;const N=Nn(D1),{activators:z,activatorEvent:r,active:u,activeNodeRect:d,ariaDescribedById:g,draggableNodes:l,over:p}=q.useContext(ho),{role:b=b_,roleDescription:w="draggable",tabIndex:f=0}=H??{},n=(u==null?void 0:u.id)===C,a=q.useContext(n?fg:A1),[o,c]=ro(),[S,x]=ro(),m=f1(z,C),E=kn(D);Ti(()=>(l.set(C,{id:C,key:N,node:o,activatorNode:S,data:E}),()=>{const R=l.get(C);R&&R.key===N&&l.delete(C)}),[l,C]);const y=q.useMemo(()=>({role:b,tabIndex:f,"aria-disabled":A,"aria-pressed":n&&b===b_?!0:void 0,"aria-roledescription":w,"aria-describedby":g.draggable}),[A,b,f,n,w,g.draggable]);return{active:u,activatorEvent:r,activeNodeRect:d,attributes:y,isDragging:n,listeners:A?void 0:m,node:o,over:p,setNodeRef:c,setActivatorNodeRef:x,transform:a}}function T1(){return q.useContext(dg)}const M1="Droppable",k1={timeout:25};function O1(_){let{data:C,disabled:D=!1,id:A,resizeObserverConfig:H}=_;const N=Nn(M1),{active:z,dispatch:r,over:u,measureDroppableContainers:d}=q.useContext(ho),g=q.useRef({disabled:D}),l=q.useRef(!1),p=q.useRef(null),b=q.useRef(null),{disabled:w,updateMeasurementsFor:f,timeout:n}={...k1,...H},a=kn(f??A),o=q.useCallback(()=>{if(!l.current){l.current=!0;return}b.current!=null&&clearTimeout(b.current),b.current=setTimeout(()=>{d(Array.isArray(a.current)?a.current:[a.current]),b.current=null},n)},[n]),c=uo({callback:o,disabled:w||!z}),S=q.useCallback((y,R)=>{c&&(R&&(c.unobserve(R),l.current=!1),y&&c.observe(y))},[c]),[x,m]=ro(S),E=kn(C);return q.useEffect(()=>{!c||!x.current||(c.disconnect(),l.current=!1,c.observe(x.current))},[x,c]),q.useEffect(()=>(r({type:bt.RegisterDroppable,element:{id:A,key:N,disabled:D,node:x,rect:p,data:E}}),()=>r({type:bt.UnregisterDroppable,key:N,id:A})),[A]),q.useEffect(()=>{D!==g.current.disabled&&(r({type:bt.SetDroppableDisabled,id:A,key:N,disabled:D}),g.current.disabled=D)},[A,N,D,r]),{active:z,rect:p,isOver:(u==null?void 0:u.id)===A,node:x,over:u,setNodeRef:m}}function gg(_,C,D){const A=_.slice();return A.splice(D<0?A.length+D:D,0,A.splice(C,1)[0]),A}function B1(_,C){return _.reduce((D,A,H)=>{const N=C.get(A);return N&&(D[H]=N),D},Array(_.length))}function Za(_){return _!==null&&_>=0}function H1(_,C){if(_===C)return!0;if(_.length!==C.length)return!1;for(let D=0;D<_.length;D++)if(_[D]!==C[D])return!1;return!0}function z1(_){return typeof _=="boolean"?{draggable:_,droppable:_}:_}const vg=_=>{let{rects:C,activeIndex:D,overIndex:A,index:H}=_;const N=gg(C,A,D),z=C[H],r=N[H];return!r||!z?null:{x:r.left-z.left,y:r.top-z.top,scaleX:r.width/z.width,scaleY:r.height/z.height}},Qa={scaleX:1,scaleY:1},pg=_=>{var C;let{activeIndex:D,activeNodeRect:A,index:H,rects:N,overIndex:z}=_;const r=(C=N[D])!=null?C:A;if(!r)return null;if(H===D){const d=N[z];return d?{x:0,y:D<z?d.top+d.height-(r.top+r.height):d.top-r.top,...Qa}:null}const u=I1(N,H,D);return H>D&&H<=z?{x:0,y:-r.height-u,...Qa}:H<D&&H>=z?{x:0,y:r.height+u,...Qa}:{x:0,y:0,...Qa}};function I1(_,C,D){const A=_[C],H=_[C-1],N=_[C+1];return A?D<C?H?A.top-(H.top+H.height):N?N.top-(A.top+A.height):0:N?N.top-(A.top+A.height):H?A.top-(H.top+H.height):0:0}const mg="Sortable",bg=xt.createContext({activeIndex:-1,containerId:mg,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:vg,disabled:{draggable:!1,droppable:!1}});function Sg(_){let{children:C,id:D,items:A,strategy:H=vg,disabled:N=!1}=_;const{active:z,dragOverlay:r,droppableRects:u,over:d,measureDroppableContainers:g}=T1(),l=Nn(mg,D),p=r.rect!==null,b=q.useMemo(()=>A.map(m=>typeof m=="object"&&"id"in m?m.id:m),[A]),w=z!=null,f=z?b.indexOf(z.id):-1,n=d?b.indexOf(d.id):-1,a=q.useRef(b),o=!H1(b,a.current),c=n!==-1&&f===-1||o,S=z1(N);Ti(()=>{o&&w&&g(b)},[o,b,w,g]),q.useEffect(()=>{a.current=b},[b]);const x=q.useMemo(()=>({activeIndex:f,containerId:l,disabled:S,disableTransforms:c,items:b,overIndex:n,useDragOverlay:p,sortedRects:B1(b,u),strategy:H}),[f,l,S.draggable,S.droppable,c,b,n,u,p,H]);return xt.createElement(bg.Provider,{value:x},C)}const N1=_=>{let{id:C,items:D,activeIndex:A,overIndex:H}=_;return gg(D,A,H).indexOf(C)},U1=_=>{let{containerId:C,isSorting:D,wasDragging:A,index:H,items:N,newIndex:z,previousItems:r,previousContainerId:u,transition:d}=_;return!d||!A||r!==N&&H===z?!1:D?!0:z!==H&&C===u},j1={duration:200,easing:"ease"},yg="transform",P1=Bn.Transition.toString({property:yg,duration:0,easing:"linear"}),F1={roleDescription:"sortable"};function q1(_){let{disabled:C,index:D,node:A,rect:H}=_;const[N,z]=q.useState(null),r=q.useRef(D);return Ti(()=>{if(!C&&D!==r.current&&A.current){const u=H.current;if(u){const d=kr(A.current,{ignoreTransform:!0}),g={x:u.left-d.left,y:u.top-d.top,scaleX:u.width/d.width,scaleY:u.height/d.height};(g.x||g.y)&&z(g)}}D!==r.current&&(r.current=D)},[C,D,A,H]),q.useEffect(()=>{N&&z(null)},[N]),N}function W1(_){let{animateLayoutChanges:C=U1,attributes:D,disabled:A,data:H,getNewIndex:N=N1,id:z,strategy:r,resizeObserverConfig:u,transition:d=j1}=_;const{items:g,containerId:l,activeIndex:p,disabled:b,disableTransforms:w,sortedRects:f,overIndex:n,useDragOverlay:a,strategy:o}=q.useContext(bg),c=$1(A,b),S=g.indexOf(z),x=q.useMemo(()=>({sortable:{containerId:l,index:S,items:g},...H}),[l,H,S,g]),m=q.useMemo(()=>g.slice(g.indexOf(z)),[g,z]),{rect:E,node:y,isOver:R,setNodeRef:T}=O1({id:z,data:x,disabled:c.droppable,resizeObserverConfig:{updateMeasurementsFor:m,...u}}),{active:I,activatorEvent:B,activeNodeRect:M,attributes:$,setNodeRef:Y,listeners:G,isDragging:W,over:X,setActivatorNodeRef:O,transform:F}=L1({id:z,data:x,attributes:{...F1,...D},disabled:c.draggable}),k=d0(T,Y),P=!!I,Q=P&&!w&&Za(p)&&Za(n),ee=!a&&W,he=ee&&Q?F:null,K=Q?he??(r??o)({rects:f,activeNodeRect:M,activeIndex:p,overIndex:n,index:S}):null,U=Za(p)&&Za(n)?N({id:z,items:g,activeIndex:p,overIndex:n}):S,ne=I==null?void 0:I.id,te=q.useRef({activeId:ne,items:g,newIndex:U,containerId:l}),_e=g!==te.current.items,fe=C({active:I,containerId:l,isDragging:W,isSorting:P,id:z,index:S,items:g,newIndex:te.current.newIndex,previousItems:te.current.items,previousContainerId:te.current.containerId,transition:d,wasDragging:te.current.activeId!=null}),be=q1({disabled:!fe,index:S,node:y,rect:E});return q.useEffect(()=>{P&&te.current.newIndex!==U&&(te.current.newIndex=U),l!==te.current.containerId&&(te.current.containerId=l),g!==te.current.items&&(te.current.items=g)},[P,U,l,g]),q.useEffect(()=>{if(ne===te.current.activeId)return;if(ne&&!te.current.activeId){te.current.activeId=ne;return}const Te=setTimeout(()=>{te.current.activeId=ne},50);return()=>clearTimeout(Te)},[ne]),{active:I,activeIndex:p,attributes:$,data:x,rect:E,index:S,newIndex:U,items:g,isOver:R,isSorting:P,isDragging:W,listeners:G,node:y,overIndex:n,over:X,setNodeRef:k,setActivatorNodeRef:O,setDroppableNodeRef:T,setDraggableNodeRef:Y,transform:be??K,transition:ge()};function ge(){if(be||_e&&te.current.newIndex===S)return P1;if(!(ee&&!Zc(B)||!d)&&(P||fe))return Bn.Transition.toString({...d,property:yg})}}function $1(_,C){var D,A;return typeof _=="boolean"?{draggable:_,droppable:!1}:{draggable:(D=_==null?void 0:_.draggable)!=null?D:C.draggable,droppable:(A=_==null?void 0:_.droppable)!=null?A:C.droppable}}function oo(_){if(!_)return!1;const C=_.data.current;return!!(C&&"sortable"in C&&typeof C.sortable=="object"&&"containerId"in C.sortable&&"items"in C.sortable&&"index"in C.sortable)}const G1=[Ne.Down,Ne.Right,Ne.Up,Ne.Left],Y1=(_,C)=>{let{context:{active:D,collisionRect:A,droppableRects:H,droppableContainers:N,over:z,scrollableAncestors:r}}=C;if(G1.includes(_.code)){if(_.preventDefault(),!D||!A)return;const u=[];N.getEnabled().forEach(l=>{if(!l||l!=null&&l.disabled)return;const p=H.get(l.id);if(p)switch(_.code){case Ne.Down:A.top<p.top&&u.push(l);break;case Ne.Up:A.top>p.top&&u.push(l);break;case Ne.Left:A.left>p.left&&u.push(l);break;case Ne.Right:A.left<p.left&&u.push(l);break}});const d=D0({collisionRect:A,droppableRects:H,droppableContainers:u});let g=eg(d,"id");if(g===(z==null?void 0:z.id)&&d.length>1&&(g=d[1].id),g!=null){const l=N.get(D.id),p=N.get(g),b=p?H.get(p.id):null,w=p==null?void 0:p.node.current;if(w&&b&&l&&p){const n=co(w).some((m,E)=>r[E]!==m),a=Cg(l,p),o=V1(l,p),c=n||!a?{x:0,y:0}:{x:o?A.width-b.width:0,y:o?A.height-b.height:0},S={x:b.left,y:b.top};return c.x&&c.y?S:On(S,c)}}}};function Cg(_,C){return!oo(_)||!oo(C)?!1:_.data.current.sortable.containerId===C.data.current.sortable.containerId}function V1(_,C){return!oo(_)||!oo(C)||!Cg(_,C)?!1:_.data.current.sortable.index<C.data.current.sortable.index}function wg(){var _;return((_=crypto.randomUUID)==null?void 0:_.call(crypto))??`id-${Date.now()}-${Math.random().toString(36).slice(2,9)}`}function xg({id:_,enabled:C,onToggle:D,onDelete:A,children:H,extraAction:N,onMoveToFirst:z,onMoveToLast:r}){const{attributes:u,listeners:d,setNodeRef:g,transform:l,transition:p,isDragging:b}=W1({id:_}),w={transform:Bn.Transform.toString(l),opacity:b?.5:1};return V.jsx("div",{ref:g,style:{...w,borderRadius:8,background:"var(--bg-tertiary)",overflow:"hidden"},children:V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"12px 12px",minHeight:"var(--min-touch-target, 44px)",overflow:"hidden"},children:[V.jsx("div",{...u,...d,"aria-label":"Drag to reorder",style:{width:24,color:"var(--text-muted)",cursor:"grab",display:"flex",alignItems:"center",justifyContent:"center",fontSize:14,userSelect:"none",touchAction:"none"},children:"⋮⋮"}),V.jsx("button",{role:"switch","aria-checked":C,"aria-label":C?"Enabled, click to disable":"Disabled, click to enable",onClick:D,style:{width:32,height:20,borderRadius:10,border:"none",background:C?"var(--status-running)":"var(--bg-primary)",cursor:"pointer",position:"relative",flexShrink:0},children:V.jsx("span",{style:{position:"absolute",top:2,left:C?14:2,width:16,height:16,borderRadius:"50%",background:"#fff",transition:"left 0.15s ease"}})}),H,N,(z||r)&&V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4,flexShrink:0},children:[z&&V.jsx("button",{"aria-label":"Move to first",title:"Move to first",onClick:z,style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center"},children:"⤒"}),r&&V.jsx("button",{"aria-label":"Move to last",title:"Move to last",onClick:r,style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center"},children:"⤓"})]}),V.jsx("button",{"aria-label":"Delete",title:"Delete",onClick:A,style:{width:32,height:32,borderRadius:6,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",fontSize:18,flexShrink:0},children:"×"})]})})}function Eg(){return R0(o_(tu,{activationConstraint:{distance:8}}),o_(Jc,{coordinateGetter:Y1}))}function X1(){const[_,C]=q.useState(!1);return q.useEffect(()=>{const D=()=>{const A=navigator.userAgent,H=/iPhone|iPad|iPod|Android/i.test(A),N=window.innerWidth<768;C(H||N)};return D(),window.addEventListener("resize",D),()=>window.removeEventListener("resize",D)},[]),_}function K1(_){if(["Control","Alt","Shift","Meta"].includes(_.key))return null;let C="",D="";if(_.ctrlKey||_.altKey||_.metaKey){const A=_.key.toUpperCase(),H=_.ctrlKey?"Ctrl":_.altKey?"Alt":"Meta";if(_.key.length===1)if(C=`${H}+${A}`,_.ctrlKey)D=String.fromCharCode(_.key.toUpperCase().charCodeAt(0)-64);else return null;else return null}else if(_.key.startsWith("Arrow")){const H={ArrowUp:{label:"↑",code:"A"},ArrowDown:{label:"↓",code:"B"},ArrowRight:{label:"→",code:"C"},ArrowLeft:{label:"←",code:"D"}}[_.key];if(H)C=H.label,D=`\x1B[${H.code}`;else return null}else if(_.key==="Escape")C="Esc",D="\x1B";else if(_.key==="Enter")C="Enter",D="\r";else if(_.key==="Tab")C=_.shiftKey?"Shift+Tab":"Tab",D=_.shiftKey?"\x1B[Z":" ";else if(_.key==="Backspace")C="Backspace",D="";else if(_.key==="Delete")C="Delete",D="\x1B[3~";else if(_.key==="Home")C="Home",D="\x1B[H";else if(_.key==="End")C="End",D="\x1B[F";else if(_.key==="PageUp")C="PageUp",D="\x1B[5~";else if(_.key==="PageDown")C="PageDown",D="\x1B[6~";else if(_.key.match(/^F([1-9]|1[0-2])$/)){const A={F1:"\x1BOP",F2:"\x1BOQ",F3:"\x1BOR",F4:"\x1BOS",F5:"\x1B[15~",F6:"\x1B[17~",F7:"\x1B[18~",F8:"\x1B[19~",F9:"\x1B[20~",F10:"\x1B[21~",F11:"\x1B[23~",F12:"\x1B[24~"};C=_.key,D=A[_.key]??""}else if(_.key.length===1)C=_.key.toUpperCase(),D=_.key;else return null;return{label:C,data:D}}function Z1({shortcuts:_,onChange:C}){const[D,A]=q.useState(null),[H,N]=q.useState(!1),z=Eg(),r=X1(),u=(f,n)=>{f.preventDefault(),f.stopPropagation();const a=K1(f);if(a){const o=_.map(c=>c._id===n?{...c,label:a.label,data:a.data}:c);C(o),A(null)}},d=f=>{const n=[..._];n[f]={...n[f],enabled:!n[f].enabled},C(n)},g=()=>{if(r){N(!0),setTimeout(()=>N(!1),3e3);return}const f=wg(),n=[..._,{label:"New",data:"",enabled:!0,_id:f}];C(n),A(f)},l=f=>{const n=_.filter((a,o)=>o!==f);C(n)},p=f=>{const{active:n,over:a}=f;if(a&&n.id!==a.id){const o=_.findIndex(m=>m._id===n.id),c=_.findIndex(m=>m._id===a.id),S=[..._],[x]=S.splice(o,1);S.splice(c,0,x),C(S)}},b=f=>{const n=_.findIndex(c=>c._id===f);if(n<=0)return;const a=[..._],[o]=a.splice(n,1);a.unshift(o),C(a)},w=f=>{const n=_.findIndex(c=>c._id===f);if(n===-1||n===_.length-1)return;const a=[..._],[o]=a.splice(n,1);a.push(o),C(a)};return V.jsxs("div",{"data-testid":"settings--shortcuts--container",style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[V.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"Shortcuts"}),V.jsx("button",{onClick:g,disabled:r,"data-testid":"settings--shortcuts--button--add",style:{padding:"8px 16px",fontSize:13,borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",cursor:r?"not-allowed":"pointer",opacity:r?.5:1},children:"+ Add"})]}),r&&V.jsxs("div",{"data-testid":"settings--shortcuts--mobile-warning",style:{padding:"10px 12px",backgroundColor:"var(--bg-warning, #fff8e6)",border:"1px solid var(--border-warning, #ffd666)",borderRadius:6,fontSize:13,color:"var(--text-warning, #ad6800)",display:"flex",alignItems:"center",gap:8},children:[V.jsx("span",{style:{fontSize:16},children:"⚠️"}),V.jsx("span",{children:"移动端无法新增快捷键,请在PC端浏览器中添加"})]}),_.length===0&&V.jsx("div",{"data-testid":"settings--shortcuts--empty",style:{padding:16,textAlign:"center",color:"var(--text-secondary)",fontSize:13},children:"No shortcuts yet. Click the button above to add one."}),V.jsx(_g,{sensors:z,collisionDetection:tg,onDragEnd:p,children:V.jsx(Sg,{items:_.map(f=>f._id),strategy:pg,children:_.map(f=>V.jsx(xg,{id:f._id,enabled:f.enabled,onToggle:()=>{const n=_.findIndex(a=>a._id===f._id);n!==-1&&d(n)},onDelete:()=>{const n=_.findIndex(a=>a._id===f._id);n!==-1&&l(n)},onMoveToFirst:()=>b(f._id),onMoveToLast:()=>w(f._id),children:V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,flex:1,minWidth:0},children:[V.jsx("input",{type:"text",value:f.label,readOnly:!0,autoComplete:"off",placeholder:"Press key to capture",onClick:()=>A(f._id),onKeyDown:n=>u(n,f._id),onBlur:()=>A(null),"aria-label":`Shortcut ${f.label}`,style:{flex:1,minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:D===f._id?"2px solid var(--status-running)":"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer",textAlign:"center"}}),V.jsx("span",{title:f.data?f.data.replace(/\x1b/g,"ESC").replace(/\r/g,"CR").replace(/\t/g,"TAB"):"(not set)",style:{display:"inline-flex",alignItems:"center",justifyContent:"flex-end",fontSize:11,color:"var(--text-muted)",fontFamily:"monospace",flexShrink:0,width:35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f.data?f.data.replace(/\x1b/g,"ESC").replace(/\r/g,"CR").replace(/\t/g,"TAB"):"(not set)"})]})},f._id))})}),D!==null&&!r&&V.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)",textAlign:"center",marginTop:4},children:"Press a key to capture…"}),H&&V.jsx("div",{style:{position:"fixed",bottom:80,left:"50%",transform:"translateX(-50%)",padding:"12px 20px",backgroundColor:"var(--bg-secondary, #333)",color:"var(--text-inverse, #fff)",borderRadius:8,fontSize:14,boxShadow:"0 4px 12px rgba(0,0,0,0.2)",zIndex:1e3,whiteSpace:"nowrap",animation:"fadeInOut 3s ease"},children:"请在PC端浏览器中新增快捷键"})]})}const Q1={width:"100%",padding:"10px 12px",borderRadius:6,fontSize:14,resize:"none",overflowX:"auto",overflowY:"hidden",whiteSpace:"nowrap",lineHeight:"20px",boxSizing:"border-box"};function Lr(_){return{...Q1,..._}}function J1({autoSend:_,onToggle:C}){const D=_??!0;return V.jsx("button",{onClick:C,"aria-label":"Auto-send toggle",title:"Auto-send toggle",style:{width:32,height:32,padding:0,borderRadius:6,border:"none",background:D?"var(--status-running)":"var(--bg-primary)",color:D?"#fff":"var(--text-secondary)",cursor:"pointer",fontSize:14,display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:D?"↗":"✎"})}function em({commands:_,onChange:C}){const[D,A]=q.useState(null),[H,N]=q.useState(""),z=Eg(),r=a=>{const o=_.find(c=>c._id===a);o&&(A(a),N(o.command))},u=a=>{if(!a){A(null),N("");return}let o=H.trim();if(!o){b(a);return}o.startsWith("/")||(o="/"+o);const c=_.map(S=>S._id===a?{...S,label:o,command:o}:S);C(c),A(null),N("")},d=a=>{const o=_.map(c=>c._id===a?{...c,enabled:!c.enabled}:c);C(o)},g=We(a=>a.showToast),l=a=>{const o=_.find(x=>x._id===a);if(!o)return;const c=!(o.autoSend??!0),S=_.map(x=>x._id===a?{...x,autoSend:c}:x);C(S),g(c?"Commands will auto-send on tap":"Commands will be inserted for editing")},p=()=>{const a=wg(),o=[..._,{label:"/new",command:"/new",enabled:!0,autoSend:!0,_id:a}];C(o),A(a),N("/new")},b=a=>{const o=_.filter(c=>c._id!==a);C(o)},w=a=>{const{active:o,over:c}=a;if(c&&o.id!==c.id){const S=_.findIndex(y=>y._id===o.id),x=_.findIndex(y=>y._id===c.id),m=[..._],[E]=m.splice(S,1);m.splice(x,0,E),C(m)}},f=a=>{const o=_.findIndex(x=>x._id===a);if(o<=0)return;const c=[..._],[S]=c.splice(o,1);c.unshift(S),C(c)},n=a=>{const o=_.findIndex(x=>x._id===a);if(o===-1||o===_.length-1)return;const c=[..._],[S]=c.splice(o,1);c.push(S),C(c)};return V.jsxs("div",{"data-testid":"settings--commands--container",style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[V.jsx("span",{style:{fontSize:14,fontWeight:600,color:"var(--text-primary)"},children:"Commands"}),V.jsx("button",{onClick:p,"data-testid":"settings--commands--button--add",style:{padding:"8px 16px",fontSize:13,borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",cursor:"pointer"},children:"+ Add"})]}),_.length===0&&V.jsx("div",{"data-testid":"settings--commands--empty",style:{padding:16,textAlign:"center",color:"var(--text-secondary)",fontSize:13},children:"No commands yet. Click the button above to add one."}),V.jsx(_g,{sensors:z,collisionDetection:tg,onDragEnd:w,children:V.jsx(Sg,{items:_.map(a=>a._id),strategy:pg,children:_.map(a=>V.jsx(xg,{id:a._id,enabled:a.enabled,onToggle:()=>d(a._id),onDelete:()=>b(a._id),onMoveToFirst:()=>f(a._id),onMoveToLast:()=>n(a._id),extraAction:V.jsx(J1,{autoSend:a.autoSend??!0,onToggle:()=>l(a._id)}),children:D===a._id?V.jsx("textarea",{value:H,onChange:o=>N(o.target.value),onKeyDown:o=>{o.key==="Enter"&&(o.preventDefault(),u(a._id)),o.key==="Escape"&&(N(""),u(null))},onBlur:()=>u(a._id),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Enter command…","aria-label":`Edit ${a.label}`,style:Lr({flex:"1 1 180px",minWidth:0,height:36,padding:"0 12px",border:"2px solid var(--status-running)",background:"var(--bg-primary)",color:"var(--text-primary)",lineHeight:"36px"})}):V.jsx("button",{type:"button",onClick:()=>r(a._id),"aria-label":`Edit command ${a.label}`,style:{flex:"1 1 180px",minWidth:0,height:36,padding:"0 12px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-primary)",color:"var(--text-primary)",fontSize:14,display:"flex",alignItems:"center",cursor:"pointer",textAlign:"left",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:a.label})},a._id))})}),V.jsx("div",{"data-testid":"settings--commands--tip",style:{fontSize:12,color:"var(--text-muted)",marginTop:8},children:"Tip: Commands are auto-prefixed with / (e.g., help → /help)"})]})}function tm({checked:_,onChange:C,disabled:D=!1,"aria-label":A}){return V.jsx("button",{type:"button",role:"switch","aria-checked":_,"aria-label":A,disabled:D,onClick:()=>!D&&C(!_),style:{position:"relative",width:"44px",height:"24px",borderRadius:"12px",border:"none",padding:0,cursor:D?"not-allowed":"pointer",background:_?"var(--status-running)":"var(--bg-tertiary)",opacity:D?.5:1,transition:"background 150ms ease-out",touchAction:"manipulation",WebkitTapHighlightColor:"transparent"},children:V.jsx("span",{style:{position:"absolute",top:"2px",left:_?"22px":"2px",width:"20px",height:"20px",borderRadius:"50%",background:"#ffffff",boxShadow:"0 1px 3px rgba(0, 0, 0, 0.3)",transition:"left 150ms ease-out"}})})}function Ja({channelType:_,status:C,isExpanded:D,onToggle:A,onEnabledChange:H,children:N}){const z=l0[_],r=(z==null?void 0:z.implemented)??!1,u=(C==null?void 0:C.configured)??!1,d=(C==null?void 0:C.enabled)??!0,g={dingtalk:"📱",email:"📧",slack:"💬",wechat_work:"💼"},l=p=>{p.stopPropagation()};return V.jsxs("div",{"data-testid":`settings--channel--card--${_}`,style:{border:"1px solid var(--border-color)",borderRadius:8,background:"var(--bg-tertiary)",overflow:"hidden",opacity:r?1:.6},children:[V.jsxs("button",{"data-testid":`settings--channel--header--${_}`,onClick:r?A:void 0,style:{width:"100%",padding:"16px",border:"none",background:D?"var(--bg-secondary)":"transparent",display:"flex",alignItems:"center",justifyContent:"space-between",cursor:r?"pointer":"default",textAlign:"left"},children:[V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[V.jsx("span",{style:{fontSize:24},children:g[_]??"🔔"}),V.jsxs("div",{children:[V.jsxs("div",{style:{fontSize:16,fontWeight:600,color:"var(--text-primary)",display:"flex",alignItems:"center",gap:8},children:[(z==null?void 0:z.displayName)??_,u&&V.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:d?"var(--status-running)":"var(--text-muted)"},title:d?"Enabled":"Disabled"})]}),V.jsx("div",{style:{fontSize:13,color:"var(--text-secondary)",marginTop:2},children:(z==null?void 0:z.description)??""})]})]}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[u&&H&&V.jsx("div",{onClick:l,children:V.jsx(tm,{checked:d,onChange:H,"aria-label":`Toggle ${(z==null?void 0:z.displayName)??_}`})}),!r&&V.jsx("span",{"data-testid":`settings--channel--coming--${_}`,style:{fontSize:12,color:"var(--text-secondary)",background:"var(--bg-secondary)",padding:"4px 10px",borderRadius:12},children:"Coming"}),r&&V.jsx("svg",{style:{width:16,height:16,transform:D?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s",color:"var(--text-secondary)"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:V.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})]}),r&&D&&V.jsx("div",{style:{padding:"16px",borderTop:"1px solid var(--border-color)",background:"var(--bg-primary)"},children:N})]})}function im({webhookUrl:_,onChange:C,configured:D}){const[A,H]=q.useState(!1),N=_===""||q_.test(_),z=A&&!N&&_!=="";return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{children:[V.jsx("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8,color:"var(--text-primary)"},children:"Webhook URL"}),V.jsx("textarea",{"data-testid":"settings--dingtalk--input--webhook",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",value:_,onChange:r=>{C(r.target.value)},onBlur:()=>H(!0),style:Lr({border:`1px solid ${z?"var(--status-error)":"var(--border-color)"}`,background:"var(--bg-secondary)",color:"var(--text-primary)"})}),z&&V.jsx("div",{"data-testid":"settings--dingtalk--error",style:{marginTop:6,fontSize:12,color:"var(--status-error)"},children:"Please enter a valid DingTalk Webhook URL starting with https://oapi.dingtalk.com/robot/send?access_token="})]}),D&&!_&&V.jsx("div",{"data-testid":"settings--dingtalk--configured",style:{padding:10,background:"rgba(46, 204, 113, 0.1)",borderRadius:6,fontSize:13,color:"var(--status-running)"},children:"✓ Configured. Enter a new URL to update."}),V.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:V.jsx("a",{href:"https://open.dingtalk.com/document/robots/custom-robot-access",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--status-running)"},children:"How to get DingTalk group bot Webhook?"})})]})}function sm({sendKey:_,onChange:C,configured:D}){const[A,H]=q.useState(!1),N=_===""||W_.test(_),z=A&&!N&&_!=="";return V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsxs("div",{children:[V.jsx("label",{style:{display:"block",fontSize:14,fontWeight:500,marginBottom:8,color:"var(--text-primary)"},children:"SendKey"}),V.jsx("textarea",{"data-testid":"settings--wechat--input--sendkey",autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"SCTxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",value:_,onChange:r=>{C(r.target.value)},onBlur:()=>H(!0),style:Lr({border:`1px solid ${z?"var(--status-error)":"var(--border-color)"}`,background:"var(--bg-secondary)",color:"var(--text-primary)"})}),z&&V.jsx("div",{"data-testid":"settings--wechat--error",style:{marginTop:6,fontSize:12,color:"var(--status-error)"},children:"Please enter a valid SendKey (starts with SCT, at least 13 characters)"})]}),D&&!_&&V.jsx("div",{"data-testid":"settings--wechat--configured",style:{padding:10,background:"rgba(46, 204, 113, 0.1)",borderRadius:6,fontSize:13,color:"var(--status-running)"},children:"✓ Configured. Enter a new SendKey to update."}),V.jsx("div",{style:{fontSize:12,color:"var(--text-secondary)"},children:V.jsx("a",{href:"https://sct.ftqq.com/sendkey",target:"_blank",rel:"noopener noreferrer",style:{color:"var(--status-running)"},children:"How to get SendKey?"})})]})}function rm({notificationStatus:_,dingtalkWebhookUrl:C,onDingtalkWebhookChange:D,wechatWorkSendKey:A,onWechatWorkSendKeyChange:H,onChannelEnabledChange:N}){var d,g,l,p;const[z,r]=q.useState("dingtalk"),u=b=>{r(w=>w===b?null:b)};return V.jsxs("div",{"data-testid":"settings--notifications--container",style:{display:"flex",flexDirection:"column",gap:12},children:[V.jsx("div",{"data-testid":"settings--notifications--description",style:{padding:12,background:"var(--bg-tertiary)",borderRadius:8,fontSize:13,color:"var(--text-secondary)"},children:"Configure notification channels to receive alerts when Claude needs your attention."}),V.jsx(Ja,{channelType:"dingtalk",status:_==null?void 0:_.dingtalk,isExpanded:z==="dingtalk",onToggle:()=>u("dingtalk"),onEnabledChange:(d=_==null?void 0:_.dingtalk)!=null&&d.configured?b=>N==null?void 0:N("dingtalk",b):void 0,children:V.jsx(im,{webhookUrl:C,onChange:D,configured:(g=_==null?void 0:_.dingtalk)==null?void 0:g.configured})}),V.jsx(Ja,{channelType:"wechat_work",status:_==null?void 0:_.wechat_work,isExpanded:z==="wechat_work",onToggle:()=>u("wechat_work"),onEnabledChange:(l=_==null?void 0:_.wechat_work)!=null&&l.configured?b=>N==null?void 0:N("wechat_work",b):void 0,children:V.jsx(sm,{sendKey:A,onChange:H,configured:(p=_==null?void 0:_.wechat_work)==null?void 0:p.configured})}),V.jsx(Ja,{channelType:"email",status:_==null?void 0:_.email,isExpanded:z==="email",onToggle:()=>u("email")}),V.jsx(Ja,{channelType:"slack",status:_==null?void 0:_.slack,isExpanded:z==="slack",onToggle:()=>u("slack")})]})}const nm=100,am=300;var H_;const An=typeof window<"u"&&((H_=window.matchMedia)==null?void 0:H_.call(window,"(prefers-reduced-motion: reduce)").matches),kc=An?0:300;function Rg({isOpen:_,onClose:C,title:D,children:A,footer:H,"data-testid":N}){const[z,r]=q.useState(!1),[u,d]=q.useState(!1),[g,l]=q.useState(0),[p,b]=q.useState(!1),w=q.useRef(0),f=q.useRef(0);q.useEffect(()=>{if(_)r(!0),l(0),An?d(!0):requestAnimationFrame(()=>{requestAnimationFrame(()=>d(!0))});else if(z)if(d(!1),An)r(!1);else{const m=setTimeout(()=>r(!1),kc);return()=>clearTimeout(m)}},[_,z]);const n=q.useCallback(m=>{b(!0),w.current=m,f.current=Date.now(),l(0)},[]),a=q.useCallback(m=>{if(!p)return;const E=m-w.current;E>0&&l(E)},[p]),o=q.useCallback(()=>{if(!p)return;const m=g,E=Date.now()-f.current,y=E>0?m/(E/1e3):0;m>nm||m>50&&y>am||m<5?C():l(0),b(!1)},[p,g,C]);if(!z)return null;const c=An||p?"none":`transform ${kc}ms ease-out`,S=An?"none":`background ${kc}ms ease-out`,x=p?`translateY(${g}px)`:u?"translateY(0)":"translateY(100%)";return V.jsx("div",{onClick:C,style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:u?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transition:S,display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:1e3},children:V.jsxs("div",{"data-testid":N,onClick:m=>m.stopPropagation(),style:{width:"100%",maxWidth:480,maxHeight:"calc(85vh - env(safe-area-inset-bottom, 0px))",borderRadius:"16px 16px 0 0",background:"var(--bg-secondary)",boxShadow:"0 -4px 24px rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden",transform:x,transition:c,paddingBottom:"var(--safe-bottom)"},children:[V.jsx("div",{style:{height:44,display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",flexShrink:0},onTouchStart:m=>n(m.touches[0].clientY),onTouchMove:m=>a(m.touches[0].clientY),onTouchEnd:o,onMouseDown:m=>n(m.clientY),onMouseMove:m=>p&&a(m.clientY),onMouseUp:o,onMouseLeave:o,children:V.jsx("div",{style:{width:36,height:4,background:"var(--text-secondary)",opacity:.5,borderRadius:2}})}),V.jsx("div",{style:{padding:"0 20px 16px 20px",display:"flex",alignItems:"center",flexShrink:0},children:V.jsx("h2",{style:{fontSize:18,fontWeight:600,margin:0},children:D})}),V.jsx("div",{style:{flex:1,overflow:"auto",overscrollBehavior:"contain",padding:"0 16px"},children:A}),H&&V.jsx("div",{style:{padding:"12px 20px",borderTop:"1px solid var(--border-color)",flexShrink:0},children:H})]})})}function om({isOpen:_,onClose:C,onConfigSaved:D}){const[A,H]=q.useState("shortcuts"),[N,z]=q.useState([]),[r,u]=q.useState([]),[d,g]=q.useState(""),[l,p]=q.useState(""),[b,w]=q.useState({}),[f,n]=q.useState(!1),[a,o]=q.useState(null),[c,S]=q.useState(!1),x=Ht(M=>M.activeInstanceId),m=We(M=>M.showToast),E=q.useRef(0);function y(){return String(++E.current)}function R(M){return{...M,_id:y()}}q.useEffect(()=>{_&&T()},[_]);const T=async()=>{try{const{config:M}=await j_(x??void 0);if(M){z(M.shortcuts.map(Y=>R(Y))),u(M.commands.map(Y=>R(Y)));const $=M.notifications||{};w($),g("")}else z($_.map($=>R({...$,enabled:!0}))),u(G_.map($=>R({...$,enabled:!0}))),w({}),g("")}catch(M){o("Failed to load configuration"),console.error(M)}},I=async(M,$)=>{const Y=b;w(W=>({...W,[M]:{...W[M],configured:!0,enabled:$}}));const G=M==="dingtalk"?"DingTalk":"WeChat Work";try{await s0(M,$),m(`${G} notifications ${$?"enabled":"disabled"}`)}catch(W){w(Y),console.error("Failed to update channel enabled status:",W),o(`Failed to update ${G.toLowerCase()}`),m(`Failed to update ${G.toLowerCase()}`),setTimeout(()=>o(null),2e3)}},B=async()=>{var M,$;n(!0),o(null),S(!1);try{const Y={shortcuts:N.map(({_id:F,...k})=>k),commands:r.map(({_id:F,...k})=>k)},G={},W=d.trim();if(W){if(!q_.test(W)){o("Please enter a valid DingTalk Webhook URL (starting with https://oapi.dingtalk.com/robot/send?access_token=)"),n(!1);return}G.dingtalk={webhookUrl:W}}const X=l.trim();if(X){if(!W_.test(X)){o("Please enter a valid SendKey (starts with SCT, at least 13 characters)"),n(!1);return}G.wechat_work={sendKey:X}}if(Object.keys(G).length>0&&(Y.notifications=G),await i0(Y,x??void 0)){S(!0);const F={...b};W&&(F.dingtalk={...b==null?void 0:b.dingtalk,configured:!0,enabled:(M=b==null?void 0:b.dingtalk)==null?void 0:M.enabled},g("")),X&&(F.wechat_work={...b==null?void 0:b.wechat_work,configured:!0,enabled:($=b==null?void 0:b.wechat_work)==null?void 0:$.enabled},p("")),w(F),D==null||D(),setTimeout(()=>S(!1),2e3)}else o("Failed to save")}catch(Y){o("Failed to save"),console.error(Y)}finally{n(!1)}};return V.jsxs(Rg,{isOpen:_,onClose:C,title:"Settings","data-testid":"settings--modal",footer:V.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:12},children:[V.jsxs("div",{style:{fontSize:13},children:[a&&V.jsx("span",{"data-testid":"settings--message--error",style:{color:"var(--status-error)"},children:a}),c&&V.jsx("span",{"data-testid":"settings--message--success",style:{color:"var(--status-running)"},children:"Saved"})]}),V.jsxs("div",{style:{display:"flex",gap:8},children:[V.jsx("button",{onClick:C,"data-testid":"settings--button--close",style:{padding:"8px 20px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"Cancel"}),V.jsx("button",{onClick:B,disabled:f,"data-testid":"settings--button--save",style:{padding:"8px 20px",borderRadius:6,border:"none",background:f?"var(--bg-tertiary)":"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:f?"default":"pointer",opacity:f?.7:1},children:f?"Saving…":"Save"})]})]}),children:[V.jsx("div",{style:{display:"flex",borderBottom:"1px solid var(--border-color)",margin:"0 -16px",marginBottom:16},children:["shortcuts","commands","notifications"].map(M=>V.jsx("button",{onClick:()=>H(M),"data-testid":`settings--tab--${M}`,style:{flex:1,padding:"12px 16px",border:"none",background:"transparent",color:A===M?"var(--text-primary)":"var(--text-secondary)",borderBottom:A===M?"2px solid var(--status-running)":"2px solid transparent",cursor:"pointer",fontSize:14,fontWeight:A===M?600:400},children:M==="shortcuts"?"Shortcuts":M==="commands"?"Commands":"Notifications"},M))}),A==="shortcuts"?V.jsx(Z1,{shortcuts:N,onChange:z}):A==="commands"?V.jsx(em,{commands:r,onChange:u}):V.jsx(rm,{notificationStatus:b,dingtalkWebhookUrl:d,onDingtalkWebhookChange:g,wechatWorkSendKey:l,onWechatWorkSendKeyChange:p,onChannelEnabledChange:I})]})}const lm={idle:{color:"var(--status-idle)",label:"Idle"},running:{color:"var(--status-running)",label:"Running"},waiting_input:{color:"var(--status-waiting)",label:"Waiting Input"}},cm={connecting:{color:"var(--status-waiting)",label:"Connecting..."},connected:{color:"var(--status-idle)",label:"Connected"},disconnected:{color:"var(--status-error)",label:"Disconnected"}};function um(){const[_,C]=q.useState(!1),D=We(r=>r.sessionStatus),A=Ht(r=>r.activeInstanceId),H=We(r=>A?r.instanceConnectionStatus[A]??"disconnected":r.connectionStatus),N=lm[D],z=cm[H];return V.jsxs(V.Fragment,{children:[V.jsxs("div",{"data-testid":"status-bar",style:{height:"var(--statusbar-height)",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color)",display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px",paddingTop:"var(--safe-top)",flexShrink:0},children:[V.jsx("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0,overflow:"hidden",flex:"1 1 auto"},children:V.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:"Claude Remote"})}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:12},children:[V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[V.jsx("span",{"data-testid":`status--indicator--${D}`,style:{width:8,height:8,borderRadius:"50%",background:N.color,display:"inline-block"}}),V.jsx("span",{"data-testid":"status--label--session",style:{fontSize:12,color:"var(--text-secondary)"},children:N.label})]}),V.jsxs("div",{style:{display:"flex",alignItems:"center",gap:6},children:[V.jsx("span",{"data-testid":`status--indicator--${H}`,style:{width:8,height:8,borderRadius:"50%",background:z.color,display:"inline-block"}}),V.jsx("span",{"data-testid":"status--label--connection",style:{fontSize:12,color:"var(--text-secondary)"},children:z.label})]}),V.jsx("button",{onClick:()=>C(!0),"aria-label":"Settings","data-testid":"status--button--settings",style:{width:44,height:44,marginRight:-12,borderRadius:8,border:"none",background:"transparent",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:22},children:"⚙"})]})]}),V.jsx(om,{isOpen:_,onClose:()=>C(!1),onConfigSaved:V_})]})}function hm({containerRef:_,onFocusInput:C}){const D=()=>{C==null||C()};return V.jsx("div",{ref:_,onClick:D,"data-testid":"terminal--container",style:{flex:1,overflow:"hidden",background:"var(--bg-primary)"}})}const dm=q.forwardRef(function({onSend:C,disabled:D,isKeyboardOpen:A},H){const[N,z]=q.useState(""),r=q.useRef(null);q.useImperativeHandle(H,()=>({setText:g=>{z(g)},focus:()=>{var g;return(g=r.current)==null?void 0:g.focus()}}),[]);const u=q.useCallback(()=>{const g=N.trim();C(g),z("")},[N,C]),d=q.useCallback(g=>{g.key==="Enter"&&!g.shiftKey&&(g.preventDefault(),u())},[u]);return V.jsx("div",{"data-testid":"console--input-bar",style:{height:"var(--inputbar-height)",background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color)",display:"flex",alignItems:"center",padding:"8px 12px",paddingBottom:A?"8px":"calc(8px + var(--safe-bottom))",transition:"padding-bottom 0.25s ease-out",gap:8,flexShrink:0},children:V.jsx("textarea",{ref:r,"data-testid":"console--input--command",value:N,onChange:g=>z(g.target.value),onKeyDown:d,disabled:D,autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Enter command or number to select…","aria-label":"Command input",style:Lr({flex:1,height:40,borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:16,fontFamily:"inherit"})})})}),Ag={height:36,borderRadius:6,border:"none",background:"var(--bg-tertiary)",fontFamily:"var(--font-mono)",fontWeight:500,cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},fm={...Ag,minWidth:44,flexShrink:0,color:"var(--text-primary)",fontSize:13,padding:"0 12px"},_m={...Ag,minWidth:60,flexShrink:0,color:"var(--text-secondary)",fontSize:12,whiteSpace:"nowrap",padding:"0 12px"};function eo(){document.activeElement instanceof HTMLElement&&document.activeElement.blur()}function Oc(_,C,D){_.preventDefault(),document.activeElement instanceof HTMLElement&&document.activeElement.blur(),C(D);const A=()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()};requestAnimationFrame(A),setTimeout(A,0)}function gm({onShortcut:_,onCommandSelect:C,onCommandSend:D,visible:A=!0}){const{shortcuts:H,commands:N,isLoading:z}=h0();return!A||z?null:V.jsxs("div",{"data-testid":"console--command-picker",style:{background:"var(--bg-secondary)",borderTop:"1px solid var(--border-color)",flexShrink:0},children:[V.jsx("div",{"data-testid":"console--shortcut-bar","data-scrollable":!0,style:{height:"var(--keybar-height)",display:"flex",alignItems:"center",padding:"6px 12px",gap:6,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:H.map(r=>V.jsx("button",{type:"button","data-testid":`console--button--shortcut-${r.label.toLowerCase().replace(/\s+/g,"-")}`,className:"cmd-picker-btn",onClick:u=>Oc(u,_,r.data),onTouchStart:eo,onMouseDown:u=>{u.preventDefault(),eo()},style:fm,children:r.label},r.label))}),V.jsx("div",{"data-testid":"console--command-buttons","data-scrollable":!0,style:{height:"var(--keybar-height)",display:"flex",alignItems:"center",padding:"6px 12px",gap:6,overflowX:"auto",WebkitOverflowScrolling:"touch",scrollbarWidth:"none",msOverflowStyle:"none"},children:N.map(r=>{const u=r.autoSend??!0;return V.jsx("button",{type:"button","data-testid":`console--button--command-${r.label.toLowerCase().replace(/\s+/g,"-")}`,className:"cmd-picker-btn",onClick:d=>{u?Oc(d,D,r.command):Oc(d,C,r.command+" ")},onTouchStart:eo,onMouseDown:d=>{d.preventDefault(),eo()},style:_m,children:r.label},r.label)})}),V.jsx("style",{children:`
54
- [data-scrollable]::-webkit-scrollbar {
55
- display: none;
56
- }
57
- @media (prefers-reduced-motion: no-preference) {
58
- .cmd-picker-btn:hover {
59
- filter: brightness(1.2);
60
- }
61
- .cmd-picker-btn:active {
62
- transform: scale(0.95);
63
- filter: brightness(0.9);
64
- }
65
- }
66
- @media (prefers-reduced-motion: reduce) {
67
- .cmd-picker-btn:hover {
68
- filter: brightness(1.2);
69
- }
70
- .cmd-picker-btn:active {
71
- filter: brightness(0.9);
72
- }
73
- }
74
- `})]})}function vm(){const _=Ht(H=>H.activeInstanceId),C=Ht(H=>H.instances),D=We(H=>H.serverAvailable),A=We(H=>_?H.instanceConnectionStatus[_]??"disconnected":H.connectionStatus);return D===!0&&C.length===0?V.jsx("div",{"data-testid":"connection--banner","data-connection-status":"no-instances",style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:"var(--status-waiting)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:"No instances available"}):D===!1?V.jsx("div",{"data-testid":"connection--banner","data-connection-status":"unavailable",style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:"var(--status-error)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:"Server unavailable"}):A==="connected"?null:V.jsx("div",{"data-testid":"connection--banner","data-connection-status":A,style:{position:"fixed",top:"calc(var(--statusbar-height) + var(--safe-top))",left:0,right:0,zIndex:50,background:A==="connecting"?"var(--status-waiting)":"var(--status-error)",color:"#fff",textAlign:"center",padding:"6px 16px",fontSize:13,fontWeight:500},children:A==="connecting"?"Connecting…":"Disconnected. Reconnecting…"})}function pm(){const _=We(N=>N.ipChangeInfo),C=We(N=>N.setIpChangeInfo),D=We(N=>N.showToast);if(!_)return null;const A=()=>{navigator.clipboard.writeText(_.newUrl),C(null),D("URL copied to clipboard")},H=()=>{C(null)};return V.jsxs("div",{role:"alert","aria-live":"polite",style:{position:"fixed",top:"calc(var(--safe-top) + 8px)",left:"50%",transform:"translateX(-50%)",zIndex:100,maxWidth:"calc(100% - 32px)",background:"var(--status-waiting)",color:"#fff",borderRadius:"8px",padding:"12px 16px",fontSize:"14px",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",display:"flex",flexDirection:"column",gap:"8px"},children:[V.jsx("div",{style:{fontWeight:500},children:"IP Address Changed"}),V.jsxs("div",{style:{fontSize:"13px",opacity:.9},children:[_.oldIp," → ",_.newIp]}),V.jsxs("div",{style:{display:"flex",gap:"8px",marginTop:"4px"},children:[V.jsx("button",{onClick:A,style:{flex:1,background:"rgba(255,255,255,0.2)",border:"none",color:"#fff",padding:"8px 12px",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"Copy New URL"}),V.jsx("button",{onClick:H,style:{background:"transparent",border:"1px solid rgba(255,255,255,0.3)",color:"#fff",padding:"8px 12px",borderRadius:"4px",cursor:"pointer",fontSize:"13px"},children:"Close"})]})]})}async function $c(){const _=await fetch("/api/instances",{credentials:"include"});if(_.status===401){const C=Mn();if(console.log("[fetchInstances] got 401, cachedToken =",C?"exists":"null"),C)try{console.log("[fetchInstances] attempting re-authentication...");const D=await xs(C);if(console.log("[fetchInstances] re-auth result:",D),D){const A=await fetch("/api/instances",{credentials:"include"});if(A.ok)return console.log("[fetchInstances] retry succeeded"),A.json()}}catch(D){console.log("[fetchInstances] re-auth error:",D)}throw new Error("Unauthorized")}if(!_.ok)throw new Error(`Failed to fetch instances: ${_.status}`);return _.json()}function mm(_){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws/${_}`}async function Dg(_,C){const D=await fetch(_,C);if(D.status===401){const A=Mn();if(A)try{if(await xs(A))return fetch(_,C)}catch{}}return D}async function bm(){const _=await Dg("/api/instances/config",{credentials:"include"});if(_.status===401)throw new Error("Unauthorized");if(!_.ok)throw new Error(`Failed to get instance config: ${_.status}`);return _.json()}async function Sm(_){const C=await Dg("/api/instances/create",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(_)});if(C.status===401)throw new Error("Unauthorized");if(!C.ok){const D=await C.json().catch(()=>({error:"Unknown error"}));throw new Error(D.error||`Failed to create instance: ${C.status}`)}return C.json()}const ym=100,Cm=300;var z_;const to=typeof window<"u"&&((z_=window.matchMedia)==null?void 0:z_.call(window,"(prefers-reduced-motion: reduce)").matches),Bc=300;function S_({options:_,value:C,onChange:D,placeholder:A="Select…",disabled:H=!1,id:N,emptyMessage:z="No options available",triggerIcon:r,getDisplayLabel:u}){const[d,g]=q.useState(!1),[l,p]=q.useState(!1),[b,w]=q.useState(-1),[f,n]=q.useState(0),[a,o]=q.useState(!1),c=q.useRef(null),S=q.useRef(0),x=q.useRef(0),m=q.useMemo(()=>_.find(W=>W.value===C)??null,[_,C]),E=q.useMemo(()=>u?u(C):(m==null?void 0:m.label)||A,[u,C,m,A]),y=q.useCallback(()=>{H||_.length===0||(g(!0),w(-1))},[H,_.length]),R=q.useCallback(()=>{p(!1),n(0),to?g(!1):setTimeout(()=>g(!1),Bc)},[]),T=q.useCallback(W=>{o(!0),S.current=W,x.current=Date.now(),n(0)},[]),I=q.useCallback(W=>{if(!a)return;const X=W-S.current;X>0&&n(X)},[a]),B=q.useCallback(()=>{if(!a)return;const W=f,X=Date.now()-x.current,O=X>0?W/(X/1e3):0;W>ym||W>50&&O>Cm||W<5?R():n(0),o(!1)},[a,f,R]),M=q.useCallback(W=>{D(W.value),R()},[D,R]);if(q.useEffect(()=>{if(d){const W=setTimeout(()=>{p(!0)},to?0:10);return()=>clearTimeout(W)}},[d]),q.useCallback(W=>{const X=_.length;switch(W.key){case"ArrowDown":W.preventDefault(),w(O=>O<X-1?O+1:0);break;case"ArrowUp":W.preventDefault(),w(O=>O>0?O-1:X-1);break;case"Enter":W.preventDefault(),b>=0&&b<X&&M(_[b]);break;case"Escape":W.preventDefault(),R();break}},[_,b,M,R]),_.length===0)return V.jsx("div",{style:Bt.emptyState,children:z});const $=to||a?"none":`transform ${Bc}ms ease-out`,Y=to?"none":`background ${Bc}ms ease-out`,G=a?`translateY(${f}px)`:l?"translateY(0)":"translateY(100%)";return V.jsxs(V.Fragment,{children:[V.jsxs("button",{ref:c,type:"button",onClick:y,onTouchStart:()=>{document.activeElement instanceof HTMLElement&&document.activeElement.blur()},disabled:H,id:N,style:{...Bt.trigger,...H?Bt.triggerDisabled:{}},"aria-haspopup":"listbox","aria-expanded":d,children:[r,V.jsx("span",{style:Bt.triggerText,children:E}),V.jsx("span",{style:Bt.triggerArrow,children:"▼"})]}),d&&V.jsx("div",{onClick:R,style:{...Bt.overlay,background:l?"rgba(0, 0, 0, 0.5)":"rgba(0, 0, 0, 0)",transition:Y},children:V.jsxs("div",{"data-testid":"common--action-sheet",onClick:W=>W.stopPropagation(),style:{...Bt.sheet,transform:G,transition:$},children:[V.jsx("div",{"data-testid":"common--drag-handle",style:Bt.handle,onTouchStart:W=>T(W.touches[0].clientY),onTouchMove:W=>I(W.touches[0].clientY),onTouchEnd:B,onMouseDown:W=>T(W.clientY),onMouseMove:W=>a&&I(W.clientY),onMouseUp:B,onMouseLeave:B}),V.jsx("div",{style:Bt.listContainer,role:"listbox",children:_.length===0?V.jsx("div",{style:Bt.emptyList,children:z}):_.map((W,X)=>V.jsxs("div",{role:"option","aria-selected":b===X,onClick:()=>M(W),onMouseEnter:()=>w(X),style:{...Bt.option,...b===X?Bt.optionHighlighted:{},...C===W.value?Bt.optionSelected:{}},children:[W.icon,V.jsxs("span",{style:Bt.optionLabel,children:[W.label,W.description&&V.jsxs("span",{style:Bt.optionDescriptionInline,children:[" (",W.description,")"]})]}),C===W.value&&V.jsx(wm,{})]},X))})]})})]})}function wm(){return V.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:Bt.checkIcon,children:V.jsx("path",{d:"M3 8L6.5 11.5L13 5",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}const Bt={emptyState:{padding:"10px 12px",borderRadius:8,background:"var(--bg-tertiary)",color:"var(--text-secondary)",fontSize:13},trigger:{width:"100%",padding:"10px 12px",borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer",display:"flex",alignItems:"center",gap:8,textAlign:"left",boxSizing:"border-box",transition:"border-color 0.15s ease"},triggerDisabled:{opacity:.6,cursor:"not-allowed"},triggerText:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",fontFamily:"var(--font-mono)"},triggerArrow:{fontSize:10,color:"var(--text-secondary)",marginLeft:"auto"},overlay:{position:"fixed",top:0,left:0,right:0,bottom:0,display:"flex",alignItems:"flex-end",justifyContent:"center",zIndex:1100},sheet:{width:"100%",maxWidth:480,maxHeight:"calc(80vh - env(safe-area-inset-bottom, 0px))",borderRadius:"16px 16px 0 0",background:"var(--bg-secondary)",boxShadow:"0 -4px 24px rgba(0, 0, 0, 0.3)",display:"flex",flexDirection:"column",overflow:"hidden",paddingBottom:"var(--safe-bottom)"},handle:{width:36,height:4,background:"var(--text-secondary)",opacity:.5,borderRadius:2,margin:"12px auto",flexShrink:0},listContainer:{flex:"1 1 auto",overflow:"auto",overscrollBehavior:"contain",WebkitOverflowScrolling:"touch",padding:"8px 0"},emptyList:{padding:"32px 16px",textAlign:"center",color:"var(--text-secondary)",fontSize:14},option:{display:"flex",alignItems:"center",gap:10,padding:"10px 16px",cursor:"pointer",transition:"background-color 0.1s ease"},optionHighlighted:{background:"rgba(88, 166, 255, 0.15)"},optionSelected:{background:"rgba(88, 166, 255, 0.08)"},optionLabel:{flex:1,minWidth:0,color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:14,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},optionDescriptionInline:{color:"var(--text-secondary)",fontSize:12},checkIcon:{marginLeft:"auto",flexShrink:0,color:"var(--status-running)"}};var I_;const xm=typeof window<"u"&&((I_=window.matchMedia)==null?void 0:I_.call(window,"(prefers-reduced-motion: reduce)").matches);function y_({options:_,value:C,onChange:D,disabled:A=!1,"aria-label":H}){const N=q.useRef(null),z=q.useRef([]),[r,u]=q.useState({}),d=_.findIndex(b=>b.value===C);q.useEffect(()=>{const b=N.current,w=z.current[d],f=()=>{if(w&&b){const n=b.getBoundingClientRect(),a=w.getBoundingClientRect(),o=a.left-n.left+b.scrollLeft-3,c=a.width;u({transform:`translateX(${o}px)`,width:`${c}px`})}};return f(),b==null||b.addEventListener("scroll",f),()=>{b==null||b.removeEventListener("scroll",f)}},[d,_]);const g=b=>{A||D(b)},l=(b,w)=>{var n;if(A)return;let f=w;switch(b.key){case"ArrowLeft":b.preventDefault(),f=w>0?w-1:_.length-1;break;case"ArrowRight":b.preventDefault(),f=w<_.length-1?w+1:0;break;case"Home":b.preventDefault(),f=0;break;case"End":b.preventDefault(),f=_.length-1;break;default:return}D(_[f].value),(n=z.current[f])==null||n.focus()},p={role:"radiogroup","aria-label":H};return V.jsxs("div",{ref:N,style:{...pi.container,...A?pi.containerDisabled:{}},...p,children:[V.jsx("div",{style:{...pi.indicator,...r,...xm?{}:pi.indicatorAnimated,...d===-1?pi.indicatorHidden:{}},"aria-hidden":"true"}),_.map((b,w)=>{const f=w===d;return V.jsxs("button",{ref:n=>{z.current[w]=n},type:"button",role:"radio",title:b.title,"aria-checked":f,disabled:A,onClick:()=>g(b.value),onKeyDown:n=>l(n,w),style:{...pi.option,...f?pi.optionSelected:{}},children:[b.icon&&V.jsx("span",{style:pi.icon,children:b.icon}),V.jsx("span",{style:pi.labelWrapper,children:V.jsx("span",{style:pi.label,children:b.label})}),b.description&&V.jsx("span",{style:pi.descriptionWrapper,children:V.jsx("span",{style:pi.description,children:b.description})})]},String(b.value))})]})}const pi={container:{display:"flex",width:"100%",maxWidth:"100%",overflowX:"auto",background:"var(--bg-tertiary)",borderRadius:10,padding:3,position:"relative",gap:2,scrollbarWidth:"none",msOverflowStyle:"none"},containerDisabled:{opacity:.6,cursor:"not-allowed"},indicator:{position:"absolute",top:3,bottom:3,background:"var(--status-running)",borderRadius:7,boxShadow:"0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15)",zIndex:0},indicatorAnimated:{transition:"transform 0.2s ease, width 0.2s ease"},indicatorHidden:{opacity:0},option:{flex:1,flexShrink:1,minWidth:0,minHeight:44,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"relative",zIndex:1,color:"var(--text-secondary)",background:"transparent",border:"none",borderRadius:7,padding:"6px 8px",cursor:"pointer",transition:"color 0.15s ease",fontFamily:"var(--font-sans)",fontSize:14,lineHeight:1.2,overflow:"visible"},optionSelected:{color:"#fff",fontWeight:500},icon:{display:"flex",alignItems:"center",justifyContent:"center",marginBottom:2,flexShrink:0},labelWrapper:{textAlign:"center",maxWidth:"100%"},label:{whiteSpace:"nowrap"},descriptionWrapper:{textAlign:"center",maxWidth:"100%"},description:{fontSize:11,opacity:.8,marginTop:1,whiteSpace:"nowrap"}};function C_(_){const C=_.split("/").filter(Boolean);return C[C.length-1]||_}function Em(_){const C=_.split("/").filter(Boolean);return C.length<=1?_:".../"+C[C.length-2]}function w_(){return V.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:[V.jsx("path",{d:"M2 4C2 3.44772 2.44772 3 3 3H6.17157C6.43678 3 6.69114 3.10536 6.87868 3.29289L7.58579 4H13C13.5523 4 14 4.44772 14 5V12C14 12.5523 13.5523 13 13 13H3C2.44772 13 2 12.5523 2 12V4Z",fill:"currentColor",opacity:"0.6"}),V.jsx("path",{d:"M2 5.5V12C2 12.5523 2.44772 13 3 13H13C13.5523 13 14 12.5523 14 12V5.5C14 5.22386 13.7761 5 13.5 5H2.5C2.22386 5 2 5.22386 2 5.5Z",fill:"currentColor"})]})}function x_(){return V.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:[V.jsx("path",{d:"M8 10C9.10457 10 10 9.10457 10 8C10 6.89543 9.10457 6 8 6C6.89543 6 6 6.89543 6 8C6 9.10457 6.89543 10 8 10Z",stroke:"currentColor",strokeWidth:"1.5",fill:"none"}),V.jsx("path",{d:"M12.9247 8.99999C12.9692 8.66999 13 8.33749 13 7.99999C13 7.66249 12.9692 7.32999 12.9247 6.99999L14.3622 5.91249C14.4872 5.81249 14.5197 5.63749 14.4372 5.48749L13.0622 3.01249C12.9797 2.86249 12.8122 2.81249 12.6622 2.86249L10.9247 3.51249C10.4247 3.13749 9.87468 2.82499 9.28718 2.58749L9.01218 0.787487C8.98718 0.624987 8.84968 0.499987 8.68718 0.499987H5.93718C5.77468 0.499987 5.63718 0.624987 5.61218 0.787487L5.33718 2.58749C4.74968 2.82499 4.19968 3.14999 3.69968 3.51249L1.96218 2.86249C1.81218 2.81249 1.64468 2.86249 1.56218 3.01249L0.187178 5.49999C0.099678 5.64999 0.137178 5.82499 0.262178 5.92499L1.69968 6.99999C1.65518 7.32999 1.62468 7.66249 1.62468 7.99999C1.62468 8.33749 1.65518 8.66999 1.69968 8.99999L0.262178 10.0875C0.137178 10.1875 0.104678 10.3625 0.187178 10.5125L1.56218 12.9875C1.64468 13.1375 1.81218 13.1875 1.96218 13.1375L3.69968 12.4875C4.19968 12.8625 4.74968 13.175 5.33718 13.4125L5.61218 15.2125C5.63718 15.375 5.77468 15.5 5.93718 15.5H8.68718C8.84968 15.5 8.98718 15.375 9.01218 15.2125L9.28718 13.4125C9.87468 13.175 10.4247 12.85 10.9247 12.4875L12.6622 13.1375C12.8122 13.1875 12.9797 13.1375 13.0622 12.9875L14.4372 10.5C14.5197 10.35 14.4872 10.175 14.3622 10.075L12.9247 8.99999ZM8 10.5C6.62468 10.5 5.49968 9.37499 5.49968 7.99999C5.49968 6.62499 6.62468 5.49999 8 5.49999C9.37532 5.49999 10.5003 6.62499 10.5003 7.99999C10.5003 9.37499 9.37532 10.5 8 10.5Z",fill:"currentColor",opacity:"0.8"})]})}function Rm(){return V.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",style:{flexShrink:0,color:"var(--text-secondary)"},children:V.jsx("path",{d:"M3 8H13",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",opacity:"0.5"})})}function Am({isOpen:_,onClose:C,onSuccess:D,copySource:A}){const[H,N]=q.useState(null),[z,r]=q.useState(""),[u,d]=q.useState(""),[g,l]=q.useState(""),[p,b]=q.useState(""),[w,f]=q.useState(!1),[n,a]=q.useState(null),o=q.useRef(null),c=We(M=>M.showToast),S=q.useMemo(()=>H?H.workspaces.map(M=>({value:M,label:C_(M),description:Em(M),icon:V.jsx(w_,{})})):[],[H]),x=q.useMemo(()=>H?H.workspaces.map(M=>({value:M,label:C_(M)})):[],[H]),m=H?H.workspaces.length<=4:!1,E=q.useMemo(()=>{if(!H)return[];const M=[{value:"",label:"None",title:"No settings file"}];return H.settingsFiles.forEach($=>{M.push({value:$.filename,label:$.displayName,title:`${$.directoryPath}/${$.filename}`})}),M},[H]),y=H?H.settingsFiles.length+1<=4:!1,R=q.useMemo(()=>{if(!H)return[];const M=[{value:"",label:"None",icon:V.jsx(Rm,{})}];return H.settingsFiles.forEach($=>{M.push({value:$.filename,label:$.displayName,description:$.directory,icon:V.jsx(x_,{})})}),M},[H]);q.useEffect(()=>{if(_&&(T(!!A),r(""),d(""),l(""),b(""),a(null),o.current=null,A&&(r(A.cwd),d(`${A.name}-copy`),A.claudeArgs&&A.claudeArgs.length>0))){const M=[...A.claudeArgs],$=M.indexOf("--settings");$!==-1&&$+1<M.length&&(o.current=M[$+1],M.splice($,2)),b(M.join(" "))}},[_,A]),q.useEffect(()=>{if(H&&o.current){const M=H.settingsFiles.find($=>`${$.directoryPath}/${$.filename}`===o.current);M&&l(M.filename),o.current=null}},[H]),q.useEffect(()=>{H&&H.workspaces.length===1&&!z&&r(H.workspaces[0])},[H,z]);const T=async M=>{try{const $=await bm();N($),!M&&$.claudeArgs.length>0&&b($.claudeArgs.join(" "))}catch($){console.error("Failed to load instance config:",$),a("Failed to load configuration")}},I=async()=>{if(!z){a("Please select a working directory");return}f(!0),a(null),c(A?"Copying instance…":"Creating instance…");try{const M=[];if(g&&H){const Y=H.settingsFiles.find(G=>G.filename===g);Y&&M.push("--settings",`${Y.directoryPath}/${Y.filename}`)}p.trim()&&M.push(...p.trim().split(/\s+/).filter(Boolean)),await Sm({cwd:z,name:u.trim()||void 0,claudeArgs:M.length>0?M:void 0});const $=u.trim()||z.split("/").pop()||"unknown";c("Instance created, starting…"),D($),C()}catch(M){console.error("Failed to create instance:",M),a(M instanceof Error?M.message:"Failed to create instance")}finally{f(!1)}},B=H&&H.workspaces.length>0;return V.jsx(Rg,{isOpen:_,onClose:C,title:A?"Copy Instance":"Create New Instance","data-testid":"instance--modal--create",footer:V.jsxs("div",{style:{display:"flex",justifyContent:"flex-end",alignItems:"center",gap:8},children:[V.jsx("button",{onClick:C,"data-testid":"instance--button--cancel",style:{padding:"8px 20px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:14,cursor:"pointer"},children:"Cancel"}),V.jsx("button",{onClick:I,disabled:w||!B,"data-testid":"instance--button--submit",style:{padding:"8px 20px",borderRadius:6,border:"none",background:w||!B?"var(--bg-tertiary)":"var(--status-running)",color:"#fff",fontSize:14,fontWeight:600,cursor:w||!B?"default":"pointer",opacity:w||!B?.7:1},children:w?A?"Copying…":"Creating…":A?"Copy":"Create"})]}),children:V.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:16,paddingBottom:16},children:[V.jsxs("div",{children:[V.jsx("label",{htmlFor:"cwd-select",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Working Directory *"}),m?V.jsx(y_,{options:x,value:z,onChange:r,disabled:!B,"aria-label":"Working directory"}):V.jsx(S_,{id:"cwd-select",options:S,value:z||null,onChange:r,placeholder:"Select working directory…",emptyMessage:"No workspaces available",disabled:!B,triggerIcon:V.jsx(w_,{})}),!B&&V.jsx("p",{style:{fontSize:12,color:"var(--text-secondary)",marginTop:6,opacity:.8},children:"Please configure workspaces in the config file first, or start an instance via CLI."})]}),V.jsxs("div",{children:[V.jsx("label",{htmlFor:"instance-name",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Instance Name (optional)"}),V.jsx("textarea",{id:"instance-name",value:u,onChange:M=>d(M.target.value),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"Defaults to working directory name",style:Lr({borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)"})})]}),H&&H.settingsFiles.length>0&&V.jsxs("div",{children:[V.jsx("label",{htmlFor:"settings-select",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Settings File (optional)"}),y?V.jsx(y_,{options:E,value:g,onChange:l,"aria-label":"Settings file"}):V.jsx(S_,{id:"settings-select",options:R,value:g||null,onChange:l,placeholder:"None",triggerIcon:V.jsx(x_,{})}),V.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:4,opacity:.7},children:"Custom Claude settings from ~/.claude/ or ~/.claude-remote/settings/"})]}),V.jsxs("div",{children:[V.jsx("label",{htmlFor:"claude-args",style:{display:"block",fontSize:13,fontWeight:500,marginBottom:6,color:"var(--text-secondary)"},children:"Claude Arguments (optional)"}),V.jsx("textarea",{id:"claude-args",value:p,onChange:M=>b(M.target.value),autoComplete:"off",autoCorrect:"off",autoCapitalize:"off",spellCheck:!1,inputMode:"text",rows:1,placeholder:"e.g., chat --model claude-sonnet-4-6",style:Lr({borderRadius:8,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)"})}),V.jsx("p",{style:{fontSize:11,color:"var(--text-secondary)",marginTop:4,opacity:.7},children:"Multiple arguments separated by spaces (quoted arguments with spaces not supported)"})]}),n&&V.jsx("div",{style:{padding:"10px 12px",borderRadius:8,background:"rgba(255, 59, 48, 0.1)",color:"var(--status-error)",fontSize:13},children:n})]})})}function E_(_,C,D=140,A=44){const H=window.innerWidth-D-8,N=window.innerHeight-A-8;return{x:Math.max(8,Math.min(_,H)),y:Math.max(8,Math.min(C,N))}}function Dm({onSwitch:_,onCopySuccess:C}){const D=Ht(m=>m.instances),A=Ht(m=>m.setInstances),H=Ht(m=>m.activeInstanceId),[N,z]=q.useState(!1),[r,u]=q.useState(null),[d,g]=q.useState(null),[l,p]=q.useState({x:0,y:0}),b=q.useRef(null),w=q.useRef(!1);q.useEffect(()=>{const m=()=>{g(null)};if(d)return document.addEventListener("click",m),()=>document.removeEventListener("click",m)},[d]);const f=(m,E)=>{w.current=!1;const{clientX:y,clientY:R}=E.touches[0];b.current=setTimeout(()=>{w.current=!0,p(E_(y,R)),g(m)},500)},n=()=>{b.current&&(clearTimeout(b.current),b.current=null)},a=q.useCallback(m=>{if(w.current){w.current=!1;return}_(m)},[_]),o=(m,E)=>{E.preventDefault(),p(E_(E.clientX,E.clientY)),g(m)},c=()=>{d&&(u(d),z(!0),g(null))},S=async m=>{for(let y=0;y<5;y++){await new Promise(R=>setTimeout(R,1e3));try{const R=await $c();if([...R].filter(I=>I.name===m).sort((I,B)=>B.startedAt.localeCompare(I.startedAt))[0]){A(R),r&&C&&C(m);return}}catch(R){console.error("[InstanceTabs] Failed to fetch instances:",R)}}try{const y=await $c();A(y)}catch{}},x=()=>{z(!1),u(null)};return V.jsxs(V.Fragment,{children:[V.jsxs("div",{"data-testid":"instance--tabs",style:{display:"flex",background:"var(--bg-secondary)",borderBottom:"1px solid var(--border-color)",flexShrink:0},children:[V.jsx("div",{style:{display:"flex",overflowX:"auto",padding:"0 4px 0 16px",flex:1},children:D.map(m=>{const E=m.instanceId===H;return V.jsxs("button",{"data-testid":E?"instance--tab--active":"instance--tab",onClick:()=>a(m.instanceId),onTouchStart:y=>f(m,y),onTouchEnd:n,onTouchMove:n,onContextMenu:y=>o(m,y),style:{padding:"8px 16px",background:"transparent",border:"none",borderBottom:E?"2px solid var(--accent-color, #007aff)":"2px solid transparent",color:E?"var(--text-primary)":"var(--text-secondary)",fontSize:13,fontWeight:E?600:400,cursor:"pointer",whiteSpace:"nowrap",flexShrink:0},children:[m.name,V.jsxs("span",{style:{marginLeft:6,fontSize:11,color:"var(--text-tertiary, var(--text-secondary))",opacity:.7},children:["#",m.instanceId.substring(0,6)]})]},m.instanceId)})}),V.jsx("button",{onClick:()=>z(!0),"aria-label":"Create new instance","data-testid":"instance--button--create",style:{width:44,height:44,padding:0,background:"transparent",border:"none",borderLeft:"1px solid var(--border-color)",color:"var(--text-secondary)",fontSize:22,fontWeight:600,cursor:"pointer",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:"+"})]}),d&&V.jsx("div",{"data-testid":"instance--context-menu",onClick:m=>m.stopPropagation(),style:{position:"fixed",left:l.x,top:l.y,zIndex:1100,background:"var(--bg-secondary)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.3)",overflow:"hidden",minWidth:140},children:V.jsx("button",{"data-testid":"instance--button--copy",onClick:c,style:{display:"block",width:"100%",padding:"12px 16px",background:"transparent",border:"none",color:"var(--text-primary)",fontSize:14,textAlign:"left",cursor:"pointer"},children:"Copy Instance"})}),V.jsx(Am,{isOpen:N,onClose:x,onSuccess:S,copySource:r})]})}function Lm({visible:_,onClick:C}){const[D,A]=q.useState(!1);q.useEffect(()=>{_&&A(!0)},[_]);const H=()=>{_||A(!1)};return D?V.jsx("button",{className:`scroll-to-bottom-btn ${_?"visible":"hidden"}`,onClick:C,onAnimationEnd:H,"aria-label":"Jump to latest output",children:"↓"}):null}const R_="__default__",A_=[1e3,2e3,4e3,8e3,16e3,3e4],Hc=new Map;function Tm(_,C,D=R_){const A=q.useRef(null),H=q.useRef(0),N=q.useRef(void 0),z=q.useRef(_),r=q.useRef(0),u=q.useRef(!1),d=We(S=>S.setConnectionStatus),g=q.useRef(d),l=We(S=>S.setInstanceConnectionStatus),p=q.useRef(l),b=We(S=>S.showToast),w=q.useCallback(S=>{D===R_&&g.current(S),p.current(D,S)},[D]);q.useEffect(()=>{z.current=_},[_]),q.useEffect(()=>{g.current=d},[d]),q.useEffect(()=>{p.current=l},[l]);const f=q.useRef(void 0),n=q.useCallback(S=>{const x=A_[Math.min(H.current,A_.length-1)];H.current++,N.current=setTimeout(()=>{var m;u.current||S!==r.current||(m=f.current)==null||m.call(f)},x)},[]),a=q.useCallback(async()=>{if(!C){w("disconnected");return}if(A.current&&A.current.readyState===WebSocket.OPEN)return;const S=C;N.current&&(clearTimeout(N.current),N.current=void 0),u.current=!1;const x=++r.current;w("connecting");const m=new WebSocket(S);A.current=m,m.onopen=()=>{u.current||x!==r.current||A.current!==m||(w("connected"),H.current=0,Hc.set(D,!1),m.send(JSON.stringify({type:"activate"})))},m.onmessage=E=>{if(!(u.current||x!==r.current||A.current!==m))try{const y=JSON.parse(E.data);z.current(y)}catch{}},m.onclose=async()=>{if(u.current||x!==r.current||A.current!==m)return;A.current=null,w("disconnected"),Hc.get(D)||(b("Connection lost. Reconnecting…"),Hc.set(D,!0));const E=Mn();if(E)try{await xs(E)}catch{}n(x)},m.onerror=()=>{}},[n,w,C]);q.useEffect(()=>{f.current=a},[a]);const o=q.useCallback(S=>{var x;return((x=A.current)==null?void 0:x.readyState)===WebSocket.OPEN?(A.current.send(JSON.stringify(S)),!0):!1},[]),c=q.useCallback(()=>{u.current=!0,r.current++,N.current&&(clearTimeout(N.current),N.current=void 0);const S=A.current;A.current=null,S==null||S.close()},[]);return q.useEffect(()=>{const S=()=>{var m;(m=A.current)==null||m.close()},x=()=>{var m;document.visibilityState==="visible"&&((m=A.current)==null?void 0:m.readyState)===WebSocket.OPEN&&A.current.send(JSON.stringify({type:"activate"}))};return window.addEventListener("offline",S),document.addEventListener("visibilitychange",x),()=>{u.current=!0,r.current++,window.removeEventListener("offline",S),document.removeEventListener("visibilitychange",x),N.current&&(clearTimeout(N.current),N.current=void 0);const m=A.current;A.current=null,m==null||m.close()}},[]),{connect:a,disconnect:c,send:o}}var zc={exports:{}},D_;function Mm(){return D_||(D_=1,(function(_,C){(function(D,A){_.exports=A()})(globalThis,(()=>(()=>{var D={4567:function(z,r,u){var d=this&&this.__decorate||function(o,c,S,x){var m,E=arguments.length,y=E<3?c:x===null?x=Object.getOwnPropertyDescriptor(c,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(o,c,S,x);else for(var R=o.length-1;R>=0;R--)(m=o[R])&&(y=(E<3?m(y):E>3?m(c,S,y):m(c,S))||y);return E>3&&y&&Object.defineProperty(c,S,y),y},g=this&&this.__param||function(o,c){return function(S,x){c(S,x,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const l=u(9042),p=u(9924),b=u(844),w=u(4725),f=u(2585),n=u(3656);let a=r.AccessibilityManager=class extends b.Disposable{constructor(o,c,S,x){super(),this._terminal=o,this._coreBrowserService=S,this._renderService=x,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let m=0;m<this._terminal.rows;m++)this._rowElements[m]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[m]);if(this._topBoundaryFocusListener=m=>this._handleBoundaryFocus(m,0),this._bottomBoundaryFocusListener=m=>this._handleBoundaryFocus(m,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(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((m=>this._handleResize(m.rows)))),this.register(this._terminal.onRender((m=>this._refreshRows(m.start,m.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((m=>this._handleChar(m)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
75
- `)))),this.register(this._terminal.onA11yTab((m=>this._handleTab(m)))),this.register(this._terminal.onKey((m=>this._handleKey(m.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,n.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(o){for(let c=0;c<o;c++)this._handleChar(" ")}_handleChar(o){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==o&&(this._charsToAnnounce+=o):this._charsToAnnounce+=o,o===`
76
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=l.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(o){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(o)||this._charsToConsume.push(o)}_refreshRows(o,c){this._liveRegionDebouncer.refresh(o,c,this._terminal.rows)}_renderRows(o,c){const S=this._terminal.buffer,x=S.lines.length.toString();for(let m=o;m<=c;m++){const E=S.lines.get(S.ydisp+m),y=[],R=(E==null?void 0:E.translateToString(!0,void 0,void 0,y))||"",T=(S.ydisp+m+1).toString(),I=this._rowElements[m];I&&(R.length===0?(I.innerText=" ",this._rowColumns.set(I,[0,1])):(I.textContent=R,this._rowColumns.set(I,y)),I.setAttribute("aria-posinset",T),I.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(o,c){const S=o.target,x=this._rowElements[c===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(c===0?"1":`${this._terminal.buffer.lines.length}`)||o.relatedTarget!==x)return;let m,E;if(c===0?(m=S,E=this._rowElements.pop(),this._rowContainer.removeChild(E)):(m=this._rowElements.shift(),E=S,this._rowContainer.removeChild(m)),m.removeEventListener("focus",this._topBoundaryFocusListener),E.removeEventListener("focus",this._bottomBoundaryFocusListener),c===0){const y=this._createAccessibilityTreeNode();this._rowElements.unshift(y),this._rowContainer.insertAdjacentElement("afterbegin",y)}else{const y=this._createAccessibilityTreeNode();this._rowElements.push(y),this._rowContainer.appendChild(y)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(c===0?-1:1),this._rowElements[c===0?1:this._rowElements.length-2].focus(),o.preventDefault(),o.stopImmediatePropagation()}_handleSelectionChange(){var R;if(this._rowElements.length===0)return;const o=document.getSelection();if(!o)return;if(o.isCollapsed)return void(this._rowContainer.contains(o.anchorNode)&&this._terminal.clearSelection());if(!o.anchorNode||!o.focusNode)return void console.error("anchorNode and/or focusNode are null");let c={node:o.anchorNode,offset:o.anchorOffset},S={node:o.focusNode,offset:o.focusOffset};if((c.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||c.node===S.node&&c.offset>S.offset)&&([c,S]=[S,c]),c.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(c={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(c.node))return;const x=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:x,offset:((R=x.textContent)==null?void 0:R.length)??0}),!this._rowContainer.contains(S.node))return;const m=({node:T,offset:I})=>{const B=T instanceof Text?T.parentNode:T;let M=parseInt(B==null?void 0:B.getAttribute("aria-posinset"),10)-1;if(isNaN(M))return console.warn("row is invalid. Race condition?"),null;const $=this._rowColumns.get(B);if(!$)return console.warn("columns is null. Race condition?"),null;let Y=I<$.length?$[I]:$.slice(-1)[0]+1;return Y>=this._terminal.cols&&(++M,Y=0),{row:M,column:Y}},E=m(c),y=m(S);if(E&&y){if(E.row>y.row||E.row===y.row&&E.column>=y.column)throw new Error("invalid range");this._terminal.select(E.column,E.row,(y.row-E.row)*this._terminal.cols-E.column+y.column)}}_handleResize(o){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let c=this._rowContainer.children.length;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);for(;this._rowElements.length>o;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const o=this._coreBrowserService.mainDocument.createElement("div");return o.setAttribute("role","listitem"),o.tabIndex=-1,this._refreshRowDimensions(o),o}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let o=0;o<this._terminal.rows;o++)this._refreshRowDimensions(this._rowElements[o])}}_refreshRowDimensions(o){o.style.height=`${this._renderService.dimensions.css.cell.height}px`}};r.AccessibilityManager=a=d([g(1,f.IInstantiationService),g(2,w.ICoreBrowserService),g(3,w.IRenderService)],a)},3614:(z,r)=>{function u(p){return p.replace(/\r?\n/g,"\r")}function d(p,b){return b?"\x1B[200~"+p+"\x1B[201~":p}function g(p,b,w,f){p=d(p=u(p),w.decPrivateModes.bracketedPasteMode&&f.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(p,!0),b.value=""}function l(p,b,w){const f=w.getBoundingClientRect(),n=p.clientX-f.left-10,a=p.clientY-f.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${n}px`,b.style.top=`${a}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=u,r.bracketTextForPaste=d,r.copyHandler=function(p,b){p.clipboardData&&p.clipboardData.setData("text/plain",b.selectionText),p.preventDefault()},r.handlePasteEvent=function(p,b,w,f){p.stopPropagation(),p.clipboardData&&g(p.clipboardData.getData("text/plain"),b,w,f)},r.paste=g,r.moveTextAreaUnderMouseCursor=l,r.rightClickHandler=function(p,b,w,f,n){l(p,b,w),n&&f.rightClickSelect(p),b.value=f.selectionText,b.select()}},7239:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const d=u(1505);r.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(g,l,p){this._css.set(g,l,p)}getCss(g,l){return this._css.get(g,l)}setColor(g,l,p){this._color.set(g,l,p)}getColor(g,l){return this._color.get(g,l)}clear(){this._color.clear(),this._css.clear()}}},3656:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(u,d,g,l){u.addEventListener(d,g,l);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(d,g,l))}}}},3551:function(z,r,u){var d=this&&this.__decorate||function(a,o,c,S){var x,m=arguments.length,E=m<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,c):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,o,c,S);else for(var y=a.length-1;y>=0;y--)(x=a[y])&&(E=(m<3?x(E):m>3?x(o,c,E):x(o,c))||E);return m>3&&E&&Object.defineProperty(o,c,E),E},g=this&&this.__param||function(a,o){return function(c,S){o(c,S,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier=void 0;const l=u(3656),p=u(8460),b=u(844),w=u(2585),f=u(4725);let n=r.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(a,o,c,S,x){super(),this._element=a,this._mouseService=o,this._renderService=c,this._bufferService=S,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var m;this._lastMouseEvent=void 0,(m=this._activeProviderReplies)==null||m.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){this._lastMouseEvent=a;const o=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const c=a.composedPath();for(let S=0;S<c.length;S++){const x=c[S];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,o){var S,x;this._activeProviderReplies&&o||((S=this._activeProviderReplies)==null||S.forEach((m=>{m==null||m.forEach((E=>{E.link.dispose&&E.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=a.y);let c=!1;for(const[m,E]of this._linkProviderService.linkProviders.entries())o?(x=this._activeProviderReplies)!=null&&x.get(m)&&(c=this._checkLinkProviderResult(m,a,c)):E.provideLinks(a.y,(y=>{var T,I;if(this._isMouseOut)return;const R=y==null?void 0:y.map((B=>({link:B})));(T=this._activeProviderReplies)==null||T.set(m,R),c=this._checkLinkProviderResult(m,a,c),((I=this._activeProviderReplies)==null?void 0:I.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)}))}_removeIntersectingLinks(a,o){const c=new Set;for(let S=0;S<o.size;S++){const x=o.get(S);if(x)for(let m=0;m<x.length;m++){const E=x[m],y=E.link.range.start.y<a?0:E.link.range.start.x,R=E.link.range.end.y>a?this._bufferService.cols:E.link.range.end.x;for(let T=y;T<=R;T++){if(c.has(T)){x.splice(m--,1);break}c.add(T)}}}}_checkLinkProviderResult(a,o,c){var m;if(!this._activeProviderReplies)return c;const S=this._activeProviderReplies.get(a);let x=!1;for(let E=0;E<a;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(x=!0);if(!x&&S){const E=S.find((y=>this._linkAtPosition(y.link,o)));E&&(c=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!c)for(let E=0;E<this._activeProviderReplies.size;E++){const y=(m=this._activeProviderReplies.get(E))==null?void 0:m.find((R=>this._linkAtPosition(R.link,o)));if(y){c=!0,this._handleNewLink(y);break}}return c}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const o=this._positionFromMouseEvent(a,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,o){this._currentLink&&this._lastMouseEvent&&(!a||!o||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=o)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(a.link,o)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>{var c,S;return(S=(c=this._currentLink)==null?void 0:c.state)==null?void 0:S.decorations.pointerCursor},set:c=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==c&&(this._currentLink.state.decorations.pointerCursor=c,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",c))}},underline:{get:()=>{var c,S;return(S=(c=this._currentLink)==null?void 0:c.state)==null?void 0:S.decorations.underline},set:c=>{var S,x,m;(S=this._currentLink)!=null&&S.state&&((m=(x=this._currentLink)==null?void 0:x.state)==null?void 0:m.decorations.underline)!==c&&(this._currentLink.state.decorations.underline=c,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,c))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((c=>{if(!this._currentLink)return;const S=c.start===0?0:c.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+c.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(S,x),this._lastMouseEvent)){const m=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);m&&this._askForLink(m,!1)}}))))}_linkHover(a,o,c){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(c,o.text)}_fireUnderlineEvent(a,o){const c=a.range,S=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(c.start.x-1,c.start.y-S-1,c.end.x,c.end.y-S-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(a,o,c){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(c,o.text)}_linkAtPosition(a,o){const c=a.range.start.y*this._bufferService.cols+a.range.start.x,S=a.range.end.y*this._bufferService.cols+a.range.end.x,x=o.y*this._bufferService.cols+o.x;return c<=x&&x<=S}_positionFromMouseEvent(a,o,c){const S=c.getCoords(a,o,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,o,c,S,x){return{x1:a,y1:o,x2:c,y2:S,cols:this._bufferService.cols,fg:x}}};r.Linkifier=n=d([g(1,f.IMouseService),g(2,f.IRenderService),g(3,w.IBufferService),g(4,f.ILinkProviderService)],n)},9042:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(z,r,u){var d=this&&this.__decorate||function(f,n,a,o){var c,S=arguments.length,x=S<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,a):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(f,n,a,o);else for(var m=f.length-1;m>=0;m--)(c=f[m])&&(x=(S<3?c(x):S>3?c(n,a,x):c(n,a))||x);return S>3&&x&&Object.defineProperty(n,a,x),x},g=this&&this.__param||function(f,n){return function(a,o){n(a,o,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const l=u(511),p=u(2585);let b=r.OscLinkProvider=class{constructor(f,n,a){this._bufferService=f,this._optionsService=n,this._oscLinkService=a}provideLinks(f,n){var R;const a=this._bufferService.buffer.lines.get(f-1);if(!a)return void n(void 0);const o=[],c=this._optionsService.rawOptions.linkHandler,S=new l.CellData,x=a.getTrimmedLength();let m=-1,E=-1,y=!1;for(let T=0;T<x;T++)if(E!==-1||a.hasContent(T)){if(a.loadCell(T,S),S.hasExtendedAttrs()&&S.extended.urlId){if(E===-1){E=T,m=S.extended.urlId;continue}y=S.extended.urlId!==m}else E!==-1&&(y=!0);if(y||E!==-1&&T===x-1){const I=(R=this._oscLinkService.getLinkData(m))==null?void 0:R.uri;if(I){const B={start:{x:E+1,y:f},end:{x:T+(y||T!==x-1?0:1),y:f}};let M=!1;if(!(c!=null&&c.allowNonHttpProtocols))try{const $=new URL(I);["http:","https:"].includes($.protocol)||(M=!0)}catch{M=!0}M||o.push({text:I,range:B,activate:($,Y)=>c?c.activate($,Y,B):w(0,Y),hover:($,Y)=>{var G;return(G=c==null?void 0:c.hover)==null?void 0:G.call(c,$,Y,B)},leave:($,Y)=>{var G;return(G=c==null?void 0:c.leave)==null?void 0:G.call(c,$,Y,B)}})}y=!1,S.hasExtendedAttrs()&&S.extended.urlId?(E=T,m=S.extended.urlId):(E=-1,m=-1)}}n(o)}};function w(f,n){if(confirm(`Do you want to navigate to ${n}?
77
-
78
- WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=n}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=b=d([g(0,p.IBufferService),g(1,p.IOptionsService),g(2,p.IOscLinkService)],b)},6193:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,d,g){this._rowCount=g,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d,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)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const d=u(3614),g=u(3656),l=u(3551),p=u(9042),b=u(3730),w=u(1680),f=u(3107),n=u(5744),a=u(2950),o=u(1296),c=u(428),S=u(4269),x=u(5114),m=u(8934),E=u(3230),y=u(9312),R=u(4725),T=u(6731),I=u(8055),B=u(8969),M=u(8460),$=u(844),Y=u(6114),G=u(8437),W=u(2584),X=u(7399),O=u(5941),F=u(9074),k=u(2585),P=u(5435),Q=u(4567),ee=u(779);class he extends B.CoreTerminal{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}constructor(K={}){super(K),this.browser=Y,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new $.MutableDisposable),this._onCursorMove=this.register(new M.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new M.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new M.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new M.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new M.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new M.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new M.EventEmitter),this._onBlur=this.register(new M.EventEmitter),this._onA11yCharEmitter=this.register(new M.EventEmitter),this._onA11yTabEmitter=this.register(new M.EventEmitter),this._onWillOpen=this.register(new M.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(F.DecorationService),this._instantiationService.setService(k.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ee.LinkProviderService),this._instantiationService.setService(R.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((U,ne)=>this.refresh(U,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((U=>this._reportWindowsOptions(U)))),this.register(this._inputHandler.onColor((U=>this._handleColorEvent(U)))),this.register((0,M.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,M.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,M.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((U=>this._afterResize(U.cols,U.rows)))),this.register((0,$.toDisposable)((()=>{var U,ne;this._customKeyEventHandler=void 0,(ne=(U=this.element)==null?void 0:U.parentNode)==null||ne.removeChild(this.element)})))}_handleColorEvent(K){if(this._themeService)for(const U of K){let ne,te="";switch(U.index){case 256:ne="foreground",te="10";break;case 257:ne="background",te="11";break;case 258:ne="cursor",te="12";break;default:ne="ansi",te="4;"+U.index}switch(U.type){case 0:const _e=I.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[U.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${te};${(0,O.toRgbString)(_e)}${W.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((fe=>fe.ansi[U.index]=I.channels.toColor(...U.color)));else{const fe=ne;this._themeService.modifyColors((be=>be[fe]=I.channels.toColor(...U.color)))}break;case 2:this._themeService.restoreColor(U.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Q.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)==null?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const K=this.buffer.ybase+this.buffer.y,U=this.buffer.lines.get(K);if(!U)return;const ne=Math.min(this.buffer.x,this.cols-1),te=this._renderService.dimensions.css.cell.height,_e=U.getWidth(ne),fe=this._renderService.dimensions.css.cell.width*_e,be=this.buffer.y*this._renderService.dimensions.css.cell.height,ge=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=ge+"px",this.textarea.style.top=be+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=te+"px",this.textarea.style.lineHeight=te+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",(U=>{this.hasSelection()&&(0,d.copyHandler)(U,this._selectionService)})));const K=U=>(0,d.handlePasteEvent)(U,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,g.addDisposableDomListener)(this.element,"paste",K)),Y.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(U=>{U.button===2&&(0,d.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",(U=>{(0,d.rightClickHandler)(U,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),Y.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",(U=>{U.button===1&&(0,d.moveTextAreaUnderMouseCursor)(U,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",(K=>this._keyUp(K)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",(K=>this._keyDown(K)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",(K=>this._keyPress(K)),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",(K=>this._compositionHelper.compositionupdate(K)))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,g.addDisposableDomListener)(this.textarea,"input",(K=>this._inputEvent(K)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(K){var ne;if(!K)throw new Error("Terminal requires a parent element.");if(K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ne=this.element)==null?void 0:ne.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=K.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"),K.appendChild(this.element);const U=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),U.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",(te=>this.updateCursorStyle(te)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),U.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),Y.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(x.CoreBrowserService,this.textarea,K.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(R.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",(te=>this._handleTextAreaFocus(te)))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(R.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(T.ThemeService),this._instantiationService.setService(R.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(R.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(E.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(R.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((te=>this._onRender.fire(te)))),this.onResize((te=>this._renderService.resize(te.cols,te.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(m.MouseService),this._instantiationService.setService(R.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(l.Linkifier,this.screenElement)),this.element.appendChild(U);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((te=>this.scrollLines(te.amount,te.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),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.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(y.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(R.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((te=>this.scrollLines(te.amount,te.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((te=>this._renderService.handleSelectionChanged(te.start,te.end,te.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((te=>{this.textarea.value=te,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((te=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(f.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",(te=>this._selectionService.handleMouseDown(te)))),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(Q.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(te=>this._handleScreenReaderModeOptionChange(te)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(te=>{!this._overviewRulerRenderer&&te&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(n.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(o.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const K=this,U=this.element;function ne(fe){const be=K._mouseService.getMouseReportCoords(fe,K.screenElement);if(!be)return!1;let ge,Te;switch(fe.overrideType||fe.type){case"mousemove":Te=32,fe.buttons===void 0?(ge=3,fe.button!==void 0&&(ge=fe.button<3?fe.button:3)):ge=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Te=0,ge=fe.button<3?fe.button:3;break;case"mousedown":Te=1,ge=fe.button<3?fe.button:3;break;case"wheel":if(K._customWheelEventHandler&&K._customWheelEventHandler(fe)===!1||K.viewport.getLinesScrolled(fe)===0)return!1;Te=fe.deltaY<0?0:1,ge=4;break;default:return!1}return!(Te===void 0||ge===void 0||ge>4)&&K.coreMouseService.triggerMouseEvent({col:be.col,row:be.row,x:be.x,y:be.y,button:ge,action:Te,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const te={mouseup:null,wheel:null,mousedrag:null,mousemove:null},_e={mouseup:fe=>(ne(fe),fe.buttons||(this._document.removeEventListener("mouseup",te.mouseup),te.mousedrag&&this._document.removeEventListener("mousemove",te.mousedrag)),this.cancel(fe)),wheel:fe=>(ne(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&ne(fe)},mousemove:fe=>{fe.buttons||ne(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),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()),8&fe?te.mousemove||(U.addEventListener("mousemove",_e.mousemove),te.mousemove=_e.mousemove):(U.removeEventListener("mousemove",te.mousemove),te.mousemove=null),16&fe?te.wheel||(U.addEventListener("wheel",_e.wheel,{passive:!1}),te.wheel=_e.wheel):(U.removeEventListener("wheel",te.wheel),te.wheel=null),2&fe?te.mouseup||(te.mouseup=_e.mouseup):(this._document.removeEventListener("mouseup",te.mouseup),te.mouseup=null),4&fe?te.mousedrag||(te.mousedrag=_e.mousedrag):(this._document.removeEventListener("mousemove",te.mousedrag),te.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(U,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return ne(fe),te.mouseup&&this._document.addEventListener("mouseup",te.mouseup),te.mousedrag&&this._document.addEventListener("mousemove",te.mousedrag),this.cancel(fe)}))),this.register((0,g.addDisposableDomListener)(U,"wheel",(fe=>{if(!te.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const be=this.viewport.getLinesScrolled(fe);if(be===0)return;const ge=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Te="";for(let Pe=0;Pe<Math.abs(be);Pe++)Te+=ge;return this.coreService.triggerDataEvent(Te,!0),this.cancel(fe,!0)}return this.viewport.handleWheel(fe)?this.cancel(fe):void 0}}),{passive:!1})),this.register((0,g.addDisposableDomListener)(U,"touchstart",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,g.addDisposableDomListener)(U,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh(K,U){var ne;(ne=this._renderService)==null||ne.refreshRows(K,U)}updateCursorStyle(K){var U;(U=this._selectionService)!=null&&U.shouldColumnSelect(K)?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(K,U,ne=0){var te;ne===1?(super.scrollLines(K,U,ne),this.refresh(0,this.rows-1)):(te=this.viewport)==null||te.scrollLines(K)}paste(K){(0,d.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}attachCustomWheelEventHandler(K){this._customWheelEventHandler=K}registerLinkProvider(K){return this._linkProviderService.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const U=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),U}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,U,ne){this._selectionService.setSelection(K,U,ne)}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 K;(K=this._selectionService)==null||K.clearSelection()}selectAll(){var K;(K=this._selectionService)==null||K.selectAll()}selectLines(K,U){var ne;(ne=this._selectionService)==null||ne.selectLines(K,U)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const U=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!U&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;U||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,X.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),ne.type===3||ne.type===2){const te=this.rows-1;return this.scrollLines(ne.type===2?-te:te),this.cancel(K,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(ne.cancel&&this.cancel(K,!0),!ne.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==W.C0.ETX&&ne.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,U){const ne=K.isMac&&!this.options.macOptionIsMeta&&U.altKey&&!U.ctrlKey&&!U.metaKey||K.isWindows&&U.altKey&&U.ctrlKey&&!U.metaKey||K.isWindows&&U.getModifierState("AltGraph");return U.type==="keypress"?ne:ne&&(!U.keyCode||U.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||((function(U){return U.keyCode===16||U.keyCode===17||U.keyCode===18})(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let U;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)U=K.charCode;else if(K.which===null||K.which===void 0)U=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;U=K.which}return!(!U||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||(U=String.fromCharCode(U),this._onKey.fire({key:U,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(U,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const U=K.data;return this.coreService.triggerDataEvent(U,!0),this.cancel(K),!0}return!1}resize(K,U){K!==this.cols||U!==this.rows?super.resize(K,U):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,U){var ne,te;(ne=this._charSizeService)==null||ne.measure(),(te=this.viewport)==null||te.syncScrollArea(!0)}clear(){var K;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 U=1;U<this.rows;U++)this.buffer.lines.push(this.buffer.getBlankLine(G.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(K=this.viewport)==null||K.reset(),this.refresh(0,this.rows-1)}}reset(){var U,ne;this.options.rows=this.rows,this.options.cols=this.cols;const K=this._customKeyEventHandler;this._setup(),super.reset(),(U=this._selectionService)==null||U.reset(),this._decorationService.reset(),(ne=this.viewport)==null||ne.reset(),this._customKeyEventHandler=K,this.refresh(0,this.rows-1)}clearTextureAtlas(){var K;(K=this._renderService)==null||K.clearTextureAtlas()}_reportFocus(){var K;(K=this.element)!=null&&K.classList.contains("focus")?this.coreService.triggerDataEvent(W.C0.ESC+"[I"):this.coreService.triggerDataEvent(W.C0.ESC+"[O")}_reportWindowsOptions(K){if(this._renderService)switch(K){case P.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const U=this._renderService.dimensions.css.canvas.width.toFixed(0),ne=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[4;${ne};${U}t`);break;case P.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const te=this._renderService.dimensions.css.cell.width.toFixed(0),_e=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${W.C0.ESC}[6;${_e};${te}t`)}}cancel(K,U){if(this.options.cancelEvents||U)return K.preventDefault(),K.stopPropagation(),!1}}r.Terminal=he},9924:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,g){this._rowCount=g,u=u!==void 0?u:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const l=Date.now();if(l-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=l,this._innerRefresh();else if(!this._additionalRefreshRequested){const p=l-this._lastRefreshMs,b=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(z,r,u){var d=this&&this.__decorate||function(a,o,c,S){var x,m=arguments.length,E=m<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,c):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,o,c,S);else for(var y=a.length-1;y>=0;y--)(x=a[y])&&(E=(m<3?x(E):m>3?x(o,c,E):x(o,c))||E);return m>3&&E&&Object.defineProperty(o,c,E),E},g=this&&this.__param||function(a,o){return function(c,S){o(c,S,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const l=u(3656),p=u(4725),b=u(8460),w=u(844),f=u(2585);let n=r.Viewport=class extends w.Disposable{constructor(a,o,c,S,x,m,E,y){super(),this._viewportElement=a,this._scrollArea=o,this._bufferService=c,this._optionsService=S,this._charSizeService=x,this._renderService=m,this._coreBrowserService=E,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,l.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((R=>this._activeBuffer=R.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((R=>this._renderDimensions=R))),this._handleThemeChange(y.colors),this.register(y.onChangeColors((R=>this._handleThemeChange(R)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(a){if(a)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const o=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==o&&(this._lastRecordedBufferHeight=o,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const o=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(a,o){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(o<0&&this._viewportElement.scrollTop!==0||o>0&&c<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const o=this._getPixelsScrolled(a);return o!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+o:this._smoothScrollState.target+=o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=o,this._bubbleScroll(a,o))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const o=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+o,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let o=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?o*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._currentRowHeight*this._bufferService.rows),o}getBufferElements(a,o){var y;let c,S="";const x=[],m=o??this._bufferService.buffer.lines.length,E=this._bufferService.buffer.lines;for(let R=a;R<m;R++){const T=E.get(R);if(!T)continue;const I=(y=E.get(R+1))==null?void 0:y.isWrapped;if(S+=T.translateToString(!I),!I||R===E.length-1){const B=document.createElement("div");B.textContent=S,x.push(B),S.length>0&&(c=B),S=""}}return{bufferElements:x,cursorElement:c}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let o=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(o/=this._currentRowHeight+0,this._wheelPartialScroll+=o,o=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(o*=this._bufferService.rows),o}_applyScrollModifier(a,o){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&o.altKey||c==="ctrl"&&o.ctrlKey||c==="shift"&&o.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const o=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,o!==0&&(this._viewportElement.scrollTop+=o,this._bubbleScroll(a,o))}};r.Viewport=n=d([g(2,f.IBufferService),g(3,f.IOptionsService),g(4,p.ICharSizeService),g(5,p.IRenderService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],n)},3107:function(z,r,u){var d=this&&this.__decorate||function(f,n,a,o){var c,S=arguments.length,x=S<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,a):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(f,n,a,o);else for(var m=f.length-1;m>=0;m--)(c=f[m])&&(x=(S<3?c(x):S>3?c(n,a,x):c(n,a))||x);return S>3&&x&&Object.defineProperty(n,a,x),x},g=this&&this.__param||function(f,n){return function(a,o){n(a,o,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const l=u(4725),p=u(844),b=u(2585);let w=r.BufferDecorationRenderer=class extends p.Disposable{constructor(f,n,a,o,c){super(),this._screenElement=f,this._bufferService=n,this._coreBrowserService=a,this._decorationService=o,this._renderService=c,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((S=>this._removeDecoration(S)))),this.register((0,p.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const f of this._decorationService.decorations)this._renderDecoration(f);this._dimensionsChanged=!1}_renderDecoration(f){this._refreshStyle(f),this._dimensionsChanged&&this._refreshXPosition(f)}_createElement(f){var o;const n=this._coreBrowserService.mainDocument.createElement("div");n.classList.add("xterm-decoration"),n.classList.toggle("xterm-decoration-top-layer",((o=f==null?void 0:f.options)==null?void 0:o.layer)==="top"),n.style.width=`${Math.round((f.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=(f.options.height||1)*this._renderService.dimensions.css.cell.height+"px",n.style.top=(f.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=f.options.x??0;return a&&a>this._bufferService.cols&&(n.style.display="none"),this._refreshXPosition(f,n),n}_refreshStyle(f){const n=f.marker.line-this._bufferService.buffers.active.ydisp;if(n<0||n>=this._bufferService.rows)f.element&&(f.element.style.display="none",f.onRenderEmitter.fire(f.element));else{let a=this._decorationElements.get(f);a||(a=this._createElement(f),f.element=a,this._decorationElements.set(f,a),this._container.appendChild(a),f.onDispose((()=>{this._decorationElements.delete(f),a.remove()}))),a.style.top=n*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",f.onRenderEmitter.fire(a)}}_refreshXPosition(f,n=f.element){if(!n)return;const a=f.options.x??0;(f.options.anchor||"left")==="right"?n.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":n.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(f){var n;(n=this._decorationElements.get(f))==null||n.remove(),this._decorationElements.delete(f),f.dispose()}};r.BufferDecorationRenderer=w=d([g(1,b.IBufferService),g(2,l.ICoreBrowserService),g(3,b.IDecorationService),g(4,l.IRenderService)],w)},5871:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=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(u){if(u.options.overviewRulerOptions){for(const d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,g){return d>=u.startBufferLine-this._linePadding[g||"full"]&&d<=u.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(z,r,u){var d=this&&this.__decorate||function(c,S,x,m){var E,y=arguments.length,R=y<3?S:m===null?m=Object.getOwnPropertyDescriptor(S,x):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(c,S,x,m);else for(var T=c.length-1;T>=0;T--)(E=c[T])&&(R=(y<3?E(R):y>3?E(S,x,R):E(S,x))||R);return y>3&&R&&Object.defineProperty(S,x,R),R},g=this&&this.__param||function(c,S){return function(x,m){S(x,m,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const l=u(5871),p=u(4725),b=u(844),w=u(2585),f={full:0,left:0,center:0,right:0},n={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let o=r.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(c,S,x,m,E,y,R){var I;super(),this._viewportElement=c,this._screenElement=S,this._bufferService=x,this._decorationService=m,this._renderService=E,this._optionsService=y,this._coreBrowserService=R,this._colorZoneStore=new l.ColorZoneStore,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(),(I=this._viewportElement.parentElement)==null||I.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var B;(B=this._canvas)==null||B.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){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())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const c=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);n.full=this._canvas.width,n.left=c,n.center=S,n.right=c,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=n.left,a.right=n.left+n.center}_refreshDrawHeightConstants(){f.full=Math.round(2*this._coreBrowserService.dpr);const c=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(c,12),6)*this._coreBrowserService.dpr);f.left=S,f.center=S,f.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*f.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(const S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const c=this._colorZoneStore.zones;for(const S of c)S.position!=="full"&&this._renderColorZone(S);for(const S of c)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(c){this._ctx.fillStyle=c.color,this._ctx.fillRect(a[c.position||"full"],Math.round((this._canvas.height-1)*(c.startBufferLine/this._bufferService.buffers.active.lines.length)-f[c.position||"full"]/2),n[c.position||"full"],Math.round((this._canvas.height-1)*((c.endBufferLine-c.startBufferLine)/this._bufferService.buffers.active.lines.length)+f[c.position||"full"]))}_queueRefresh(c,S){this._shouldUpdateDimensions=c||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};r.OverviewRulerRenderer=o=d([g(2,w.IBufferService),g(3,w.IDecorationService),g(4,p.IRenderService),g(5,w.IOptionsService),g(6,p.ICoreBrowserService)],o)},2950:function(z,r,u){var d=this&&this.__decorate||function(f,n,a,o){var c,S=arguments.length,x=S<3?n:o===null?o=Object.getOwnPropertyDescriptor(n,a):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(f,n,a,o);else for(var m=f.length-1;m>=0;m--)(c=f[m])&&(x=(S<3?c(x):S>3?c(n,a,x):c(n,a))||x);return S>3&&x&&Object.defineProperty(n,a,x),x},g=this&&this.__param||function(f,n){return function(a,o){n(a,o,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const l=u(4725),p=u(2585),b=u(2584);let w=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(f,n,a,o,c,S){this._textarea=f,this._compositionView=n,this._bufferService=a,this._optionsService=o,this._coreService=c,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(f){this._compositionView.textContent=f.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(f){if(this._isComposing||this._isSendingComposition){if(f.keyCode===229||f.keyCode===16||f.keyCode===17||f.keyCode===18)return!1;this._finalizeComposition(!1)}return f.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(f){if(this._compositionView.classList.remove("active"),this._isComposing=!1,f){const n={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,n.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(n.start,n.end):this._textarea.value.substring(n.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}}),0)}else{this._isSendingComposition=!1;const n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(n,!0)}}_handleAnyTextareaChanges(){const f=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const n=this._textarea.value,a=n.replace(f,"");this._dataAlreadySent=a,n.length>f.length?this._coreService.triggerDataEvent(a,!0):n.length<f.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):n.length===f.length&&n!==f&&this._coreService.triggerDataEvent(n,!0)}}),0)}updateCompositionElements(f){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const n=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,o=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=n*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=o+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=o+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}f||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};r.CompositionHelper=w=d([g(2,p.IBufferService),g(3,p.IOptionsService),g(4,p.ICoreService),g(5,l.IRenderService)],w)},9806:(z,r)=>{function u(d,g,l){const p=l.getBoundingClientRect(),b=d.getComputedStyle(l),w=parseInt(b.getPropertyValue("padding-left")),f=parseInt(b.getPropertyValue("padding-top"));return[g.clientX-p.left-w,g.clientY-p.top-f]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=u,r.getCoords=function(d,g,l,p,b,w,f,n,a){if(!w)return;const o=u(d,g,l);return o?(o[0]=Math.ceil((o[0]+(a?f/2:0))/f),o[1]=Math.ceil(o[1]/n),o[0]=Math.min(Math.max(o[0],1),p+(a?1:0)),o[1]=Math.min(Math.max(o[1],1),b),o):void 0}},9504:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const d=u(2584);function g(n,a,o,c){const S=n-l(n,o),x=a-l(a,o),m=Math.abs(S-x)-(function(E,y,R){let T=0;const I=E-l(E,R),B=y-l(y,R);for(let M=0;M<Math.abs(I-B);M++){const $=p(E,y)==="A"?-1:1,Y=R.buffer.lines.get(I+$*M);Y!=null&&Y.isWrapped&&T++}return T})(n,a,o);return f(m,w(p(n,a),c))}function l(n,a){let o=0,c=a.buffer.lines.get(n),S=c==null?void 0:c.isWrapped;for(;S&&n>=0&&n<a.rows;)o++,c=a.buffer.lines.get(--n),S=c==null?void 0:c.isWrapped;return o}function p(n,a){return n>a?"A":"B"}function b(n,a,o,c,S,x){let m=n,E=a,y="";for(;m!==o||E!==c;)m+=S?1:-1,S&&m>x.cols-1?(y+=x.buffer.translateBufferLineToString(E,!1,n,m),m=0,n=0,E++):!S&&m<0&&(y+=x.buffer.translateBufferLineToString(E,!1,0,n+1),m=x.cols-1,n=m,E--);return y+x.buffer.translateBufferLineToString(E,!1,n,m)}function w(n,a){const o=a?"O":"[";return d.C0.ESC+o+n}function f(n,a){n=Math.floor(n);let o="";for(let c=0;c<n;c++)o+=a;return o}r.moveToCellSequence=function(n,a,o,c){const S=o.buffer.x,x=o.buffer.y;if(!o.buffer.hasScrollback)return(function(y,R,T,I,B,M){return g(R,I,B,M).length===0?"":f(b(y,R,y,R-l(R,B),!1,B).length,w("D",M))})(S,x,0,a,o,c)+g(x,a,o,c)+(function(y,R,T,I,B,M){let $;$=g(R,I,B,M).length>0?I-l(I,B):R;const Y=I,G=(function(W,X,O,F,k,P){let Q;return Q=g(O,F,k,P).length>0?F-l(F,k):X,W<O&&Q<=F||W>=O&&Q<F?"C":"D"})(y,R,T,I,B,M);return f(b(y,$,T,Y,G==="C",B).length,w(G,M))})(S,x,n,a,o,c);let m;if(x===a)return m=S>n?"D":"C",f(Math.abs(S-n),w(m,c));m=x>a?"D":"C";const E=Math.abs(x-a);return f((function(y,R){return R.cols-y})(x>a?n:S,o)+(E-1)*o.cols+1+((x>a?S:n)-1),w(m,c))}},1296:function(z,r,u){var d=this&&this.__decorate||function(M,$,Y,G){var W,X=arguments.length,O=X<3?$:G===null?G=Object.getOwnPropertyDescriptor($,Y):G;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")O=Reflect.decorate(M,$,Y,G);else for(var F=M.length-1;F>=0;F--)(W=M[F])&&(O=(X<3?W(O):X>3?W($,Y,O):W($,Y))||O);return X>3&&O&&Object.defineProperty($,Y,O),O},g=this&&this.__param||function(M,$){return function(Y,G){$(Y,G,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const l=u(3787),p=u(2550),b=u(2223),w=u(6171),f=u(6052),n=u(4725),a=u(8055),o=u(8460),c=u(844),S=u(2585),x="xterm-dom-renderer-owner-",m="xterm-rows",E="xterm-fg-",y="xterm-bg-",R="xterm-focus",T="xterm-selection";let I=1,B=r.DomRenderer=class extends c.Disposable{constructor(M,$,Y,G,W,X,O,F,k,P,Q,ee,he){super(),this._terminal=M,this._document=$,this._element=Y,this._screenElement=G,this._viewportElement=W,this._helperContainer=X,this._linkifier2=O,this._charSizeService=k,this._optionsService=P,this._bufferService=Q,this._coreBrowserService=ee,this._themeService=he,this._terminalClass=I++,this._rowElements=[],this._selectionRenderModel=(0,f.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(m),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(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,w.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((oe=>this._injectCss(oe)))),this._injectCss(this._themeService.colors),this._rowFactory=F.createInstance(l.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((oe=>this._handleLinkHover(oe)))),this.register(this._linkifier2.onHideLinkUnderline((oe=>this._handleLinkLeave(oe)))),this.register((0,c.toDisposable)((()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new p.WidthCache(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(){const M=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*M,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*M),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/M),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/M),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(const Y of this._rowElements)Y.style.width=`${this.dimensions.css.canvas.width}px`,Y.style.height=`${this.dimensions.css.cell.height}px`,Y.style.lineHeight=`${this.dimensions.css.cell.height}px`,Y.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const $=`${this._terminalSelector} .${m} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=$,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(M){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let $=`${this._terminalSelector} .${m} { color: ${M.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;$+=`${this._terminalSelector} .${m} .xterm-dim { color: ${a.color.multiplyOpacity(M.foreground,.5).css};}`,$+=`${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;}`;const Y=`blink_underline_${this._terminalClass}`,G=`blink_bar_${this._terminalClass}`,W=`blink_block_${this._terminalClass}`;$+=`@keyframes ${Y} { 50% { border-bottom-style: hidden; }}`,$+=`@keyframes ${G} { 50% { box-shadow: none; }}`,$+=`@keyframes ${W} { 0% { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css}; } 50% { background-color: inherit; color: ${M.cursor.css}; }}`,$+=`${this._terminalSelector} .${m}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${m}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${G} 1s step-end infinite;}${this._terminalSelector} .${m}.${R} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${W} 1s step-end infinite;}${this._terminalSelector} .${m} .xterm-cursor.xterm-cursor-block { background-color: ${M.cursor.css}; color: ${M.cursorAccent.css};}${this._terminalSelector} .${m} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${M.cursor.css} !important; color: ${M.cursorAccent.css} !important;}${this._terminalSelector} .${m} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${M.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${m} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${M.cursor.css} inset;}${this._terminalSelector} .${m} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${M.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,$+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${M.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${M.selectionInactiveBackgroundOpaque.css};}`;for(const[X,O]of M.ansi.entries())$+=`${this._terminalSelector} .${E}${X} { color: ${O.css}; }${this._terminalSelector} .${E}${X}.xterm-dim { color: ${a.color.multiplyOpacity(O,.5).css}; }${this._terminalSelector} .${y}${X} { background-color: ${O.css}; }`;$+=`${this._terminalSelector} .${E}${b.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(M.background).css}; }${this._terminalSelector} .${E}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(M.background),.5).css}; }${this._terminalSelector} .${y}${b.INVERTED_DEFAULT_COLOR} { background-color: ${M.foreground.css}; }`,this._themeStyleElement.textContent=$}_setDefaultSpacing(){const M=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${M}px`,this._rowFactory.defaultSpacing=M}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(M,$){for(let Y=this._rowElements.length;Y<=$;Y++){const G=this._document.createElement("div");this._rowContainer.appendChild(G),this._rowElements.push(G)}for(;this._rowElements.length>$;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(M,$){this._refreshRowElements(M,$),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(R),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(R),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(M,$,Y){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(M,$,Y),this.renderRows(0,this._bufferService.rows-1),!M||!$)return;this._selectionRenderModel.update(this._terminal,M,$,Y);const G=this._selectionRenderModel.viewportStartRow,W=this._selectionRenderModel.viewportEndRow,X=this._selectionRenderModel.viewportCappedStartRow,O=this._selectionRenderModel.viewportCappedEndRow;if(X>=this._bufferService.rows||O<0)return;const F=this._document.createDocumentFragment();if(Y){const k=M[0]>$[0];F.appendChild(this._createSelectionElement(X,k?$[0]:M[0],k?M[0]:$[0],O-X+1))}else{const k=G===X?M[0]:0,P=X===W?$[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(X,k,P));const Q=O-X-1;if(F.appendChild(this._createSelectionElement(X+1,0,this._bufferService.cols,Q)),X!==O){const ee=W===O?$[0]:this._bufferService.cols;F.appendChild(this._createSelectionElement(O,0,ee))}}this._selectionContainer.appendChild(F)}_createSelectionElement(M,$,Y,G=1){const W=this._document.createElement("div"),X=$*this.dimensions.css.cell.width;let O=this.dimensions.css.cell.width*(Y-$);return X+O>this.dimensions.css.canvas.width&&(O=this.dimensions.css.canvas.width-X),W.style.height=G*this.dimensions.css.cell.height+"px",W.style.top=M*this.dimensions.css.cell.height+"px",W.style.left=`${X}px`,W.style.width=`${O}px`,W}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(const M of this._rowElements)M.replaceChildren()}renderRows(M,$){const Y=this._bufferService.buffer,G=Y.ybase+Y.y,W=Math.min(Y.x,this._bufferService.cols-1),X=this._optionsService.rawOptions.cursorBlink,O=this._optionsService.rawOptions.cursorStyle,F=this._optionsService.rawOptions.cursorInactiveStyle;for(let k=M;k<=$;k++){const P=k+Y.ydisp,Q=this._rowElements[k],ee=Y.lines.get(P);if(!Q||!ee)break;Q.replaceChildren(...this._rowFactory.createRow(ee,P,P===G,O,F,W,X,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!0)}_handleLinkLeave(M){this._setCellUnderline(M.x1,M.x2,M.y1,M.y2,M.cols,!1)}_setCellUnderline(M,$,Y,G,W,X){Y<0&&(M=0),G<0&&($=0);const O=this._bufferService.rows-1;Y=Math.max(Math.min(Y,O),0),G=Math.max(Math.min(G,O),0),W=Math.min(W,this._bufferService.cols);const F=this._bufferService.buffer,k=F.ybase+F.y,P=Math.min(F.x,W-1),Q=this._optionsService.rawOptions.cursorBlink,ee=this._optionsService.rawOptions.cursorStyle,he=this._optionsService.rawOptions.cursorInactiveStyle;for(let oe=Y;oe<=G;++oe){const K=oe+F.ydisp,U=this._rowElements[oe],ne=F.lines.get(K);if(!U||!ne)break;U.replaceChildren(...this._rowFactory.createRow(ne,K,K===k,ee,he,P,Q,this.dimensions.css.cell.width,this._widthCache,X?oe===Y?M:0:-1,X?(oe===G?$:W)-1:-1))}}};r.DomRenderer=B=d([g(7,S.IInstantiationService),g(8,n.ICharSizeService),g(9,S.IOptionsService),g(10,S.IBufferService),g(11,n.ICoreBrowserService),g(12,n.IThemeService)],B)},3787:function(z,r,u){var d=this&&this.__decorate||function(m,E,y,R){var T,I=arguments.length,B=I<3?E:R===null?R=Object.getOwnPropertyDescriptor(E,y):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(m,E,y,R);else for(var M=m.length-1;M>=0;M--)(T=m[M])&&(B=(I<3?T(B):I>3?T(E,y,B):T(E,y))||B);return I>3&&B&&Object.defineProperty(E,y,B),B},g=this&&this.__param||function(m,E){return function(y,R){E(y,R,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const l=u(2223),p=u(643),b=u(511),w=u(2585),f=u(8055),n=u(4725),a=u(4269),o=u(6171),c=u(3734);let S=r.DomRendererRowFactory=class{constructor(m,E,y,R,T,I,B){this._document=m,this._characterJoinerService=E,this._optionsService=y,this._coreBrowserService=R,this._coreService=T,this._decorationService=I,this._themeService=B,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(m,E,y){this._selectionStart=m,this._selectionEnd=E,this._columnSelectMode=y}createRow(m,E,y,R,T,I,B,M,$,Y,G){const W=[],X=this._characterJoinerService.getJoinedCharacters(E),O=this._themeService.colors;let F,k=m.getNoBgTrimmedLength();y&&k<I+1&&(k=I+1);let P=0,Q="",ee=0,he=0,oe=0,K=!1,U=0,ne=!1,te=0;const _e=[],fe=Y!==-1&&G!==-1;for(let be=0;be<k;be++){m.loadCell(be,this._workCell);let ge=this._workCell.getWidth();if(ge===0)continue;let Te=!1,Pe=be,Se=this._workCell;if(X.length>0&&be===X[0][0]){Te=!0;const De=X.shift();Se=new a.JoinedCellData(this._workCell,m.translateToString(!0,De[0],De[1]),De[1]-De[0]),Pe=De[1]-1,ge=Se.getWidth()}const Mt=this._isCellInSelection(be,E),It=y&&be===I,xe=fe&&be>=Y&&be<=G;let Ee=!1;this._decorationService.forEachDecorationAtCell(be,E,void 0,(De=>{Ee=!0}));let Ae=Se.getChars()||p.WHITESPACE_CELL_CHAR;if(Ae===" "&&(Se.isUnderline()||Se.isOverline())&&(Ae=" "),te=ge*M-$.get(Ae,Se.isBold(),Se.isItalic()),F){if(P&&(Mt&&ne||!Mt&&!ne&&Se.bg===ee)&&(Mt&&ne&&O.selectionForeground||Se.fg===he)&&Se.extended.ext===oe&&xe===K&&te===U&&!It&&!Te&&!Ee){Se.isInvisible()?Q+=p.WHITESPACE_CELL_CHAR:Q+=Ae,P++;continue}P&&(F.textContent=Q),F=this._document.createElement("span"),P=0,Q=""}else F=this._document.createElement("span");if(ee=Se.bg,he=Se.fg,oe=Se.extended.ext,K=xe,U=te,ne=Mt,Te&&I>=be&&I<=Pe&&(I=be),!this._coreService.isCursorHidden&&It&&this._coreService.isCursorInitialized){if(_e.push("xterm-cursor"),this._coreBrowserService.isFocused)B&&_e.push("xterm-cursor-blink"),_e.push(R==="bar"?"xterm-cursor-bar":R==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(T)switch(T){case"outline":_e.push("xterm-cursor-outline");break;case"block":_e.push("xterm-cursor-block");break;case"bar":_e.push("xterm-cursor-bar");break;case"underline":_e.push("xterm-cursor-underline")}}if(Se.isBold()&&_e.push("xterm-bold"),Se.isItalic()&&_e.push("xterm-italic"),Se.isDim()&&_e.push("xterm-dim"),Q=Se.isInvisible()?p.WHITESPACE_CELL_CHAR:Se.getChars()||p.WHITESPACE_CELL_CHAR,Se.isUnderline()&&(_e.push(`xterm-underline-${Se.extended.underlineStyle}`),Q===" "&&(Q=" "),!Se.isUnderlineColorDefault()))if(Se.isUnderlineColorRGB())F.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(Se.getUnderlineColor()).join(",")})`;else{let De=Se.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Se.isBold()&&De<8&&(De+=8),F.style.textDecorationColor=O.ansi[De].css}Se.isOverline()&&(_e.push("xterm-overline"),Q===" "&&(Q=" ")),Se.isStrikethrough()&&_e.push("xterm-strikethrough"),xe&&(F.style.textDecoration="underline");let ve=Se.getFgColor(),we=Se.getFgColorMode(),Ze=Se.getBgColor(),qe=Se.getBgColorMode();const gt=!!Se.isInverse();if(gt){const De=ve;ve=Ze,Ze=De;const Xt=we;we=qe,qe=Xt}let Qe,ct,Je,ke=!1;switch(this._decorationService.forEachDecorationAtCell(be,E,void 0,(De=>{De.options.layer!=="top"&&ke||(De.backgroundColorRGB&&(qe=50331648,Ze=De.backgroundColorRGB.rgba>>8&16777215,Qe=De.backgroundColorRGB),De.foregroundColorRGB&&(we=50331648,ve=De.foregroundColorRGB.rgba>>8&16777215,ct=De.foregroundColorRGB),ke=De.options.layer==="top")})),!ke&&Mt&&(Qe=this._coreBrowserService.isFocused?O.selectionBackgroundOpaque:O.selectionInactiveBackgroundOpaque,Ze=Qe.rgba>>8&16777215,qe=50331648,ke=!0,O.selectionForeground&&(we=50331648,ve=O.selectionForeground.rgba>>8&16777215,ct=O.selectionForeground)),ke&&_e.push("xterm-decoration-top"),qe){case 16777216:case 33554432:Je=O.ansi[Ze],_e.push(`xterm-bg-${Ze}`);break;case 50331648:Je=f.channels.toColor(Ze>>16,Ze>>8&255,255&Ze),this._addStyle(F,`background-color:#${x((Ze>>>0).toString(16),"0",6)}`);break;default:gt?(Je=O.foreground,_e.push(`xterm-bg-${l.INVERTED_DEFAULT_COLOR}`)):Je=O.background}switch(Qe||Se.isDim()&&(Qe=f.color.multiplyOpacity(Je,.5)),we){case 16777216:case 33554432:Se.isBold()&&ve<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ve+=8),this._applyMinimumContrast(F,Je,O.ansi[ve],Se,Qe,void 0)||_e.push(`xterm-fg-${ve}`);break;case 50331648:const De=f.channels.toColor(ve>>16&255,ve>>8&255,255&ve);this._applyMinimumContrast(F,Je,De,Se,Qe,ct)||this._addStyle(F,`color:#${x(ve.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(F,Je,O.foreground,Se,Qe,ct)||gt&&_e.push(`xterm-fg-${l.INVERTED_DEFAULT_COLOR}`)}_e.length&&(F.className=_e.join(" "),_e.length=0),It||Te||Ee?F.textContent=Q:P++,te!==this.defaultSpacing&&(F.style.letterSpacing=`${te}px`),W.push(F),be=Pe}return F&&P&&(F.textContent=Q),W}_applyMinimumContrast(m,E,y,R,T,I){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,o.treatGlyphAsBackgroundColor)(R.getCode()))return!1;const B=this._getContrastCache(R);let M;if(T||I||(M=B.getColor(E.rgba,y.rgba)),M===void 0){const $=this._optionsService.rawOptions.minimumContrastRatio/(R.isDim()?2:1);M=f.color.ensureContrastRatio(T||E,I||y,$),B.setColor((T||E).rgba,(I||y).rgba,M??null)}return!!M&&(this._addStyle(m,`color:${M.css}`),!0)}_getContrastCache(m){return m.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(m,E){m.setAttribute("style",`${m.getAttribute("style")||""}${E};`)}_isCellInSelection(m,E){const y=this._selectionStart,R=this._selectionEnd;return!(!y||!R)&&(this._columnSelectMode?y[0]<=R[0]?m>=y[0]&&E>=y[1]&&m<R[0]&&E<=R[1]:m<y[0]&&E>=y[1]&&m>=R[0]&&E<=R[1]:E>y[1]&&E<R[1]||y[1]===R[1]&&E===y[1]&&m>=y[0]&&m<R[0]||y[1]<R[1]&&E===R[1]&&m<R[0]||y[1]<R[1]&&E===y[1]&&m>=y[0])}};function x(m,E,y){for(;m.length<y;)m=E+m;return m}r.DomRendererRowFactory=S=d([g(1,n.ICharacterJoinerService),g(2,w.IOptionsService),g(3,n.ICoreBrowserService),g(4,w.ICoreService),g(5,w.IDecorationService),g(6,n.IThemeService)],S)},2550:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(u,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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";const g=u.createElement("span");g.classList.add("xterm-char-measure-element");const l=u.createElement("span");l.classList.add("xterm-char-measure-element"),l.style.fontWeight="bold";const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const b=u.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[g,l,p,b],this._container.appendChild(g),this._container.appendChild(l),this._container.appendChild(p),this._container.appendChild(b),d.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(u,d,g,l){u===this._font&&d===this._fontSize&&g===this._weight&&l===this._weightBold||(this._font=u,this._fontSize=d,this._weight=g,this._weightBold=l,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${l}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${l}`,this.clear())}get(u,d,g){let l=0;if(!d&&!g&&u.length===1&&(l=u.charCodeAt(0))<256){if(this._flat[l]!==-9999)return this._flat[l];const w=this._measure(u,0);return w>0&&(this._flat[l]=w),w}let p=u;d&&(p+="B"),g&&(p+="I");let b=this._holey.get(p);if(b===void 0){let w=0;d&&(w|=1),g&&(w|=2),b=this._measure(u,w),b>0&&this._holey.set(p,b)}return b}_measure(u,d){const g=this._measureElements[d];return g.textContent=u.repeat(32),g.offsetWidth/32}}},2223:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(z,r)=>{function u(g){return 57508<=g&&g<=57558}function d(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},r.isPowerlineGlyph=u,r.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},r.isEmoji=d,r.allowRescaling=function(g,l,p,b){return l===1&&p>Math.ceil(1.5*b)&&g!==void 0&&g>255&&!d(g)&&!u(g)&&!(function(w){return 57344<=w&&w<=63743})(g)},r.treatGlyphAsBackgroundColor=function(g){return u(g)||(function(l){return 9472<=l&&l<=9631})(g)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},r.computeNextVariantOffset=function(g,l,p=0){return(g-(2*Math.round(l)-p))%(2*Math.round(l))}},6052:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class u{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(g,l,p,b=!1){if(this.selectionStart=l,this.selectionEnd=p,!l||!p||l[0]===p[0]&&l[1]===p[1])return void this.clear();const w=g.buffers.active.ydisp,f=l[1]-w,n=p[1]-w,a=Math.max(f,0),o=Math.min(n,g.rows-1);a>=g.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=f,this.viewportEndRow=n,this.viewportCappedStartRow=a,this.viewportCappedEndRow=o,this.startCol=l[0],this.endCol=p[0])}isCellSelected(g,l,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&p>=this.viewportCappedStartRow&&l<this.endCol&&p<=this.viewportCappedEndRow:l<this.startCol&&p>=this.viewportCappedStartRow&&l>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&l>=this.startCol)}}r.createSelectionRenderModel=function(){return new u}},456:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(u){this._bufferService=u,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.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()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(z,r,u){var d=this&&this.__decorate||function(o,c,S,x){var m,E=arguments.length,y=E<3?c:x===null?x=Object.getOwnPropertyDescriptor(c,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(o,c,S,x);else for(var R=o.length-1;R>=0;R--)(m=o[R])&&(y=(E<3?m(y):E>3?m(c,S,y):m(c,S))||y);return E>3&&y&&Object.defineProperty(c,S,y),y},g=this&&this.__param||function(o,c){return function(S,x){c(S,x,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const l=u(2585),p=u(8460),b=u(844);let w=r.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(o,c,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new n(o,c,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())}};r.CharSizeService=w=d([g(2,l.IOptionsService)],w);class f extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(c,S){c!==void 0&&c>0&&S!==void 0&&S>0&&(this._result.width=c,this._result.height=S)}}class n extends f{constructor(c,S,x){super(),this._document=c,this._parentElement=S,this._optionsService=x,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}}class a extends f{constructor(c){super(),this._optionsService=c,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const c=this._ctx.measureText("W");return this._validateAndSet(c.width,c.fontBoundingBoxAscent+c.fontBoundingBoxDescent),this._result}}},4269:function(z,r,u){var d=this&&this.__decorate||function(a,o,c,S){var x,m=arguments.length,E=m<3?o:S===null?S=Object.getOwnPropertyDescriptor(o,c):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(a,o,c,S);else for(var y=a.length-1;y>=0;y--)(x=a[y])&&(E=(m<3?x(E):m>3?x(o,c,E):x(o,c))||E);return m>3&&E&&Object.defineProperty(o,c,E),E},g=this&&this.__param||function(a,o){return function(c,S){o(c,S,a)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const l=u(3734),p=u(643),b=u(511),w=u(2585);class f extends l.AttributeData{constructor(o,c,S){super(),this.content=0,this.combinedData="",this.fg=o.fg,this.bg=o.bg,this.combinedData=c,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(o){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=f;let n=r.CharacterJoinerService=class Lg{constructor(o){this._bufferService=o,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(o){const c={id:this._nextCharacterJoinerId++,handler:o};return this._characterJoiners.push(c),c.id}deregister(o){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===o)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(o){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(o);if(!c||c.length===0)return[];const S=[],x=c.translateToString(!0);let m=0,E=0,y=0,R=c.getFg(0),T=c.getBg(0);for(let I=0;I<c.getTrimmedLength();I++)if(c.loadCell(I,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==R||this._workCell.bg!==T){if(I-m>1){const B=this._getJoinedRanges(x,y,E,c,m);for(let M=0;M<B.length;M++)S.push(B[M])}m=I,y=E,R=this._workCell.fg,T=this._workCell.bg}E+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-m>1){const I=this._getJoinedRanges(x,y,E,c,m);for(let B=0;B<I.length;B++)S.push(I[B])}return S}_getJoinedRanges(o,c,S,x,m){const E=o.substring(c,S);let y=[];try{y=this._characterJoiners[0].handler(E)}catch(R){console.error(R)}for(let R=1;R<this._characterJoiners.length;R++)try{const T=this._characterJoiners[R].handler(E);for(let I=0;I<T.length;I++)Lg._mergeRanges(y,T[I])}catch(T){console.error(T)}return this._stringRangesToCellRanges(y,x,m),y}_stringRangesToCellRanges(o,c,S){let x=0,m=!1,E=0,y=o[x];if(y){for(let R=S;R<this._bufferService.cols;R++){const T=c.getWidth(R),I=c.getString(R).length||p.WHITESPACE_CELL_CHAR.length;if(T!==0){if(!m&&y[0]<=E&&(y[0]=R,m=!0),y[1]<=E){if(y[1]=R,y=o[++x],!y)break;y[0]<=E?(y[0]=R,m=!0):m=!1}E+=I}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(o,c){let S=!1;for(let x=0;x<o.length;x++){const m=o[x];if(S){if(c[1]<=m[0])return o[x-1][1]=c[1],o;if(c[1]<=m[1])return o[x-1][1]=Math.max(c[1],m[1]),o.splice(x,1),o;o.splice(x,1),x--}else{if(c[1]<=m[0])return o.splice(x,0,c),o;if(c[1]<=m[1])return m[0]=Math.min(c[0],m[0]),o;c[0]<m[1]&&(m[0]=Math.min(c[0],m[0]),S=!0)}}return S?o[o.length-1][1]=c[1]:o.push(c),o}};r.CharacterJoinerService=n=d([g(0,w.IBufferService)],n)},5114:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0;const d=u(844),g=u(8460),l=u(3656);class p extends d.Disposable{constructor(f,n,a){super(),this._textarea=f,this._window=n,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((o=>this._screenDprMonitor.setWindow(o)))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(f){this._window!==f&&(this._window=f,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}}r.CoreBrowserService=p;class b extends d.Disposable{constructor(f){super(),this._parentWindow=f,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(f){this._parentWindow=f,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,l.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var f;this._outerListener&&((f=this._resolutionMediaMatchList)==null||f.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)}}},779:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkProviderService=void 0;const d=u(844);class g extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const b=this.linkProviders.indexOf(p);b!==-1&&this.linkProviders.splice(b,1)}}}}r.LinkProviderService=g},8934:function(z,r,u){var d=this&&this.__decorate||function(w,f,n,a){var o,c=arguments.length,S=c<3?f:a===null?a=Object.getOwnPropertyDescriptor(f,n):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(w,f,n,a);else for(var x=w.length-1;x>=0;x--)(o=w[x])&&(S=(c<3?o(S):c>3?o(f,n,S):o(f,n))||S);return c>3&&S&&Object.defineProperty(f,n,S),S},g=this&&this.__param||function(w,f){return function(n,a){f(n,a,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const l=u(4725),p=u(9806);let b=r.MouseService=class{constructor(w,f){this._renderService=w,this._charSizeService=f}getCoords(w,f,n,a,o){return(0,p.getCoords)(window,w,f,n,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,o)}getMouseReportCoords(w,f){const n=(0,p.getCoordsRelativeToElement)(window,w,f);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};r.MouseService=b=d([g(0,l.IRenderService),g(1,l.ICharSizeService)],b)},3230:function(z,r,u){var d=this&&this.__decorate||function(o,c,S,x){var m,E=arguments.length,y=E<3?c:x===null?x=Object.getOwnPropertyDescriptor(c,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(o,c,S,x);else for(var R=o.length-1;R>=0;R--)(m=o[R])&&(y=(E<3?m(y):E>3?m(c,S,y):m(c,S))||y);return E>3&&y&&Object.defineProperty(c,S,y),y},g=this&&this.__param||function(o,c){return function(S,x){c(S,x,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const l=u(6193),p=u(4725),b=u(8460),w=u(844),f=u(7226),n=u(2585);let a=r.RenderService=class extends w.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(o,c,S,x,m,E,y,R){super(),this._rowCount=o,this._charSizeService=x,this._renderer=this.register(new w.MutableDisposable),this._pausedResizeTask=new f.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new l.RenderDebouncer(((T,I)=>this._renderRows(T,I)),y),this.register(this._renderDebouncer),this.register(y.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(E.onResize((()=>this._fullRefresh()))),this.register(E.buffers.onBufferActivate((()=>{var T;return(T=this._renderer.value)==null?void 0:T.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(m.onDecorationRegistered((()=>this._fullRefresh()))),this.register(m.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(E.cols,E.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(E.buffer.y,E.buffer.y,!0)))),this.register(R.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(y.window,c),this.register(y.onWindowChange((T=>this._registerIntersectionObserver(T,c))))}_registerIntersectionObserver(o,c){if("IntersectionObserver"in o){const S=new o.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});S.observe(c),this._observerDisposable.value=(0,w.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(o){this._isPaused=o.isIntersecting===void 0?o.intersectionRatio===0:!o.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(o,c,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(o,c,this._rowCount))}_renderRows(o,c){this._renderer.value&&(o=Math.min(o,this._rowCount-1),c=Math.min(c,this._rowCount-1),this._renderer.value.renderRows(o,c),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:o,end:c}),this._onRender.fire({start:o,end:c}),this._isNextRenderRedrawOnly=!0)}resize(o,c){this._rowCount=c,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(o){this._renderer.value=o,this._renderer.value&&(this._renderer.value.onRequestRedraw((c=>this.refreshRows(c.start,c.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(o){return this._renderDebouncer.addRefreshCallback(o)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var o,c;this._renderer.value&&((c=(o=this._renderer.value).clearTextureAtlas)==null||c.call(o),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(o,c){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(o,c)})):this._renderer.value.handleResize(o,c),this._fullRefresh())}handleCharSizeChanged(){var o;(o=this._renderer.value)==null||o.handleCharSizeChanged()}handleBlur(){var o;(o=this._renderer.value)==null||o.handleBlur()}handleFocus(){var o;(o=this._renderer.value)==null||o.handleFocus()}handleSelectionChanged(o,c,S){var x;this._selectionState.start=o,this._selectionState.end=c,this._selectionState.columnSelectMode=S,(x=this._renderer.value)==null||x.handleSelectionChanged(o,c,S)}handleCursorMove(){var o;(o=this._renderer.value)==null||o.handleCursorMove()}clear(){var o;(o=this._renderer.value)==null||o.clear()}};r.RenderService=a=d([g(2,n.IOptionsService),g(3,p.ICharSizeService),g(4,n.IDecorationService),g(5,n.IBufferService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],a)},9312:function(z,r,u){var d=this&&this.__decorate||function(y,R,T,I){var B,M=arguments.length,$=M<3?R:I===null?I=Object.getOwnPropertyDescriptor(R,T):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")$=Reflect.decorate(y,R,T,I);else for(var Y=y.length-1;Y>=0;Y--)(B=y[Y])&&($=(M<3?B($):M>3?B(R,T,$):B(R,T))||$);return M>3&&$&&Object.defineProperty(R,T,$),$},g=this&&this.__param||function(y,R){return function(T,I){R(T,I,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const l=u(9806),p=u(9504),b=u(456),w=u(4725),f=u(8460),n=u(844),a=u(6114),o=u(4841),c=u(511),S=u(2585),x=" ",m=new RegExp(x,"g");let E=r.SelectionService=class extends n.Disposable{constructor(y,R,T,I,B,M,$,Y,G){super(),this._element=y,this._screenElement=R,this._linkifier=T,this._bufferService=I,this._coreService=B,this._mouseService=M,this._optionsService=$,this._renderService=Y,this._coreBrowserService=G,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new f.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new f.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new f.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((W=>this._handleTrim(W))),this.register(this._bufferService.buffers.onBufferActivate((W=>this._handleBufferActivate(W)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,n.toDisposable)((()=>{this._removeMouseDownListeners()})))}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(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!y||!R||y[0]===R[0]&&y[1]===R[1])}get selectionText(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;if(!y||!R)return"";const T=this._bufferService.buffer,I=[];if(this._activeSelectionMode===3){if(y[0]===R[0])return"";const B=y[0]<R[0]?y[0]:R[0],M=y[0]<R[0]?R[0]:y[0];for(let $=y[1];$<=R[1];$++){const Y=T.translateBufferLineToString($,!0,B,M);I.push(Y)}}else{const B=y[1]===R[1]?R[0]:void 0;I.push(T.translateBufferLineToString(y[1],!0,y[0],B));for(let M=y[1]+1;M<=R[1]-1;M++){const $=T.lines.get(M),Y=T.translateBufferLineToString(M,!0);$!=null&&$.isWrapped?I[I.length-1]+=Y:I.push(Y)}if(y[1]!==R[1]){const M=T.lines.get(R[1]),$=T.translateBufferLineToString(R[1],!0,0,R[0]);M&&M.isWrapped?I[I.length-1]+=$:I.push($)}}return I.map((B=>B.replace(m," "))).join(a.isWindows?`\r
79
- `:`
80
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),a.isLinux&&y&&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(y){const R=this._getMouseBufferCoords(y),T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!!(T&&I&&R)&&this._areCoordsInSelection(R,T,I)}isCellInSelection(y,R){const T=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!T||!I)&&this._areCoordsInSelection([y,R],T,I)}_areCoordsInSelection(y,R,T){return y[1]>R[1]&&y[1]<T[1]||R[1]===T[1]&&y[1]===R[1]&&y[0]>=R[0]&&y[0]<T[0]||R[1]<T[1]&&y[1]===T[1]&&y[0]<T[0]||R[1]<T[1]&&y[1]===R[1]&&y[0]>=R[0]}_selectWordAtCursor(y,R){var B,M;const T=(M=(B=this._linkifier.currentLink)==null?void 0:B.link)==null?void 0:M.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,o.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const I=this._getMouseBufferCoords(y);return!!I&&(this._selectWordAt(I,R),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,R){this._model.clearSelection(),y=Math.max(y,0),R=Math.min(R,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,R],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const R=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(R)return R[0]--,R[1]--,R[1]+=this._bufferService.buffer.ydisp,R}_getMouseEventScrollAmount(y){let R=(0,l.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const T=this._renderService.dimensions.css.canvas.height;return R>=0&&R<=T?0:(R>T&&(R-=T),R=Math.min(Math.max(R,-50),50),R/=50,R/Math.abs(R)+Math.round(14*R))}shouldForceSelection(y){return a.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),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()),50)}_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(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const R=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);R&&R.length!==this._model.selectionStart[0]&&R.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const R=this._getMouseBufferCoords(y);R&&(this._activeSelectionMode=2,this._selectLineAt(R[1]))}shouldColumnSelect(y){return y.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const R=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!this._model.selectionEnd)return void this.refresh(!0);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(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const T=this._bufferService.buffer;if(this._model.selectionEnd[1]<T.lines.length){const I=T.lines.get(this._model.selectionEnd[1]);I&&I.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}R&&R[0]===this._model.selectionEnd[0]&&R[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});const y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const R=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&R<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const T=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(T&&T[0]!==void 0&&T[1]!==void 0){const I=(0,p.moveToCellSequence)(T[0]-1,T[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(I,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,R=this._model.finalSelectionEnd,T=!(!y||!R||y[0]===R[0]&&y[1]===R[1]);T?y&&R&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&R[0]===this._oldSelectionEnd[0]&&R[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,R,T)):this._oldHasSelection&&this._fireOnSelectionChange(y,R,T)}_fireOnSelectionChange(y,R,T){this._oldSelectionStart=y,this._oldSelectionEnd=R,this._oldHasSelection=T,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim((R=>this._handleTrim(R)))}_convertViewportColToCharacterIndex(y,R){let T=R;for(let I=0;R>=I;I++){const B=y.loadCell(I,this._workCell).getChars().length;this._workCell.getWidth()===0?T--:B>1&&R!==I&&(T+=B-1)}return T}setSelection(y,R,T){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,R],this._model.selectionStartLength=T,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,R,T=!0,I=!0){if(y[0]>=this._bufferService.cols)return;const B=this._bufferService.buffer,M=B.lines.get(y[1]);if(!M)return;const $=B.translateBufferLineToString(y[1],!1);let Y=this._convertViewportColToCharacterIndex(M,y[0]),G=Y;const W=y[0]-Y;let X=0,O=0,F=0,k=0;if($.charAt(Y)===" "){for(;Y>0&&$.charAt(Y-1)===" ";)Y--;for(;G<$.length&&$.charAt(G+1)===" ";)G++}else{let ee=y[0],he=y[0];M.getWidth(ee)===0&&(X++,ee--),M.getWidth(he)===2&&(O++,he++);const oe=M.getString(he).length;for(oe>1&&(k+=oe-1,G+=oe-1);ee>0&&Y>0&&!this._isCharWordSeparator(M.loadCell(ee-1,this._workCell));){M.loadCell(ee-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(X++,ee--):K>1&&(F+=K-1,Y-=K-1),Y--,ee--}for(;he<M.length&&G+1<$.length&&!this._isCharWordSeparator(M.loadCell(he+1,this._workCell));){M.loadCell(he+1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===2?(O++,he++):K>1&&(k+=K-1,G+=K-1),G++,he++}}G++;let P=Y+W-X+F,Q=Math.min(this._bufferService.cols,G-Y+X+O-F-k);if(R||$.slice(Y,G).trim()!==""){if(T&&P===0&&M.getCodePoint(0)!==32){const ee=B.lines.get(y[1]-1);if(ee&&M.isWrapped&&ee.getCodePoint(this._bufferService.cols-1)!==32){const he=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(he){const oe=this._bufferService.cols-he.start;P-=oe,Q+=oe}}}if(I&&P+Q===this._bufferService.cols&&M.getCodePoint(this._bufferService.cols-1)!==32){const ee=B.lines.get(y[1]+1);if(ee!=null&&ee.isWrapped&&ee.getCodePoint(0)!==32){const he=this._getWordAt([0,y[1]+1],!1,!1,!0);he&&(Q+=he.length)}}return{start:P,length:Q}}}_selectWordAt(y,R){const T=this._getWordAt(y,R);if(T){for(;T.start<0;)T.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[T.start,y[1]],this._model.selectionStartLength=T.length}}_selectToWordAt(y){const R=this._getWordAt(y,!0);if(R){let T=y[1];for(;R.start<0;)R.start+=this._bufferService.cols,T--;if(!this._model.areSelectionValuesReversed())for(;R.start+R.length>this._bufferService.cols;)R.length-=this._bufferService.cols,T++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?R.start:R.start+R.length,T]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const R=this._bufferService.buffer.getWrappedRangeForLine(y),T={start:{x:0,y:R.first},end:{x:this._bufferService.cols-1,y:R.last}};this._model.selectionStart=[0,R.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,o.getRangeLength)(T,this._bufferService.cols)}};r.SelectionService=E=d([g(3,S.IBufferService),g(4,S.ICoreService),g(5,w.IMouseService),g(6,S.IOptionsService),g(7,w.IRenderService),g(8,w.ICoreBrowserService)],E)},4725:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ILinkProviderService=r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const d=u(8343);r.ICharSizeService=(0,d.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),r.IMouseService=(0,d.createDecorator)("MouseService"),r.IRenderService=(0,d.createDecorator)("RenderService"),r.ISelectionService=(0,d.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,d.createDecorator)("ThemeService"),r.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(z,r,u){var d=this&&this.__decorate||function(E,y,R,T){var I,B=arguments.length,M=B<3?y:T===null?T=Object.getOwnPropertyDescriptor(y,R):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(E,y,R,T);else for(var $=E.length-1;$>=0;$--)(I=E[$])&&(M=(B<3?I(M):B>3?I(y,R,M):I(y,R))||M);return B>3&&M&&Object.defineProperty(y,R,M),M},g=this&&this.__param||function(E,y){return function(R,T){y(R,T,E)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const l=u(7239),p=u(8055),b=u(8460),w=u(844),f=u(2585),n=p.css.toColor("#ffffff"),a=p.css.toColor("#000000"),o=p.css.toColor("#ffffff"),c=p.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const E=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let R=0;R<216;R++){const T=y[R/36%6|0],I=y[R/6%6|0],B=y[R%6];E.push({css:p.channels.toCss(T,I,B),rgba:p.channels.toRgba(T,I,B)})}for(let R=0;R<24;R++){const T=8+10*R;E.push({css:p.channels.toCss(T,T,T),rgba:p.channels.toRgba(T,T,T)})}return E})());let x=r.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(E){super(),this._optionsService=E,this._contrastCache=new l.ColorContrastCache,this._halfContrastCache=new l.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:n,background:a,cursor:o,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:p.color.blend(a,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:p.color.blend(a,S),ansi:r.DEFAULT_ANSI_COLORS.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))))}_setTheme(E={}){const y=this._colors;if(y.foreground=m(E.foreground,n),y.background=m(E.background,a),y.cursor=m(E.cursor,o),y.cursorAccent=m(E.cursorAccent,c),y.selectionBackgroundTransparent=m(E.selectionBackground,S),y.selectionBackgroundOpaque=p.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=m(E.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=p.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=E.selectionForeground?m(E.selectionForeground,p.NULL_COLOR):void 0,y.selectionForeground===p.NULL_COLOR&&(y.selectionForeground=void 0),p.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=p.color.opacity(y.selectionBackgroundTransparent,.3)),p.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=p.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=r.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=m(E.black,r.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=m(E.red,r.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=m(E.green,r.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=m(E.yellow,r.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=m(E.blue,r.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=m(E.magenta,r.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=m(E.cyan,r.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=m(E.white,r.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=m(E.brightBlack,r.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=m(E.brightRed,r.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=m(E.brightGreen,r.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=m(E.brightYellow,r.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=m(E.brightBlue,r.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=m(E.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=m(E.brightCyan,r.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=m(E.brightWhite,r.DEFAULT_ANSI_COLORS[15]),E.extendedAnsi){const R=Math.min(y.ansi.length-16,E.extendedAnsi.length);for(let T=0;T<R;T++)y.ansi[T+16]=m(E.extendedAnsi[T],r.DEFAULT_ANSI_COLORS[T+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)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]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}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()}}};function m(E,y){if(E!==void 0)try{return p.css.toColor(E)}catch{}return y}r.ThemeService=x=d([g(0,f.IOptionsService)],x)},6349:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const d=u(8460),g=u(844);class l extends g.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(b){if(this._maxLength===b)return;const w=new Array(b);for(let f=0;f<Math.min(b,this.length);f++)w[f]=this._array[this._getCyclicIndex(f)];this._array=w,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let w=this._length;w<b;w++)this._array[w]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,w){this._array[this._getCyclicIndex(b)]=w}push(b){this._array[this._getCyclicIndex(this._length)]=b,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(b,w,...f){if(w){for(let n=b;n<this._length-w;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+w)];this._length-=w,this.onDeleteEmitter.fire({index:b,amount:w})}for(let n=this._length-1;n>=b;n--)this._array[this._getCyclicIndex(n+f.length)]=this._array[this._getCyclicIndex(n)];for(let n=0;n<f.length;n++)this._array[this._getCyclicIndex(b+n)]=f[n];if(f.length&&this.onInsertEmitter.fire({index:b,amount:f.length}),this._length+f.length>this._maxLength){const n=this._length+f.length-this._maxLength;this._startIndex+=n,this._length=this._maxLength,this.onTrimEmitter.fire(n)}else this._length+=f.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,w,f){if(!(w<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+f<0)throw new Error("Cannot shift elements in list beyond index 0");if(f>0){for(let a=w-1;a>=0;a--)this.set(b+a+f,this.get(b+a));const n=b+w+f-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<w;n++)this.set(b+n+f,this.get(b+n))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}r.CircularList=l},1439:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function u(d,g=5){if(typeof d!="object")return d;const l=Array.isArray(d)?[]:{};for(const p in d)l[p]=g<=1?d[p]:d[p]&&u(d[p],g-1);return l}},8055:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let u=0,d=0,g=0,l=0;var p,b,w,f,n;function a(c){const S=c.toString(16);return S.length<2?"0"+S:S}function o(c,S){return c<S?(S+.05)/(c+.05):(c+.05)/(S+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(S,x,m,E){return E!==void 0?`#${a(S)}${a(x)}${a(m)}${a(E)}`:`#${a(S)}${a(x)}${a(m)}`},c.toRgba=function(S,x,m,E=255){return(S<<24|x<<16|m<<8|E)>>>0},c.toColor=function(S,x,m,E){return{css:c.toCss(S,x,m,E),rgba:c.toRgba(S,x,m,E)}}})(p||(r.channels=p={})),(function(c){function S(x,m){return l=Math.round(255*m),[u,d,g]=n.toChannels(x.rgba),{css:p.toCss(u,d,g,l),rgba:p.toRgba(u,d,g,l)}}c.blend=function(x,m){if(l=(255&m.rgba)/255,l===1)return{css:m.css,rgba:m.rgba};const E=m.rgba>>24&255,y=m.rgba>>16&255,R=m.rgba>>8&255,T=x.rgba>>24&255,I=x.rgba>>16&255,B=x.rgba>>8&255;return u=T+Math.round((E-T)*l),d=I+Math.round((y-I)*l),g=B+Math.round((R-B)*l),{css:p.toCss(u,d,g),rgba:p.toRgba(u,d,g)}},c.isOpaque=function(x){return(255&x.rgba)==255},c.ensureContrastRatio=function(x,m,E){const y=n.ensureContrastRatio(x.rgba,m.rgba,E);if(y)return p.toColor(y>>24&255,y>>16&255,y>>8&255)},c.opaque=function(x){const m=(255|x.rgba)>>>0;return[u,d,g]=n.toChannels(m),{css:p.toCss(u,d,g),rgba:m}},c.opacity=S,c.multiplyOpacity=function(x,m){return l=255&x.rgba,S(x,l*m/255)},c.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(b||(r.color=b={})),(function(c){let S,x;try{const m=document.createElement("canvas");m.width=1,m.height=1;const E=m.getContext("2d",{willReadFrequently:!0});E&&(S=E,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}c.toColor=function(m){if(m.match(/#[\da-f]{3,8}/i))switch(m.length){case 4:return u=parseInt(m.slice(1,2).repeat(2),16),d=parseInt(m.slice(2,3).repeat(2),16),g=parseInt(m.slice(3,4).repeat(2),16),p.toColor(u,d,g);case 5:return u=parseInt(m.slice(1,2).repeat(2),16),d=parseInt(m.slice(2,3).repeat(2),16),g=parseInt(m.slice(3,4).repeat(2),16),l=parseInt(m.slice(4,5).repeat(2),16),p.toColor(u,d,g,l);case 7:return{css:m,rgba:(parseInt(m.slice(1),16)<<8|255)>>>0};case 9:return{css:m,rgba:parseInt(m.slice(1),16)>>>0}}const E=m.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return u=parseInt(E[1]),d=parseInt(E[2]),g=parseInt(E[3]),l=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),p.toColor(u,d,g,l);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=m,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,g,l]=S.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,d,g,l),css:m}}})(w||(r.css=w={})),(function(c){function S(x,m,E){const y=x/255,R=m/255,T=E/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}c.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},c.relativeLuminance2=S})(f||(r.rgb=f={})),(function(c){function S(m,E,y){const R=m>>24&255,T=m>>16&255,I=m>>8&255;let B=E>>24&255,M=E>>16&255,$=E>>8&255,Y=o(f.relativeLuminance2(B,M,$),f.relativeLuminance2(R,T,I));for(;Y<y&&(B>0||M>0||$>0);)B-=Math.max(0,Math.ceil(.1*B)),M-=Math.max(0,Math.ceil(.1*M)),$-=Math.max(0,Math.ceil(.1*$)),Y=o(f.relativeLuminance2(B,M,$),f.relativeLuminance2(R,T,I));return(B<<24|M<<16|$<<8|255)>>>0}function x(m,E,y){const R=m>>24&255,T=m>>16&255,I=m>>8&255;let B=E>>24&255,M=E>>16&255,$=E>>8&255,Y=o(f.relativeLuminance2(B,M,$),f.relativeLuminance2(R,T,I));for(;Y<y&&(B<255||M<255||$<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),M=Math.min(255,M+Math.ceil(.1*(255-M))),$=Math.min(255,$+Math.ceil(.1*(255-$))),Y=o(f.relativeLuminance2(B,M,$),f.relativeLuminance2(R,T,I));return(B<<24|M<<16|$<<8|255)>>>0}c.blend=function(m,E){if(l=(255&E)/255,l===1)return E;const y=E>>24&255,R=E>>16&255,T=E>>8&255,I=m>>24&255,B=m>>16&255,M=m>>8&255;return u=I+Math.round((y-I)*l),d=B+Math.round((R-B)*l),g=M+Math.round((T-M)*l),p.toRgba(u,d,g)},c.ensureContrastRatio=function(m,E,y){const R=f.relativeLuminance(m>>8),T=f.relativeLuminance(E>>8);if(o(R,T)<y){if(T<R){const M=S(m,E,y),$=o(R,f.relativeLuminance(M>>8));if($<y){const Y=x(m,E,y);return $>o(R,f.relativeLuminance(Y>>8))?M:Y}return M}const I=x(m,E,y),B=o(R,f.relativeLuminance(I>>8));if(B<y){const M=S(m,E,y);return B>o(R,f.relativeLuminance(M>>8))?I:M}return I}},c.reduceLuminance=S,c.increaseLuminance=x,c.toChannels=function(m){return[m>>24&255,m>>16&255,m>>8&255,255&m]}})(n||(r.rgba=n={})),r.toPaddedHex=a,r.contrastRatio=o},8969:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const d=u(844),g=u(2585),l=u(4348),p=u(7866),b=u(744),w=u(7302),f=u(6975),n=u(8460),a=u(1753),o=u(1480),c=u(7994),S=u(9282),x=u(5435),m=u(5981),E=u(2660);let y=!1;class R extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new n.EventEmitter),this._onScroll.event((I=>{var B;(B=this._onScrollApi)==null||B.fire(I.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(I){for(const B in I)this.optionsService.options[B]=I[B]}constructor(I){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new n.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new n.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new n.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new n.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new n.EventEmitter),this._instantiationService=new l.InstantiationService,this.optionsService=this.register(new w.OptionsService(I)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(f.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(o.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(E.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,n.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,n.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,n.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,n.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((B=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new m.WriteBuffer(((B,M)=>this._inputHandler.parse(B,M)))),this.register((0,n.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(I,B){this._writeBuffer.write(I,B)}writeSync(I,B){this._logService.logLevel<=g.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(I,B)}input(I,B=!0){this.coreService.triggerDataEvent(I,B)}resize(I,B){isNaN(I)||isNaN(B)||(I=Math.max(I,b.MINIMUM_COLS),B=Math.max(B,b.MINIMUM_ROWS),this._bufferService.resize(I,B))}scroll(I,B=!1){this._bufferService.scroll(I,B)}scrollLines(I,B,M){this._bufferService.scrollLines(I,B,M)}scrollPages(I){this.scrollLines(I*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(I){const B=I-this._bufferService.buffer.ydisp;B!==0&&this.scrollLines(B)}registerEscHandler(I,B){return this._inputHandler.registerEscHandler(I,B)}registerDcsHandler(I,B){return this._inputHandler.registerDcsHandler(I,B)}registerCsiHandler(I,B){return this._inputHandler.registerCsiHandler(I,B)}registerOscHandler(I,B){return this._inputHandler.registerOscHandler(I,B)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let I=!1;const B=this.optionsService.rawOptions.windowsPty;B&&B.buildNumber!==void 0&&B.buildNumber!==void 0?I=B.backend==="conpty"&&B.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(I=!0),I?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const I=[];I.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),I.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const B of I)B.dispose()}))}}}r.CoreTerminal=R},8460:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const g=[];for(let l=0;l<this._listeners.length;l++)g.push(this._listeners[l]);for(let l=0;l<g.length;l++)g[l].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(u,d){return u((g=>d.fire(g)))},r.runAndSubscribe=function(u,d){return d(void 0),u((g=>d(g)))}},5435:function(z,r,u){var d=this&&this.__decorate||function(X,O,F,k){var P,Q=arguments.length,ee=Q<3?O:k===null?k=Object.getOwnPropertyDescriptor(O,F):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(X,O,F,k);else for(var he=X.length-1;he>=0;he--)(P=X[he])&&(ee=(Q<3?P(ee):Q>3?P(O,F,ee):P(O,F))||ee);return Q>3&&ee&&Object.defineProperty(O,F,ee),ee},g=this&&this.__param||function(X,O){return function(F,k){O(F,k,X)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const l=u(2584),p=u(7116),b=u(2015),w=u(844),f=u(482),n=u(8437),a=u(8460),o=u(643),c=u(511),S=u(3734),x=u(2585),m=u(1480),E=u(6242),y=u(6351),R=u(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},I=131072;function B(X,O){if(X>24)return O.setWinLines||!1;switch(X){case 1:return!!O.restoreWin;case 2:return!!O.minimizeWin;case 3:return!!O.setWinPosition;case 4:return!!O.setWinSizePixels;case 5:return!!O.raiseWin;case 6:return!!O.lowerWin;case 7:return!!O.refreshWin;case 8:return!!O.setWinSizeChars;case 9:return!!O.maximizeWin;case 10:return!!O.fullscreenWin;case 11:return!!O.getWinState;case 13:return!!O.getWinPosition;case 14:return!!O.getWinSizePixels;case 15:return!!O.getScreenSizePixels;case 16:return!!O.getCellSizePixels;case 18:return!!O.getWinSizeChars;case 19:return!!O.getScreenSizeChars;case 20:return!!O.getIconTitle;case 21:return!!O.getWinTitle;case 22:return!!O.pushTitle;case 23:return!!O.popTitle;case 24:return!!O.setWinLines}return!1}var M;(function(X){X[X.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",X[X.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(M||(r.WindowsOptionsReportType=M={}));let $=0;class Y extends w.Disposable{getAttrData(){return this._curAttrData}constructor(O,F,k,P,Q,ee,he,oe,K=new b.EscapeSequenceParser){super(),this._bufferService=O,this._charsetService=F,this._coreService=k,this._logService=P,this._optionsService=Q,this._oscLinkService=ee,this._coreMouseService=he,this._unicodeService=oe,this._parser=K,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new f.StringToUtf32,this._utf8Decoder=new f.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.EventEmitter),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 G(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((U=>this._activeBuffer=U.activeBuffer))),this._parser.setCsiHandlerFallback(((U,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(U),params:ne.toArray()})})),this._parser.setEscHandlerFallback((U=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(U)})})),this._parser.setExecuteHandlerFallback((U=>{this._logService.debug("Unknown EXECUTE code: ",{code:U})})),this._parser.setOscHandlerFallback(((U,ne,te)=>{this._logService.debug("Unknown OSC code: ",{identifier:U,action:ne,data:te})})),this._parser.setDcsHandlerFallback(((U,ne,te)=>{ne==="HOOK"&&(te=te.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(U),action:ne,payload:te})})),this._parser.setPrintHandler(((U,ne,te)=>this.print(U,ne,te))),this._parser.registerCsiHandler({final:"@"},(U=>this.insertChars(U))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(U=>this.scrollLeft(U))),this._parser.registerCsiHandler({final:"A"},(U=>this.cursorUp(U))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(U=>this.scrollRight(U))),this._parser.registerCsiHandler({final:"B"},(U=>this.cursorDown(U))),this._parser.registerCsiHandler({final:"C"},(U=>this.cursorForward(U))),this._parser.registerCsiHandler({final:"D"},(U=>this.cursorBackward(U))),this._parser.registerCsiHandler({final:"E"},(U=>this.cursorNextLine(U))),this._parser.registerCsiHandler({final:"F"},(U=>this.cursorPrecedingLine(U))),this._parser.registerCsiHandler({final:"G"},(U=>this.cursorCharAbsolute(U))),this._parser.registerCsiHandler({final:"H"},(U=>this.cursorPosition(U))),this._parser.registerCsiHandler({final:"I"},(U=>this.cursorForwardTab(U))),this._parser.registerCsiHandler({final:"J"},(U=>this.eraseInDisplay(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(U=>this.eraseInDisplay(U,!0))),this._parser.registerCsiHandler({final:"K"},(U=>this.eraseInLine(U,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(U=>this.eraseInLine(U,!0))),this._parser.registerCsiHandler({final:"L"},(U=>this.insertLines(U))),this._parser.registerCsiHandler({final:"M"},(U=>this.deleteLines(U))),this._parser.registerCsiHandler({final:"P"},(U=>this.deleteChars(U))),this._parser.registerCsiHandler({final:"S"},(U=>this.scrollUp(U))),this._parser.registerCsiHandler({final:"T"},(U=>this.scrollDown(U))),this._parser.registerCsiHandler({final:"X"},(U=>this.eraseChars(U))),this._parser.registerCsiHandler({final:"Z"},(U=>this.cursorBackwardTab(U))),this._parser.registerCsiHandler({final:"`"},(U=>this.charPosAbsolute(U))),this._parser.registerCsiHandler({final:"a"},(U=>this.hPositionRelative(U))),this._parser.registerCsiHandler({final:"b"},(U=>this.repeatPrecedingCharacter(U))),this._parser.registerCsiHandler({final:"c"},(U=>this.sendDeviceAttributesPrimary(U))),this._parser.registerCsiHandler({prefix:">",final:"c"},(U=>this.sendDeviceAttributesSecondary(U))),this._parser.registerCsiHandler({final:"d"},(U=>this.linePosAbsolute(U))),this._parser.registerCsiHandler({final:"e"},(U=>this.vPositionRelative(U))),this._parser.registerCsiHandler({final:"f"},(U=>this.hVPosition(U))),this._parser.registerCsiHandler({final:"g"},(U=>this.tabClear(U))),this._parser.registerCsiHandler({final:"h"},(U=>this.setMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(U=>this.setModePrivate(U))),this._parser.registerCsiHandler({final:"l"},(U=>this.resetMode(U))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(U=>this.resetModePrivate(U))),this._parser.registerCsiHandler({final:"m"},(U=>this.charAttributes(U))),this._parser.registerCsiHandler({final:"n"},(U=>this.deviceStatus(U))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(U=>this.deviceStatusPrivate(U))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(U=>this.softReset(U))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(U=>this.setCursorStyle(U))),this._parser.registerCsiHandler({final:"r"},(U=>this.setScrollRegion(U))),this._parser.registerCsiHandler({final:"s"},(U=>this.saveCursor(U))),this._parser.registerCsiHandler({final:"t"},(U=>this.windowOptions(U))),this._parser.registerCsiHandler({final:"u"},(U=>this.restoreCursor(U))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(U=>this.insertColumns(U))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(U=>this.deleteColumns(U))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(U=>this.selectProtected(U))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(U=>this.requestMode(U,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(U=>this.requestMode(U,!1))),this._parser.setExecuteHandler(l.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(l.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(l.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(l.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(l.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(l.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(l.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(l.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(l.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(l.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new E.OscHandler((U=>(this.setTitle(U),this.setIconName(U),!0)))),this._parser.registerOscHandler(1,new E.OscHandler((U=>this.setIconName(U)))),this._parser.registerOscHandler(2,new E.OscHandler((U=>this.setTitle(U)))),this._parser.registerOscHandler(4,new E.OscHandler((U=>this.setOrReportIndexedColor(U)))),this._parser.registerOscHandler(8,new E.OscHandler((U=>this.setHyperlink(U)))),this._parser.registerOscHandler(10,new E.OscHandler((U=>this.setOrReportFgColor(U)))),this._parser.registerOscHandler(11,new E.OscHandler((U=>this.setOrReportBgColor(U)))),this._parser.registerOscHandler(12,new E.OscHandler((U=>this.setOrReportCursorColor(U)))),this._parser.registerOscHandler(104,new E.OscHandler((U=>this.restoreIndexedColor(U)))),this._parser.registerOscHandler(110,new E.OscHandler((U=>this.restoreFgColor(U)))),this._parser.registerOscHandler(111,new E.OscHandler((U=>this.restoreBgColor(U)))),this._parser.registerOscHandler(112,new E.OscHandler((U=>this.restoreCursorColor(U)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const U in p.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:U},(()=>this.selectCharset("("+U))),this._parser.registerEscHandler({intermediates:")",final:U},(()=>this.selectCharset(")"+U))),this._parser.registerEscHandler({intermediates:"*",final:U},(()=>this.selectCharset("*"+U))),this._parser.registerEscHandler({intermediates:"+",final:U},(()=>this.selectCharset("+"+U))),this._parser.registerEscHandler({intermediates:"-",final:U},(()=>this.selectCharset("-"+U))),this._parser.registerEscHandler({intermediates:".",final:U},(()=>this.selectCharset("."+U))),this._parser.registerEscHandler({intermediates:"/",final:U},(()=>this.selectCharset("/"+U)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((U=>(this._logService.error("Parsing error: ",U),U))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new y.DcsHandler(((U,ne)=>this.requestStatusString(U,ne))))}_preserveStack(O,F,k,P){this._parseStack.paused=!0,this._parseStack.cursorStartX=O,this._parseStack.cursorStartY=F,this._parseStack.decodedLength=k,this._parseStack.position=P}_logSlowResolvingAsync(O){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([O,new Promise(((F,k)=>setTimeout((()=>k("#SLOW_TIMEOUT")),5e3)))]).catch((F=>{if(F!=="#SLOW_TIMEOUT")throw F;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(O,F){let k,P=this._activeBuffer.x,Q=this._activeBuffer.y,ee=0;const he=this._parseStack.paused;if(he){if(k=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,F))return this._logSlowResolvingAsync(k),k;P=this._parseStack.cursorStartX,Q=this._parseStack.cursorStartY,this._parseStack.paused=!1,O.length>I&&(ee=this._parseStack.position+I)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof O=="string"?` "${O}"`:` "${Array.prototype.map.call(O,(U=>String.fromCharCode(U))).join("")}"`),typeof O=="string"?O.split("").map((U=>U.charCodeAt(0))):O),this._parseBuffer.length<O.length&&this._parseBuffer.length<I&&(this._parseBuffer=new Uint32Array(Math.min(O.length,I))),he||this._dirtyRowTracker.clearRange(),O.length>I)for(let U=ee;U<O.length;U+=I){const ne=U+I<O.length?U+I:O.length,te=typeof O=="string"?this._stringDecoder.decode(O.substring(U,ne),this._parseBuffer):this._utf8Decoder.decode(O.subarray(U,ne),this._parseBuffer);if(k=this._parser.parse(this._parseBuffer,te))return this._preserveStack(P,Q,te,U),this._logSlowResolvingAsync(k),k}else if(!he){const U=typeof O=="string"?this._stringDecoder.decode(O,this._parseBuffer):this._utf8Decoder.decode(O,this._parseBuffer);if(k=this._parser.parse(this._parseBuffer,U))return this._preserveStack(P,Q,U,0),this._logSlowResolvingAsync(k),k}this._activeBuffer.x===P&&this._activeBuffer.y===Q||this._onCursorMove.fire();const oe=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),K=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);K<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(K,this._bufferService.rows-1),Math.min(oe,this._bufferService.rows-1))}print(O,F,k){let P,Q;const ee=this._charsetService.charset,he=this._optionsService.rawOptions.screenReaderMode,oe=this._bufferService.cols,K=this._coreService.decPrivateModes.wraparound,U=this._coreService.modes.insertMode,ne=this._curAttrData;let te=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&k-F>0&&te.getWidth(this._activeBuffer.x-1)===2&&te.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let _e=this._parser.precedingJoinState;for(let fe=F;fe<k;++fe){if(P=O[fe],P<127&&ee){const Pe=ee[String.fromCharCode(P)];Pe&&(P=Pe.charCodeAt(0))}const be=this._unicodeService.charProperties(P,_e);Q=m.UnicodeService.extractWidth(be);const ge=m.UnicodeService.extractShouldJoin(be),Te=ge?m.UnicodeService.extractWidth(_e):0;if(_e=be,he&&this._onA11yChar.fire((0,f.stringFromCodePoint)(P)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Q-Te>oe){if(K){const Pe=te;let Se=this._activeBuffer.x-Te;for(this._activeBuffer.x=Te,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),te=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Te>0&&te instanceof n.BufferLine&&te.copyCellsFrom(Pe,Se,0,Te,!1);Se<oe;)Pe.setCellFromCodepoint(Se++,0,1,ne)}else if(this._activeBuffer.x=oe-1,Q===2)continue}if(ge&&this._activeBuffer.x){const Pe=te.getWidth(this._activeBuffer.x-1)?1:2;te.addCodepointToCell(this._activeBuffer.x-Pe,P,Q);for(let Se=Q-Te;--Se>=0;)te.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(U&&(te.insertCells(this._activeBuffer.x,Q-Te,this._activeBuffer.getNullCell(ne)),te.getWidth(oe-1)===2&&te.setCellFromCodepoint(oe-1,o.NULL_CELL_CODE,o.NULL_CELL_WIDTH,ne)),te.setCellFromCodepoint(this._activeBuffer.x++,P,Q,ne),Q>0)for(;--Q;)te.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=_e,this._activeBuffer.x<oe&&k-F>0&&te.getWidth(this._activeBuffer.x)===0&&!te.hasContent(this._activeBuffer.x)&&te.setCellFromCodepoint(this._activeBuffer.x,0,1,ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(O,F){return O.final!=="t"||O.prefix||O.intermediates?this._parser.registerCsiHandler(O,F):this._parser.registerCsiHandler(O,(k=>!B(k.params[0],this._optionsService.rawOptions.windowOptions)||F(k)))}registerDcsHandler(O,F){return this._parser.registerDcsHandler(O,new y.DcsHandler(F))}registerEscHandler(O,F){return this._parser.registerEscHandler(O,F)}registerOscHandler(O,F){return this._parser.registerOscHandler(O,new E.OscHandler(F))}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 O;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&&((O=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&O.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);F.hasWidth(this._activeBuffer.x)&&!F.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const O=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-O),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(O=this._bufferService.cols-1){this._activeBuffer.x=Math.min(O,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(O,F){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=O,this._activeBuffer.y=this._activeBuffer.scrollTop+F):(this._activeBuffer.x=O,this._activeBuffer.y=F),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(O,F){this._restrictCursor(),this._setCursor(this._activeBuffer.x+O,this._activeBuffer.y+F)}cursorUp(O){const F=this._activeBuffer.y-this._activeBuffer.scrollTop;return F>=0?this._moveCursor(0,-Math.min(F,O.params[0]||1)):this._moveCursor(0,-(O.params[0]||1)),!0}cursorDown(O){const F=this._activeBuffer.scrollBottom-this._activeBuffer.y;return F>=0?this._moveCursor(0,Math.min(F,O.params[0]||1)):this._moveCursor(0,O.params[0]||1),!0}cursorForward(O){return this._moveCursor(O.params[0]||1,0),!0}cursorBackward(O){return this._moveCursor(-(O.params[0]||1),0),!0}cursorNextLine(O){return this.cursorDown(O),this._activeBuffer.x=0,!0}cursorPrecedingLine(O){return this.cursorUp(O),this._activeBuffer.x=0,!0}cursorCharAbsolute(O){return this._setCursor((O.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(O){return this._setCursor(O.length>=2?(O.params[1]||1)-1:0,(O.params[0]||1)-1),!0}charPosAbsolute(O){return this._setCursor((O.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(O){return this._moveCursor(O.params[0]||1,0),!0}linePosAbsolute(O){return this._setCursor(this._activeBuffer.x,(O.params[0]||1)-1),!0}vPositionRelative(O){return this._moveCursor(0,O.params[0]||1),!0}hVPosition(O){return this.cursorPosition(O),!0}tabClear(O){const F=O.params[0];return F===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:F===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(O){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=O.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(O){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let F=O.params[0]||1;for(;F--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(O){const F=O.params[0];return F===1&&(this._curAttrData.bg|=536870912),F!==2&&F!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(O,F,k,P=!1,Q=!1){const ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);ee.replaceCells(F,k,this._activeBuffer.getNullCell(this._eraseAttrData()),Q),P&&(ee.isWrapped=!1)}_resetBufferLine(O,F=!1){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);k&&(k.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),F),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+O),k.isWrapped=!1)}eraseInDisplay(O,F=!1){let k;switch(this._restrictCursor(this._bufferService.cols),O.params[0]){case 0:for(k=this._activeBuffer.y,this._dirtyRowTracker.markDirty(k),this._eraseInBufferLine(k++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);k<this._bufferService.rows;k++)this._resetBufferLine(k,F);this._dirtyRowTracker.markDirty(k);break;case 1:for(k=this._activeBuffer.y,this._dirtyRowTracker.markDirty(k),this._eraseInBufferLine(k,0,this._activeBuffer.x+1,!0,F),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(k+1).isWrapped=!1);k--;)this._resetBufferLine(k,F);this._dirtyRowTracker.markDirty(0);break;case 2:for(k=this._bufferService.rows,this._dirtyRowTracker.markDirty(k-1);k--;)this._resetBufferLine(k,F);this._dirtyRowTracker.markDirty(0);break;case 3:const P=this._activeBuffer.lines.length-this._bufferService.rows;P>0&&(this._activeBuffer.lines.trimStart(P),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-P,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-P,0),this._onScroll.fire(0))}return!0}eraseInLine(O,F=!1){switch(this._restrictCursor(this._bufferService.cols),O.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,F);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,F);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,F)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(O){this._restrictCursor();let F=O.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=this._activeBuffer.ybase+this._activeBuffer.y,P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Q=this._bufferService.rows-1+this._activeBuffer.ybase-P+1;for(;F--;)this._activeBuffer.lines.splice(Q-1,1),this._activeBuffer.lines.splice(k,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(O){this._restrictCursor();let F=O.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const k=this._activeBuffer.ybase+this._activeBuffer.y;let P;for(P=this._bufferService.rows-1-this._activeBuffer.scrollBottom,P=this._bufferService.rows-1+this._activeBuffer.ybase-P;F--;)this._activeBuffer.lines.splice(k,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(O){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.insertCells(this._activeBuffer.x,O.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(O){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.deleteCells(this._activeBuffer.x,O.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(O){let F=O.params[0]||1;for(;F--;)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(O){let F=O.params[0]||1;for(;F--;)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(n.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=O.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);P.deleteCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=O.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);P.insertCells(0,F,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=O.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);P.insertCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(O){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const F=O.params[0]||1;for(let k=this._activeBuffer.scrollTop;k<=this._activeBuffer.scrollBottom;++k){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);P.deleteCells(this._activeBuffer.x,F,this._activeBuffer.getNullCell(this._eraseAttrData())),P.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(O){this._restrictCursor();const F=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return F&&(F.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(O.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(O){const F=this._parser.precedingJoinState;if(!F)return!0;const k=O.params[0]||1,P=m.UnicodeService.extractWidth(F),Q=this._activeBuffer.x-P,ee=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Q),he=new Uint32Array(ee.length*k);let oe=0;for(let U=0;U<ee.length;){const ne=ee.codePointAt(U)||0;he[oe++]=ne,U+=ne>65535?2:1}let K=oe;for(let U=1;U<k;++U)he.copyWithin(K,0,oe),K+=oe;return this.print(he,0,K),!0}sendDeviceAttributesPrimary(O){return O.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(l.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(l.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(O){return O.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(l.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(l.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(O.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(l.C0.ESC+"[>83;40003;0c")),!0}_is(O){return(this._optionsService.rawOptions.termName+"").indexOf(O)===0}setMode(O){for(let F=0;F<O.length;F++)switch(O.params[F]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(O){for(let F=0;F<O.length;F++)switch(O.params[F]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(O){for(let F=0;F<O.length;F++)switch(O.params[F]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(O){for(let F=0;F<O.length;F++)switch(O.params[F]){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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),O.params[F]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(O,F){const k=this._coreService.decPrivateModes,{activeProtocol:P,activeEncoding:Q}=this._coreMouseService,ee=this._coreService,{buffers:he,cols:oe}=this._bufferService,{active:K,alt:U}=he,ne=this._optionsService.rawOptions,te=ge=>ge?1:2,_e=O.params[0];return fe=_e,be=F?_e===2?4:_e===4?te(ee.modes.insertMode):_e===12?3:_e===20?te(ne.convertEol):0:_e===1?te(k.applicationCursorKeys):_e===3?ne.windowOptions.setWinLines?oe===80?2:oe===132?1:0:0:_e===6?te(k.origin):_e===7?te(k.wraparound):_e===8?3:_e===9?te(P==="X10"):_e===12?te(ne.cursorBlink):_e===25?te(!ee.isCursorHidden):_e===45?te(k.reverseWraparound):_e===66?te(k.applicationKeypad):_e===67?4:_e===1e3?te(P==="VT200"):_e===1002?te(P==="DRAG"):_e===1003?te(P==="ANY"):_e===1004?te(k.sendFocus):_e===1005?4:_e===1006?te(Q==="SGR"):_e===1015?4:_e===1016?te(Q==="SGR_PIXELS"):_e===1048?1:_e===47||_e===1047||_e===1049?te(K===U):_e===2004?te(k.bracketedPasteMode):0,ee.triggerDataEvent(`${l.C0.ESC}[${F?"":"?"}${fe};${be}$y`),!0;var fe,be}_updateAttrColor(O,F,k,P,Q){return F===2?(O|=50331648,O&=-16777216,O|=S.AttributeData.fromColorRGB([k,P,Q])):F===5&&(O&=-50331904,O|=33554432|255&k),O}_extractColor(O,F,k){const P=[0,0,-1,0,0,0];let Q=0,ee=0;do{if(P[ee+Q]=O.params[F+ee],O.hasSubParams(F+ee)){const he=O.getSubParams(F+ee);let oe=0;do P[1]===5&&(Q=1),P[ee+oe+1+Q]=he[oe];while(++oe<he.length&&oe+ee+1+Q<P.length);break}if(P[1]===5&&ee+Q>=2||P[1]===2&&ee+Q>=5)break;P[1]&&(Q=1)}while(++ee+F<O.length&&ee+Q<P.length);for(let he=2;he<P.length;++he)P[he]===-1&&(P[he]=0);switch(P[0]){case 38:k.fg=this._updateAttrColor(k.fg,P[1],P[3],P[4],P[5]);break;case 48:k.bg=this._updateAttrColor(k.bg,P[1],P[3],P[4],P[5]);break;case 58:k.extended=k.extended.clone(),k.extended.underlineColor=this._updateAttrColor(k.extended.underlineColor,P[1],P[3],P[4],P[5])}return ee}_processUnderline(O,F){F.extended=F.extended.clone(),(!~O||O>5)&&(O=1),F.extended.underlineStyle=O,F.fg|=268435456,O===0&&(F.fg&=-268435457),F.updateExtended()}_processSGR0(O){O.fg=n.DEFAULT_ATTR_DATA.fg,O.bg=n.DEFAULT_ATTR_DATA.bg,O.extended=O.extended.clone(),O.extended.underlineStyle=0,O.extended.underlineColor&=-67108864,O.updateExtended()}charAttributes(O){if(O.length===1&&O.params[0]===0)return this._processSGR0(this._curAttrData),!0;const F=O.length;let k;const P=this._curAttrData;for(let Q=0;Q<F;Q++)k=O.params[Q],k>=30&&k<=37?(P.fg&=-50331904,P.fg|=16777216|k-30):k>=40&&k<=47?(P.bg&=-50331904,P.bg|=16777216|k-40):k>=90&&k<=97?(P.fg&=-50331904,P.fg|=16777224|k-90):k>=100&&k<=107?(P.bg&=-50331904,P.bg|=16777224|k-100):k===0?this._processSGR0(P):k===1?P.fg|=134217728:k===3?P.bg|=67108864:k===4?(P.fg|=268435456,this._processUnderline(O.hasSubParams(Q)?O.getSubParams(Q)[0]:1,P)):k===5?P.fg|=536870912:k===7?P.fg|=67108864:k===8?P.fg|=1073741824:k===9?P.fg|=2147483648:k===2?P.bg|=134217728:k===21?this._processUnderline(2,P):k===22?(P.fg&=-134217729,P.bg&=-134217729):k===23?P.bg&=-67108865:k===24?(P.fg&=-268435457,this._processUnderline(0,P)):k===25?P.fg&=-536870913:k===27?P.fg&=-67108865:k===28?P.fg&=-1073741825:k===29?P.fg&=2147483647:k===39?(P.fg&=-67108864,P.fg|=16777215&n.DEFAULT_ATTR_DATA.fg):k===49?(P.bg&=-67108864,P.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):k===38||k===48||k===58?Q+=this._extractColor(O,Q,P):k===53?P.bg|=1073741824:k===55?P.bg&=-1073741825:k===59?(P.extended=P.extended.clone(),P.extended.underlineColor=-1,P.updateExtended()):k===100?(P.fg&=-67108864,P.fg|=16777215&n.DEFAULT_ATTR_DATA.fg,P.bg&=-67108864,P.bg|=16777215&n.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",k);return!0}deviceStatus(O){switch(O.params[0]){case 5:this._coreService.triggerDataEvent(`${l.C0.ESC}[0n`);break;case 6:const F=this._activeBuffer.y+1,k=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[${F};${k}R`)}return!0}deviceStatusPrivate(O){if(O.params[0]===6){const F=this._activeBuffer.y+1,k=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${l.C0.ESC}[?${F};${k}R`)}return!0}softReset(O){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=n.DEFAULT_ATTR_DATA.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(O){const F=O.params[0]||1;switch(F){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const k=F%2==1;return this._optionsService.options.cursorBlink=k,!0}setScrollRegion(O){const F=O.params[0]||1;let k;return(O.length<2||(k=O.params[1])>this._bufferService.rows||k===0)&&(k=this._bufferService.rows),k>F&&(this._activeBuffer.scrollTop=F-1,this._activeBuffer.scrollBottom=k-1,this._setCursor(0,0)),!0}windowOptions(O){if(!B(O.params[0],this._optionsService.rawOptions.windowOptions))return!0;const F=O.length>1?O.params[1]:0;switch(O.params[0]){case 14:F!==2&&this._onRequestWindowsOptionsReport.fire(M.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(M.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${l.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:F!==0&&F!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),F!==0&&F!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:F!==0&&F!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),F!==0&&F!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(O){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(O){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(O){return this._windowTitle=O,this._onTitleChange.fire(O),!0}setIconName(O){return this._iconName=O,!0}setOrReportIndexedColor(O){const F=[],k=O.split(";");for(;k.length>1;){const P=k.shift(),Q=k.shift();if(/^\d+$/.exec(P)){const ee=parseInt(P);if(W(ee))if(Q==="?")F.push({type:0,index:ee});else{const he=(0,R.parseColor)(Q);he&&F.push({type:1,index:ee,color:he})}}}return F.length&&this._onColor.fire(F),!0}setHyperlink(O){const F=O.split(";");return!(F.length<2)&&(F[1]?this._createHyperlink(F[0],F[1]):!F[0]&&this._finishHyperlink())}_createHyperlink(O,F){this._getCurrentLinkId()&&this._finishHyperlink();const k=O.split(":");let P;const Q=k.findIndex((ee=>ee.startsWith("id=")));return Q!==-1&&(P=k[Q].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:P,uri:F}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(O,F){const k=O.split(";");for(let P=0;P<k.length&&!(F>=this._specialColors.length);++P,++F)if(k[P]==="?")this._onColor.fire([{type:0,index:this._specialColors[F]}]);else{const Q=(0,R.parseColor)(k[P]);Q&&this._onColor.fire([{type:1,index:this._specialColors[F],color:Q}])}return!0}setOrReportFgColor(O){return this._setOrReportSpecialColor(O,0)}setOrReportBgColor(O){return this._setOrReportSpecialColor(O,1)}setOrReportCursorColor(O){return this._setOrReportSpecialColor(O,2)}restoreIndexedColor(O){if(!O)return this._onColor.fire([{type:2}]),!0;const F=[],k=O.split(";");for(let P=0;P<k.length;++P)if(/^\d+$/.exec(k[P])){const Q=parseInt(k[P]);W(Q)&&F.push({type:2,index:Q})}return F.length&&this._onColor.fire(F),!0}restoreFgColor(O){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(O){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(O){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,p.DEFAULT_CHARSET),!0}selectCharset(O){return O.length!==2?(this.selectDefaultCharset(),!0):(O[0]==="/"||this._charsetService.setgCharset(T[O[0]],p.CHARSETS[O[1]]||p.DEFAULT_CHARSET),!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){const O=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,O,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=n.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=n.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(O){return this._charsetService.setgLevel(O),!0}screenAlignmentPattern(){const O=new c.CellData;O.content=4194373,O.fg=this._curAttrData.fg,O.bg=this._curAttrData.bg,this._setCursor(0,0);for(let F=0;F<this._bufferService.rows;++F){const k=this._activeBuffer.ybase+this._activeBuffer.y+F,P=this._activeBuffer.lines.get(k);P&&(P.fill(O),P.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(O,F){const k=this._bufferService.buffer,P=this._optionsService.rawOptions;return(Q=>(this._coreService.triggerDataEvent(`${l.C0.ESC}${Q}${l.C0.ESC}\\`),!0))(O==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:O==='"p'?'P1$r61;1"p':O==="r"?`P1$r${k.scrollTop+1};${k.scrollBottom+1}r`:O==="m"?"P1$r0m":O===" q"?`P1$r${{block:2,underline:4,bar:6}[P.cursorStyle]-(P.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(O,F){this._dirtyRowTracker.markRangeDirty(O,F)}}r.InputHandler=Y;let G=class{constructor(X){this._bufferService=X,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(X){X<this.start?this.start=X:X>this.end&&(this.end=X)}markRangeDirty(X,O){X>O&&($=X,X=O,O=$),X<this.start&&(this.start=X),O>this.end&&(this.end=O)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function W(X){return 0<=X&&X<256}G=d([g(0,x.IBufferService)],G)},844:(z,r)=>{function u(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)==null||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=u,r.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,l,p){this._data[g]||(this._data[g]={}),this._data[g][l]=p}get(g,l){return this._data[g]?this._data[g][l]:void 0}clear(){this._data={}}}r.TwoKeyMap=u,r.FourKeyMap=class{constructor(){this._data=new u}set(d,g,l,p,b){this._data.get(d,g)||this._data.set(d,g,new u),this._data.get(d,g).set(l,p,b)}get(d,g,l,p){var b;return(b=this._data.get(d,g))==null?void 0:b.get(l,p)}clear(){this._data.clear()}}},6114:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const u=r.isNode?"node":navigator.userAgent,d=r.isNode?"node":navigator.platform;r.isFirefox=u.includes("Firefox"),r.isLegacyEdge=u.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(u),r.getSafariVersion=function(){if(!r.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(u)},6106:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let u=0;r.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const g=this._getKey(d);if(g===void 0||(u=this._search(g),u===-1)||this._getKey(this._array[u])!==g)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===g);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,g){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do g(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let g=0,l=this._array.length-1;for(;l>=g;){let p=g+l>>1;const b=this._getKey(this._array[p]);if(b>d)l=p-1;else{if(!(b<d)){for(;p>0&&this._getKey(this._array[p-1])===d;)p--;return p}g=p+1}}return g}}},7226:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const d=u(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let w=0,f=0,n=b.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),f=Math.max(w,f),a=b.timeRemaining(),1.5*f>a)return n-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-w))}ms`),void this._start();n=a}this.clear()}}class l extends g{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const w=Date.now()+b;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}r.PriorityTaskQueue=l,r.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:l,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const d=u(643);r.updateWindowsModeWrappedState=function(g){const l=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),p=l==null?void 0:l.get(g.cols-1),b=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);b&&p&&(b.isWrapped=p[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&p[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new u;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}r.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,p=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=d},9092:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const d=u(6349),g=u(7226),l=u(3734),p=u(8437),b=u(4634),w=u(511),f=u(643),n=u(4863),a=u(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(o,c,S){this._hasScrollback=o,this._optionsService=c,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(o){return o?(this._nullCell.fg=o.fg,this._nullCell.bg=o.bg,this._nullCell.extended=o.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new l.ExtendedAttrs),this._nullCell}getWhitespaceCell(o){return o?(this._whitespaceCell.fg=o.fg,this._whitespaceCell.bg=o.bg,this._whitespaceCell.extended=o.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new l.ExtendedAttrs),this._whitespaceCell}getBlankLine(o,c){return new p.BufferLine(this._bufferService.cols,this.getNullCell(o),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const o=this.ybase+this.y-this.ydisp;return o>=0&&o<this._rows}_getCorrectBufferLength(o){if(!this._hasScrollback)return o;const c=o+this._optionsService.rawOptions.scrollback;return c>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:c}fillViewportRows(o){if(this.lines.length===0){o===void 0&&(o=p.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(o))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(o,c){const S=this.getNullCell(p.DEFAULT_ATTR_DATA);let x=0;const m=this._getCorrectBufferLength(c);if(m>this.lines.maxLength&&(this.lines.maxLength=m),this.lines.length>0){if(this._cols<o)for(let y=0;y<this.lines.length;y++)x+=+this.lines.get(y).resize(o,S);let E=0;if(this._rows<c)for(let y=this._rows;y<c;y++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(o,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+E+1?(this.ybase--,E++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(o,S)));else for(let y=this._rows;y>c;y--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(m<this.lines.maxLength){const y=this.lines.length-m;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=m}this.x=Math.min(this.x,o-1),this.y=Math.min(this.y,c-1),E&&(this.y+=E),this.savedX=Math.min(this.savedX,o-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(o,c),this._cols>o))for(let E=0;E<this.lines.length;E++)x+=+this.lines.get(E).resize(o,S);this._cols=o,this._rows=c,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let o=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,o=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return o}get _isReflowEnabled(){const o=this._optionsService.rawOptions.windowsPty;return o&&o.buildNumber?this._hasScrollback&&o.backend==="conpty"&&o.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(o,c){this._cols!==o&&(o>this._cols?this._reflowLarger(o,c):this._reflowSmaller(o,c))}_reflowLarger(o,c){const S=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,o,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(S.length>0){const x=(0,b.reflowLargerCreateNewLayout)(this.lines,S);(0,b.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(o,c,x.countRemoved)}}_reflowLargerAdjustViewport(o,c,S){const x=this.getNullCell(p.DEFAULT_ATTR_DATA);let m=S;for(;m-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new p.BufferLine(o,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(o,c){const S=this.getNullCell(p.DEFAULT_ATTR_DATA),x=[];let m=0;for(let E=this.lines.length-1;E>=0;E--){let y=this.lines.get(E);if(!y||!y.isWrapped&&y.getTrimmedLength()<=o)continue;const R=[y];for(;y.isWrapped&&E>0;)y=this.lines.get(--E),R.unshift(y);const T=this.ybase+this.y;if(T>=E&&T<E+R.length)continue;const I=R[R.length-1].getTrimmedLength(),B=(0,b.reflowSmallerGetNewLineLengths)(R,this._cols,o),M=B.length-R.length;let $;$=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+M):Math.max(0,this.lines.length-this.lines.maxLength+M);const Y=[];for(let k=0;k<M;k++){const P=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);Y.push(P)}Y.length>0&&(x.push({start:E+R.length+m,newLines:Y}),m+=Y.length),R.push(...Y);let G=B.length-1,W=B[G];W===0&&(G--,W=B[G]);let X=R.length-M-1,O=I;for(;X>=0;){const k=Math.min(O,W);if(R[G]===void 0)break;if(R[G].copyCellsFrom(R[X],O-k,W-k,k,!0),W-=k,W===0&&(G--,W=B[G]),O-=k,O===0){X--;const P=Math.max(X,0);O=(0,b.getWrappedLineTrimmedLength)(R,P,this._cols)}}for(let k=0;k<R.length;k++)B[k]<o&&R[k].setCell(B[k],S);let F=M-$;for(;F-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+m)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+M,this.ybase+c-1)}if(x.length>0){const E=[],y=[];for(let G=0;G<this.lines.length;G++)y.push(this.lines.get(G));const R=this.lines.length;let T=R-1,I=0,B=x[I];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+m);let M=0;for(let G=Math.min(this.lines.maxLength-1,R+m-1);G>=0;G--)if(B&&B.start>T+M){for(let W=B.newLines.length-1;W>=0;W--)this.lines.set(G--,B.newLines[W]);G++,E.push({index:T+1,amount:B.newLines.length}),M+=B.newLines.length,B=x[++I]}else this.lines.set(G,y[T--]);let $=0;for(let G=E.length-1;G>=0;G--)E[G].index+=$,this.lines.onInsertEmitter.fire(E[G]),$+=E[G].amount;const Y=Math.max(0,R+m-this.lines.maxLength);Y>0&&this.lines.onTrimEmitter.fire(Y)}}translateBufferLineToString(o,c,S=0,x){const m=this.lines.get(o);return m?m.translateToString(c,S,x):""}getWrappedRangeForLine(o){let c=o,S=o;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:c,last:S}}setupTabStops(o){for(o!=null?this.tabs[o]||(o=this.prevStop(o)):(this.tabs={},o=0);o<this._cols;o+=this._optionsService.rawOptions.tabStopWidth)this.tabs[o]=!0}prevStop(o){for(o==null&&(o=this.x);!this.tabs[--o]&&o>0;);return o>=this._cols?this._cols-1:o<0?0:o}nextStop(o){for(o==null&&(o=this.x);!this.tabs[++o]&&o<this._cols;);return o>=this._cols?this._cols-1:o<0?0:o}clearMarkers(o){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===o&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].dispose(),this.markers.splice(o--,1);this._isClearing=!1}addMarker(o){const c=new n.Marker(o);return this.markers.push(c),c.register(this.lines.onTrim((S=>{c.line-=S,c.line<0&&c.dispose()}))),c.register(this.lines.onInsert((S=>{c.line>=S.index&&(c.line+=S.amount)}))),c.register(this.lines.onDelete((S=>{c.line>=S.index&&c.line<S.index+S.amount&&c.dispose(),c.line>S.index&&(c.line-=S.amount)}))),c.register(c.onDispose((()=>this._removeMarker(c)))),c}_removeMarker(o){this._isClearing||this.markers.splice(this.markers.indexOf(o),1)}}},8437:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const d=u(3734),g=u(511),l=u(643),p=u(482);r.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class w{constructor(n,a,o=!1){this.isWrapped=o,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*n);const c=a||g.CellData.fromCharData([0,l.NULL_CELL_CHAR,l.NULL_CELL_WIDTH,l.NULL_CELL_CODE]);for(let S=0;S<n;++S)this.setCell(S,c);this.length=n}get(n){const a=this._data[3*n+0],o=2097151&a;return[this._data[3*n+1],2097152&a?this._combined[n]:o?(0,p.stringFromCodePoint)(o):"",a>>22,2097152&a?this._combined[n].charCodeAt(this._combined[n].length-1):o]}set(n,a){this._data[3*n+1]=a[l.CHAR_DATA_ATTR_INDEX],a[l.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[n]=a[1],this._data[3*n+0]=2097152|n|a[l.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*n+0]=a[l.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[l.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(n){return this._data[3*n+0]>>22}hasWidth(n){return 12582912&this._data[3*n+0]}getFg(n){return this._data[3*n+1]}getBg(n){return this._data[3*n+2]}hasContent(n){return 4194303&this._data[3*n+0]}getCodePoint(n){const a=this._data[3*n+0];return 2097152&a?this._combined[n].charCodeAt(this._combined[n].length-1):2097151&a}isCombined(n){return 2097152&this._data[3*n+0]}getString(n){const a=this._data[3*n+0];return 2097152&a?this._combined[n]:2097151&a?(0,p.stringFromCodePoint)(2097151&a):""}isProtected(n){return 536870912&this._data[3*n+2]}loadCell(n,a){return b=3*n,a.content=this._data[b+0],a.fg=this._data[b+1],a.bg=this._data[b+2],2097152&a.content&&(a.combinedData=this._combined[n]),268435456&a.bg&&(a.extended=this._extendedAttrs[n]),a}setCell(n,a){2097152&a.content&&(this._combined[n]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[n]=a.extended),this._data[3*n+0]=a.content,this._data[3*n+1]=a.fg,this._data[3*n+2]=a.bg}setCellFromCodepoint(n,a,o,c){268435456&c.bg&&(this._extendedAttrs[n]=c.extended),this._data[3*n+0]=a|o<<22,this._data[3*n+1]=c.fg,this._data[3*n+2]=c.bg}addCodepointToCell(n,a,o){let c=this._data[3*n+0];2097152&c?this._combined[n]+=(0,p.stringFromCodePoint)(a):2097151&c?(this._combined[n]=(0,p.stringFromCodePoint)(2097151&c)+(0,p.stringFromCodePoint)(a),c&=-2097152,c|=2097152):c=a|4194304,o&&(c&=-12582913,c|=o<<22),this._data[3*n+0]=c}insertCells(n,a,o){if((n%=this.length)&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),a<this.length-n){const c=new g.CellData;for(let S=this.length-n-a-1;S>=0;--S)this.setCell(n+a+S,this.loadCell(n+S,c));for(let S=0;S<a;++S)this.setCell(n+S,o)}else for(let c=n;c<this.length;++c)this.setCell(c,o);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,o)}deleteCells(n,a,o){if(n%=this.length,a<this.length-n){const c=new g.CellData;for(let S=0;S<this.length-n-a;++S)this.setCell(n+S,this.loadCell(n+a+S,c));for(let S=this.length-a;S<this.length;++S)this.setCell(S,o)}else for(let c=n;c<this.length;++c)this.setCell(c,o);n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),this.getWidth(n)!==0||this.hasContent(n)||this.setCellFromCodepoint(n,0,1,o)}replaceCells(n,a,o,c=!1){if(c)for(n&&this.getWidth(n-1)===2&&!this.isProtected(n-1)&&this.setCellFromCodepoint(n-1,0,1,o),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,o);n<a&&n<this.length;)this.isProtected(n)||this.setCell(n,o),n++;else for(n&&this.getWidth(n-1)===2&&this.setCellFromCodepoint(n-1,0,1,o),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,o);n<a&&n<this.length;)this.setCell(n++,o)}resize(n,a){if(n===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const o=3*n;if(n>this.length){if(this._data.buffer.byteLength>=4*o)this._data=new Uint32Array(this._data.buffer,0,o);else{const c=new Uint32Array(o);c.set(this._data),this._data=c}for(let c=this.length;c<n;++c)this.setCell(c,a)}else{this._data=this._data.subarray(0,o);const c=Object.keys(this._combined);for(let x=0;x<c.length;x++){const m=parseInt(c[x],10);m>=n&&delete this._combined[m]}const S=Object.keys(this._extendedAttrs);for(let x=0;x<S.length;x++){const m=parseInt(S[x],10);m>=n&&delete this._extendedAttrs[m]}}return this.length=n,4*o*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const n=new Uint32Array(this._data.length);return n.set(this._data),this._data=n,1}return 0}fill(n,a=!1){if(a)for(let o=0;o<this.length;++o)this.isProtected(o)||this.setCell(o,n);else{this._combined={},this._extendedAttrs={};for(let o=0;o<this.length;++o)this.setCell(o,n)}}copyFrom(n){this.length!==n.length?this._data=new Uint32Array(n._data):this._data.set(n._data),this.length=n.length,this._combined={};for(const a in n._combined)this._combined[a]=n._combined[a];this._extendedAttrs={};for(const a in n._extendedAttrs)this._extendedAttrs[a]=n._extendedAttrs[a];this.isWrapped=n.isWrapped}clone(){const n=new w(0);n._data=new Uint32Array(this._data),n.length=this.length;for(const a in this._combined)n._combined[a]=this._combined[a];for(const a in this._extendedAttrs)n._extendedAttrs[a]=this._extendedAttrs[a];return n.isWrapped=this.isWrapped,n}getTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0])return n+(this._data[3*n+0]>>22);return 0}getNoBgTrimmedLength(){for(let n=this.length-1;n>=0;--n)if(4194303&this._data[3*n+0]||50331648&this._data[3*n+2])return n+(this._data[3*n+0]>>22);return 0}copyCellsFrom(n,a,o,c,S){const x=n._data;if(S)for(let E=c-1;E>=0;E--){for(let y=0;y<3;y++)this._data[3*(o+E)+y]=x[3*(a+E)+y];268435456&x[3*(a+E)+2]&&(this._extendedAttrs[o+E]=n._extendedAttrs[a+E])}else for(let E=0;E<c;E++){for(let y=0;y<3;y++)this._data[3*(o+E)+y]=x[3*(a+E)+y];268435456&x[3*(a+E)+2]&&(this._extendedAttrs[o+E]=n._extendedAttrs[a+E])}const m=Object.keys(n._combined);for(let E=0;E<m.length;E++){const y=parseInt(m[E],10);y>=a&&(this._combined[y-a+o]=n._combined[y])}}translateToString(n,a,o,c){a=a??0,o=o??this.length,n&&(o=Math.min(o,this.getTrimmedLength())),c&&(c.length=0);let S="";for(;a<o;){const x=this._data[3*a+0],m=2097151&x,E=2097152&x?this._combined[a]:m?(0,p.stringFromCodePoint)(m):l.WHITESPACE_CELL_CHAR;if(S+=E,c)for(let y=0;y<E.length;++y)c.push(a);a+=x>>22||1}return c&&c.push(a),S}}r.BufferLine=w},4841:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(u,d){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(z,r)=>{function u(d,g,l){if(g===d.length-1)return d[g].getTrimmedLength();const p=!d[g].hasContent(l-1)&&d[g].getWidth(l-1)===1,b=d[g+1].getWidth(0)===2;return p&&b?l-1:l}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(d,g,l,p,b){const w=[];for(let f=0;f<d.length-1;f++){let n=f,a=d.get(++n);if(!a.isWrapped)continue;const o=[d.get(f)];for(;n<d.length&&a.isWrapped;)o.push(a),a=d.get(++n);if(p>=f&&p<n){f+=o.length-1;continue}let c=0,S=u(o,c,g),x=1,m=0;for(;x<o.length;){const y=u(o,x,g),R=y-m,T=l-S,I=Math.min(R,T);o[c].copyCellsFrom(o[x],m,S,I,!1),S+=I,S===l&&(c++,S=0),m+=I,m===y&&(x++,m=0),S===0&&c!==0&&o[c-1].getWidth(l-1)===2&&(o[c].copyCellsFrom(o[c-1],l-1,S++,1,!1),o[c-1].setCell(l-1,b))}o[c].replaceCells(S,l,b);let E=0;for(let y=o.length-1;y>0&&(y>c||o[y].getTrimmedLength()===0);y--)E++;E>0&&(w.push(f+o.length-E),w.push(E)),f+=o.length-1}return w},r.reflowLargerCreateNewLayout=function(d,g){const l=[];let p=0,b=g[p],w=0;for(let f=0;f<d.length;f++)if(b===f){const n=g[++p];d.onDeleteEmitter.fire({index:f-w,amount:n}),f+=n-1,w+=n,b=g[++p]}else l.push(f);return{layout:l,countRemoved:w}},r.reflowLargerApplyNewLayout=function(d,g){const l=[];for(let p=0;p<g.length;p++)l.push(d.get(g[p]));for(let p=0;p<l.length;p++)d.set(p,l[p]);d.length=g.length},r.reflowSmallerGetNewLineLengths=function(d,g,l){const p=[],b=d.map(((a,o)=>u(d,o,g))).reduce(((a,o)=>a+o));let w=0,f=0,n=0;for(;n<b;){if(b-n<l){p.push(b-n);break}w+=l;const a=u(d,f,g);w>a&&(w-=a,f++);const o=d[f].getWidth(w-1)===2;o&&w--;const c=o?l-1:l;p.push(c),n+=c}return p},r.getWrappedLineTrimmedLength=u},5295:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const d=u(8460),g=u(844),l=u(9092);class p extends g.Disposable{constructor(w,f){super(),this._optionsService=w,this._bufferService=f,this._onBufferActivate=this.register(new d.EventEmitter),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 l.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new l.Buffer(!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(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),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(w,f){this._normal.resize(w,f),this._alt.resize(w,f),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}r.BufferSet=p},511:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const d=u(482),g=u(643),l=u(3734);class p extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const f=new p;return f.setFromCharData(w),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const n=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const a=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(n-55296)+a-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=p},643:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const d=u(8460),g=u(844);class l{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=l._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,g.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}r.Marker=l,l._nextId=1},7116:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(z,r)=>{var u,d,g;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,(function(l){l.NUL="\0",l.SOH="",l.STX="",l.ETX="",l.EOT="",l.ENQ="",l.ACK="",l.BEL="\x07",l.BS="\b",l.HT=" ",l.LF=`
81
- `,l.VT="\v",l.FF="\f",l.CR="\r",l.SO="",l.SI="",l.DLE="",l.DC1="",l.DC2="",l.DC3="",l.DC4="",l.NAK="",l.SYN="",l.ETB="",l.CAN="",l.EM="",l.SUB="",l.ESC="\x1B",l.FS="",l.GS="",l.RS="",l.US="",l.SP=" ",l.DEL=""})(u||(r.C0=u={})),(function(l){l.PAD="€",l.HOP="",l.BPH="‚",l.NBH="ƒ",l.IND="„",l.NEL="…",l.SSA="†",l.ESA="‡",l.HTS="ˆ",l.HTJ="‰",l.VTS="Š",l.PLD="‹",l.PLU="Œ",l.RI="",l.SS2="Ž",l.SS3="",l.DCS="",l.PU1="‘",l.PU2="’",l.STS="“",l.CCH="”",l.MW="•",l.SPA="–",l.EPA="—",l.SOS="˜",l.SGCI="™",l.SCI="š",l.CSI="›",l.ST="œ",l.OSC="",l.PM="ž",l.APC="Ÿ"})(d||(r.C1=d={})),(function(l){l.ST=`${u.ESC}\\`})(g||(r.C1_ESCAPED=g={}))},7399:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const d=u(2584),g={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:["'",'"']};r.evaluateKeyboardEvent=function(l,p,b,w){const f={type:0,cancel:!1,key:void 0},n=(l.shiftKey?1:0)|(l.altKey?2:0)|(l.ctrlKey?4:0)|(l.metaKey?8:0);switch(l.keyCode){case 0:l.key==="UIKeyInputUpArrow"?f.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A":l.key==="UIKeyInputLeftArrow"?f.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D":l.key==="UIKeyInputRightArrow"?f.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C":l.key==="UIKeyInputDownArrow"&&(f.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:f.key=l.ctrlKey?"\b":d.C0.DEL,l.altKey&&(f.key=d.C0.ESC+f.key);break;case 9:if(l.shiftKey){f.key=d.C0.ESC+"[Z";break}f.key=d.C0.HT,f.cancel=!0;break;case 13:f.key=l.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,f.cancel=!0;break;case 27:f.key=d.C0.ESC,l.altKey&&(f.key=d.C0.ESC+d.C0.ESC),f.cancel=!0;break;case 37:if(l.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"D",f.key===d.C0.ESC+"[1;3D"&&(f.key=d.C0.ESC+(b?"b":"[1;5D"))):f.key=p?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(l.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"C",f.key===d.C0.ESC+"[1;3C"&&(f.key=d.C0.ESC+(b?"f":"[1;5C"))):f.key=p?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(l.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"A",b||f.key!==d.C0.ESC+"[1;3A"||(f.key=d.C0.ESC+"[1;5A")):f.key=p?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(l.metaKey)break;n?(f.key=d.C0.ESC+"[1;"+(n+1)+"B",b||f.key!==d.C0.ESC+"[1;3B"||(f.key=d.C0.ESC+"[1;5B")):f.key=p?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:l.shiftKey||l.ctrlKey||(f.key=d.C0.ESC+"[2~");break;case 46:f.key=n?d.C0.ESC+"[3;"+(n+1)+"~":d.C0.ESC+"[3~";break;case 36:f.key=n?d.C0.ESC+"[1;"+(n+1)+"H":p?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:f.key=n?d.C0.ESC+"[1;"+(n+1)+"F":p?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:l.shiftKey?f.type=2:l.ctrlKey?f.key=d.C0.ESC+"[5;"+(n+1)+"~":f.key=d.C0.ESC+"[5~";break;case 34:l.shiftKey?f.type=3:l.ctrlKey?f.key=d.C0.ESC+"[6;"+(n+1)+"~":f.key=d.C0.ESC+"[6~";break;case 112:f.key=n?d.C0.ESC+"[1;"+(n+1)+"P":d.C0.ESC+"OP";break;case 113:f.key=n?d.C0.ESC+"[1;"+(n+1)+"Q":d.C0.ESC+"OQ";break;case 114:f.key=n?d.C0.ESC+"[1;"+(n+1)+"R":d.C0.ESC+"OR";break;case 115:f.key=n?d.C0.ESC+"[1;"+(n+1)+"S":d.C0.ESC+"OS";break;case 116:f.key=n?d.C0.ESC+"[15;"+(n+1)+"~":d.C0.ESC+"[15~";break;case 117:f.key=n?d.C0.ESC+"[17;"+(n+1)+"~":d.C0.ESC+"[17~";break;case 118:f.key=n?d.C0.ESC+"[18;"+(n+1)+"~":d.C0.ESC+"[18~";break;case 119:f.key=n?d.C0.ESC+"[19;"+(n+1)+"~":d.C0.ESC+"[19~";break;case 120:f.key=n?d.C0.ESC+"[20;"+(n+1)+"~":d.C0.ESC+"[20~";break;case 121:f.key=n?d.C0.ESC+"[21;"+(n+1)+"~":d.C0.ESC+"[21~";break;case 122:f.key=n?d.C0.ESC+"[23;"+(n+1)+"~":d.C0.ESC+"[23~";break;case 123:f.key=n?d.C0.ESC+"[24;"+(n+1)+"~":d.C0.ESC+"[24~";break;default:if(!l.ctrlKey||l.shiftKey||l.altKey||l.metaKey)if(b&&!w||!l.altKey||l.metaKey)!b||l.altKey||l.ctrlKey||l.shiftKey||!l.metaKey?l.key&&!l.ctrlKey&&!l.altKey&&!l.metaKey&&l.keyCode>=48&&l.key.length===1?f.key=l.key:l.key&&l.ctrlKey&&(l.key==="_"&&(f.key=d.C0.US),l.key==="@"&&(f.key=d.C0.NUL)):l.keyCode===65&&(f.type=1);else{const a=g[l.keyCode],o=a==null?void 0:a[l.shiftKey?1:0];if(o)f.key=d.C0.ESC+o;else if(l.keyCode>=65&&l.keyCode<=90){const c=l.ctrlKey?l.keyCode-64:l.keyCode+32;let S=String.fromCharCode(c);l.shiftKey&&(S=S.toUpperCase()),f.key=d.C0.ESC+S}else if(l.keyCode===32)f.key=d.C0.ESC+(l.ctrlKey?d.C0.NUL:" ");else if(l.key==="Dead"&&l.code.startsWith("Key")){let c=l.code.slice(3,4);l.shiftKey||(c=c.toLowerCase()),f.key=d.C0.ESC+c,f.cancel=!0}}else l.keyCode>=65&&l.keyCode<=90?f.key=String.fromCharCode(l.keyCode-64):l.keyCode===32?f.key=d.C0.NUL:l.keyCode>=51&&l.keyCode<=55?f.key=String.fromCharCode(l.keyCode-51+27):l.keyCode===56?f.key=d.C0.DEL:l.keyCode===219?f.key=d.C0.ESC:l.keyCode===220?f.key=d.C0.FS:l.keyCode===221&&(f.key=d.C0.GS)}return f}},482:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},r.utf32ToString=function(u,d=0,g=u.length){let l="";for(let p=d;p<g;++p){let b=u[p];b>65535?(b-=65536,l+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):l+=String.fromCharCode(b)}return l},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const g=u.length;if(!g)return 0;let l=0,p=0;if(this._interim){const b=u.charCodeAt(p++);56320<=b&&b<=57343?d[l++]=1024*(this._interim-55296)+b-56320+65536:(d[l++]=this._interim,d[l++]=b),this._interim=0}for(let b=p;b<g;++b){const w=u.charCodeAt(b);if(55296<=w&&w<=56319){if(++b>=g)return this._interim=w,l;const f=u.charCodeAt(b);56320<=f&&f<=57343?d[l++]=1024*(w-55296)+f-56320+65536:(d[l++]=w,d[l++]=f)}else w!==65279&&(d[l++]=w)}return l}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const g=u.length;if(!g)return 0;let l,p,b,w,f=0,n=0,a=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let m,E=0;for(;(m=63&this.interim[++E])&&E<4;)x<<=6,x|=m;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=y-E;for(;a<R;){if(a>=g)return 0;if(m=u[a++],(192&m)!=128){a--,S=!0;break}this.interim[E++]=m,x<<=6,x|=63&m}S||(y===2?x<128?a--:d[f++]=x:y===3?x<2048||x>=55296&&x<=57343||x===65279||(d[f++]=x):x<65536||x>1114111||(d[f++]=x)),this.interim.fill(0)}const o=g-4;let c=a;for(;c<g;){for(;!(!(c<o)||128&(l=u[c])||128&(p=u[c+1])||128&(b=u[c+2])||128&(w=u[c+3]));)d[f++]=l,d[f++]=p,d[f++]=b,d[f++]=w,c+=4;if(l=u[c++],l<128)d[f++]=l;else if((224&l)==192){if(c>=g)return this.interim[0]=l,f;if(p=u[c++],(192&p)!=128){c--;continue}if(n=(31&l)<<6|63&p,n<128){c--;continue}d[f++]=n}else if((240&l)==224){if(c>=g)return this.interim[0]=l,f;if(p=u[c++],(192&p)!=128){c--;continue}if(c>=g)return this.interim[0]=l,this.interim[1]=p,f;if(b=u[c++],(192&b)!=128){c--;continue}if(n=(15&l)<<12|(63&p)<<6|63&b,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&l)==240){if(c>=g)return this.interim[0]=l,f;if(p=u[c++],(192&p)!=128){c--;continue}if(c>=g)return this.interim[0]=l,this.interim[1]=p,f;if(b=u[c++],(192&b)!=128){c--;continue}if(c>=g)return this.interim[0]=l,this.interim[1]=p,this.interim[2]=b,f;if(w=u[c++],(192&w)!=128){c--;continue}if(n=(7&l)<<18|(63&p)<<12|(63&b)<<6|63&w,n<65536||n>1114111)continue;d[f++]=n}}return f}}},225:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const d=u(1480),g=[[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]],l=[[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]];let p;r.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let b=0;b<g.length;++b)p.fill(0,g[b][0],g[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?p[b]:(function(w,f){let n,a=0,o=f.length-1;if(w<f[0][0]||w>f[o][1])return!1;for(;o>=a;)if(n=a+o>>1,w>f[n][1])a=n+1;else{if(!(w<f[n][0]))return!0;o=n-1}return!1})(b,l)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,w){let f=this.wcwidth(b),n=f===0&&w!==0;if(n){const a=d.UnicodeService.extractWidth(w);a===0?n=!1:a>f&&(f=a)}return d.UnicodeService.createPropertyValue(0,f,n)}}},5981:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const d=u(8460),g=u(844);class l extends g.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let f;for(this._isSyncWriting=!0;f=this._writeBuffer.shift();){this._action(f);const n=this._callbacks.shift();n&&n()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(w)}_innerWrite(b=0,w=!0){const f=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const n=this._writeBuffer[this._bufferOffset],a=this._action(n,w);if(a){const c=S=>Date.now()-f>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(f,S);return void a.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(c)}const o=this._callbacks[this._bufferOffset];if(o&&o(),this._bufferOffset++,this._pendingData-=n.length,Date.now()-f>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}r.WriteBuffer=l},5941:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const u=/^([\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})$/,d=/^[\da-f]+$/;function g(l,p){const b=l.toString(16),w=b.length<2?"0"+b:b;switch(p){case 4:return b[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}r.parseColor=function(l){if(!l)return;let p=l.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const b=u.exec(p);if(b){const w=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/w*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/w*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/w*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),d.exec(p)&&[3,6,9,12].includes(p.length))){const b=p.length/3,w=[0,0,0];for(let f=0;f<3;++f){const n=parseInt(p.slice(b*f,b*f+b),16);w[f]=b===1?n<<4:b===2?n:b===3?n>>4:n>>8}return w}},r.toRgbString=function(l,p=16){const[b,w,f]=l;return`rgb:${g(b,p)}/${g(w,p)}/${g(f,p)}`}},5770:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const d=u(482),g=u(8742),l=u(5770),p=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(w,f){this._handlers[w]===void 0&&(this._handlers[w]=[]);const n=this._handlers[w];return n.push(f),{dispose:()=>{const a=n.indexOf(f);a!==-1&&n.splice(a,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(w,f){if(this.reset(),this._ident=w,this._active=this._handlers[w]||p,this._active.length)for(let n=this._active.length-1;n>=0;n--)this._active[n].hook(f);else this._handlerFb(this._ident,"HOOK",f)}put(w,f,n){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(w,f,n);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(w,f,n))}unhook(w,f=!0){if(this._active.length){let n=!1,a=this._active.length-1,o=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,n=f,o=this._stack.fallThrough,this._stack.paused=!1),!o&&n===!1){for(;a>=0&&(n=this._active[a].unhook(w),n!==!0);a--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,n;a--}for(;a>=0;a--)if(n=this._active[a].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,n}else this._handlerFb(this._ident,"UNHOOK",w);this._active=p,this._ident=0}};const b=new g.Params;b.addParam(0),r.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=b,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():b,this._data="",this._hitLimit=!1}put(w,f,n){this._hitLimit||(this._data+=(0,d.utf32ToString)(w,f,n),this._data.length>l.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let f=!1;if(this._hitLimit)f=!1;else if(w&&(f=this._handler(this._data,this._params),f instanceof Promise))return f.then((n=>(this._params=b,this._data="",this._hitLimit=!1,n)));return this._params=b,this._data="",this._hitLimit=!1,f}}},2015:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const d=u(844),g=u(8742),l=u(6242),p=u(6351);class b{constructor(a){this.table=new Uint8Array(a)}setDefault(a,o){this.table.fill(a<<4|o)}add(a,o,c,S){this.table[o<<8|a]=c<<4|S}addMany(a,o,c,S){for(let x=0;x<a.length;x++)this.table[o<<8|a[x]]=c<<4|S}}r.TransitionTable=b;const w=160;r.VT500_TRANSITION_TABLE=(function(){const n=new b(4095),a=Array.apply(null,Array(256)).map(((E,y)=>y)),o=(E,y)=>a.slice(E,y),c=o(32,127),S=o(0,24);S.push(25),S.push.apply(S,o(28,32));const x=o(0,14);let m;for(m in n.setDefault(1,0),n.addMany(c,0,2,0),x)n.addMany([24,26,153,154],m,3,0),n.addMany(o(128,144),m,3,0),n.addMany(o(144,152),m,3,0),n.add(156,m,0,0),n.add(27,m,11,1),n.add(157,m,4,8),n.addMany([152,158,159],m,0,7),n.add(155,m,11,3),n.add(144,m,11,9);return n.addMany(S,0,3,0),n.addMany(S,1,3,1),n.add(127,1,0,1),n.addMany(S,8,0,8),n.addMany(S,3,3,3),n.add(127,3,0,3),n.addMany(S,4,3,4),n.add(127,4,0,4),n.addMany(S,6,3,6),n.addMany(S,5,3,5),n.add(127,5,0,5),n.addMany(S,2,3,2),n.add(127,2,0,2),n.add(93,1,4,8),n.addMany(c,8,5,8),n.add(127,8,5,8),n.addMany([156,27,24,26,7],8,6,0),n.addMany(o(28,32),8,0,8),n.addMany([88,94,95],1,0,7),n.addMany(c,7,0,7),n.addMany(S,7,0,7),n.add(156,7,0,0),n.add(127,7,0,7),n.add(91,1,11,3),n.addMany(o(64,127),3,7,0),n.addMany(o(48,60),3,8,4),n.addMany([60,61,62,63],3,9,4),n.addMany(o(48,60),4,8,4),n.addMany(o(64,127),4,7,0),n.addMany([60,61,62,63],4,0,6),n.addMany(o(32,64),6,0,6),n.add(127,6,0,6),n.addMany(o(64,127),6,0,0),n.addMany(o(32,48),3,9,5),n.addMany(o(32,48),5,9,5),n.addMany(o(48,64),5,0,6),n.addMany(o(64,127),5,7,0),n.addMany(o(32,48),4,9,5),n.addMany(o(32,48),1,9,2),n.addMany(o(32,48),2,9,2),n.addMany(o(48,127),2,10,0),n.addMany(o(48,80),1,10,0),n.addMany(o(81,88),1,10,0),n.addMany([89,90,92],1,10,0),n.addMany(o(96,127),1,10,0),n.add(80,1,11,9),n.addMany(S,9,0,9),n.add(127,9,0,9),n.addMany(o(28,32),9,0,9),n.addMany(o(32,48),9,9,12),n.addMany(o(48,60),9,8,10),n.addMany([60,61,62,63],9,9,10),n.addMany(S,11,0,11),n.addMany(o(32,128),11,0,11),n.addMany(o(28,32),11,0,11),n.addMany(S,10,0,10),n.add(127,10,0,10),n.addMany(o(28,32),10,0,10),n.addMany(o(48,60),10,8,10),n.addMany([60,61,62,63],10,0,11),n.addMany(o(32,48),10,9,12),n.addMany(S,12,0,12),n.add(127,12,0,12),n.addMany(o(28,32),12,0,12),n.addMany(o(32,48),12,9,12),n.addMany(o(48,64),12,0,11),n.addMany(o(64,127),12,12,13),n.addMany(o(64,127),10,12,13),n.addMany(o(64,127),9,12,13),n.addMany(S,13,13,13),n.addMany(c,13,13,13),n.add(127,13,0,13),n.addMany([27,156,24,26],13,14,0),n.add(w,0,2,0),n.add(w,8,5,8),n.add(w,6,0,6),n.add(w,11,0,11),n.add(w,13,13,13),n})();class f extends d.Disposable{constructor(a=r.VT500_TRANSITION_TABLE){super(),this._transitions=a,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(o,c,S)=>{},this._executeHandlerFb=o=>{},this._csiHandlerFb=(o,c)=>{},this._escHandlerFb=o=>{},this._errorHandlerFb=o=>o,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new l.OscParser),this._dcsParser=this.register(new p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(a,o=[64,126]){let c=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=a.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<a.intermediates.length;++x){const m=a.intermediates.charCodeAt(x);if(32>m||m>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=m}}if(a.final.length!==1)throw new Error("final must be a single byte");const S=a.final.charCodeAt(0);if(o[0]>S||S>o[1])throw new Error(`final must be in range ${o[0]} .. ${o[1]}`);return c<<=8,c|=S,c}identToString(a){const o=[];for(;a;)o.push(String.fromCharCode(255&a)),a>>=8;return o.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,o){const c=this._identifier(a,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const S=this._escHandlers[c];return S.push(o),{dispose:()=>{const x=S.indexOf(o);x!==-1&&S.splice(x,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,o){this._executeHandlers[a.charCodeAt(0)]=o}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,o){const c=this._identifier(a);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const S=this._csiHandlers[c];return S.push(o),{dispose:()=>{const x=S.indexOf(o);x!==-1&&S.splice(x,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,o){return this._dcsParser.registerHandler(this._identifier(a),o)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,o){return this._oscParser.registerHandler(a,o)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}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(a,o,c,S,x){this._parseStack.state=a,this._parseStack.handlers=o,this._parseStack.handlerPos=c,this._parseStack.transition=S,this._parseStack.chunkPos=x}parse(a,o,c){let S,x=0,m=0,E=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,E=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let R=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&R>-1){for(;R>=0&&(S=y[R](this._params),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 4:if(c===!1&&R>-1){for(;R>=0&&(S=y[R](),S!==!0);R--)if(S instanceof Promise)return this._parseStack.handlerPos=R,S}this._parseStack.handlers=[];break;case 6:if(x=a[this._parseStack.chunkPos],S=this._dcsParser.unhook(x!==24&&x!==26,c),S)return S;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=a[this._parseStack.chunkPos],S=this._oscParser.end(x!==24&&x!==26,c),S)return S;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,E=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let y=E;y<o;++y){switch(x=a[y],m=this._transitions.table[this.currentState<<8|(x<160?x:w)],m>>4){case 2:for(let M=y+1;;++M){if(M>=o||(x=a[M])<32||x>126&&x<w){this._printHandler(a,y,M),y=M-1;break}if(++M>=o||(x=a[M])<32||x>126&&x<w){this._printHandler(a,y,M),y=M-1;break}if(++M>=o||(x=a[M])<32||x>126&&x<w){this._printHandler(a,y,M),y=M-1;break}if(++M>=o||(x=a[M])<32||x>126&&x<w){this._printHandler(a,y,M),y=M-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const R=this._csiHandlers[this._collect<<8|x];let T=R?R.length-1:-1;for(;T>=0&&(S=R[T](this._params),S!==!0);T--)if(S instanceof Promise)return this._preserveStack(3,R,T,m,y),S;T<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingJoinState=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++y<o&&(x=a[y])>47&&x<60);y--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:const I=this._escHandlers[this._collect<<8|x];let B=I?I.length-1:-1;for(;B>=0&&(S=I[B](),S!==!0);B--)if(S instanceof Promise)return this._preserveStack(4,I,B,m,y),S;B<0&&this._escHandlerFb(this._collect<<8|x),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|x,this._params);break;case 13:for(let M=y+1;;++M)if(M>=o||(x=a[M])===24||x===26||x===27||x>127&&x<w){this._dcsParser.put(a,y,M),y=M-1;break}break;case 14:if(S=this._dcsParser.unhook(x!==24&&x!==26),S)return this._preserveStack(6,[],0,m,y),S;x===27&&(m|=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 M=y+1;;M++)if(M>=o||(x=a[M])<32||x>127&&x<w){this._oscParser.put(a,y,M),y=M-1;break}break;case 6:if(S=this._oscParser.end(x!==24&&x!==26),S)return this._preserveStack(5,[],0,m,y),S;x===27&&(m|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&m}}}r.EscapeSequenceParser=f},6242:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const d=u(5770),g=u(482),l=[];r.OscParser=class{constructor(){this._state=0,this._active=l,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(p,b){this._handlers[p]===void 0&&(this._handlers[p]=[]);const w=this._handlers[p];return w.push(b),{dispose:()=>{const f=w.indexOf(b);f!==-1&&w.splice(f,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=l}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=l,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||l,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,b,w){if(this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].put(p,b,w);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(p,b,w))}start(){this.reset(),this._state=1}put(p,b,w){if(this._state!==3){if(this._state===1)for(;b<w;){const f=p[b++];if(f===59){this._state=2,this._start();break}if(f<48||57<f)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+f-48}this._state===2&&w-b>0&&this._put(p,b,w)}}end(p,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,f=this._active.length-1,n=!1;if(this._stack.paused&&(f=this._stack.loopPosition-1,w=b,n=this._stack.fallThrough,this._stack.paused=!1),!n&&w===!1){for(;f>=0&&(w=this._active[f].end(p),w!==!0);f--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!1,w;f--}for(;f>=0;f--)if(w=this._active[f].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=f,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",p);this._active=l,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,b,w){this._hitLimit||(this._data+=(0,g.utf32ToString)(p,b,w),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let b=!1;if(this._hitLimit)b=!1;else if(p&&(b=this._handler(this._data),b instanceof Promise))return b.then((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,b}}},8742:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const u=2147483647;class d{static fromArray(l){const p=new d;if(!l.length)return p;for(let b=Array.isArray(l[0])?1:0;b<l.length;++b){const w=l[b];if(Array.isArray(w))for(let f=0;f<w.length;++f)p.addSubParam(w[f]);else p.addParam(w)}return p}constructor(l=32,p=32){if(this.maxLength=l,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(l),this.length=0,this._subParams=new Int32Array(p),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(l),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const l=new d(this.maxLength,this.maxSubParamsLength);return l.params.set(this.params),l.length=this.length,l._subParams.set(this._subParams),l._subParamsLength=this._subParamsLength,l._subParamsIdx.set(this._subParamsIdx),l._rejectDigits=this._rejectDigits,l._rejectSubDigits=this._rejectSubDigits,l._digitIsSub=this._digitIsSub,l}toArray(){const l=[];for(let p=0;p<this.length;++p){l.push(this.params[p]);const b=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-b>0&&l.push(Array.prototype.slice.call(this._subParams,b,w))}return l}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(l){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=l>u?u:l}}addSubParam(l){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(l<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=l>u?u:l,this._subParamsIdx[this.length-1]++}}hasSubParams(l){return(255&this._subParamsIdx[l])-(this._subParamsIdx[l]>>8)>0}getSubParams(l){const p=this._subParamsIdx[l]>>8,b=255&this._subParamsIdx[l];return b-p>0?this._subParams.subarray(p,b):null}getSubParamsAll(){const l={};for(let p=0;p<this.length;++p){const b=this._subParamsIdx[p]>>8,w=255&this._subParamsIdx[p];w-b>0&&(l[p]=this._subParams.slice(b,w))}return l}addDigit(l){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,w=b[p-1];b[p-1]=~w?Math.min(10*w+l,u):l}}r.Params=d},5741:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const g={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(g),d.dispose=()=>this._wrappedAddonDispose(g),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===u){d=g;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(d,1)}}},8771:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const d=u(3785),g=u(511);r.BufferApiView=class{constructor(l,p){this._buffer=l,this.type=p}init(l){return this._buffer=l,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(l){const p=this._buffer.lines.get(l);if(p)return new d.BufferLineApiView(p)}getNullCell(){return new g.CellData}}},3785:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const d=u(511);r.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,l){if(!(g<0||g>=this._line.length))return l?(this._line.loadCell(g,l),l):this._line.loadCell(g,new d.CellData)}translateToString(g,l,p){return this._line.translateToString(g,l,p)}}},8285:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const d=u(8771),g=u(8460),l=u(844);class p extends l.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new g.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.BufferApiView(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)}}r.BufferNamespaceApi=p},7975:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(g=>d(g.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((g,l)=>d(g,l.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(z,r,u){var d=this&&this.__decorate||function(n,a,o,c){var S,x=arguments.length,m=x<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(n,a,o,c);else for(var E=n.length-1;E>=0;E--)(S=n[E])&&(m=(x<3?S(m):x>3?S(a,o,m):S(a,o))||m);return x>3&&m&&Object.defineProperty(a,o,m),m},g=this&&this.__param||function(n,a){return function(o,c){a(o,c,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const l=u(8460),p=u(844),b=u(5295),w=u(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let f=r.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(n){super(),this.isUserScrolling=!1,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new l.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(n.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(n.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(n,this))}resize(n,a){this.cols=n,this.rows=a,this.buffers.resize(n,a),this._onResize.fire({cols:n,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(n,a=!1){const o=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===n.fg&&c.getBg(0)===n.bg||(c=o.getBlankLine(n,a),this._cachedBlankLine=c),c.isWrapped=a;const S=o.ybase+o.scrollTop,x=o.ybase+o.scrollBottom;if(o.scrollTop===0){const m=o.lines.isFull;x===o.lines.length-1?m?o.lines.recycle().copyFrom(c):o.lines.push(c.clone()):o.lines.splice(x+1,0,c.clone()),m?this.isUserScrolling&&(o.ydisp=Math.max(o.ydisp-1,0)):(o.ybase++,this.isUserScrolling||o.ydisp++)}else{const m=x-S+1;o.lines.shiftElements(S+1,m-1,-1),o.lines.set(x,c.clone())}this.isUserScrolling||(o.ydisp=o.ybase),this._onScroll.fire(o.ydisp)}scrollLines(n,a,o){const c=this.buffer;if(n<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else n+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const S=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+n,c.ybase),0),S!==c.ydisp&&(a||this._onScroll.fire(c.ydisp))}};r.BufferService=f=d([g(0,w.IOptionsService)],f)},7994:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(z,r,u){var d=this&&this.__decorate||function(c,S,x,m){var E,y=arguments.length,R=y<3?S:m===null?m=Object.getOwnPropertyDescriptor(S,x):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(c,S,x,m);else for(var T=c.length-1;T>=0;T--)(E=c[T])&&(R=(y<3?E(R):y>3?E(S,x,R):E(S,x))||R);return y>3&&R&&Object.defineProperty(S,x,R),R},g=this&&this.__param||function(c,S){return function(x,m){S(x,m,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const l=u(2585),p=u(8460),b=u(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function f(c,S){let x=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(x|=64,x|=c.action):(x|=3&c.button,4&c.button&&(x|=64),8&c.button&&(x|=128),c.action===32?x|=32:c.action!==0||S||(x|=3)),x}const n=String.fromCharCode,a={DEFAULT:c=>{const S=[f(c,!1)+32,c.col+32,c.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${n(S[0])}${n(S[1])}${n(S[2])}`},SGR:c=>{const S=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${f(c,!0)};${c.col};${c.row}${S}`},SGR_PIXELS:c=>{const S=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${f(c,!0)};${c.x};${c.y}${S}`}};let o=r.CoreMouseService=class extends b.Disposable{constructor(c,S){super(),this._bufferService=c,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const x of Object.keys(w))this.addProtocol(x,w[x]);for(const x of Object.keys(a))this.addEncoding(x,a[x]);this.reset()}addProtocol(c,S){this._protocols[c]=S}addEncoding(c,S){this._encodings[c]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const S=this._encodings[this._activeEncoding](c);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,S,x){if(x){if(c.x!==S.x||c.y!==S.y)return!1}else if(c.col!==S.col||c.row!==S.row)return!1;return c.button===S.button&&c.action===S.action&&c.ctrl===S.ctrl&&c.alt===S.alt&&c.shift===S.shift}};r.CoreMouseService=o=d([g(0,l.IBufferService),g(1,l.ICoreService)],o)},6975:function(z,r,u){var d=this&&this.__decorate||function(o,c,S,x){var m,E=arguments.length,y=E<3?c:x===null?x=Object.getOwnPropertyDescriptor(c,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(o,c,S,x);else for(var R=o.length-1;R>=0;R--)(m=o[R])&&(y=(E<3?m(y):E>3?m(c,S,y):m(c,S))||y);return E>3&&y&&Object.defineProperty(c,S,y),y},g=this&&this.__param||function(o,c){return function(S,x){c(S,x,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const l=u(1439),p=u(8460),b=u(844),w=u(2585),f=Object.freeze({insertMode:!1}),n=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=r.CoreService=class extends b.Disposable{constructor(o,c,S){super(),this._bufferService=o,this._logService=c,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,l.clone)(f),this.decPrivateModes=(0,l.clone)(n)}reset(){this.modes=(0,l.clone)(f),this.decPrivateModes=(0,l.clone)(n)}triggerDataEvent(o,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${o}"`,(()=>o.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(o)}triggerBinaryEvent(o){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${o}"`,(()=>o.split("").map((c=>c.charCodeAt(0))))),this._onBinary.fire(o))}};r.CoreService=a=d([g(0,w.IBufferService),g(1,w.ILogService),g(2,w.IOptionsService)],a)},9074:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const d=u(8055),g=u(8460),l=u(844),p=u(6106);let b=0,w=0;class f extends l.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList((o=>o==null?void 0:o.marker.line)),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,l.toDisposable)((()=>this.reset())))}registerDecoration(o){if(o.marker.isDisposed)return;const c=new n(o);if(c){const S=c.marker.onDispose((()=>c.dispose()));c.onDispose((()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),S.dispose())})),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const o of this._decorations.values())o.dispose();this._decorations.clear()}*getDecorationsAtCell(o,c,S){let x=0,m=0;for(const E of this._decorations.getKeyIterator(c))x=E.options.x??0,m=x+(E.options.width??1),o>=x&&o<m&&(!S||(E.options.layer??"bottom")===S)&&(yield E)}forEachDecorationAtCell(o,c,S,x){this._decorations.forEachByKey(c,(m=>{b=m.options.x??0,w=b+(m.options.width??1),o>=b&&o<w&&(!S||(m.options.layer??"bottom")===S)&&x(m)}))}}r.DecorationService=f;class n extends l.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(o){super(),this.options=o,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=o.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const d=u(2585),g=u(8343);class l{constructor(...b){this._entries=new Map;for(const[w,f]of b)this.set(w,f)}set(b,w){const f=this._entries.get(b);return this._entries.set(b,w),f}forEach(b){for(const[w,f]of this._entries.entries())b(w,f)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}r.ServiceCollection=l,r.InstantiationService=class{constructor(){this._services=new l,this._services.set(d.IInstantiationService,this)}setService(p,b){this._services.set(p,b)}getService(p){return this._services.get(p)}createInstance(p,...b){const w=(0,g.getServiceDependencies)(p).sort(((a,o)=>a.index-o.index)),f=[];for(const a of w){const o=this._services.get(a.id);if(!o)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${a.id}.`);f.push(o)}const n=w.length>0?w[0].index:b.length;if(b.length!==n)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${n+1} conflicts with ${b.length} static arguments`);return new p(...b,...f)}}},7866:function(z,r,u){var d=this&&this.__decorate||function(n,a,o,c){var S,x=arguments.length,m=x<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(n,a,o,c);else for(var E=n.length-1;E>=0;E--)(S=n[E])&&(m=(x<3?S(m):x>3?S(a,o,m):S(a,o))||m);return x>3&&m&&Object.defineProperty(a,o,m),m},g=this&&this.__param||function(n,a){return function(o,c){a(o,c,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const l=u(844),p=u(2585),b={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,f=r.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let a=0;a<n.length;a++)typeof n[a]=="function"&&(n[a]=n[a]())}_log(n,a,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...o)}trace(n,...a){var o;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.trace.bind(this._optionsService.options.logger))??console.log,n,a)}debug(n,...a){var o;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.debug.bind(this._optionsService.options.logger))??console.log,n,a)}info(n,...a){var o;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.info.bind(this._optionsService.options.logger))??console.info,n,a)}warn(n,...a){var o;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.warn.bind(this._optionsService.options.logger))??console.warn,n,a)}error(n,...a){var o;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.error.bind(this._optionsService.options.logger))??console.error,n,a)}};r.LogService=f=d([g(0,p.IOptionsService)],f),r.setTraceLogger=function(n){w=n},r.traceCall=function(n,a,o){if(typeof o.value!="function")throw new Error("not supported");const c=o.value;o.value=function(...S){if(w.logLevel!==p.LogLevelEnum.TRACE)return c.apply(this,S);w.trace(`GlyphRenderer#${c.name}(${S.map((m=>JSON.stringify(m))).join(", ")})`);const x=c.apply(this,S);return w.trace(`GlyphRenderer#${c.name} return`,x),x}}},7302:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const d=u(8460),g=u(844),l=u(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:l.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends g.Disposable{constructor(f){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const n={...r.DEFAULT_OPTIONS};for(const a in f)if(a in n)try{const o=f[a];n[a]=this._sanitizeAndValidateOption(a,o)}catch(o){console.error(o)}this.rawOptions=n,this.options={...n},this._setupOptions(),this.register((0,g.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(f,n){return this.onOptionChange((a=>{a===f&&n(this.rawOptions[f])}))}onMultipleOptionChange(f,n){return this.onOptionChange((a=>{f.indexOf(a)!==-1&&n()}))}_setupOptions(){const f=a=>{if(!(a in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},n=(a,o)=>{if(!(a in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);o=this._sanitizeAndValidateOption(a,o),this.rawOptions[a]!==o&&(this.rawOptions[a]=o,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const o={get:f.bind(this,a),set:n.bind(this,a)};Object.defineProperty(this.options,a,o)}}_sanitizeAndValidateOption(f,n){switch(f){case"cursorStyle":if(n||(n=r.DEFAULT_OPTIONS[f]),!(function(a){return a==="block"||a==="underline"||a==="bar"})(n))throw new Error(`"${n}" is not a valid value for ${f}`);break;case"wordSeparator":n||(n=r.DEFAULT_OPTIONS[f]);break;case"fontWeight":case"fontWeightBold":if(typeof n=="number"&&1<=n&&n<=1e3)break;n=p.includes(n)?n:r.DEFAULT_OPTIONS[f];break;case"cursorWidth":n=Math.floor(n);case"lineHeight":case"tabStopWidth":if(n<1)throw new Error(`${f} cannot be less than 1, value: ${n}`);break;case"minimumContrastRatio":n=Math.max(1,Math.min(21,Math.round(10*n)/10));break;case"scrollback":if((n=Math.min(n,4294967295))<0)throw new Error(`${f} cannot be less than 0, value: ${n}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(n<=0)throw new Error(`${f} cannot be less than or equal to 0, value: ${n}`);break;case"rows":case"cols":if(!n&&n!==0)throw new Error(`${f} must be numeric, value: ${n}`);break;case"windowsPty":n=n??{}}return n}}r.OptionsService=b},2660:function(z,r,u){var d=this&&this.__decorate||function(b,w,f,n){var a,o=arguments.length,c=o<3?w:n===null?n=Object.getOwnPropertyDescriptor(w,f):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(b,w,f,n);else for(var S=b.length-1;S>=0;S--)(a=b[S])&&(c=(o<3?a(c):o>3?a(w,f,c):a(w,f))||c);return o>3&&c&&Object.defineProperty(w,f,c),c},g=this&&this.__param||function(b,w){return function(f,n){w(f,n,b)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const l=u(2585);let p=r.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const w=this._bufferService.buffer;if(b.id===void 0){const S=w.addMarker(w.ybase+w.y),x={data:b,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(x,S))),this._dataByLinkId.set(x.id,x),x.id}const f=b,n=this._getEntryIdKey(f),a=this._entriesWithId.get(n);if(a)return this.addLineToLink(a.id,w.ybase+w.y),a.id;const o=w.addMarker(w.ybase+w.y),c={id:this._nextId++,key:this._getEntryIdKey(f),data:f,lines:[o]};return o.onDispose((()=>this._removeMarkerFromLink(c,o))),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(b,w){const f=this._dataByLinkId.get(b);if(f&&f.lines.every((n=>n.line!==w))){const n=this._bufferService.buffer.addMarker(w);f.lines.push(n),n.onDispose((()=>this._removeMarkerFromLink(f,n)))}}getLinkData(b){var w;return(w=this._dataByLinkId.get(b))==null?void 0:w.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,w){const f=b.lines.indexOf(w);f!==-1&&(b.lines.splice(f,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};r.OscLinkService=p=d([g(0,l.IBufferService)],p)},8343:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const u="di$target",d="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(g){return g[d]||[]},r.createDecorator=function(g){if(r.serviceRegistry.has(g))return r.serviceRegistry.get(g);const l=function(p,b,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,a){n[u]===n?n[d].push({id:f,index:a}):(n[d]=[{id:f,index:a}],n[u]=n)})(l,p,w)};return l.toString=()=>g,r.serviceRegistry.set(g,l),l}},2585:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const d=u(8343);var g;r.IBufferService=(0,d.createDecorator)("BufferService"),r.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),r.ICoreService=(0,d.createDecorator)("CoreService"),r.ICharsetService=(0,d.createDecorator)("CharsetService"),r.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(g||(r.LogLevelEnum=g={})),r.ILogService=(0,d.createDecorator)("LogService"),r.IOptionsService=(0,d.createDecorator)("OptionsService"),r.IOscLinkService=(0,d.createDecorator)("OscLinkService"),r.IUnicodeService=(0,d.createDecorator)("UnicodeService"),r.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const d=u(8460),g=u(225);class l{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,w,f=!1){return(16777215&b)<<3|(3&w)<<1|(f?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new g.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let w=0,f=0;const n=b.length;for(let a=0;a<n;++a){let o=b.charCodeAt(a);if(55296<=o&&o<=56319){if(++a>=n)return w+this.wcwidth(o);const x=b.charCodeAt(a);56320<=x&&x<=57343?o=1024*(o-55296)+x-56320+65536:w+=this.wcwidth(x)}const c=this.charProperties(o,f);let S=l.extractWidth(c);l.extractShouldJoin(c)&&(S-=l.extractWidth(f)),w+=S,f=c}return w}charProperties(b,w){return this._activeProvider.charProperties(b,w)}}r.UnicodeService=l}},A={};function H(z){var r=A[z];if(r!==void 0)return r.exports;var u=A[z]={exports:{}};return D[z].call(u.exports,u,u.exports,H),u.exports}var N={};return(()=>{var z=N;Object.defineProperty(z,"__esModule",{value:!0}),z.Terminal=void 0;const r=H(9042),u=H(3236),d=H(844),g=H(5741),l=H(8285),p=H(7975),b=H(7090),w=["cols","rows"];class f extends d.Disposable{constructor(a){super(),this._core=this.register(new u.Terminal(a)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const o=S=>this._core.options[S],c=(S,x)=>{this._checkReadonlyOptions(S),this._core.options[S]=x};for(const S in this._core.options){const x={get:o.bind(this,S),set:c.bind(this,S)};Object.defineProperty(this._publicOptions,S,x)}}_checkReadonlyOptions(a){if(w.includes(a))throw new Error(`Option "${a}" 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 p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.UnicodeApi(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 l.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const a=this._core.coreService.decPrivateModes;let o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const o in a)this._publicOptions[o]=a[o]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,o=!0){this._core.input(a,o)}resize(a,o){this._verifyIntegers(a,o),this._core.resize(a,o)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,o,c){this._verifyIntegers(a,o,c),this._core.select(a,o,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,o){this._verifyIntegers(a,o),this._core.selectLines(a,o)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,o){this._core.write(a,o)}writeln(a,o){this._core.write(a),this._core.write(`\r
82
- `,o)}paste(a){this._core.paste(a)}refresh(a,o){this._verifyIntegers(a,o),this._core.refresh(a,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){this._addonManager.loadAddon(this,a)}static get strings(){return r}_verifyIntegers(...a){for(const o of a)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const o of a)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}z.Terminal=f})(),N})()))})(zc)),zc.exports}var km=Mm(),Ic={exports:{}},L_;function Om(){return L_||(L_=1,(function(_,C){(function(D,A){_.exports=A()})(self,(()=>(()=>{var D={};return(()=>{var A=D;Object.defineProperty(A,"__esModule",{value:!0}),A.FitAddon=void 0,A.FitAddon=class{activate(H){this._terminal=H}dispose(){}fit(){const H=this.proposeDimensions();if(!H||!this._terminal||isNaN(H.cols)||isNaN(H.rows))return;const N=this._terminal._core;this._terminal.rows===H.rows&&this._terminal.cols===H.cols||(N._renderService.clear(),this._terminal.resize(H.cols,H.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const H=this._terminal._core,N=H._renderService.dimensions;if(N.css.cell.width===0||N.css.cell.height===0)return;const z=this._terminal.options.scrollback===0?0:H.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(r.getPropertyValue("height")),d=Math.max(0,parseInt(r.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),l=u-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=d-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-z;return{cols:Math.max(2,Math.floor(p/N.css.cell.width)),rows:Math.max(1,Math.floor(l/N.css.cell.height))}}}})(),D})()))})(Ic)),Ic.exports}var Bm=Om(),Nc={exports:{}},T_;function Hm(){return T_||(T_=1,(function(_,C){(function(D,A){_.exports=A()})(self,(()=>(()=>{var D={965:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GlyphRenderer=void 0;const d=u(374),g=u(509),l=u(855),p=u(859),b=u(381),w=11,f=w*Float32Array.BYTES_PER_ELEMENT;let n,a=0,o=0,c=0;class S extends p.Disposable{constructor(m,E,y,R){super(),this._terminal=m,this._gl=E,this._dimensions=y,this._optionsService=R,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const T=this._gl;g.TextureAtlas.maxAtlasPages===void 0&&(g.TextureAtlas.maxAtlasPages=Math.min(32,(0,d.throwIfFalsy)(T.getParameter(T.MAX_TEXTURE_IMAGE_UNITS))),g.TextureAtlas.maxTextureSize=(0,d.throwIfFalsy)(T.getParameter(T.MAX_TEXTURE_SIZE))),this._program=(0,d.throwIfFalsy)((0,b.createProgram)(T,`#version 300 es
83
- layout (location = 0) in vec2 a_unitquad;
84
- layout (location = 1) in vec2 a_cellpos;
85
- layout (location = 2) in vec2 a_offset;
86
- layout (location = 3) in vec2 a_size;
87
- layout (location = 4) in float a_texpage;
88
- layout (location = 5) in vec2 a_texcoord;
89
- layout (location = 6) in vec2 a_texsize;
90
-
91
- uniform mat4 u_projection;
92
- uniform vec2 u_resolution;
93
-
94
- out vec2 v_texcoord;
95
- flat out int v_texpage;
96
-
97
- void main() {
98
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
99
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
100
- v_texpage = int(a_texpage);
101
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
102
- }`,(function(G){let W="";for(let X=1;X<G;X++)W+=` else if (v_texpage == ${X}) { outColor = texture(u_texture[${X}], v_texcoord); }`;return`#version 300 es
103
- precision lowp float;
104
-
105
- in vec2 v_texcoord;
106
- flat in int v_texpage;
107
-
108
- uniform sampler2D u_texture[${G}];
109
-
110
- out vec4 outColor;
111
-
112
- void main() {
113
- if (v_texpage == 0) {
114
- outColor = texture(u_texture[0], v_texcoord);
115
- } ${W}
116
- }`})(g.TextureAtlas.maxAtlasPages))),this.register((0,p.toDisposable)((()=>T.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(T.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,d.throwIfFalsy)(T.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,d.throwIfFalsy)(T.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=T.createVertexArray(),T.bindVertexArray(this._vertexArrayObject);const I=new Float32Array([0,0,1,0,0,1,1,1]),B=T.createBuffer();this.register((0,p.toDisposable)((()=>T.deleteBuffer(B)))),T.bindBuffer(T.ARRAY_BUFFER,B),T.bufferData(T.ARRAY_BUFFER,I,T.STATIC_DRAW),T.enableVertexAttribArray(0),T.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const M=new Uint8Array([0,1,2,3]),$=T.createBuffer();this.register((0,p.toDisposable)((()=>T.deleteBuffer($)))),T.bindBuffer(T.ELEMENT_ARRAY_BUFFER,$),T.bufferData(T.ELEMENT_ARRAY_BUFFER,M,T.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(T.createBuffer()),this.register((0,p.toDisposable)((()=>T.deleteBuffer(this._attributesBuffer)))),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.enableVertexAttribArray(2),T.vertexAttribPointer(2,2,T.FLOAT,!1,f,0),T.vertexAttribDivisor(2,1),T.enableVertexAttribArray(3),T.vertexAttribPointer(3,2,T.FLOAT,!1,f,2*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(3,1),T.enableVertexAttribArray(4),T.vertexAttribPointer(4,1,T.FLOAT,!1,f,4*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(4,1),T.enableVertexAttribArray(5),T.vertexAttribPointer(5,2,T.FLOAT,!1,f,5*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(5,1),T.enableVertexAttribArray(6),T.vertexAttribPointer(6,2,T.FLOAT,!1,f,7*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(6,1),T.enableVertexAttribArray(1),T.vertexAttribPointer(1,2,T.FLOAT,!1,f,9*Float32Array.BYTES_PER_ELEMENT),T.vertexAttribDivisor(1,1),T.useProgram(this._program);const Y=new Int32Array(g.TextureAtlas.maxAtlasPages);for(let G=0;G<g.TextureAtlas.maxAtlasPages;G++)Y[G]=G;T.uniform1iv(this._textureLocation,Y),T.uniformMatrix4fv(this._projectionLocation,!1,b.PROJECTION_MATRIX),this._atlasTextures=[];for(let G=0;G<g.TextureAtlas.maxAtlasPages;G++){const W=new b.GLTexture((0,d.throwIfFalsy)(T.createTexture()));this.register((0,p.toDisposable)((()=>T.deleteTexture(W.texture)))),T.activeTexture(T.TEXTURE0+G),T.bindTexture(T.TEXTURE_2D,W.texture),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_S,T.CLAMP_TO_EDGE),T.texParameteri(T.TEXTURE_2D,T.TEXTURE_WRAP_T,T.CLAMP_TO_EDGE),T.texImage2D(T.TEXTURE_2D,0,T.RGBA,1,1,0,T.RGBA,T.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[G]=W}T.enable(T.BLEND),T.blendFunc(T.SRC_ALPHA,T.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(m,E,y,R,T,I,B,M,$){this._updateCell(this._vertices.attributes,m,E,y,R,T,I,B,M,$)}_updateCell(m,E,y,R,T,I,B,M,$,Y){a=(y*this._terminal.cols+E)*w,R!==l.NULL_CELL_CODE&&R!==void 0?this._atlas&&(n=M&&M.length>1?this._atlas.getRasterizedGlyphCombinedChar(M,T,I,B,!1):this._atlas.getRasterizedGlyph(R,T,I,B,!1),o=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),T!==Y&&n.offset.x>o?(c=n.offset.x-o,m[a]=-(n.offset.x-c)+this._dimensions.device.char.left,m[a+1]=-n.offset.y+this._dimensions.device.char.top,m[a+2]=(n.size.x-c)/this._dimensions.device.canvas.width,m[a+3]=n.size.y/this._dimensions.device.canvas.height,m[a+4]=n.texturePage,m[a+5]=n.texturePositionClipSpace.x+c/this._atlas.pages[n.texturePage].canvas.width,m[a+6]=n.texturePositionClipSpace.y,m[a+7]=n.sizeClipSpace.x-c/this._atlas.pages[n.texturePage].canvas.width,m[a+8]=n.sizeClipSpace.y):(m[a]=-n.offset.x+this._dimensions.device.char.left,m[a+1]=-n.offset.y+this._dimensions.device.char.top,m[a+2]=n.size.x/this._dimensions.device.canvas.width,m[a+3]=n.size.y/this._dimensions.device.canvas.height,m[a+4]=n.texturePage,m[a+5]=n.texturePositionClipSpace.x,m[a+6]=n.texturePositionClipSpace.y,m[a+7]=n.sizeClipSpace.x,m[a+8]=n.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,d.allowRescaling)(R,$,n.size.x,this._dimensions.device.cell.width)&&(m[a+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):m.fill(0,a,a+w-1-2)}clear(){const m=this._terminal,E=m.cols*m.rows*w;this._vertices.count!==E?this._vertices.attributes=new Float32Array(E):this._vertices.attributes.fill(0);let y=0;for(;y<this._vertices.attributesBuffers.length;y++)this._vertices.count!==E?this._vertices.attributesBuffers[y]=new Float32Array(E):this._vertices.attributesBuffers[y].fill(0);this._vertices.count=E,y=0;for(let R=0;R<m.rows;R++)for(let T=0;T<m.cols;T++)this._vertices.attributes[y+9]=T/m.cols,this._vertices.attributes[y+10]=R/m.rows,y+=w}handleResize(){const m=this._gl;m.useProgram(this._program),m.viewport(0,0,m.canvas.width,m.canvas.height),m.uniform2f(this._resolutionLocation,m.canvas.width,m.canvas.height),this.clear()}render(m){if(!this._atlas)return;const E=this._gl;E.useProgram(this._program),E.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const y=this._vertices.attributesBuffers[this._activeBuffer];let R=0;for(let T=0;T<m.lineLengths.length;T++){const I=T*this._terminal.cols*w,B=this._vertices.attributes.subarray(I,I+m.lineLengths[T]*w);y.set(B,R),R+=B.length}E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.bufferData(E.ARRAY_BUFFER,y.subarray(0,R),E.STREAM_DRAW);for(let T=0;T<this._atlas.pages.length;T++)this._atlas.pages[T].version!==this._atlasTextures[T].version&&this._bindAtlasPageTexture(E,this._atlas,T);E.drawElementsInstanced(E.TRIANGLE_STRIP,4,E.UNSIGNED_BYTE,0,R/w)}setAtlas(m){this._atlas=m;for(const E of this._atlasTextures)E.version=-1}_bindAtlasPageTexture(m,E,y){m.activeTexture(m.TEXTURE0+y),m.bindTexture(m.TEXTURE_2D,this._atlasTextures[y].texture),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_S,m.CLAMP_TO_EDGE),m.texParameteri(m.TEXTURE_2D,m.TEXTURE_WRAP_T,m.CLAMP_TO_EDGE),m.texImage2D(m.TEXTURE_2D,0,m.RGBA,m.RGBA,m.UNSIGNED_BYTE,E.pages[y].canvas),m.generateMipmap(m.TEXTURE_2D),this._atlasTextures[y].version=E.pages[y].version}setDimensions(m){this._dimensions=m}}r.GlyphRenderer=S},742:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RectangleRenderer=void 0;const d=u(374),g=u(859),l=u(310),p=u(381),b=8*Float32Array.BYTES_PER_ELEMENT;class w{constructor(){this.attributes=new Float32Array(160),this.count=0}}let f=0,n=0,a=0,o=0,c=0,S=0,x=0;class m extends g.Disposable{constructor(y,R,T,I){super(),this._terminal=y,this._gl=R,this._dimensions=T,this._themeService=I,this._vertices=new w,this._verticesCursor=new w;const B=this._gl;this._program=(0,d.throwIfFalsy)((0,p.createProgram)(B,`#version 300 es
117
- layout (location = 0) in vec2 a_position;
118
- layout (location = 1) in vec2 a_size;
119
- layout (location = 2) in vec4 a_color;
120
- layout (location = 3) in vec2 a_unitquad;
121
-
122
- uniform mat4 u_projection;
123
-
124
- out vec4 v_color;
125
-
126
- void main() {
127
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
128
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
129
- v_color = a_color;
130
- }`,`#version 300 es
131
- precision lowp float;
132
-
133
- in vec4 v_color;
134
-
135
- out vec4 outColor;
136
-
137
- void main() {
138
- outColor = v_color;
139
- }`)),this.register((0,g.toDisposable)((()=>B.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(B.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=B.createVertexArray(),B.bindVertexArray(this._vertexArrayObject);const M=new Float32Array([0,0,1,0,0,1,1,1]),$=B.createBuffer();this.register((0,g.toDisposable)((()=>B.deleteBuffer($)))),B.bindBuffer(B.ARRAY_BUFFER,$),B.bufferData(B.ARRAY_BUFFER,M,B.STATIC_DRAW),B.enableVertexAttribArray(3),B.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const Y=new Uint8Array([0,1,2,3]),G=B.createBuffer();this.register((0,g.toDisposable)((()=>B.deleteBuffer(G)))),B.bindBuffer(B.ELEMENT_ARRAY_BUFFER,G),B.bufferData(B.ELEMENT_ARRAY_BUFFER,Y,B.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(B.createBuffer()),this.register((0,g.toDisposable)((()=>B.deleteBuffer(this._attributesBuffer)))),B.bindBuffer(B.ARRAY_BUFFER,this._attributesBuffer),B.enableVertexAttribArray(0),B.vertexAttribPointer(0,2,B.FLOAT,!1,b,0),B.vertexAttribDivisor(0,1),B.enableVertexAttribArray(1),B.vertexAttribPointer(1,2,B.FLOAT,!1,b,2*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(1,1),B.enableVertexAttribArray(2),B.vertexAttribPointer(2,4,B.FLOAT,!1,b,4*Float32Array.BYTES_PER_ELEMENT),B.vertexAttribDivisor(2,1),this._updateCachedColors(I.colors),this.register(this._themeService.onChangeColors((W=>{this._updateCachedColors(W),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(y){const R=this._gl;R.useProgram(this._program),R.bindVertexArray(this._vertexArrayObject),R.uniformMatrix4fv(this._projectionLocation,!1,p.PROJECTION_MATRIX),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.bufferData(R.ARRAY_BUFFER,y.attributes,R.DYNAMIC_DRAW),R.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,R.UNSIGNED_BYTE,0,y.count)}handleResize(){this._updateViewportRectangle()}setDimensions(y){this._dimensions=y}_updateCachedColors(y){this._bgFloat=this._colorToFloat32Array(y.background),this._cursorFloat=this._colorToFloat32Array(y.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(y){const R=this._terminal,T=this._vertices;let I,B,M,$,Y,G,W,X,O,F,k,P=1;for(I=0;I<R.rows;I++){for(M=-1,$=0,Y=0,G=!1,B=0;B<R.cols;B++)W=(I*R.cols+B)*l.RENDER_MODEL_INDICIES_PER_CELL,X=y.cells[W+l.RENDER_MODEL_BG_OFFSET],O=y.cells[W+l.RENDER_MODEL_FG_OFFSET],F=!!(67108864&O),(X!==$||O!==Y&&(G||F))&&(($!==0||G&&Y!==0)&&(k=8*P++,this._updateRectangle(T,k,Y,$,M,B,I)),M=B,$=X,Y=O,G=F);($!==0||G&&Y!==0)&&(k=8*P++,this._updateRectangle(T,k,Y,$,M,R.cols,I))}T.count=P}updateCursor(y){const R=this._verticesCursor,T=y.cursor;if(!T||T.style==="block")return void(R.count=0);let I,B=0;T.style!=="bar"&&T.style!=="outline"||(I=8*B++,this._addRectangleFloat(R.attributes,I,T.x*this._dimensions.device.cell.width,T.y*this._dimensions.device.cell.height,T.style==="bar"?T.dpr*T.cursorWidth:T.dpr,this._dimensions.device.cell.height,this._cursorFloat)),T.style!=="underline"&&T.style!=="outline"||(I=8*B++,this._addRectangleFloat(R.attributes,I,T.x*this._dimensions.device.cell.width,(T.y+1)*this._dimensions.device.cell.height-T.dpr,T.width*this._dimensions.device.cell.width,T.dpr,this._cursorFloat)),T.style==="outline"&&(I=8*B++,this._addRectangleFloat(R.attributes,I,T.x*this._dimensions.device.cell.width,T.y*this._dimensions.device.cell.height,T.width*this._dimensions.device.cell.width,T.dpr,this._cursorFloat),I=8*B++,this._addRectangleFloat(R.attributes,I,(T.x+T.width)*this._dimensions.device.cell.width-T.dpr,T.y*this._dimensions.device.cell.height,T.dpr,this._dimensions.device.cell.height,this._cursorFloat)),R.count=B}_updateRectangle(y,R,T,I,B,M,$){if(67108864&T)switch(50331648&T){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&T].rgba;break;case 50331648:f=(16777215&T)<<8;break;default:f=this._themeService.colors.foreground.rgba}else switch(50331648&I){case 16777216:case 33554432:f=this._themeService.colors.ansi[255&I].rgba;break;case 50331648:f=(16777215&I)<<8;break;default:f=this._themeService.colors.background.rgba}y.attributes.length<R+4&&(y.attributes=(0,p.expandFloat32Array)(y.attributes,this._terminal.rows*this._terminal.cols*8)),n=B*this._dimensions.device.cell.width,a=$*this._dimensions.device.cell.height,o=(f>>24&255)/255,c=(f>>16&255)/255,S=(f>>8&255)/255,x=1,this._addRectangle(y.attributes,R,n,a,(M-B)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,o,c,S,x)}_addRectangle(y,R,T,I,B,M,$,Y,G,W){y[R]=T/this._dimensions.device.canvas.width,y[R+1]=I/this._dimensions.device.canvas.height,y[R+2]=B/this._dimensions.device.canvas.width,y[R+3]=M/this._dimensions.device.canvas.height,y[R+4]=$,y[R+5]=Y,y[R+6]=G,y[R+7]=W}_addRectangleFloat(y,R,T,I,B,M,$){y[R]=T/this._dimensions.device.canvas.width,y[R+1]=I/this._dimensions.device.canvas.height,y[R+2]=B/this._dimensions.device.canvas.width,y[R+3]=M/this._dimensions.device.canvas.height,y[R+4]=$[0],y[R+5]=$[1],y[R+6]=$[2],y[R+7]=$[3]}_colorToFloat32Array(y){return new Float32Array([(y.rgba>>24&255)/255,(y.rgba>>16&255)/255,(y.rgba>>8&255)/255,(255&y.rgba)/255])}}r.RectangleRenderer=m},310:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderModel=r.COMBINED_CHAR_BIT_MASK=r.RENDER_MODEL_EXT_OFFSET=r.RENDER_MODEL_FG_OFFSET=r.RENDER_MODEL_BG_OFFSET=r.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=u(296);r.RENDER_MODEL_INDICIES_PER_CELL=4,r.RENDER_MODEL_BG_OFFSET=1,r.RENDER_MODEL_FG_OFFSET=2,r.RENDER_MODEL_EXT_OFFSET=3,r.COMBINED_CHAR_BIT_MASK=2147483648,r.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(g,l){const p=g*l*r.RENDER_MODEL_INDICIES_PER_CELL;p!==this.cells.length&&(this.cells=new Uint32Array(p),this.lineLengths=new Uint32Array(l))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.JoinedCellData=r.WebglRenderer=void 0;const d=u(820),g=u(274),l=u(627),p=u(457),b=u(56),w=u(374),f=u(345),n=u(859),a=u(147),o=u(782),c=u(855),S=u(965),x=u(742),m=u(310),E=u(733);class y extends n.Disposable{constructor(B,M,$,Y,G,W,X,O,F){super(),this._terminal=B,this._characterJoinerService=M,this._charSizeService=$,this._coreBrowserService=Y,this._coreService=G,this._decorationService=W,this._optionsService=X,this._themeService=O,this._cursorBlinkStateManager=new n.MutableDisposable,this._charAtlasDisposable=this.register(new n.MutableDisposable),this._observerDisposable=this.register(new n.MutableDisposable),this._model=new m.RenderModel,this._workCell=new o.CellData,this._workCell2=new o.CellData,this._rectangleRenderer=this.register(new n.MutableDisposable),this._glyphRenderer=this.register(new n.MutableDisposable),this._onChangeTextureAtlas=this.register(new f.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new f.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new f.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new f.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new f.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new g.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new E.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,X,this._themeService)],this.dimensions=(0,w.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(X.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const k={antialias:!1,depth:!1,preserveDrawingBuffer:F};if(this._gl=this._canvas.getContext("webgl2",k),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextlost",(P=>{console.log("webglcontextlost event received"),P.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(P)}),3e3)}))),this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextrestored",(P=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,l.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,b.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((P,Q)=>this._setCanvasDevicePixelDimensions(P,Q))),this.register(this._coreBrowserService.onWindowChange((P=>{this._observerDisposable.value=(0,b.observeDevicePixelDimensions)(this._canvas,P,((Q,ee)=>this._setCanvasDevicePixelDimensions(Q,ee)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,n.toDisposable)((()=>{var P;for(const Q of this._renderLayers)Q.dispose();(P=this._canvas.parentElement)==null||P.removeChild(this._canvas),(0,l.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var B;return(B=this._charAtlas)==null?void 0:B.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(B,M){var $,Y,G,W;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const X of this._renderLayers)X.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,($=this._rectangleRenderer.value)==null||$.setDimensions(this.dimensions),(Y=this._rectangleRenderer.value)==null||Y.handleResize(),(G=this._glyphRenderer.value)==null||G.setDimensions(this.dimensions),(W=this._glyphRenderer.value)==null||W.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var B;for(const M of this._renderLayers)M.handleBlur(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.pause(),this._requestRedrawViewport()}handleFocus(){var B;for(const M of this._renderLayers)M.handleFocus(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.resume(),this._requestRedrawViewport()}handleSelectionChanged(B,M,$){for(const Y of this._renderLayers)Y.handleSelectionChanged(this._terminal,B,M,$);this._model.selection.update(this._core,B,M,$),this._requestRedrawViewport()}handleCursorMove(){var B;for(const M of this._renderLayers)M.handleCursorMove(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new x.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new S.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var M;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const B=(0,l.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==B&&(this._onChangeTextureAtlas.fire(B.pages[0].canvas),this._charAtlasDisposable.value=(0,n.getDisposeArrayDisposable)([(0,f.forwardEvent)(B.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,f.forwardEvent)(B.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=B,this._charAtlas.warmUp(),(M=this._glyphRenderer.value)==null||M.setAtlas(this._charAtlas)}_clearModel(B){var M;this._model.clear(),B&&((M=this._glyphRenderer.value)==null||M.clear())}clearTextureAtlas(){var B;(B=this._charAtlas)==null||B.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var B;this._clearModel(!0);for(const M of this._renderLayers)M.reset(this._terminal);(B=this._cursorBlinkStateManager.value)==null||B.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(B){return-1}deregisterCharacterJoiner(B){return!1}renderRows(B,M){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const $ of this._renderLayers)$.handleGridChanged(this._terminal,B,M);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(B,M),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new p.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(B,M){const $=this._core;let Y,G,W,X,O,F,k,P,Q,ee,he,oe,K,U,ne=this._workCell;B=T(B,$.rows-1,0),M=T(M,$.rows-1,0);const te=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,_e=te-$.buffer.ydisp,fe=Math.min(this._terminal.buffer.active.cursorX,$.cols-1);let be=-1;const ge=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Te=!1;for(G=B;G<=M;G++)for(W=G+$.buffer.ydisp,X=$.buffer.lines.get(W),this._model.lineLengths[G]=0,O=this._characterJoinerService.getJoinedCharacters(W),K=0;K<$.cols;K++)if(Y=this._cellColorResolver.result.bg,X.loadCell(K,ne),K===0&&(Y=this._cellColorResolver.result.bg),F=!1,k=K,O.length>0&&K===O[0][0]&&(F=!0,P=O.shift(),ne=new R(ne,X.translateToString(!0,P[0],P[1]),P[1]-P[0]),k=P[1]-1),Q=ne.getChars(),ee=ne.getCode(),oe=(G*$.cols+K)*m.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ne,K,W,this.dimensions.device.cell.width),ge&&W===te&&(K===fe&&(this._model.cursor={x:fe,y:_e,width:ne.getWidth(),style:this._coreBrowserService.isFocused?$.options.cursorStyle||"block":$.options.cursorInactiveStyle,cursorWidth:$.options.cursorWidth,dpr:this._devicePixelRatio},be=fe+ne.getWidth()-1),K>=fe&&K<=be&&(this._coreBrowserService.isFocused&&($.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&$.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),ee!==c.NULL_CELL_CODE&&(this._model.lineLengths[G]=K+1),(this._model.cells[oe]!==ee||this._model.cells[oe+m.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[oe+m.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[oe+m.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Te=!0,Q.length>1&&(ee|=m.COMBINED_CHAR_BIT_MASK),this._model.cells[oe]=ee,this._model.cells[oe+m.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[oe+m.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[oe+m.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,he=ne.getWidth(),this._glyphRenderer.value.updateCell(K,G,ee,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Q,he,Y),F))for(ne=this._workCell,K++;K<k;K++)U=(G*$.cols+K)*m.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell(K,G,c.NULL_CELL_CODE,0,0,0,c.NULL_CELL_CHAR,0,0),this._model.cells[U]=c.NULL_CELL_CODE,this._model.cells[U+m.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[U+m.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[U+m.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Te&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){this._charSizeService.width&&this._charSizeService.height&&(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(B,M){this._canvas.width===B&&this._canvas.height===M||(this._canvas.width=B,this._canvas.height=M,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const B=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:B,end:B})}}r.WebglRenderer=y;class R extends a.AttributeData{constructor(B,M,$){super(),this.content=0,this.combinedData="",this.fg=B.fg,this.bg=B.bg,this.combinedData=M,this._width=$}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(B){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}function T(I,B,M=0){return Math.max(Math.min(I,B),M)}r.JoinedCellData=R},381:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.GLTexture=r.expandFloat32Array=r.createShader=r.createProgram=r.PROJECTION_MATRIX=void 0;const d=u(374);function g(l,p,b){const w=(0,d.throwIfFalsy)(l.createShader(p));if(l.shaderSource(w,b),l.compileShader(w),l.getShaderParameter(w,l.COMPILE_STATUS))return w;console.error(l.getShaderInfoLog(w)),l.deleteShader(w)}r.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),r.createProgram=function(l,p,b){const w=(0,d.throwIfFalsy)(l.createProgram());if(l.attachShader(w,(0,d.throwIfFalsy)(g(l,l.VERTEX_SHADER,p))),l.attachShader(w,(0,d.throwIfFalsy)(g(l,l.FRAGMENT_SHADER,b))),l.linkProgram(w),l.getProgramParameter(w,l.LINK_STATUS))return w;console.error(l.getProgramInfoLog(w)),l.deleteProgram(w)},r.createShader=g,r.expandFloat32Array=function(l,p){const b=Math.min(2*l.length,p),w=new Float32Array(b);for(let f=0;f<l.length;f++)w[f]=l[f];return w},r.GLTexture=class{constructor(l){this.texture=l,this.version=-1}}},592:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const d=u(627),g=u(237),l=u(374),p=u(859);class b extends p.Disposable{constructor(f,n,a,o,c,S,x,m){super(),this._container=n,this._alpha=c,this._coreBrowserService=S,this._optionsService=x,this._themeService=m,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${a}-layer`),this._canvas.style.zIndex=o.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((E=>{this._refreshCharAtlas(f,E),this.reset(f)}))),this.register((0,p.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,l.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(f){}handleFocus(f){}handleCursorMove(f){}handleGridChanged(f,n,a){}handleSelectionChanged(f,n,a,o=!1){}_setTransparency(f,n){if(n===this._alpha)return;const a=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,a),this._refreshCharAtlas(f,this._themeService.colors),this.handleGridChanged(f,0,f.rows-1)}_refreshCharAtlas(f,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(f,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(f,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(f,this._themeService.colors)}_fillBottomLineAtCells(f,n,a=1){this._ctx.fillRect(f*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,a*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(f,n,a,o){this._alpha?this._ctx.clearRect(f*this._deviceCellWidth,n*this._deviceCellHeight,a*this._deviceCellWidth,o*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(f*this._deviceCellWidth,n*this._deviceCellHeight,a*this._deviceCellWidth,o*this._deviceCellHeight))}_fillCharTrueColor(f,n,a,o){this._ctx.font=this._getFont(f,!1,!1),this._ctx.textBaseline=g.TEXT_BASELINE,this._clipCell(a,o,n.getWidth()),this._ctx.fillText(n.getChars(),a*this._deviceCellWidth+this._deviceCharLeft,o*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(f,n,a){this._ctx.beginPath(),this._ctx.rect(f*this._deviceCellWidth,n*this._deviceCellHeight,a*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(f,n,a){return`${a?"italic":""} ${n?f.options.fontWeightBold:f.options.fontWeight} ${f.options.fontSize*this._coreBrowserService.dpr}px ${f.options.fontFamily}`}}r.BaseRenderLayer=b},733:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const d=u(197),g=u(237),l=u(592);class p extends l.BaseRenderLayer{constructor(w,f,n,a,o,c,S){super(n,w,"link",f,!0,o,c,S),this.register(a.onShowLinkUnderline((x=>this._handleShowLinkUnderline(x)))),this.register(a.onHideLinkUnderline((x=>this._handleHideLinkUnderline(x))))}resize(w,f){super.resize(w,f),this._state=void 0}reset(w){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const w=this._state.y2-this._state.y1-1;w>0&&this._clearCells(0,this._state.y1+1,this._state.cols,w),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(w){if(w.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:w.fg!==void 0&&(0,d.is256Color)(w.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[w.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,w.y1===w.y2)this._fillBottomLineAtCells(w.x1,w.y1,w.x2-w.x1);else{this._fillBottomLineAtCells(w.x1,w.y1,w.cols-w.x1);for(let f=w.y1+1;f<w.y2;f++)this._fillBottomLineAtCells(0,f,w.cols);this._fillBottomLineAtCells(0,w.y2,w.x2)}this._state=w}_handleHideLinkUnderline(w){this._clearCurrentLink()}}r.LinkRenderLayer=p},820:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(u,d,g,l){u.addEventListener(d,g,l);let p=!1;return{dispose:()=>{p||(p=!0,u.removeEventListener(d,g,l))}}}},274:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;const d=u(855),g=u(160),l=u(374);let p,b=0,w=0,f=!1,n=!1,a=!1,o=0;r.CellColorResolver=class{constructor(c,S,x,m,E,y){this._terminal=c,this._optionService=S,this._selectionRenderModel=x,this._decorationService=m,this._coreBrowserService=E,this._themeService=y,this.result={fg:0,bg:0,ext:0}}resolve(c,S,x,m){if(this.result.bg=c.bg,this.result.fg=c.fg,this.result.ext=268435456&c.bg?c.extended.ext:0,w=0,b=0,n=!1,f=!1,a=!1,p=this._themeService.colors,o=0,c.getCode()!==d.NULL_CELL_CODE&&c.extended.underlineStyle===4){const E=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));o=S*m%(2*Math.round(E))}if(this._decorationService.forEachDecorationAtCell(S,x,"bottom",(E=>{E.backgroundColorRGB&&(w=E.backgroundColorRGB.rgba>>8&16777215,n=!0),E.foregroundColorRGB&&(b=E.foregroundColorRGB.rgba>>8&16777215,f=!0)})),a=this._selectionRenderModel.isCellSelected(this._terminal,S,x),a){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:w=(16777215&this.result.fg)<<8|255;break;default:w=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:w=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:w=(16777215&this.result.bg)<<8|255}w=g.rgba.blend(w,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else w=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(n=!0,p.selectionForeground&&(b=p.selectionForeground.rgba>>8&16777215,f=!0),(0,l.treatGlyphAsBackgroundColor)(c.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)b=(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}b=g.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}f=!0}}this._decorationService.forEachDecorationAtCell(S,x,"top",(E=>{E.backgroundColorRGB&&(w=E.backgroundColorRGB.rgba>>8&16777215,n=!0),E.foregroundColorRGB&&(b=E.foregroundColorRGB.rgba>>8&16777215,f=!0)})),n&&(w=a?-16777216&c.bg&-134217729|w|50331648:-16777216&c.bg|w|50331648),f&&(b=-16777216&c.fg&-67108865|b|50331648),67108864&this.result.fg&&(n&&!f&&(b=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&p.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,f=!0),!n&&f&&(w=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&p.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,n=!0)),p=void 0,this.result.bg=n?w:this.result.bg,this.result.fg=f?b:this.result.fg,this.result.ext&=536870911,this.result.ext|=o<<29&3758096384}}},627:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const d=u(509),g=u(197),l=[];r.acquireTextureAtlas=function(p,b,w,f,n,a,o,c){const S=(0,g.generateConfig)(f,n,a,o,b,w,c);for(let E=0;E<l.length;E++){const y=l[E],R=y.ownedBy.indexOf(p);if(R>=0){if((0,g.configEquals)(y.config,S))return y.atlas;y.ownedBy.length===1?(y.atlas.dispose(),l.splice(E,1)):y.ownedBy.splice(R,1);break}}for(let E=0;E<l.length;E++){const y=l[E];if((0,g.configEquals)(y.config,S))return y.ownedBy.push(p),y.atlas}const x=p._core,m={atlas:new d.TextureAtlas(document,S,x.unicodeService),config:S,ownedBy:[p]};return l.push(m),m.atlas},r.removeTerminalFromCache=function(p){for(let b=0;b<l.length;b++){const w=l[b].ownedBy.indexOf(p);if(w!==-1){l[b].ownedBy.length===1?(l[b].atlas.dispose(),l.splice(b,1)):l[b].ownedBy.splice(w,1);break}}}},197:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const d=u(160);r.generateConfig=function(g,l,p,b,w,f,n){const a={foreground:f.foreground,background:f.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:w.customGlyphs,devicePixelRatio:n,letterSpacing:w.letterSpacing,lineHeight:w.lineHeight,deviceCellWidth:g,deviceCellHeight:l,deviceCharWidth:p,deviceCharHeight:b,fontFamily:w.fontFamily,fontSize:w.fontSize,fontWeight:w.fontWeight,fontWeightBold:w.fontWeightBold,allowTransparency:w.allowTransparency,drawBoldTextInBrightColors:w.drawBoldTextInBrightColors,minimumContrastRatio:w.minimumContrastRatio,colors:a}},r.configEquals=function(g,l){for(let p=0;p<g.colors.ansi.length;p++)if(g.colors.ansi[p].rgba!==l.colors.ansi[p].rgba)return!1;return g.devicePixelRatio===l.devicePixelRatio&&g.customGlyphs===l.customGlyphs&&g.lineHeight===l.lineHeight&&g.letterSpacing===l.letterSpacing&&g.fontFamily===l.fontFamily&&g.fontSize===l.fontSize&&g.fontWeight===l.fontWeight&&g.fontWeightBold===l.fontWeightBold&&g.allowTransparency===l.allowTransparency&&g.deviceCharWidth===l.deviceCharWidth&&g.deviceCharHeight===l.deviceCharHeight&&g.drawBoldTextInBrightColors===l.drawBoldTextInBrightColors&&g.minimumContrastRatio===l.minimumContrastRatio&&g.colors.foreground.rgba===l.colors.foreground.rgba&&g.colors.background.rgba===l.colors.background.rgba},r.is256Color=function(g){return(50331648&g)==16777216||(50331648&g)==33554432}},237:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const d=u(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorBlinkStateManager=void 0,r.CursorBlinkStateManager=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))))}_restartInterval(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const d=u(374);r.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const g={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};r.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╒":{1:(f,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(f,n)=>`M${.5-f},1 L${.5-f},.5 L1,.5 M${.5+f},.5 L${.5+f},1`},"╔":{1:(f,n)=>`M1,${.5-n} L${.5-f},${.5-n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╕":{1:(f,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(f,n)=>`M${.5+f},1 L${.5+f},.5 L0,.5 M${.5-f},.5 L${.5-f},1`},"╗":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5+f},${.5-n} L${.5+f},1`},"╘":{1:(f,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(f,n)=>`M1,.5 L${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╚":{1:(f,n)=>`M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0 M1,${.5+n} L${.5-f},${.5+n} L${.5-f},0`},"╛":{1:(f,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(f,n)=>`M0,.5 L${.5+f},.5 L${.5+f},0 M${.5-f},.5 L${.5-f},0`},"╝":{1:(f,n)=>`M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M0,${.5+n} L${.5+f},${.5+n} L${.5+f},0`},"╞":{1:(f,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1 M${.5+f},.5 L1,.5`},"╠":{1:(f,n)=>`M${.5-f},0 L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╡":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(f,n)=>`M0,.5 L${.5-f},.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╣":{1:(f,n)=>`M${.5+f},0 L${.5+f},1 M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0`},"╤":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},1 M${.5+f},.5 L${.5+f},1`},"╦":{1:(f,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1`},"╧":{1:(f,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},.5 L${.5-f},0 M${.5+f},.5 L${.5+f},0`},"╩":{1:(f,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╪":{1:(f,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(f,n)=>`M0,.5 L1,.5 M${.5-f},0 L${.5-f},1 M${.5+f},0 L${.5+f},1`},"╬":{1:(f,n)=>`M0,${.5+n} L${.5-f},${.5+n} L${.5-f},1 M1,${.5+n} L${.5+f},${.5+n} L${.5+f},1 M0,${.5-n} L${.5-f},${.5-n} L${.5-f},0 M1,${.5-n} L${.5+f},${.5-n} L${.5+f},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(f,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(f,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},r.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.tryDrawCustomChar=function(f,n,a,o,c,S,x,m){const E=r.blockElementDefinitions[n];if(E)return(function(I,B,M,$,Y,G){for(let W=0;W<B.length;W++){const X=B[W],O=Y/8,F=G/8;I.fillRect(M+X.x*O,$+X.y*F,X.w*O,X.h*F)}})(f,E,a,o,c,S),!0;const y=g[n];if(y)return(function(I,B,M,$,Y,G){let W=l.get(B);W||(W=new Map,l.set(B,W));const X=I.fillStyle;if(typeof X!="string")throw new Error(`Unexpected fillStyle type "${X}"`);let O=W.get(X);if(!O){const F=B[0].length,k=B.length,P=I.canvas.ownerDocument.createElement("canvas");P.width=F,P.height=k;const Q=(0,d.throwIfFalsy)(P.getContext("2d")),ee=new ImageData(F,k);let he,oe,K,U;if(X.startsWith("#"))he=parseInt(X.slice(1,3),16),oe=parseInt(X.slice(3,5),16),K=parseInt(X.slice(5,7),16),U=X.length>7&&parseInt(X.slice(7,9),16)||1;else{if(!X.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${X}" when drawing pattern glyph`);[he,oe,K,U]=X.substring(5,X.length-1).split(",").map((ne=>parseFloat(ne)))}for(let ne=0;ne<k;ne++)for(let te=0;te<F;te++)ee.data[4*(ne*F+te)]=he,ee.data[4*(ne*F+te)+1]=oe,ee.data[4*(ne*F+te)+2]=K,ee.data[4*(ne*F+te)+3]=B[ne][te]*(255*U);Q.putImageData(ee,0,0),O=(0,d.throwIfFalsy)(I.createPattern(P,null)),W.set(X,O)}I.fillStyle=O,I.fillRect(M,$,Y,G)})(f,y,a,o,c,S),!0;const R=r.boxDrawingDefinitions[n];if(R)return(function(I,B,M,$,Y,G,W){I.strokeStyle=I.fillStyle;for(const[X,O]of Object.entries(B)){let F;I.beginPath(),I.lineWidth=W*Number.parseInt(X),F=typeof O=="function"?O(.15,.15/G*Y):O;for(const k of F.split(" ")){const P=k[0],Q=b[P];if(!Q){console.error(`Could not find drawing instructions for "${P}"`);continue}const ee=k.substring(1).split(",");ee[0]&&ee[1]&&Q(I,w(ee,Y,G,M,$,!0,W))}I.stroke(),I.closePath()}})(f,R,a,o,c,S,m),!0;const T=r.powerlineDefinitions[n];return!!T&&((function(I,B,M,$,Y,G,W,X){const O=new Path2D;O.rect(M,$,Y,G),I.clip(O),I.beginPath();const F=W/12;I.lineWidth=X*F;for(const k of B.d.split(" ")){const P=k[0],Q=b[P];if(!Q){console.error(`Could not find drawing instructions for "${P}"`);continue}const ee=k.substring(1).split(",");ee[0]&&ee[1]&&Q(I,w(ee,Y,G,M,$,!1,X,(B.leftPadding??0)*(F/2),(B.rightPadding??0)*(F/2)))}B.type===1?(I.strokeStyle=I.fillStyle,I.stroke()):I.fill(),I.closePath()})(f,T,a,o,c,S,x,m),!0)};const l=new Map;function p(f,n,a=0){return Math.max(Math.min(f,n),a)}const b={C:(f,n)=>f.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(f,n)=>f.lineTo(n[0],n[1]),M:(f,n)=>f.moveTo(n[0],n[1])};function w(f,n,a,o,c,S,x,m=0,E=0){const y=f.map((R=>parseFloat(R)||parseInt(R)));if(y.length<2)throw new Error("Too few arguments for instruction");for(let R=0;R<y.length;R+=2)y[R]*=n-m*x-E*x,S&&y[R]!==0&&(y[R]=p(Math.round(y[R]+.5)-.5,n,0)),y[R]+=o+m*x;for(let R=1;R<y.length;R+=2)y[R]*=a,S&&y[R]!==0&&(y[R]=p(Math.round(y[R]+.5)-.5,a,0)),y[R]+=c;return y}},56:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const d=u(859);r.observeDevicePixelDimensions=function(g,l,p){let b=new l.ResizeObserver((w=>{const f=w.find((o=>o.target===g));if(!f)return;if(!("devicePixelContentBoxSize"in f))return b==null||b.disconnect(),void(b=void 0);const n=f.devicePixelContentBoxSize[0].inlineSize,a=f.devicePixelContentBoxSize[0].blockSize;n>0&&a>0&&p(n,a)}));try{b.observe(g,{box:["device-pixel-content-box"]})}catch{b.disconnect(),b=void 0}return(0,d.toDisposable)((()=>b==null?void 0:b.disconnect()))}},374:(z,r)=>{function u(g){return 57508<=g&&g<=57558}function d(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(r,"__esModule",{value:!0}),r.computeNextVariantOffset=r.createRenderDimensions=r.treatGlyphAsBackgroundColor=r.allowRescaling=r.isEmoji=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},r.isPowerlineGlyph=u,r.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},r.isEmoji=d,r.allowRescaling=function(g,l,p,b){return l===1&&p>Math.ceil(1.5*b)&&g!==void 0&&g>255&&!d(g)&&!u(g)&&!(function(w){return 57344<=w&&w<=63743})(g)},r.treatGlyphAsBackgroundColor=function(g){return u(g)||(function(l){return 9472<=l&&l<=9631})(g)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},r.computeNextVariantOffset=function(g,l,p=0){return(g-(2*Math.round(l)-p))%(2*Math.round(l))}},296:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class u{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(g,l,p,b=!1){if(this.selectionStart=l,this.selectionEnd=p,!l||!p||l[0]===p[0]&&l[1]===p[1])return void this.clear();const w=g.buffers.active.ydisp,f=l[1]-w,n=p[1]-w,a=Math.max(f,0),o=Math.min(n,g.rows-1);a>=g.rows||o<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=f,this.viewportEndRow=n,this.viewportCappedStartRow=a,this.viewportCappedEndRow=o,this.startCol=l[0],this.endCol=p[0])}isCellSelected(g,l,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?l>=this.startCol&&p>=this.viewportCappedStartRow&&l<this.endCol&&p<=this.viewportCappedEndRow:l<this.startCol&&p>=this.viewportCappedStartRow&&l>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&l>=this.startCol&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&l<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&l>=this.startCol)}}r.createSelectionRenderModel=function(){return new u}},509:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const d=u(237),g=u(860),l=u(374),p=u(160),b=u(345),w=u(485),f=u(385),n=u(147),a=u(855),o={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let c;class S{get pages(){return this._pages}constructor(R,T,I){this._document=R,this._config=T,this._unicodeService=I,this._didWarmUp=!1,this._cacheMap=new w.FourKeyMap,this._cacheMapCombined=new w.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new n.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new b.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new b.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=E(R,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,l.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const R of this.pages)R.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const R=new f.IdleTaskQueue;for(let T=33;T<126;T++)R.enqueue((()=>{if(!this._cacheMap.get(T,a.DEFAULT_COLOR,a.DEFAULT_COLOR,a.DEFAULT_EXT)){const I=this._drawToCache(T,a.DEFAULT_COLOR,a.DEFAULT_COLOR,a.DEFAULT_EXT);this._cacheMap.set(T,a.DEFAULT_COLOR,a.DEFAULT_COLOR,a.DEFAULT_EXT,I)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const R of this._pages)R.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const T=this._pages.filter((W=>2*W.canvas.width<=(S.maxTextureSize||4096))).sort(((W,X)=>X.canvas.width!==W.canvas.width?X.canvas.width-W.canvas.width:X.percentageUsed-W.percentageUsed));let I=-1,B=0;for(let W=0;W<T.length;W++)if(T[W].canvas.width!==B)I=W,B=T[W].canvas.width;else if(W-I==3)break;const M=T.slice(I,I+4),$=M.map((W=>W.glyphs[0].texturePage)).sort(((W,X)=>W>X?1:-1)),Y=this.pages.length-M.length,G=this._mergePages(M,Y);G.version++;for(let W=$.length-1;W>=0;W--)this._deletePage($[W]);this.pages.push(G),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(G.canvas)}const R=new x(this._document,this._textureSize);return this._pages.push(R),this._activePages.push(R),this._onAddTextureAtlasCanvas.fire(R.canvas),R}_mergePages(R,T){const I=2*R[0].canvas.width,B=new x(this._document,I,R);for(const[M,$]of R.entries()){const Y=M*$.canvas.width%I,G=Math.floor(M/2)*$.canvas.height;B.ctx.drawImage($.canvas,Y,G);for(const X of $.glyphs)X.texturePage=T,X.sizeClipSpace.x=X.size.x/I,X.sizeClipSpace.y=X.size.y/I,X.texturePosition.x+=Y,X.texturePosition.y+=G,X.texturePositionClipSpace.x=X.texturePosition.x/I,X.texturePositionClipSpace.y=X.texturePosition.y/I;this._onRemoveTextureAtlasCanvas.fire($.canvas);const W=this._activePages.indexOf($);W!==-1&&this._activePages.splice(W,1)}return B}_deletePage(R){this._pages.splice(R,1);for(let T=R;T<this._pages.length;T++){const I=this._pages[T];for(const B of I.glyphs)B.texturePage--;I.version++}}getRasterizedGlyphCombinedChar(R,T,I,B,M){return this._getFromCacheMap(this._cacheMapCombined,R,T,I,B,M)}getRasterizedGlyph(R,T,I,B,M){return this._getFromCacheMap(this._cacheMap,R,T,I,B,M)}_getFromCacheMap(R,T,I,B,M,$=!1){return c=R.get(T,I,B,M),c||(c=this._drawToCache(T,I,B,M,$),R.set(T,I,B,M,c)),c}_getColorFromAnsiIndex(R){if(R>=this._config.colors.ansi.length)throw new Error("No color found for idx "+R);return this._config.colors.ansi[R]}_getBackgroundColor(R,T,I,B){if(this._config.allowTransparency)return p.NULL_COLOR;let M;switch(R){case 16777216:case 33554432:M=this._getColorFromAnsiIndex(T);break;case 50331648:const $=n.AttributeData.toColorRGB(T);M=p.channels.toColor($[0],$[1],$[2]);break;default:M=I?p.color.opaque(this._config.colors.foreground):this._config.colors.background}return M}_getForegroundColor(R,T,I,B,M,$,Y,G,W,X){const O=this._getMinimumContrastColor(R,T,I,B,M,$,Y,W,G,X);if(O)return O;let F;switch(M){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&W&&$<8&&($+=8),F=this._getColorFromAnsiIndex($);break;case 50331648:const k=n.AttributeData.toColorRGB($);F=p.channels.toColor(k[0],k[1],k[2]);break;default:F=Y?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(F=p.color.opaque(F)),G&&(F=p.color.multiplyOpacity(F,d.DIM_OPACITY)),F}_resolveBackgroundRgba(R,T,I){switch(R){case 16777216:case 33554432:return this._getColorFromAnsiIndex(T).rgba;case 50331648:return T<<8;default:return I?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(R,T,I,B){switch(R){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&B&&T<8&&(T+=8),this._getColorFromAnsiIndex(T).rgba;case 50331648:return T<<8;default:return I?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(R,T,I,B,M,$,Y,G,W,X){if(this._config.minimumContrastRatio===1||X)return;const O=this._getContrastCache(W),F=O.getColor(R,B);if(F!==void 0)return F||void 0;const k=this._resolveBackgroundRgba(T,I,Y),P=this._resolveForegroundRgba(M,$,Y,G),Q=p.rgba.ensureContrastRatio(k,P,this._config.minimumContrastRatio/(W?2:1));if(!Q)return void O.setColor(R,B,null);const ee=p.channels.toColor(Q>>24&255,Q>>16&255,Q>>8&255);return O.setColor(R,B,ee),ee}_getContrastCache(R){return R?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(R,T,I,B,M=!1){const $=typeof R=="number"?String.fromCharCode(R):R,Y=Math.min(this._config.deviceCellWidth*Math.max($.length,2)+4,this._textureSize);this._tmpCanvas.width<Y&&(this._tmpCanvas.width=Y);const G=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<G&&(this._tmpCanvas.height=G),this._tmpCtx.save(),this._workAttributeData.fg=I,this._workAttributeData.bg=T,this._workAttributeData.extended.ext=B,this._workAttributeData.isInvisible())return o;const W=!!this._workAttributeData.isBold(),X=!!this._workAttributeData.isInverse(),O=!!this._workAttributeData.isDim(),F=!!this._workAttributeData.isItalic(),k=!!this._workAttributeData.isUnderline(),P=!!this._workAttributeData.isStrikethrough(),Q=!!this._workAttributeData.isOverline();let ee=this._workAttributeData.getFgColor(),he=this._workAttributeData.getFgColorMode(),oe=this._workAttributeData.getBgColor(),K=this._workAttributeData.getBgColorMode();if(X){const ve=ee;ee=oe,oe=ve;const we=he;he=K,K=we}const U=this._getBackgroundColor(K,oe,X,O);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ne=W?this._config.fontWeightBold:this._config.fontWeight,te=F?"italic":"";this._tmpCtx.font=`${te} ${ne} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const _e=$.length===1&&(0,l.isPowerlineGlyph)($.charCodeAt(0)),fe=$.length===1&&(0,l.isRestrictedPowerlineGlyph)($.charCodeAt(0)),be=this._getForegroundColor(T,K,oe,I,he,ee,X,O,W,(0,l.treatGlyphAsBackgroundColor)($.charCodeAt(0)));this._tmpCtx.fillStyle=be.css;const ge=fe?0:4;let Te=!1;this._config.customGlyphs!==!1&&(Te=(0,g.tryDrawCustomChar)(this._tmpCtx,$,ge,ge,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let Pe,Se=!_e;if(Pe=typeof R=="number"?this._unicodeService.wcwidth(R):this._unicodeService.getStringCellWidth(R),k){this._tmpCtx.save();const ve=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),we=ve%2==1?.5:0;if(this._tmpCtx.lineWidth=ve,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())Se=!1,this._tmpCtx.strokeStyle=`rgb(${n.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{Se=!1;let Je=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Je<8&&(Je+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Je).css}this._tmpCtx.beginPath();const Ze=ge,qe=Math.ceil(ge+this._config.deviceCharHeight)-we-(M?2*ve:0),gt=qe+ve,Qe=qe+2*ve;let ct=this._workAttributeData.getUnderlineVariantOffset();for(let Je=0;Je<Pe;Je++){this._tmpCtx.save();const ke=Ze+Je*this._config.deviceCellWidth,De=Ze+(Je+1)*this._config.deviceCellWidth,Xt=ke+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(De,qe),this._tmpCtx.moveTo(ke,Qe),this._tmpCtx.lineTo(De,Qe);break;case 3:const ut=ve<=1?Qe:Math.ceil(ge+this._config.deviceCharHeight-ve/2)-we,Et=ve<=1?qe:Math.ceil(ge+this._config.deviceCharHeight+ve/2)-we,vt=new Path2D;vt.rect(ke,qe,this._config.deviceCellWidth,Qe-qe),this._tmpCtx.clip(vt),this._tmpCtx.moveTo(ke-this._config.deviceCellWidth/2,gt),this._tmpCtx.bezierCurveTo(ke-this._config.deviceCellWidth/2,Et,ke,Et,ke,gt),this._tmpCtx.bezierCurveTo(ke,ut,Xt,ut,Xt,gt),this._tmpCtx.bezierCurveTo(Xt,Et,De,Et,De,gt),this._tmpCtx.bezierCurveTo(De,ut,De+this._config.deviceCellWidth/2,ut,De+this._config.deviceCellWidth/2,gt);break;case 4:const Qi=ct===0?0:ct>=ve?2*ve-ct:ve-ct;ct>=ve||Qi===0?(this._tmpCtx.setLineDash([Math.round(ve),Math.round(ve)]),this._tmpCtx.moveTo(ke+Qi,qe),this._tmpCtx.lineTo(De,qe)):(this._tmpCtx.setLineDash([Math.round(ve),Math.round(ve)]),this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(ke+Qi,qe),this._tmpCtx.moveTo(ke+Qi+ve,qe),this._tmpCtx.lineTo(De,qe)),ct=(0,l.computeNextVariantOffset)(De-ke,ve,ct);break;case 5:const qs=.6,Or=.3,Ei=De-ke,Mi=Math.floor(qs*Ei),it=Math.floor(Or*Ei),rt=Ei-Mi-it;this._tmpCtx.setLineDash([Mi,it,rt]),this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(De,qe);break;default:this._tmpCtx.moveTo(ke,qe),this._tmpCtx.lineTo(De,qe)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Te&&this._config.fontSize>=12&&!this._config.allowTransparency&&$!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Je=this._tmpCtx.measureText($);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Je&&Je.actualBoundingBoxDescent>0){this._tmpCtx.save();const ke=new Path2D;ke.rect(Ze,qe-Math.ceil(ve/2),this._config.deviceCellWidth*Pe,Qe-qe+Math.ceil(ve/2)),this._tmpCtx.clip(ke),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=U.css,this._tmpCtx.strokeText($,ge,ge+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Q){const ve=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),we=ve%2==1?.5:0;this._tmpCtx.lineWidth=ve,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ge,ge+we),this._tmpCtx.lineTo(ge+this._config.deviceCharWidth*Pe,ge+we),this._tmpCtx.stroke()}if(Te||this._tmpCtx.fillText($,ge,ge+this._config.deviceCharHeight),$==="_"&&!this._config.allowTransparency){let ve=m(this._tmpCtx.getImageData(ge,ge,this._config.deviceCellWidth,this._config.deviceCellHeight),U,be,Se);if(ve)for(let we=1;we<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=U.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText($,ge,ge+this._config.deviceCharHeight-we),ve=m(this._tmpCtx.getImageData(ge,ge,this._config.deviceCellWidth,this._config.deviceCellHeight),U,be,Se),ve);we++);}if(P){const ve=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),we=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=ve,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(ge,ge+Math.floor(this._config.deviceCharHeight/2)-we),this._tmpCtx.lineTo(ge+this._config.deviceCharWidth*Pe,ge+Math.floor(this._config.deviceCharHeight/2)-we),this._tmpCtx.stroke()}this._tmpCtx.restore();const Mt=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let It;if(It=this._config.allowTransparency?(function(ve){for(let we=0;we<ve.data.length;we+=4)if(ve.data[we+3]>0)return!1;return!0})(Mt):m(Mt,U,be,Se),It)return o;const xe=this._findGlyphBoundingBox(Mt,this._workBoundingBox,Y,fe,Te,ge);let Ee,Ae;for(;;){if(this._activePages.length===0){const ve=this._createNewPage();Ee=ve,Ae=ve.currentRow,Ae.height=xe.size.y;break}Ee=this._activePages[this._activePages.length-1],Ae=Ee.currentRow;for(const ve of this._activePages)xe.size.y<=ve.currentRow.height&&(Ee=ve,Ae=ve.currentRow);for(let ve=this._activePages.length-1;ve>=0;ve--)for(const we of this._activePages[ve].fixedRows)we.height<=Ae.height&&xe.size.y<=we.height&&(Ee=this._activePages[ve],Ae=we);if(Ae.y+xe.size.y>=Ee.canvas.height||Ae.height>xe.size.y+2){let ve=!1;if(Ee.currentRow.y+Ee.currentRow.height+xe.size.y>=Ee.canvas.height){let we;for(const Ze of this._activePages)if(Ze.currentRow.y+Ze.currentRow.height+xe.size.y<Ze.canvas.height){we=Ze;break}if(we)Ee=we;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&Ae.y+xe.size.y<=Ee.canvas.height&&Ae.height>=xe.size.y&&Ae.x+xe.size.x<=Ee.canvas.width)ve=!0;else{const Ze=this._createNewPage();Ee=Ze,Ae=Ze.currentRow,Ae.height=xe.size.y,ve=!0}}ve||(Ee.currentRow.height>0&&Ee.fixedRows.push(Ee.currentRow),Ae={x:0,y:Ee.currentRow.y+Ee.currentRow.height,height:xe.size.y},Ee.fixedRows.push(Ae),Ee.currentRow={x:0,y:Ae.y+Ae.height,height:0})}if(Ae.x+xe.size.x<=Ee.canvas.width)break;Ae===Ee.currentRow?(Ae.x=0,Ae.y+=Ae.height,Ae.height=0):Ee.fixedRows.splice(Ee.fixedRows.indexOf(Ae),1)}return xe.texturePage=this._pages.indexOf(Ee),xe.texturePosition.x=Ae.x,xe.texturePosition.y=Ae.y,xe.texturePositionClipSpace.x=Ae.x/Ee.canvas.width,xe.texturePositionClipSpace.y=Ae.y/Ee.canvas.height,xe.sizeClipSpace.x/=Ee.canvas.width,xe.sizeClipSpace.y/=Ee.canvas.height,Ae.height=Math.max(Ae.height,xe.size.y),Ae.x+=xe.size.x,Ee.ctx.putImageData(Mt,xe.texturePosition.x-this._workBoundingBox.left,xe.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,xe.size.x,xe.size.y),Ee.addGlyph(xe),Ee.version++,xe}_findGlyphBoundingBox(R,T,I,B,M,$){T.top=0;const Y=B?this._config.deviceCellHeight:this._tmpCanvas.height,G=B?this._config.deviceCellWidth:I;let W=!1;for(let X=0;X<Y;X++){for(let O=0;O<G;O++){const F=X*this._tmpCanvas.width*4+4*O+3;if(R.data[F]!==0){T.top=X,W=!0;break}}if(W)break}T.left=0,W=!1;for(let X=0;X<$+G;X++){for(let O=0;O<Y;O++){const F=O*this._tmpCanvas.width*4+4*X+3;if(R.data[F]!==0){T.left=X,W=!0;break}}if(W)break}T.right=G,W=!1;for(let X=$+G-1;X>=$;X--){for(let O=0;O<Y;O++){const F=O*this._tmpCanvas.width*4+4*X+3;if(R.data[F]!==0){T.right=X,W=!0;break}}if(W)break}T.bottom=Y,W=!1;for(let X=Y-1;X>=0;X--){for(let O=0;O<G;O++){const F=X*this._tmpCanvas.width*4+4*O+3;if(R.data[F]!==0){T.bottom=X,W=!0;break}}if(W)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:T.right-T.left+1,y:T.bottom-T.top+1},sizeClipSpace:{x:T.right-T.left+1,y:T.bottom-T.top+1},offset:{x:-T.left+$+(B||M?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-T.top+$+(B||M?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}r.TextureAtlas=S;class x{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(R){this._glyphs.push(R),this._usedPixels+=R.size.x*R.size.y}constructor(R,T,I){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],I)for(const B of I)this._glyphs.push(...B.glyphs),this._usedPixels+=B._usedPixels;this.canvas=E(R,T,T),this.ctx=(0,l.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}}function m(y,R,T,I){const B=R.rgba>>>24,M=R.rgba>>>16&255,$=R.rgba>>>8&255,Y=T.rgba>>>24,G=T.rgba>>>16&255,W=T.rgba>>>8&255,X=Math.floor((Math.abs(B-Y)+Math.abs(M-G)+Math.abs($-W))/12);let O=!0;for(let F=0;F<y.data.length;F+=4)y.data[F]===B&&y.data[F+1]===M&&y.data[F+2]===$||I&&Math.abs(y.data[F]-B)+Math.abs(y.data[F+1]-M)+Math.abs(y.data[F+2]-$)<X?y.data[F+3]=0:O=!1;return O}function E(y,R,T){const I=y.createElement("canvas");return I.width=R,I.height=T,I}},160:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;let u=0,d=0,g=0,l=0;var p,b,w,f,n;function a(c){const S=c.toString(16);return S.length<2?"0"+S:S}function o(c,S){return c<S?(S+.05)/(c+.05):(c+.05)/(S+.05)}r.NULL_COLOR={css:"#00000000",rgba:0},(function(c){c.toCss=function(S,x,m,E){return E!==void 0?`#${a(S)}${a(x)}${a(m)}${a(E)}`:`#${a(S)}${a(x)}${a(m)}`},c.toRgba=function(S,x,m,E=255){return(S<<24|x<<16|m<<8|E)>>>0},c.toColor=function(S,x,m,E){return{css:c.toCss(S,x,m,E),rgba:c.toRgba(S,x,m,E)}}})(p||(r.channels=p={})),(function(c){function S(x,m){return l=Math.round(255*m),[u,d,g]=n.toChannels(x.rgba),{css:p.toCss(u,d,g,l),rgba:p.toRgba(u,d,g,l)}}c.blend=function(x,m){if(l=(255&m.rgba)/255,l===1)return{css:m.css,rgba:m.rgba};const E=m.rgba>>24&255,y=m.rgba>>16&255,R=m.rgba>>8&255,T=x.rgba>>24&255,I=x.rgba>>16&255,B=x.rgba>>8&255;return u=T+Math.round((E-T)*l),d=I+Math.round((y-I)*l),g=B+Math.round((R-B)*l),{css:p.toCss(u,d,g),rgba:p.toRgba(u,d,g)}},c.isOpaque=function(x){return(255&x.rgba)==255},c.ensureContrastRatio=function(x,m,E){const y=n.ensureContrastRatio(x.rgba,m.rgba,E);if(y)return p.toColor(y>>24&255,y>>16&255,y>>8&255)},c.opaque=function(x){const m=(255|x.rgba)>>>0;return[u,d,g]=n.toChannels(m),{css:p.toCss(u,d,g),rgba:m}},c.opacity=S,c.multiplyOpacity=function(x,m){return l=255&x.rgba,S(x,l*m/255)},c.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(b||(r.color=b={})),(function(c){let S,x;try{const m=document.createElement("canvas");m.width=1,m.height=1;const E=m.getContext("2d",{willReadFrequently:!0});E&&(S=E,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}c.toColor=function(m){if(m.match(/#[\da-f]{3,8}/i))switch(m.length){case 4:return u=parseInt(m.slice(1,2).repeat(2),16),d=parseInt(m.slice(2,3).repeat(2),16),g=parseInt(m.slice(3,4).repeat(2),16),p.toColor(u,d,g);case 5:return u=parseInt(m.slice(1,2).repeat(2),16),d=parseInt(m.slice(2,3).repeat(2),16),g=parseInt(m.slice(3,4).repeat(2),16),l=parseInt(m.slice(4,5).repeat(2),16),p.toColor(u,d,g,l);case 7:return{css:m,rgba:(parseInt(m.slice(1),16)<<8|255)>>>0};case 9:return{css:m,rgba:parseInt(m.slice(1),16)>>>0}}const E=m.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(E)return u=parseInt(E[1]),d=parseInt(E[2]),g=parseInt(E[3]),l=Math.round(255*(E[5]===void 0?1:parseFloat(E[5]))),p.toColor(u,d,g,l);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=m,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,g,l]=S.getImageData(0,0,1,1).data,l!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(u,d,g,l),css:m}}})(w||(r.css=w={})),(function(c){function S(x,m,E){const y=x/255,R=m/255,T=E/255;return .2126*(y<=.03928?y/12.92:Math.pow((y+.055)/1.055,2.4))+.7152*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}c.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},c.relativeLuminance2=S})(f||(r.rgb=f={})),(function(c){function S(m,E,y){const R=m>>24&255,T=m>>16&255,I=m>>8&255;let B=E>>24&255,M=E>>16&255,$=E>>8&255,Y=o(f.relativeLuminance2(B,M,$),f.relativeLuminance2(R,T,I));for(;Y<y&&(B>0||M>0||$>0);)B-=Math.max(0,Math.ceil(.1*B)),M-=Math.max(0,Math.ceil(.1*M)),$-=Math.max(0,Math.ceil(.1*$)),Y=o(f.relativeLuminance2(B,M,$),f.relativeLuminance2(R,T,I));return(B<<24|M<<16|$<<8|255)>>>0}function x(m,E,y){const R=m>>24&255,T=m>>16&255,I=m>>8&255;let B=E>>24&255,M=E>>16&255,$=E>>8&255,Y=o(f.relativeLuminance2(B,M,$),f.relativeLuminance2(R,T,I));for(;Y<y&&(B<255||M<255||$<255);)B=Math.min(255,B+Math.ceil(.1*(255-B))),M=Math.min(255,M+Math.ceil(.1*(255-M))),$=Math.min(255,$+Math.ceil(.1*(255-$))),Y=o(f.relativeLuminance2(B,M,$),f.relativeLuminance2(R,T,I));return(B<<24|M<<16|$<<8|255)>>>0}c.blend=function(m,E){if(l=(255&E)/255,l===1)return E;const y=E>>24&255,R=E>>16&255,T=E>>8&255,I=m>>24&255,B=m>>16&255,M=m>>8&255;return u=I+Math.round((y-I)*l),d=B+Math.round((R-B)*l),g=M+Math.round((T-M)*l),p.toRgba(u,d,g)},c.ensureContrastRatio=function(m,E,y){const R=f.relativeLuminance(m>>8),T=f.relativeLuminance(E>>8);if(o(R,T)<y){if(T<R){const M=S(m,E,y),$=o(R,f.relativeLuminance(M>>8));if($<y){const Y=x(m,E,y);return $>o(R,f.relativeLuminance(Y>>8))?M:Y}return M}const I=x(m,E,y),B=o(R,f.relativeLuminance(I>>8));if(B<y){const M=S(m,E,y);return B>o(R,f.relativeLuminance(M>>8))?I:M}return I}},c.reduceLuminance=S,c.increaseLuminance=x,c.toChannels=function(m){return[m>>24&255,m>>16&255,m>>8&255,255&m]}})(n||(r.rgba=n={})),r.toPaddedHex=a,r.contrastRatio=o},345:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const g=[];for(let l=0;l<this._listeners.length;l++)g.push(this._listeners[l]);for(let l=0;l<g.length;l++)g[l].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(u,d){return u((g=>d.fire(g)))},r.runAndSubscribe=function(u,d){return d(void 0),u((g=>d(g)))}},859:(z,r)=>{function u(d){for(const g of d)g.dispose();d.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const g=this._disposables.indexOf(d);g!==-1&&this._disposables.splice(g,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var g;this._isDisposed||d===this._value||((g=this._value)==null||g.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},r.toDisposable=function(d){return{dispose:d}},r.disposeArray=u,r.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},485:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(g,l,p){this._data[g]||(this._data[g]={}),this._data[g][l]=p}get(g,l){return this._data[g]?this._data[g][l]:void 0}clear(){this._data={}}}r.TwoKeyMap=u,r.FourKeyMap=class{constructor(){this._data=new u}set(d,g,l,p,b){this._data.get(d,g)||this._data.set(d,g,new u),this._data.get(d,g).set(l,p,b)}get(d,g,l,p){var b;return(b=this._data.get(d,g))==null?void 0:b.get(l,p)}clear(){this._data.clear()}}},399:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof process<"u"&&"title"in process;const u=r.isNode?"node":navigator.userAgent,d=r.isNode?"node":navigator.platform;r.isFirefox=u.includes("Firefox"),r.isLegacyEdge=u.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(u),r.getSafariVersion=function(){if(!r.isSafari)return 0;const g=u.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(u)},385:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const d=u(399);class g{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let w=0,f=0,n=b.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),f=Math.max(w,f),a=b.timeRemaining(),1.5*f>a)return n-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(n-w))}ms`),void this._start();n=a}this.clear()}}class l extends g{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const w=Date.now()+b;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}r.PriorityTaskQueue=l,r.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:l,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},147:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(l){return[l>>>16&255,l>>>8&255,255&l]}static fromColorRGB(l){return(255&l[0])<<16|(255&l[1])<<8|255&l[2]}clone(){const l=new u;return l.fg=this.fg,l.bg=this.bg,l.extended=this.extended.clone(),l}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}r.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(l){this._ext=l}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(l){this._ext&=-469762049,this._ext|=l<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(l){this._ext&=-67108864,this._ext|=67108863&l}get urlId(){return this._urlId}set urlId(l){this._urlId=l}get underlineVariantOffset(){const l=(3758096384&this._ext)>>29;return l<0?4294967288^l:l}set underlineVariantOffset(l){this._ext&=536870911,this._ext|=l<<29&3758096384}constructor(l=0,p=0){this._ext=0,this._urlId=0,this._ext=l,this._urlId=p}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=d},782:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const d=u(133),g=u(855),l=u(147);class p extends l.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new l.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const f=new p;return f.setFromCharData(w),f}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let f=!1;if(w[g.CHAR_DATA_CHAR_INDEX].length>2)f=!0;else if(w[g.CHAR_DATA_CHAR_INDEX].length===2){const n=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){const a=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(n-55296)+a-56320+65536|w[g.CHAR_DATA_WIDTH_INDEX]<<22:f=!0}else f=!0}else this.content=w[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[g.CHAR_DATA_WIDTH_INDEX]<<22;f&&(this.combinedData=w[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=p},855:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},r.utf32ToString=function(u,d=0,g=u.length){let l="";for(let p=d;p<g;++p){let b=u[p];b>65535?(b-=65536,l+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):l+=String.fromCharCode(b)}return l},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const g=u.length;if(!g)return 0;let l=0,p=0;if(this._interim){const b=u.charCodeAt(p++);56320<=b&&b<=57343?d[l++]=1024*(this._interim-55296)+b-56320+65536:(d[l++]=this._interim,d[l++]=b),this._interim=0}for(let b=p;b<g;++b){const w=u.charCodeAt(b);if(55296<=w&&w<=56319){if(++b>=g)return this._interim=w,l;const f=u.charCodeAt(b);56320<=f&&f<=57343?d[l++]=1024*(w-55296)+f-56320+65536:(d[l++]=w,d[l++]=f)}else w!==65279&&(d[l++]=w)}return l}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const g=u.length;if(!g)return 0;let l,p,b,w,f=0,n=0,a=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let m,E=0;for(;(m=63&this.interim[++E])&&E<4;)x<<=6,x|=m;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,R=y-E;for(;a<R;){if(a>=g)return 0;if(m=u[a++],(192&m)!=128){a--,S=!0;break}this.interim[E++]=m,x<<=6,x|=63&m}S||(y===2?x<128?a--:d[f++]=x:y===3?x<2048||x>=55296&&x<=57343||x===65279||(d[f++]=x):x<65536||x>1114111||(d[f++]=x)),this.interim.fill(0)}const o=g-4;let c=a;for(;c<g;){for(;!(!(c<o)||128&(l=u[c])||128&(p=u[c+1])||128&(b=u[c+2])||128&(w=u[c+3]));)d[f++]=l,d[f++]=p,d[f++]=b,d[f++]=w,c+=4;if(l=u[c++],l<128)d[f++]=l;else if((224&l)==192){if(c>=g)return this.interim[0]=l,f;if(p=u[c++],(192&p)!=128){c--;continue}if(n=(31&l)<<6|63&p,n<128){c--;continue}d[f++]=n}else if((240&l)==224){if(c>=g)return this.interim[0]=l,f;if(p=u[c++],(192&p)!=128){c--;continue}if(c>=g)return this.interim[0]=l,this.interim[1]=p,f;if(b=u[c++],(192&b)!=128){c--;continue}if(n=(15&l)<<12|(63&p)<<6|63&b,n<2048||n>=55296&&n<=57343||n===65279)continue;d[f++]=n}else if((248&l)==240){if(c>=g)return this.interim[0]=l,f;if(p=u[c++],(192&p)!=128){c--;continue}if(c>=g)return this.interim[0]=l,this.interim[1]=p,f;if(b=u[c++],(192&b)!=128){c--;continue}if(c>=g)return this.interim[0]=l,this.interim[1]=p,this.interim[2]=b,f;if(w=u[c++],(192&w)!=128){c--;continue}if(n=(7&l)<<18|(63&p)<<12|(63&b)<<6|63&w,n<65536||n>1114111)continue;d[f++]=n}}return f}}},776:function(z,r,u){var d=this&&this.__decorate||function(n,a,o,c){var S,x=arguments.length,m=x<3?a:c===null?c=Object.getOwnPropertyDescriptor(a,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(n,a,o,c);else for(var E=n.length-1;E>=0;E--)(S=n[E])&&(m=(x<3?S(m):x>3?S(a,o,m):S(a,o))||m);return x>3&&m&&Object.defineProperty(a,o,m),m},g=this&&this.__param||function(n,a){return function(o,c){a(o,c,n)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const l=u(859),p=u(97),b={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let w,f=r.LogService=class extends l.Disposable{get logLevel(){return this._logLevel}constructor(n){super(),this._optionsService=n,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),w=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(n){for(let a=0;a<n.length;a++)typeof n[a]=="function"&&(n[a]=n[a]())}_log(n,a,o){this._evalLazyOptionalParams(o),n.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...o)}trace(n,...a){var o;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.trace.bind(this._optionsService.options.logger))??console.log,n,a)}debug(n,...a){var o;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.debug.bind(this._optionsService.options.logger))??console.log,n,a)}info(n,...a){var o;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.info.bind(this._optionsService.options.logger))??console.info,n,a)}warn(n,...a){var o;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.warn.bind(this._optionsService.options.logger))??console.warn,n,a)}error(n,...a){var o;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((o=this._optionsService.options.logger)==null?void 0:o.error.bind(this._optionsService.options.logger))??console.error,n,a)}};r.LogService=f=d([g(0,p.IOptionsService)],f),r.setTraceLogger=function(n){w=n},r.traceCall=function(n,a,o){if(typeof o.value!="function")throw new Error("not supported");const c=o.value;o.value=function(...S){if(w.logLevel!==p.LogLevelEnum.TRACE)return c.apply(this,S);w.trace(`GlyphRenderer#${c.name}(${S.map((m=>JSON.stringify(m))).join(", ")})`);const x=c.apply(this,S);return w.trace(`GlyphRenderer#${c.name} return`,x),x}}},726:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const u="di$target",d="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(g){return g[d]||[]},r.createDecorator=function(g){if(r.serviceRegistry.has(g))return r.serviceRegistry.get(g);const l=function(p,b,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(f,n,a){n[u]===n?n[d].push({id:f,index:a}):(n[d]=[{id:f,index:a}],n[u]=n)})(l,p,w)};return l.toString=()=>g,r.serviceRegistry.set(g,l),l}},97:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const d=u(726);var g;r.IBufferService=(0,d.createDecorator)("BufferService"),r.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),r.ICoreService=(0,d.createDecorator)("CoreService"),r.ICharsetService=(0,d.createDecorator)("CharsetService"),r.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(l){l[l.TRACE=0]="TRACE",l[l.DEBUG=1]="DEBUG",l[l.INFO=2]="INFO",l[l.WARN=3]="WARN",l[l.ERROR=4]="ERROR",l[l.OFF=5]="OFF"})(g||(r.LogLevelEnum=g={})),r.ILogService=(0,d.createDecorator)("LogService"),r.IOptionsService=(0,d.createDecorator)("OptionsService"),r.IOscLinkService=(0,d.createDecorator)("OscLinkService"),r.IUnicodeService=(0,d.createDecorator)("UnicodeService"),r.IDecorationService=(0,d.createDecorator)("DecorationService")}},A={};function H(z){var r=A[z];if(r!==void 0)return r.exports;var u=A[z]={exports:{}};return D[z].call(u.exports,u,u.exports,H),u.exports}var N={};return(()=>{var z=N;Object.defineProperty(z,"__esModule",{value:!0}),z.WebglAddon=void 0;const r=H(345),u=H(859),d=H(399),g=H(666),l=H(776);class p extends u.Disposable{constructor(w){if(d.isSafari&&(0,d.getSafariVersion)()<16){const f={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",f))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=w,this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new r.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new r.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(w){const f=w._core;if(!w.element)return void this.register(f.onWillOpen((()=>this.activate(w))));this._terminal=w;const n=f.coreService,a=f.optionsService,o=f,c=o._renderService,S=o._characterJoinerService,x=o._charSizeService,m=o._coreBrowserService,E=o._decorationService,y=o._logService,R=o._themeService;(0,l.setTraceLogger)(y),this._renderer=this.register(new g.WebglRenderer(w,S,x,m,n,E,a,R,this._preserveDrawingBuffer)),this.register((0,r.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,r.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),c.setRenderer(this._renderer),this.register((0,u.toDisposable)((()=>{const T=this._terminal._core._renderService;T.setRenderer(this._terminal._core._createRenderer()),T.handleResize(w.cols,w.rows)})))}get textureAtlas(){var w;return(w=this._renderer)==null?void 0:w.textureAtlas}clearTextureAtlas(){var w;(w=this._renderer)==null||w.clearTextureAtlas()}}z.WebglAddon=p})(),N})()))})(Nc)),Nc.exports}var zm=Hm(),so={exports:{}},Im=so.exports,M_;function Nm(){return M_||(M_=1,(function(_,C){(function(D,A){_.exports=A()})(Im,(()=>(()=>{var D={433:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV11=void 0;const d=u(938),g=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],l=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],p=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],b=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let w;function f(n,a){let o,c=0,S=a.length-1;if(n<a[0][0]||n>a[S][1])return!1;for(;S>=c;)if(o=c+S>>1,n>a[o][1])c=o+1;else{if(!(n<a[o][0]))return!0;S=o-1}return!1}r.UnicodeV11=class{constructor(){if(this.version="11",!w){w=new Uint8Array(65536),w.fill(1),w[0]=0,w.fill(0,1,32),w.fill(0,127,160);for(let n=0;n<g.length;++n)w.fill(0,g[n][0],g[n][1]+1);for(let n=0;n<p.length;++n)w.fill(2,p[n][0],p[n][1]+1)}}wcwidth(n){return n<32?0:n<127?1:n<65536?w[n]:f(n,l)?0:f(n,b)?2:1}charProperties(n,a){let o=this.wcwidth(n),c=o===0&&a!==0;if(c){const S=d.UnicodeService.extractWidth(a);S===0?c=!1:S>o&&(o=S)}return d.UnicodeService.createPropertyValue(0,o,c)}}},345:(z,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.runAndSubscribe=r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const g=[];for(let l=0;l<this._listeners.length;l++)g.push(this._listeners[l]);for(let l=0;l<g.length;l++)g[l].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},r.forwardEvent=function(u,d){return u((g=>d.fire(g)))},r.runAndSubscribe=function(u,d){return d(void 0),u((g=>d(g)))}},490:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const d=u(938),g=[[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]],l=[[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]];let p;r.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let b=0;b<g.length;++b)p.fill(0,g[b][0],g[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?p[b]:(function(w,f){let n,a=0,o=f.length-1;if(w<f[0][0]||w>f[o][1])return!1;for(;o>=a;)if(n=a+o>>1,w>f[n][1])a=n+1;else{if(!(w<f[n][0]))return!0;o=n-1}return!1})(b,l)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,w){let f=this.wcwidth(b),n=f===0&&w!==0;if(n){const a=d.UnicodeService.extractWidth(w);a===0?n=!1:a>f&&(f=a)}return d.UnicodeService.createPropertyValue(0,f,n)}}},938:(z,r,u)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const d=u(345),g=u(490);class l{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,w,f=!1){return(16777215&b)<<3|(3&w)<<1|(f?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new g.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let w=0,f=0;const n=b.length;for(let a=0;a<n;++a){let o=b.charCodeAt(a);if(55296<=o&&o<=56319){if(++a>=n)return w+this.wcwidth(o);const x=b.charCodeAt(a);56320<=x&&x<=57343?o=1024*(o-55296)+x-56320+65536:w+=this.wcwidth(x)}const c=this.charProperties(o,f);let S=l.extractWidth(c);l.extractShouldJoin(c)&&(S-=l.extractWidth(f)),w+=S,f=c}return w}charProperties(b,w){return this._activeProvider.charProperties(b,w)}}r.UnicodeService=l}},A={};function H(z){var r=A[z];if(r!==void 0)return r.exports;var u=A[z]={exports:{}};return D[z](u,u.exports,H),u.exports}var N={};return(()=>{var z=N;Object.defineProperty(z,"__esModule",{value:!0}),z.Unicode11Addon=void 0;const r=H(433);z.Unicode11Addon=class{activate(u){u.unicode.register(new r.UnicodeV11)}dispose(){}}})(),N})()))})(so)),so.exports}var Um=Nm();const jm=16,Pm=256*1024,k_=50;function Fm(_,C){const D=q.useRef(null),A=q.useRef(null),H=q.useRef(null),N=q.useRef(C);N.current=C;const z=q.useRef([]),r=q.useRef(0),u=q.useRef(null),d=q.useRef(null),g=q.useRef(null),l=q.useRef(0),p=q.useRef(null),b=q.useRef(null),w=q.useRef(null),f=q.useRef(!0),n=q.useRef(!0),[a,o]=q.useState(!1),c=q.useRef(!1),S=q.useRef(!1),x=q.useRef(0),m=20,E=q.useRef(0);q.useEffect(()=>{if(!_.current)return;const Y=()=>{if(!D.current||z.current.length===0)return;const oe=z.current.join("");z.current=[],r.current=0,D.current.write(oe)};g.current=Y;const G=(oe,K)=>{const U=w.current;if(U&&U.cols===oe&&U.rows===K)return;const te=Date.now()-l.current,_e=()=>{var be;l.current=Date.now(),((be=N.current)==null?void 0:be.call(N,oe,K))!==!1&&(w.current={cols:oe,rows:K})};if(te>=k_){_e();return}b.current={cols:oe,rows:K},p.current||(p.current=setTimeout(()=>{var be;p.current=null;const fe=b.current;b.current=null,fe&&(l.current=Date.now(),((be=N.current)==null?void 0:be.call(N,fe.cols,fe.rows))!==!1&&(w.current={cols:fe.cols,rows:fe.rows}))},k_-te))},W=new km.Terminal({disableStdin:!0,fontSize:14,fontFamily:"'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace",theme:{background:"#0d1117",foreground:"#e6edf3",cursor:"#e6edf3",selectionBackground:"#264f78",black:"#484f58",red:"#ff7b72",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ffa198",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},scrollback:1e4}),X=new Bm.FitAddon;W.loadAddon(X);try{const oe=new Um.Unicode11Addon;W.loadAddon(oe),W.unicode.activeVersion="11"}catch{}W.open(_.current);try{const oe=new zm.WebglAddon;W.loadAddon(oe),oe.onContextLoss(()=>{oe.dispose()})}catch{}X.fit(),requestAnimationFrame(()=>{D.current&&G(D.current.cols,D.current.rows)}),D.current=W,A.current=X,E.current=W.buffer.active.viewportY;const O=(oe,K)=>{X.fit(),G(W.cols,W.rows)};H.current=O;const F=new ResizeObserver(()=>{X.fit(),G(W.cols,W.rows)});F.observe(_.current),W.onScroll(()=>{if(c.current)return;const oe=W.buffer.active,K=oe.viewportY,U=K>=oe.length-W.rows;E.current-K>0&&!U&&(f.current=!1),E.current=K,n.current=U,U&&(f.current=!0),o(!f.current&&!U)});const k=_.current,P=oe=>{var U;const K=(U=oe.touches)==null?void 0:U[0];K&&(S.current=!0,x.current=K.clientY)},Q=oe=>{var ne;const K=(ne=oe.touches)==null?void 0:ne[0];if(!K)return;if(K.clientY-x.current>m){if(!(W.buffer.active.length>W.rows))return;f.current=!1,o(!0)}},ee=()=>{S.current=!1},he=oe=>{if(oe.deltaY<0){if(!(W.buffer.active.length>W.rows))return;f.current=!1,o(!0)}};return k.addEventListener("touchstart",P,{passive:!0}),k.addEventListener("touchmove",Q,{passive:!0}),k.addEventListener("touchend",ee,{passive:!0}),k.addEventListener("wheel",he,{passive:!0}),()=>{k.removeEventListener("touchstart",P),k.removeEventListener("touchmove",Q),k.removeEventListener("touchend",ee),k.removeEventListener("wheel",he),F.disconnect(),p.current&&(clearTimeout(p.current),p.current=null),u.current!==null&&(cancelAnimationFrame(u.current),u.current=null),d.current&&(clearTimeout(d.current),d.current=null),Y(),W.dispose(),D.current=null,A.current=null,H.current=null,g.current=null}},[_]);const y=q.useCallback(()=>{const Y=D.current;if(!Y||S.current)return;if(f.current){c.current=!0,Y.scrollToBottom(),c.current=!1,E.current=Y.buffer.active.viewportY;return}const G=Y.buffer.active,W=G.viewportY>=G.length-Y.rows;W!==n.current&&(n.current=W,o(!W))},[]),R=q.useCallback((Y,G)=>{var W;if(!Y){G==null||G();return}if(z.current.push(Y),r.current+=Y.length,r.current>=Pm){(W=g.current)==null||W.call(g),y(),G==null||G();return}u.current===null&&(u.current=requestAnimationFrame(()=>{var X;u.current=null,d.current&&(clearTimeout(d.current),d.current=null),(X=g.current)==null||X.call(g),y()})),d.current||(d.current=setTimeout(()=>{var X;d.current=null,(X=g.current)==null||X.call(g),y()},jm)),G==null||G()},[]),T=q.useCallback(()=>{var Y;(Y=D.current)==null||Y.clear()},[]),I=q.useCallback(()=>{var Y;(Y=D.current)==null||Y.reset()},[]),B=q.useCallback(()=>{const Y=D.current;Y&&(c.current=!0,Y.scrollToBottom(),c.current=!1,E.current=Y.buffer.active.viewportY)},[]),M=q.useCallback(Y=>{f.current=Y,Y&&o(!1)},[]),$=q.useCallback((Y,G)=>{var W;(W=H.current)==null||W.call(H,Y,G)},[]);return{write:R,clear:T,reset:I,scrollToBottom:B,setAutoFollow:M,showScrollHint:a,adaptToPtyCols:$,terminal:D}}function qm(){const[_,C]=q.useState(0),[D,A]=q.useState(!1),H=q.useRef(null),N=q.useRef(!1);q.useEffect(()=>{const g=navigator.userAgent;N.current=/android/i.test(g)&&!/windows phone/i.test(g),console.log("[viewport] Device detection:",{isAndroid:N.current,ua:g})},[]);const z=q.useCallback(()=>{const g=document.activeElement;if((g==null?void 0:g.tagName)!=="INPUT"&&(g==null?void 0:g.tagName)!=="TEXTAREA")return!1;const l=window.visualViewport;if(!l)return!1;const p=g.getBoundingClientRect(),b=p.bottom>l.height+l.offsetTop-10;return console.log("[viewport] checkOcclusion",{elementTag:g.tagName,rectBottom:Math.round(p.bottom),vvHeight:Math.round(l.height),vvOffsetTop:Math.round(l.offsetTop),threshold:Math.round(l.height+l.offsetTop-10),occluded:b,isAndroid:N.current}),b},[]),r=q.useCallback(()=>{const g=window.visualViewport;if(!g){console.log("[viewport] updateViewport: no visualViewport"),C(0),A(!1);return}if(console.log("[viewport] updateViewport start",{vvOffsetTop:Math.round(g.offsetTop),vvHeight:Math.round(g.height),windowInnerHeight:window.innerHeight,isAndroid:N.current}),N.current){console.log("[viewport] updateViewport: Android detected, skipping JS compensation"),C(0),A(!1);return}const l=z();A(l),l?(console.log("[viewport] updateViewport: iOS setting offsetTop",Math.round(g.offsetTop)),C(g.offsetTop)):(console.log("[viewport] updateViewport: iOS clearing offsetTop (not occluded)"),C(0))},[z]),u=q.useCallback(()=>{var p;const g=window.visualViewport;if(!g)return;if(console.log("[viewport] updateViewportImmediate (focusin/focusout)",{vvOffsetTop:Math.round(g.offsetTop),vvHeight:Math.round(g.height),activeElement:(p=document.activeElement)==null?void 0:p.tagName,isAndroid:N.current}),N.current){console.log("[viewport] updateViewportImmediate: Android detected, skipping"),A(!1),C(0);return}const l=z();A(l),l?console.log("[viewport] updateViewportImmediate: focusin detected occlusion, waiting for resize"):(console.log("[viewport] updateViewportImmediate: clearing offsetTop (focusout/not occluded)"),C(0))},[z]),d=q.useCallback(()=>{console.log("[viewport] debouncedUpdate triggered (visualViewport resize/scroll)"),H.current&&clearTimeout(H.current),H.current=setTimeout(r,150)},[r]);return q.useEffect(()=>{const g=window.visualViewport;if(g)return C(0),g.addEventListener("resize",d),g.addEventListener("scroll",d),document.addEventListener("focusin",u,!0),document.addEventListener("focusout",u,!0),()=>{g.removeEventListener("resize",d),g.removeEventListener("scroll",d),document.removeEventListener("focusin",u,!0),document.removeEventListener("focusout",u,!0),H.current&&clearTimeout(H.current)}},[d,u]),{offsetTop:_,needsCompensation:D}}function Wm(_){const C="=".repeat((4-_.length%4)%4),D=(_+C).replace(/-/g,"+").replace(/_/g,"/"),A=atob(D),H=new Uint8Array(A.length);for(let N=0;N<A.length;N++)H[N]=A.charCodeAt(N);return H}function $m(){const _=q.useRef(!1);q.useEffect(()=>{if(!_.current){if(_.current=!0,!("serviceWorker"in navigator)||!("PushManager"in window)){console.log("[Push] Service Worker or PushManager not supported");return}(async()=>{try{console.log("[Push] Registering service worker...");const C=await navigator.serviceWorker.register("/sw.js");console.log("[Push] Service worker registered:",C.scope);const D=await C.pushManager.getSubscription();if(D){console.log("[Push] Already subscribed, endpoint:",D.endpoint);return}console.log("[Push] Fetching VAPID key from server...");let A="";for(let u=0;u<8;u++){const d=await fetch("/api/push/vapid-key",{credentials:"include"});if(d.ok){const g=await d.json();if(g!=null&&g.vapidPublicKey){A=g.vapidPublicKey,console.log("[Push] Got VAPID key:",A.substring(0,20)+"...");break}}else console.log("[Push] VAPID key fetch failed, attempt",u+1,"status:",d.status);await new Promise(g=>setTimeout(g,Math.min(300*(u+1),1500)))}if(!A){console.warn("[Push] Failed to get VAPID key after retries");return}console.log("[Push] Requesting notification permission...");const H=await Notification.requestPermission();if(console.log("[Push] Permission result:",H),H!=="granted"){console.warn("[Push] Notification permission not granted");return}console.log("[Push] Creating push subscription...");const N=await C.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Wm(A)});console.log("[Push] Subscription created:",N.endpoint);const z=N.toJSON();console.log("[Push] Sending subscription to server...");const r=await fetch("/api/push/subscribe",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({endpoint:z.endpoint,keys:z.keys})});r.ok?console.log("[Push] Subscription sent to server successfully"):console.error("[Push] Failed to send subscription, status:",r.status)}catch(C){console.error("[Push] Setup failed:",C)}})()}},[])}function Gm(){const _=q.useRef("default"),C=q.useRef(null);q.useEffect(()=>{"Notification"in window&&(_.current=Notification.permission)},[]);const D=q.useCallback(async()=>{if(!("Notification"in window))return console.log("[useLocalNotification] Notification API not supported"),!1;if(Notification.permission==="granted")return _.current="granted",!0;if(Notification.permission==="denied")return console.log("[useLocalNotification] Notification permission denied"),!1;const H=await Notification.requestPermission();return _.current=H,H==="granted"},[]);return{showNotification:q.useCallback(async H=>{if(H.tag&&H.tag===C.current)return console.log("[useLocalNotification] Skipping duplicate notification with tag:",H.tag),!1;if(_.current!=="granted"&&!await D())return console.log("[useLocalNotification] Permission not granted, cannot show notification"),!1;try{const N=new Notification(H.title,{body:H.body,tag:H.tag,icon:"/favicon.ico"});return N.onclick=()=>{window.focus(),N.close()},H.tag&&(C.current=H.tag),console.log("[useLocalNotification] Notification shown:",H.title),!0}catch(N){return console.error("[useLocalNotification] Failed to show notification:",N),!1}},[D]),requestPermission:D}}const Ym=5e3;function Vm(){const _=Ht(A=>A.setInstances),C=Ht(A=>A.setActiveInstanceId),D=We(A=>A.setServerAvailable);return q.useRef(!1),q.useEffect(()=>{let A,H=!1;const N=async()=>{try{const z=await $c();if(H)return;D(!0),_(z);const r=Ht.getState().activeInstanceId,u=r&&z.some(d=>d.instanceId===r);if((!r||!u)&&z.length>0){const d=z.find(g=>g.isCurrent)??z[0];d&&C(d.instanceId)}}catch{if(H)return;D(!1),_([])}};return N(),A=setInterval(N,Ym),()=>{H=!0,A&&clearInterval(A)}},[_,C,D]),{activeInstanceId:Ht(A=>A.activeInstanceId)}}function Xm({wsUrl:_,instanceId:C,showCommandPicker:D,isKeyboardOpen:A}){const H=q.useRef(null),N=q.useRef(null),z=We(Y=>Y.setSessionStatus),r=We(Y=>Y.setIpChangeInfo),u=We(Y=>Y.setInstanceConnectionStatus),{showNotification:d}=Gm(),g=q.useRef(null),l=q.useRef((Y,G)=>{}),p=q.useRef(()=>{}),b=q.useRef(()=>{}),w=q.useRef((Y,G)=>{}),f=q.useCallback(Y=>{switch(Y.type){case"terminal_output":l.current(Y.data);break;case"history_sync":p.current(),w.current(0,0),l.current(Y.data),z(Y.status);break;case"terminal_resize":Y.cols&&Y.cols>0&&w.current(Y.cols,Y.rows);break;case"status_update":z(Y.status),Y.status==="waiting_input"&&d({title:"Claude Code 需要输入",body:Y.detail??"Claude 正在等待你的输入",tag:"claude-waiting-input",renotify:!1});break;case"session_ended":z("idle"),C&&u(C,"disconnected");break;case"error":l.current(`\r
140
- \x1B[31m[Error] ${Y.message}\x1B[0m\r
141
- `);break;case"heartbeat":break;case"ip_changed":r({oldIp:Y.oldIp,newIp:Y.newIp,newUrl:Y.newUrl});break}},[z,r,d]),{connect:n,send:a}=Tm(f,_,C);g.current=a;const{write:o,reset:c,scrollToBottom:S,setAutoFollow:x,showScrollHint:m,adaptToPtyCols:E}=Fm(H,q.useCallback((Y,G)=>{var W;return((W=g.current)==null?void 0:W.call(g,{type:"resize",cols:Y,rows:G}))??!1},[]));l.current=o,p.current=c,b.current=S,w.current=E;const y=q.useRef(!1);q.useEffect(()=>{y.current||(y.current=!0,n())},[n]);const R=q.useCallback(Y=>{Y?(a({type:"user_input",data:Y}),setTimeout(()=>{a({type:"user_input",data:"\r"})},0)):a({type:"user_input",data:"\r"})},[a]),T=q.useCallback(Y=>{a({type:"user_input",data:Y})},[a]),I=q.useCallback(Y=>{var G;(G=N.current)==null||G.setText(Y)},[]),B=q.useCallback(Y=>{a({type:"user_input",data:Y}),a({type:"user_input",data:"\r"})},[a]),M=q.useCallback(()=>{S(),x(!0)},[S,x]),$=q.useCallback(()=>{var Y;(Y=N.current)==null||Y.focus()},[]);return V.jsxs(V.Fragment,{children:[V.jsx(vm,{}),V.jsx(pm,{}),V.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:[V.jsx(hm,{containerRef:H,onFocusInput:$}),V.jsx(Lm,{visible:m,onClick:M})]}),V.jsx(gm,{onShortcut:T,onCommandSelect:I,onCommandSend:B,visible:D}),V.jsx(dm,{ref:N,onSend:R,isKeyboardOpen:A})]})}function Km(_,C){return _.filter(D=>D.instanceId!==C).sort((D,A)=>D.startedAt.localeCompare(A.startedAt))}function Zm(){const{offsetTop:_,needsCompensation:C}=qm(),D=C&&_>0,A=!D;$m(),Vm();const H=Ht(c=>c.instances),N=Ht(c=>c.activeInstanceId),z=Ht(c=>c.setActiveInstanceId),r=We(c=>c.cachedToken),u=We(c=>c.serverAvailable),d=We(c=>c.instanceConnectionStatus),g=We(c=>c.toastMessage),l=We(c=>c.showToast),p=We(c=>c.hideToast),b=q.useRef(!1),w=q.useRef(null),f=H.find(c=>c.instanceId===N),n=N?mm(N):void 0;q.useEffect(()=>{if(!N||u===!1)return;const c=!f,S=d[N]==="disconnected";if(!(c||S)||b.current||w.current===N)return;const m=Km(H,N);if(m.length===0)return;b.current=!0,w.current=N,(async()=>{if(r)try{await xs(r)}catch{}const y=m[0];z(y.instanceId),l(`Switched to ${y.name}`),b.current=!1})()},[f,N,r,d,H,u,z,l]),q.useEffect(()=>{if(!g)return;const c=setTimeout(()=>p(),3e3);return()=>clearTimeout(c)},[g,p]);const a=q.useCallback(async c=>{if(r)try{await xs(r)}catch{}z(c);const S=H.find(x=>x.instanceId===c);S&&l(`Switched to ${S.name}`)},[r,z,H,l]),o=q.useCallback(async c=>{const x=[...Ht.getState().instances].filter(m=>m.name===c).sort((m,E)=>E.startedAt.localeCompare(m.startedAt))[0];if(!x){l("Instance created, but switch failed");return}z(x.instanceId),l(`Created and switched to ${c}`)},[z,l]);return V.jsxs("div",{"data-testid":"console--page",style:{position:"fixed",top:0,left:0,right:0,height:"100dvh",transform:C?`translateY(-${_}px)`:"none",transition:"transform 0.25s ease-out",willChange:C?"transform":"auto",display:"flex",flexDirection:"column"},children:[V.jsx(um,{}),V.jsx(Dm,{onSwitch:a,onCopySuccess:o}),V.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:V.jsx(Xm,{wsUrl:n,instanceId:N??void 0,showCommandPicker:A,isKeyboardOpen:D},N??"default")}),g&&V.jsx("div",{"data-testid":"toast--message",className:"app-toast app-toast-top",role:"status","aria-live":"polite",children:g})]})}const O_=[{id:"add-instance",target:'button[aria-label="Create new instance"]',title:"Start Here",description:"Tap + to create a new Claude Code session. Each instance runs independently.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:16},{id:"instance-tabs",target:'[data-testid="instance--tabs"]',title:"Switch Sessions",description:"Tap any tab to switch between different Claude sessions.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:8},{id:"clone-instance",target:'[data-testid="instance--tab"], [data-testid="instance--tab--active"]',title:"Clone Sessions",description:"Long press a tab to clone it with all settings. Perfect for backup or testing.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:8},{id:"shortcut-bar",target:'[data-testid="console--shortcut-bar"]',title:"Quick Keys",description:"Send Ctrl+C, Tab, Enter etc. instantly without typing.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"command-buttons",target:'[data-testid="console--command-buttons"]',title:"One-Tap Commands",description:"Run preset commands with a single tap.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"input-bar",target:'[data-testid="console--input--command"]',title:"Chat with Claude",description:"Type your message or command here. Claude Code will respond in real-time.",tooltipPosition:"top",spotlightPadding:4,spotlightRadius:8},{id:"settings-button",target:'button[aria-label="Settings"]',title:"Customize",description:"Adjust shortcuts, commands, and preferences.",tooltipPosition:"bottom",spotlightPadding:4,spotlightRadius:16}],B_="claude_remote_spotlight_done";function Qm(){const[_,C]=q.useState(!1),[D,A]=q.useState(0),[H,N]=q.useState(null),[z,r]=q.useState(!0),u=q.useRef(null),d=O_[D]??null,g=O_.length,l=q.useCallback(a=>{const o=document.querySelector(a.target);if(!o)return null;const c=o.getBoundingClientRect(),S=document.querySelector('[data-testid="console--page"]'),x=S?window.getComputedStyle(S):null,m=x==null?void 0:x.transform;let E=0;if(m&&m!=="none"){const y=m.match(/matrix\([^,]+,[^,]+,[^,]+,[^,]+,[^,]+,([^)]+)\)/);y&&(E=parseFloat(y[1]))}return{left:c.left,top:c.top-E,width:c.width,height:c.height}},[]),p=q.useCallback(()=>{if(!d)return;const a=l(d);N(a)},[d,l]);q.useEffect(()=>{localStorage.getItem(B_)||C(!0)},[]),q.useEffect(()=>{if(!_||!d)return;const a=document.querySelector(d.target);a&&a.scrollIntoView({behavior:"smooth",block:"center"});const o=setTimeout(()=>{const c=l(d);c?(N(c),r(!1)):D<g-1?A(D+1):b()},100);return()=>clearTimeout(o)},[_,D,d,l,g]),q.useEffect(()=>{if(!_||!d)return;const a=document.querySelector(d.target);if(!a)return;const o=a.style.outline,c=a.style.outlineOffset,S=a.style.position,x=a.style.zIndex;return a.style.outline="2px solid var(--status-running)",a.style.outlineOffset="2px",window.getComputedStyle(a).position==="static"&&(a.style.position="relative"),a.style.zIndex="2001",()=>{a.style.outline=o,a.style.outlineOffset=c,a.style.position=S,a.style.zIndex=x}},[_,d]),q.useEffect(()=>{if(!_)return;const a=()=>{u.current&&clearTimeout(u.current),u.current=window.setTimeout(()=>{p()},100)};return window.addEventListener("resize",a),window.visualViewport&&window.visualViewport.addEventListener("resize",a),()=>{window.removeEventListener("resize",a),window.visualViewport&&window.visualViewport.removeEventListener("resize",a),u.current&&clearTimeout(u.current)}},[_,p]);const b=q.useCallback(()=>{localStorage.setItem(B_,"true"),C(!1),r(!0),N(null)},[]),w=q.useCallback(()=>{D<g-1?A(D+1):b()},[D,g,b]),f=q.useCallback(()=>{D>0&&A(D-1)},[D]),n=q.useCallback(()=>{b()},[b]);return{visible:_,currentStep:D,totalSteps:g,step:d,targetRect:H,isLoading:z,handleNext:w,handlePrev:f,handleSkip:n,recalculate:p}}const Tg=q.createContext(null);function Jm({children:_}){const C=Qm();return V.jsx(Tg.Provider,{value:C,children:_})}function eb(){const _=q.useContext(Tg);if(!_)throw new Error("useSpotlightContext must be used within a SpotlightProvider");return _}function tb(){const{visible:_,currentStep:C,totalSteps:D,step:A,targetRect:H,isLoading:N,handleNext:z,handlePrev:r,handleSkip:u}=eb(),d=q.useRef(null),g=q.useRef(null),l=q.useCallback(B=>{switch(B.key){case"ArrowRight":case"ArrowDown":B.preventDefault(),z();break;case"ArrowLeft":case"ArrowUp":B.preventDefault(),r();break;case"Escape":B.preventDefault(),u();break;case"Enter":case" ":B.preventDefault(),z();break}},[z,r,u]);if(q.useEffect(()=>{if(_){g.current=document.activeElement;const B=setTimeout(()=>{var M;(M=d.current)==null||M.focus()},100);return()=>clearTimeout(B)}else g.current&&g.current.focus()},[_]),!_||!A||!H)return null;const p=A.spotlightPadding??4;A.spotlightRadius;const b=C===D-1,w=C===0,f=H.left-p,n=H.top-p,a=H.width+p*2,o=H.height+p*2,c=140,S=n,x=window.innerHeight-(n+o);let m=A.tooltipPosition;A.tooltipPosition==="bottom"&&x<c&&S>=c?m="top":A.tooltipPosition==="top"&&S<c&&x>=c&&(m="bottom");const E=m==="bottom"?n+o+12:n-12,y=Math.min(E,window.innerHeight-c-16),R=280,T=Math.max(16,Math.min(window.innerWidth-R-16,f)),I=typeof window<"u"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;return V.jsxs("div",{ref:d,"data-testid":"spotlight--dialog",role:"dialog","aria-modal":"true","aria-label":`Guide step ${C+1} of ${D}: ${A.title}`,tabIndex:-1,onKeyDown:l,style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:2e3,cursor:"pointer",WebkitTapHighlightColor:"transparent"},onClick:B=>{B.target.closest("[data-spotlight-tooltip]")||z()},children:[V.jsx("div",{style:{position:"absolute",inset:0,boxShadow:"0 0 0 9999px rgba(0, 0, 0, 0.75)",pointerEvents:"none"}}),V.jsxs("div",{"data-spotlight-tooltip":!0,"data-testid":"spotlight--tooltip",style:{position:"absolute",left:T,top:Math.max(16,y),transform:m==="top"?"translateY(-100%)":"none",maxWidth:R,padding:"12px 16px",borderRadius:12,background:"var(--bg-secondary)",boxShadow:"0 4px 24px rgba(0, 0, 0, 0.3)",pointerEvents:"auto",animation:I?"none":"spotlight-tooltip-enter 0.3s ease-out"},children:[V.jsx("div",{style:{position:"absolute",left:Math.max(16,Math.min(R-28,f+a/2-T-6)),[m==="top"?"bottom":"top"]:-6,width:12,height:12,background:"var(--bg-secondary)",transform:m==="top"?"translateY(50%) rotate(45deg)":"translateY(-50%) rotate(45deg)"}}),V.jsxs("div",{style:{position:"relative",zIndex:1},children:[V.jsx("div",{"data-testid":"spotlight--title",style:{fontSize:16,fontWeight:600,marginBottom:4,color:"var(--text-primary)"},children:A.title}),V.jsx("div",{"data-testid":"spotlight--description",style:{fontSize:13,lineHeight:1.5,color:"var(--text-secondary)"},children:A.description}),V.jsxs("div",{style:{marginTop:12,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[V.jsx("div",{"data-testid":"spotlight--dots",style:{display:"flex",gap:6},children:Array.from({length:D}).map((B,M)=>V.jsx("div",{style:{width:6,height:6,borderRadius:"50%",background:M===C?"var(--status-running)":M<C?"var(--status-idle)":"var(--border-color)"}},M))}),V.jsxs("div",{style:{display:"flex",gap:8},children:[V.jsx("button",{"data-testid":"spotlight--button--skip",onClick:B=>{B.stopPropagation(),u()},style:{padding:"6px 12px",borderRadius:6,border:"none",background:"transparent",color:"var(--text-muted)",fontSize:13,cursor:"pointer"},children:"Skip"}),!w&&V.jsx("button",{"data-testid":"spotlight--button--prev",onClick:B=>{B.stopPropagation(),r()},style:{padding:"6px 14px",borderRadius:6,border:"1px solid var(--border-color)",background:"var(--bg-tertiary)",color:"var(--text-primary)",fontSize:13,cursor:"pointer"},children:"Prev"}),V.jsx("button",{"data-testid":"spotlight--button--next",onClick:B=>{B.stopPropagation(),z()},style:{padding:"6px 16px",borderRadius:6,border:"none",background:"var(--status-running)",color:"#fff",fontSize:13,fontWeight:600,cursor:"pointer"},children:b?"Done":"Next"})]})]})]})]}),V.jsx("style",{children:`
142
- @keyframes spotlight-tooltip-enter {
143
- from {
144
- opacity: 0;
145
- transform: translateY(8px);
146
- }
147
- to {
148
- opacity: 1;
149
- transform: translateY(0);
150
- }
151
- }
152
- `})]})}function ib(){const C=new URLSearchParams(window.location.search).get("token");if(C){const D=window.location.pathname+window.location.hash;window.history.replaceState({},"",D)}return C}function sb(){const _=We(N=>N.isAuthenticated),C=We(N=>N.isCheckingAuth),D=We(N=>N.setAuthenticated),A=We(N=>N.setCheckingAuth),H=We(N=>N.setCachedToken);return q.useEffect(()=>{const N=ib();if(N){xs(N).then(z=>{z?(D(!0),H(N),P_(N)):(sessionStorage.setItem("prefill_token",N),A(!1))}).catch(()=>{sessionStorage.setItem("prefill_token",N),A(!1)});return}t0().then(()=>{D(!0);const z=Mn();z&&H(z)}).catch(async()=>{const z=Mn();if(z)try{if(await xs(z)){D(!0),H(z);return}}catch{}A(!1),F_(),H(null)})},[D,A,H]),C?V.jsx("div",{style:{height:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--bg-primary)",color:"var(--text-secondary)"},children:"Checking session…"}):_?V.jsxs(Jm,{children:[V.jsx(Zm,{}),V.jsx(tb,{})]}):V.jsx(n0,{})}Zp.createRoot(document.getElementById("root")).render(V.jsx(q.StrictMode,{children:V.jsx(sb,{})}));