zerogterm 0.7.0-alpha1 → 0.7.0-alpha2

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,19 +0,0 @@
1
- (function(){const B=document.createElement("link").relList;if(B&&B.supports&&B.supports("modulepreload"))return;for(const ee of document.querySelectorAll('link[rel="modulepreload"]'))j(ee);new MutationObserver(ee=>{for(const se of ee)if(se.type==="childList")for(const X of se.addedNodes)X.tagName==="LINK"&&X.rel==="modulepreload"&&j(X)}).observe(document,{childList:!0,subtree:!0});function O(ee){const se={};return ee.integrity&&(se.integrity=ee.integrity),ee.referrerPolicy&&(se.referrerPolicy=ee.referrerPolicy),ee.crossOrigin==="use-credentials"?se.credentials="include":ee.crossOrigin==="anonymous"?se.credentials="omit":se.credentials="same-origin",se}function j(ee){if(ee.ep)return;ee.ep=!0;const se=O(ee);fetch(ee.href,se)}})();var xc={exports:{}},Fn={};var gd;function cm(){if(gd)return Fn;gd=1;var w=Symbol.for("react.transitional.element"),B=Symbol.for("react.fragment");function O(j,ee,se){var X=null;if(se!==void 0&&(X=""+se),ee.key!==void 0&&(X=""+ee.key),"key"in ee){se={};for(var u in ee)u!=="key"&&(se[u]=ee[u])}else se=ee;return ee=se.ref,{$$typeof:w,type:j,key:X,ref:ee!==void 0?ee:null,props:se}}return Fn.Fragment=B,Fn.jsx=O,Fn.jsxs=O,Fn}var Sd;function um(){return Sd||(Sd=1,xc.exports=cm()),xc.exports}var p=um(),Ac={exports:{}},ke={};var bd;function hm(){if(bd)return ke;bd=1;var w=Symbol.for("react.transitional.element"),B=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),ee=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),X=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),h=Symbol.for("react.activity"),v=Symbol.iterator;function b(A){return A===null||typeof A!="object"?null:(A=v&&A[v]||A["@@iterator"],typeof A=="function"?A:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,o={};function c(A,k,K){this.props=A,this.context=k,this.refs=o,this.updater=K||C}c.prototype.isReactComponent={},c.prototype.setState=function(A,k){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,k,"setState")},c.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function a(){}a.prototype=c.prototype;function l(A,k,K){this.props=A,this.context=k,this.refs=o,this.updater=K||C}var _=l.prototype=new a;_.constructor=l,m(_,c.prototype),_.isPureReactComponent=!0;var x=Array.isArray;function E(){}var D={H:null,A:null,T:null,S:null},g=Object.prototype.hasOwnProperty;function T(A,k,K){var re=K.ref;return{$$typeof:w,type:A,key:k,ref:re!==void 0?re:null,props:K}}function U(A,k){return T(A.type,k,A.props)}function P(A){return typeof A=="object"&&A!==null&&A.$$typeof===w}function W(A){var k={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(K){return k[K]})}var N=/\/+/g;function Q(A,k){return typeof A=="object"&&A!==null&&A.key!=null?W(""+A.key):k.toString(36)}function ae(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(E,E):(A.status="pending",A.then(function(k){A.status==="pending"&&(A.status="fulfilled",A.value=k)},function(k){A.status==="pending"&&(A.status="rejected",A.reason=k)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function q(A,k,K,re,me){var pe=typeof A;(pe==="undefined"||pe==="boolean")&&(A=null);var F=!1;if(A===null)F=!0;else switch(pe){case"bigint":case"string":case"number":F=!0;break;case"object":switch(A.$$typeof){case w:case B:F=!0;break;case y:return F=A._init,q(F(A._payload),k,K,re,me)}}if(F)return me=me(A),F=re===""?"."+Q(A,0):re,x(me)?(K="",F!=null&&(K=F.replace(N,"$&/")+"/"),q(me,k,K,"",function(ve){return ve})):me!=null&&(P(me)&&(me=U(me,K+(me.key==null||A&&A.key===me.key?"":(""+me.key).replace(N,"$&/")+"/")+F)),k.push(me)),1;F=0;var L=re===""?".":re+":";if(x(A))for(var ne=0;ne<A.length;ne++)re=A[ne],pe=L+Q(re,ne),F+=q(re,k,K,pe,me);else if(ne=b(A),typeof ne=="function")for(A=ne.call(A),ne=0;!(re=A.next()).done;)re=re.value,pe=L+Q(re,ne++),F+=q(re,k,K,pe,me);else if(pe==="object"){if(typeof A.then=="function")return q(ae(A),k,K,re,me);throw k=String(A),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return F}function te(A,k,K){if(A==null)return A;var re=[],me=0;return q(A,re,"","",function(pe){return k.call(K,pe,me++)}),re}function V(A){if(A._status===-1){var k=A._result;k=k(),k.then(function(K){(A._status===0||A._status===-1)&&(A._status=1,A._result=K)},function(K){(A._status===0||A._status===-1)&&(A._status=2,A._result=K)}),A._status===-1&&(A._status=0,A._result=k)}if(A._status===1)return A._result.default;throw A._result}var R=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},z={map:te,forEach:function(A,k,K){te(A,function(){k.apply(this,arguments)},K)},count:function(A){var k=0;return te(A,function(){k++}),k},toArray:function(A){return te(A,function(k){return k})||[]},only:function(A){if(!P(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return ke.Activity=h,ke.Children=z,ke.Component=c,ke.Fragment=O,ke.Profiler=ee,ke.PureComponent=l,ke.StrictMode=j,ke.Suspense=f,ke.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,ke.__COMPILER_RUNTIME={__proto__:null,c:function(A){return D.H.useMemoCache(A)}},ke.cache=function(A){return function(){return A.apply(null,arguments)}},ke.cacheSignal=function(){return null},ke.cloneElement=function(A,k,K){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var re=m({},A.props),me=A.key;if(k!=null)for(pe in k.key!==void 0&&(me=""+k.key),k)!g.call(k,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&k.ref===void 0||(re[pe]=k[pe]);var pe=arguments.length-2;if(pe===1)re.children=K;else if(1<pe){for(var F=Array(pe),L=0;L<pe;L++)F[L]=arguments[L+2];re.children=F}return T(A.type,me,re)},ke.createContext=function(A){return A={$$typeof:X,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:se,_context:A},A},ke.createElement=function(A,k,K){var re,me={},pe=null;if(k!=null)for(re in k.key!==void 0&&(pe=""+k.key),k)g.call(k,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(me[re]=k[re]);var F=arguments.length-2;if(F===1)me.children=K;else if(1<F){for(var L=Array(F),ne=0;ne<F;ne++)L[ne]=arguments[ne+2];me.children=L}if(A&&A.defaultProps)for(re in F=A.defaultProps,F)me[re]===void 0&&(me[re]=F[re]);return T(A,pe,me)},ke.createRef=function(){return{current:null}},ke.forwardRef=function(A){return{$$typeof:u,render:A}},ke.isValidElement=P,ke.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:V}},ke.memo=function(A,k){return{$$typeof:d,type:A,compare:k===void 0?null:k}},ke.startTransition=function(A){var k=D.T,K={};D.T=K;try{var re=A(),me=D.S;me!==null&&me(K,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(E,R)}catch(pe){R(pe)}finally{k!==null&&K.types!==null&&(k.types=K.types),D.T=k}},ke.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},ke.use=function(A){return D.H.use(A)},ke.useActionState=function(A,k,K){return D.H.useActionState(A,k,K)},ke.useCallback=function(A,k){return D.H.useCallback(A,k)},ke.useContext=function(A){return D.H.useContext(A)},ke.useDebugValue=function(){},ke.useDeferredValue=function(A,k){return D.H.useDeferredValue(A,k)},ke.useEffect=function(A,k){return D.H.useEffect(A,k)},ke.useEffectEvent=function(A){return D.H.useEffectEvent(A)},ke.useId=function(){return D.H.useId()},ke.useImperativeHandle=function(A,k,K){return D.H.useImperativeHandle(A,k,K)},ke.useInsertionEffect=function(A,k){return D.H.useInsertionEffect(A,k)},ke.useLayoutEffect=function(A,k){return D.H.useLayoutEffect(A,k)},ke.useMemo=function(A,k){return D.H.useMemo(A,k)},ke.useOptimistic=function(A,k){return D.H.useOptimistic(A,k)},ke.useReducer=function(A,k,K){return D.H.useReducer(A,k,K)},ke.useRef=function(A){return D.H.useRef(A)},ke.useState=function(A){return D.H.useState(A)},ke.useSyncExternalStore=function(A,k,K){return D.H.useSyncExternalStore(A,k,K)},ke.useTransition=function(){return D.H.useTransition()},ke.version="19.2.8",ke}var yd;function qc(){return yd||(yd=1,Ac.exports=hm()),Ac.exports}var _e=qc(),Dc={exports:{}},Kn={},Tc={exports:{}},Rc={};var Cd;function fm(){return Cd||(Cd=1,(function(w){function B(q,te){var V=q.length;q.push(te);e:for(;0<V;){var R=V-1>>>1,z=q[R];if(0<ee(z,te))q[R]=te,q[V]=z,V=R;else break e}}function O(q){return q.length===0?null:q[0]}function j(q){if(q.length===0)return null;var te=q[0],V=q.pop();if(V!==te){q[0]=V;e:for(var R=0,z=q.length,A=z>>>1;R<A;){var k=2*(R+1)-1,K=q[k],re=k+1,me=q[re];if(0>ee(K,V))re<z&&0>ee(me,K)?(q[R]=me,q[re]=V,R=re):(q[R]=K,q[k]=V,R=k);else if(re<z&&0>ee(me,V))q[R]=me,q[re]=V,R=re;else break e}}return te}function ee(q,te){var V=q.sortIndex-te.sortIndex;return V!==0?V:q.id-te.id}if(w.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var se=performance;w.unstable_now=function(){return se.now()}}else{var X=Date,u=X.now();w.unstable_now=function(){return X.now()-u}}var f=[],d=[],y=1,h=null,v=3,b=!1,C=!1,m=!1,o=!1,c=typeof setTimeout=="function"?setTimeout:null,a=typeof clearTimeout=="function"?clearTimeout:null,l=typeof setImmediate<"u"?setImmediate:null;function _(q){for(var te=O(d);te!==null;){if(te.callback===null)j(d);else if(te.startTime<=q)j(d),te.sortIndex=te.expirationTime,B(f,te);else break;te=O(d)}}function x(q){if(m=!1,_(q),!C)if(O(f)!==null)C=!0,E||(E=!0,W());else{var te=O(d);te!==null&&ae(x,te.startTime-q)}}var E=!1,D=-1,g=5,T=-1;function U(){return o?!0:!(w.unstable_now()-T<g)}function P(){if(o=!1,E){var q=w.unstable_now();T=q;var te=!0;try{e:{C=!1,m&&(m=!1,a(D),D=-1),b=!0;var V=v;try{t:{for(_(q),h=O(f);h!==null&&!(h.expirationTime>q&&U());){var R=h.callback;if(typeof R=="function"){h.callback=null,v=h.priorityLevel;var z=R(h.expirationTime<=q);if(q=w.unstable_now(),typeof z=="function"){h.callback=z,_(q),te=!0;break t}h===O(f)&&j(f),_(q)}else j(f);h=O(f)}if(h!==null)te=!0;else{var A=O(d);A!==null&&ae(x,A.startTime-q),te=!1}}break e}finally{h=null,v=V,b=!1}te=void 0}}finally{te?W():E=!1}}}var W;if(typeof l=="function")W=function(){l(P)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,Q=N.port2;N.port1.onmessage=P,W=function(){Q.postMessage(null)}}else W=function(){c(P,0)};function ae(q,te){D=c(function(){q(w.unstable_now())},te)}w.unstable_IdlePriority=5,w.unstable_ImmediatePriority=1,w.unstable_LowPriority=4,w.unstable_NormalPriority=3,w.unstable_Profiling=null,w.unstable_UserBlockingPriority=2,w.unstable_cancelCallback=function(q){q.callback=null},w.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):g=0<q?Math.floor(1e3/q):5},w.unstable_getCurrentPriorityLevel=function(){return v},w.unstable_next=function(q){switch(v){case 1:case 2:case 3:var te=3;break;default:te=v}var V=v;v=te;try{return q()}finally{v=V}},w.unstable_requestPaint=function(){o=!0},w.unstable_runWithPriority=function(q,te){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var V=v;v=q;try{return te()}finally{v=V}},w.unstable_scheduleCallback=function(q,te,V){var R=w.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?R+V:R):V=R,q){case 1:var z=-1;break;case 2:z=250;break;case 5:z=1073741823;break;case 4:z=1e4;break;default:z=5e3}return z=V+z,q={id:y++,callback:te,priorityLevel:q,startTime:V,expirationTime:z,sortIndex:-1},V>R?(q.sortIndex=V,B(d,q),O(f)===null&&q===O(d)&&(m?(a(D),D=-1):m=!0,ae(x,V-R))):(q.sortIndex=z,B(f,q),C||b||(C=!0,E||(E=!0,W()))),q},w.unstable_shouldYield=U,w.unstable_wrapCallback=function(q){var te=v;return function(){var V=v;v=te;try{return q.apply(this,arguments)}finally{v=V}}}})(Rc)),Rc}var wd;function dm(){return wd||(wd=1,Tc.exports=fm()),Tc.exports}var Mc={exports:{}},Wt={};var Ed;function _m(){if(Ed)return Wt;Ed=1;var w=qc();function B(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)d+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function O(){}var j={d:{f:O,r:function(){throw Error(B(522))},D:O,C:O,L:O,m:O,X:O,S:O,M:O},p:0,findDOMNode:null},ee=Symbol.for("react.portal");function se(f,d,y){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ee,key:h==null?null:""+h,children:f,containerInfo:d,implementation:y}}var X=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Wt.createPortal=function(f,d){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(B(299));return se(f,d,null,y)},Wt.flushSync=function(f){var d=X.T,y=j.p;try{if(X.T=null,j.p=2,f)return f()}finally{X.T=d,j.p=y,j.d.f()}},Wt.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,j.d.C(f,d))},Wt.prefetchDNS=function(f){typeof f=="string"&&j.d.D(f)},Wt.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var y=d.as,h=u(y,d.crossOrigin),v=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;y==="style"?j.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:h,integrity:v,fetchPriority:b}):y==="script"&&j.d.X(f,{crossOrigin:h,integrity:v,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Wt.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var y=u(d.as,d.crossOrigin);j.d.M(f,{crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&j.d.M(f)},Wt.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var y=d.as,h=u(y,d.crossOrigin);j.d.L(f,y,{crossOrigin:h,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})}},Wt.preloadModule=function(f,d){if(typeof f=="string")if(d){var y=u(d.as,d.crossOrigin);j.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:y,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else j.d.m(f)},Wt.requestFormReset=function(f){j.d.r(f)},Wt.unstable_batchedUpdates=function(f,d){return f(d)},Wt.useFormState=function(f,d,y){return X.H.useFormState(f,d,y)},Wt.useFormStatus=function(){return X.H.useHostTransitionStatus()},Wt.version="19.2.8",Wt}var xd;function vm(){if(xd)return Mc.exports;xd=1;function w(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w)}catch(B){console.error(B)}}return w(),Mc.exports=_m(),Mc.exports}var Ad;function mm(){if(Ad)return Kn;Ad=1;var w=dm(),B=qc(),O=vm();function j(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 ee(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function se(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 X(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 u(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 f(e){if(se(e)!==e)throw Error(j(188))}function d(e){var t=e.alternate;if(!t){if(t=se(e),t===null)throw Error(j(188));return t!==e?null:e}for(var i=e,s=t;;){var r=i.return;if(r===null)break;var n=r.alternate;if(n===null){if(s=r.return,s!==null){i=s;continue}break}if(r.child===n.child){for(n=r.child;n;){if(n===i)return f(r),e;if(n===s)return f(r),t;n=n.sibling}throw Error(j(188))}if(i.return!==s.return)i=r,s=n;else{for(var S=!1,M=r.child;M;){if(M===i){S=!0,i=r,s=n;break}if(M===s){S=!0,s=r,i=n;break}M=M.sibling}if(!S){for(M=n.child;M;){if(M===i){S=!0,i=n,s=r;break}if(M===s){S=!0,s=n,i=r;break}M=M.sibling}if(!S)throw Error(j(189))}}if(i.alternate!==s)throw Error(j(190))}if(i.tag!==3)throw Error(j(188));return i.stateNode.current===i?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,v=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),T=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=P&&e[P]||e["@@iterator"],typeof e=="function"?e:null)}var N=Symbol.for("react.client.reference");function Q(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case c:return"Profiler";case o:return"StrictMode";case x:return"Suspense";case E:return"SuspenseList";case T:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case l:return e.displayName||"Context";case a:return(e._context.displayName||"Context")+".Consumer";case _:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case D:return t=e.displayName||null,t!==null?t:Q(e.type)||"Memo";case g:t=e._payload,e=e._init;try{return Q(e(t))}catch{}}return null}var ae=Array.isArray,q=B.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te=O.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},R=[],z=-1;function A(e){return{current:e}}function k(e){0>z||(e.current=R[z],R[z]=null,z--)}function K(e,t){z++,R[z]=e.current,e.current=t}var re=A(null),me=A(null),pe=A(null),F=A(null);function L(e,t){switch(K(pe,t),K(me,e),K(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?If(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=If(t),e=Pf(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}k(re),K(re,e)}function ne(){k(re),k(me),k(pe)}function ve(e){e.memoizedState!==null&&K(F,e);var t=re.current,i=Pf(t,e.type);t!==i&&(K(me,e),K(re,i))}function Se(e){me.current===e&&(k(re),k(me)),F.current===e&&(k(F),In._currentValue=V)}var be,Me;function Ue(e){if(be===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||"",Me=-1<i.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+be+e+Me}var He=!1;function at(e,t){if(!e||He)return"";He=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(le){var ie=le}Reflect.construct(e,[],he)}else{try{he.call()}catch(le){ie=le}e.call(he.prototype)}}else{try{throw Error()}catch(le){ie=le}(he=e())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(le){if(le&&ie&&typeof le.stack=="string")return[le.stack,ie.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var n=s.DetermineComponentFrameRoot(),S=n[0],M=n[1];if(S&&M){var I=S.split(`
4
- `),Z=M.split(`
5
- `);for(r=s=0;s<I.length&&!I[s].includes("DetermineComponentFrameRoot");)s++;for(;r<Z.length&&!Z[r].includes("DetermineComponentFrameRoot");)r++;if(s===I.length||r===Z.length)for(s=I.length-1,r=Z.length-1;1<=s&&0<=r&&I[s]!==Z[r];)r--;for(;1<=s&&0<=r;s--,r--)if(I[s]!==Z[r]){if(s!==1||r!==1)do if(s--,r--,0>r||I[s]!==Z[r]){var ce=`
6
- `+I[s].replace(" at new "," at ");return e.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",e.displayName)),ce}while(1<=s&&0<=r);break}}}finally{He=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?Ue(i):""}function Ae(e,t){switch(e.tag){case 26:case 27:case 5:return Ue(e.type);case 16:return Ue("Lazy");case 13:return e.child!==t&&t!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return at(e.type,!1);case 11:return at(e.type.render,!1);case 1:return at(e.type,!0);case 31:return Ue("Activity");default:return""}}function Mt(e){try{var t="",i=null;do t+=Ae(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
7
- Error generating stack: `+s.message+`
8
- `+s.stack}}var fe=Object.prototype.hasOwnProperty,ge=w.unstable_scheduleCallback,Ce=w.unstable_cancelCallback,Le=w.unstable_shouldYield,Xe=w.unstable_requestPaint,je=w.unstable_now,dt=w.unstable_getCurrentPriorityLevel,Ge=w.unstable_ImmediatePriority,lt=w.unstable_UserBlockingPriority,mt=w.unstable_NormalPriority,fi=w.unstable_LowPriority,Lt=w.unstable_IdlePriority,di=w.log,qe=w.unstable_setDisableYieldValue,Ni=null,kt=null;function Ft(e){if(typeof di=="function"&&qe(e),kt&&typeof kt.setStrictMode=="function")try{kt.setStrictMode(Ni,e)}catch{}}var It=Math.clz32?Math.clz32:Pc,Yn=Math.log,Yr=Math.LN2;function Pc(e){return e>>>=0,e===0?32:31-(Yn(e)/Yr|0)|0}var Bs=256,as=262144,lr=4194304;function Pt(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 or(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var r=0,n=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var M=s&134217727;return M!==0?(s=M&~n,s!==0?r=Pt(s):(S&=M,S!==0?r=Pt(S):i||(i=M&~e,i!==0&&(r=Pt(i))))):(M=s&~n,M!==0?r=Pt(M):S!==0?r=Pt(S):i||(i=s&~e,i!==0&&(r=Pt(i)))),r===0?0:t!==0&&t!==r&&(t&n)===0&&(n=r&-r,i=t&-t,n>=i||n===32&&(i&4194048)!==0)?t:r}function js(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function yl(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 Vn(){var e=lr;return lr<<=1,(lr&62914560)===0&&(lr=4194304),e}function Vr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Hs(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Cl(e,t,i,s,r,n){var S=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 M=e.entanglements,I=e.expirationTimes,Z=e.hiddenUpdates;for(i=S&~i;0<i;){var ce=31-It(i),he=1<<ce;M[ce]=0,I[ce]=-1;var ie=Z[ce];if(ie!==null)for(Z[ce]=null,ce=0;ce<ie.length;ce++){var le=ie[ce];le!==null&&(le.lane&=-536870913)}i&=~he}s!==0&&_i(e,s,0),n!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=n&~(S&~t))}function _i(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-It(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function $r(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-It(i),r=1<<s;r&t|e[s]&t&&(e[s]|=t),i&=~r}}function $n(e,t){var i=t&-t;return i=(i&42)!==0?1:Bt(i),(i&(e.suspendedLanes|t))!==0?0:i}function Bt(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 Ze(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Gi(){var e=te.p;return e!==0?e:(e=window.event,e===void 0?32:hd(e.type))}function Xr(e,t){var i=te.p;try{return te.p=e,t()}finally{te.p=i}}var Ai=Math.random().toString(36).slice(2),pt="__reactFiber$"+Ai,jt="__reactProps$"+Ai,Di="__reactContainer$"+Ai,zi="__reactEvents$"+Ai,wl="__reactListeners$"+Ai,Et="__reactHandles$"+Ai,Xn="__reactResources$"+Ai,Ns="__reactMarker$"+Ai;function Gt(e){delete e[pt],delete e[jt],delete e[zi],delete e[wl],delete e[Et]}function Ht(e){var t=e[pt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Di]||i[pt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=$f(e);e!==null;){if(i=e[pt])return i;e=$f(e)}return t}e=i,i=e.parentNode}return null}function ls(e){if(e=e[pt]||e[Di]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function zs(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(j(33))}function os(e){var t=e[Xn];return t||(t=e[Xn]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function bt(e){e[Ns]=!0}var Zr=new Set,Qr={};function Vt(e,t){Ti(e,t),Ti(e+"Capture",t)}function Ti(e,t){for(Qr[e]=t,e=0;e<t.length;e++)Zr.add(t[e])}var El=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]*$"),Zn={},Jr={};function Qn(e){return fe.call(Jr,e)?!0:fe.call(Zn,e)?!1:El.test(e)?Jr[e]=!0:(Zn[e]=!0,!1)}function Ri(e,t,i){if(Qn(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 Mi(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 vi(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 $t(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function en(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jn(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 r=s.get,n=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(S){i=""+S,n.call(this,S)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(S){i=""+S},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cr(e){if(!e._valueTracker){var t=en(e)?"checked":"value";e._valueTracker=Jn(e,t,""+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=en(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function ur(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 xl=/[\n"\\]/g;function Kt(e){return e.replace(xl,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function hr(e,t,i,s,r,n,S,M){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),t!=null?S==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+$t(t)):e.value!==""+$t(t)&&(e.value=""+$t(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?fr(e,S,$t(t)):i!=null?fr(e,S,$t(i)):s!=null&&e.removeAttribute("value"),r==null&&n!=null&&(e.defaultChecked=!!n),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?e.name=""+$t(M):e.removeAttribute("name")}function ea(e,t,i,s,r,n,S,M){if(n!=null&&typeof n!="function"&&typeof n!="symbol"&&typeof n!="boolean"&&(e.type=n),t!=null||i!=null){if(!(n!=="submit"&&n!=="reset"||t!=null)){cr(e);return}i=i!=null?""+$t(i):"",t=t!=null?""+$t(t):i,M||t===e.value||(e.value=t),e.defaultValue=t}s=s??r,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=M?e.checked:!!s,e.defaultChecked=!!s,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),cr(e)}function fr(e,t,i){t==="number"&&ur(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function mi(e,t,i,s){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&s&&(e[i].defaultSelected=!0)}else{for(i=""+$t(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,s&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function sn(e,t,i){if(t!=null&&(t=""+$t(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+$t(i):""}function ta(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(j(92));if(ae(s)){if(1<s.length)throw Error(j(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=$t(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),cr(e)}function cs(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ia=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 sa(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||ia.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function ra(e,t,i){if(t!=null&&typeof t!="object")throw Error(j(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 r in t)s=t[r],t.hasOwnProperty(r)&&i[r]!==s&&sa(e,r,s)}else for(var n in t)t.hasOwnProperty(n)&&sa(e,n,t[n])}function H(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 J=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"]]),oe=/^[\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 de(e){return oe.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function we(){}var xe=null;function Re(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var We=null,Fe=null;function Ve(e){var t=ls(e);if(t&&(e=t.stateNode)){var i=e[jt]||null;e:switch(e=t.stateNode,t.type){case"input":if(hr(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="'+Kt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var r=s[jt]||null;if(!r)throw Error(j(90));hr(s,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&tn(s)}break e;case"textarea":sn(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&mi(e,!!i.multiple,t,!1)}}}var ii=!1;function _t(e,t,i){if(ii)return e(t,i);ii=!0;try{var s=e(t);return s}finally{if(ii=!1,(We!==null||Fe!==null)&&(Pa(),We&&(t=We,e=Fe,Fe=We=null,Ve(t),e)))for(t=0;t<e.length;t++)Ve(e[t])}}function Li(e,t){var i=e.stateNode;if(i===null)return null;var s=i[jt]||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(j(231,t,typeof i));return i}var vt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),us=!1;if(vt)try{var ki={};Object.defineProperty(ki,"passive",{get:function(){us=!0}}),window.addEventListener("test",ki,ki),window.removeEventListener("test",ki,ki)}catch{us=!1}var si=null,rn=null,nn=null;function pi(){if(nn)return nn;var e,t=rn,i=t.length,s,r="value"in si?si.value:si.textContent,n=r.length;for(e=0;e<i&&t[e]===r[e];e++);var S=i-e;for(s=1;s<=S&&t[i-s]===r[n-s];s++);return nn=r.slice(e,1<s?1-s:void 0)}function dr(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 hs(){return!0}function Us(){return!1}function Xt(e){function t(i,s,r,n,S){this._reactName=i,this._targetInst=r,this.type=s,this.nativeEvent=n,this.target=S,this.currentTarget=null;for(var M in e)e.hasOwnProperty(M)&&(i=e[M],this[M]=i?i(n):n[M]);return this.isDefaultPrevented=(n.defaultPrevented!=null?n.defaultPrevented:n.returnValue===!1)?hs:Us,this.isPropagationStopped=Us,this}return h(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=hs)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=hs)},persist:function(){},isPersistent:hs}),t}var qs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},na=Xt(qs),an=h({},qs,{view:0,detail:0}),l_=Xt(an),Al,Dl,ln,aa=h({},an,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rl,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!==ln&&(ln&&e.type==="mousemove"?(Al=e.screenX-ln.screenX,Dl=e.screenY-ln.screenY):Dl=Al=0,ln=e),Al)},movementY:function(e){return"movementY"in e?e.movementY:Dl}}),Gc=Xt(aa),o_=h({},aa,{dataTransfer:0}),c_=Xt(o_),u_=h({},an,{relatedTarget:0}),Tl=Xt(u_),h_=h({},qs,{animationName:0,elapsedTime:0,pseudoElement:0}),f_=Xt(h_),d_=h({},qs,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),__=Xt(d_),v_=h({},qs,{data:0}),Wc=Xt(v_),m_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},p_={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"},g_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function S_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=g_[e])?!!t[e]:!1}function Rl(){return S_}var b_=h({},an,{key:function(e){if(e.key){var t=m_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=dr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?p_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rl,charCode:function(e){return e.type==="keypress"?dr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?dr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),y_=Xt(b_),C_=h({},aa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fc=Xt(C_),w_=h({},an,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rl}),E_=Xt(w_),x_=h({},qs,{propertyName:0,elapsedTime:0,pseudoElement:0}),A_=Xt(x_),D_=h({},aa,{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}),T_=Xt(D_),R_=h({},qs,{newState:0,oldState:0}),M_=Xt(R_),L_=[9,13,27,32],Ml=vt&&"CompositionEvent"in window,on=null;vt&&"documentMode"in document&&(on=document.documentMode);var k_=vt&&"TextEvent"in window&&!on,Kc=vt&&(!Ml||on&&8<on&&11>=on),Yc=" ",Vc=!1;function $c(e,t){switch(e){case"keyup":return L_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Xc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var _r=!1;function O_(e,t){switch(e){case"compositionend":return Xc(t);case"keypress":return t.which!==32?null:(Vc=!0,Yc);case"textInput":return e=t.data,e===Yc&&Vc?null:e;default:return null}}function B_(e,t){if(_r)return e==="compositionend"||!Ml&&$c(e,t)?(e=pi(),nn=rn=si=null,_r=!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 Kc&&t.locale!=="ko"?null:t.data;default:return null}}var j_={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 Zc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!j_[e.type]:t==="textarea"}function Qc(e,t,i,s){We?Fe?Fe.push(s):Fe=[s]:We=s,t=$a(t,"onChange"),0<t.length&&(i=new na("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var cn=null,un=null;function H_(e){jf(e,0)}function la(e){var t=zs(e);if(tn(t))return e}function Jc(e,t){if(e==="change")return t}var eu=!1;if(vt){var Ll;if(vt){var kl="oninput"in document;if(!kl){var tu=document.createElement("div");tu.setAttribute("oninput","return;"),kl=typeof tu.oninput=="function"}Ll=kl}else Ll=!1;eu=Ll&&(!document.documentMode||9<document.documentMode)}function iu(){cn&&(cn.detachEvent("onpropertychange",su),un=cn=null)}function su(e){if(e.propertyName==="value"&&la(un)){var t=[];Qc(t,un,e,Re(e)),_t(H_,t)}}function N_(e,t,i){e==="focusin"?(iu(),cn=t,un=i,cn.attachEvent("onpropertychange",su)):e==="focusout"&&iu()}function z_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return la(un)}function U_(e,t){if(e==="click")return la(t)}function q_(e,t){if(e==="input"||e==="change")return la(t)}function I_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ri=typeof Object.is=="function"?Object.is:I_;function hn(e,t){if(ri(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 r=i[s];if(!fe.call(t,r)||!ri(e[r],t[r]))return!1}return!0}function ru(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function nu(e,t){var i=ru(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=ru(i)}}function au(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?au(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function lu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ur(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=ur(e.document)}return t}function Ol(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 P_=vt&&"documentMode"in document&&11>=document.documentMode,vr=null,Bl=null,fn=null,jl=!1;function ou(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;jl||vr==null||vr!==ur(s)||(s=vr,"selectionStart"in s&&Ol(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}),fn&&hn(fn,s)||(fn=s,s=$a(Bl,"onSelect"),0<s.length&&(t=new na("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=vr)))}function Is(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var mr={animationend:Is("Animation","AnimationEnd"),animationiteration:Is("Animation","AnimationIteration"),animationstart:Is("Animation","AnimationStart"),transitionrun:Is("Transition","TransitionRun"),transitionstart:Is("Transition","TransitionStart"),transitioncancel:Is("Transition","TransitionCancel"),transitionend:Is("Transition","TransitionEnd")},Hl={},cu={};vt&&(cu=document.createElement("div").style,"AnimationEvent"in window||(delete mr.animationend.animation,delete mr.animationiteration.animation,delete mr.animationstart.animation),"TransitionEvent"in window||delete mr.transitionend.transition);function Ps(e){if(Hl[e])return Hl[e];if(!mr[e])return e;var t=mr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in cu)return Hl[e]=t[i];return e}var uu=Ps("animationend"),hu=Ps("animationiteration"),fu=Ps("animationstart"),G_=Ps("transitionrun"),W_=Ps("transitionstart"),F_=Ps("transitioncancel"),du=Ps("transitionend"),_u=new Map,Nl="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(" ");Nl.push("scrollEnd");function Oi(e,t){_u.set(e,t),Vt(t,[e])}var oa=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)},gi=[],pr=0,zl=0;function ca(){for(var e=pr,t=zl=pr=0;t<e;){var i=gi[t];gi[t++]=null;var s=gi[t];gi[t++]=null;var r=gi[t];gi[t++]=null;var n=gi[t];if(gi[t++]=null,s!==null&&r!==null){var S=s.pending;S===null?r.next=r:(r.next=S.next,S.next=r),s.pending=r}n!==0&&vu(i,r,n)}}function ua(e,t,i,s){gi[pr++]=e,gi[pr++]=t,gi[pr++]=i,gi[pr++]=s,zl|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Ul(e,t,i,s){return ua(e,t,i,s),ha(e)}function Gs(e,t){return ua(e,null,null,t),ha(e)}function vu(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var r=!1,n=e.return;n!==null;)n.childLanes|=i,s=n.alternate,s!==null&&(s.childLanes|=i),n.tag===22&&(e=n.stateNode,e===null||e._visibility&1||(r=!0)),e=n,n=n.return;return e.tag===3?(n=e.stateNode,r&&t!==null&&(r=31-It(i),e=n.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=i|536870912),n):null}function ha(e){if(50<Bn)throw Bn=0,$o=null,Error(j(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var gr={};function K_(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 ni(e,t,i,s){return new K_(e,t,i,s)}function ql(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Wi(e,t){var i=e.alternate;return i===null?(i=ni(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 mu(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 fa(e,t,i,s,r,n){var S=0;if(s=e,typeof e=="function")ql(e)&&(S=1);else if(typeof e=="string")S=Zv(e,i,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case T:return e=ni(31,i,t,r),e.elementType=T,e.lanes=n,e;case m:return Ws(i.children,r,n,t);case o:S=8,r|=24;break;case c:return e=ni(12,i,t,r|2),e.elementType=c,e.lanes=n,e;case x:return e=ni(13,i,t,r),e.elementType=x,e.lanes=n,e;case E:return e=ni(19,i,t,r),e.elementType=E,e.lanes=n,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case l:S=10;break e;case a:S=9;break e;case _:S=11;break e;case D:S=14;break e;case g:S=16,s=null;break e}S=29,i=Error(j(130,e===null?"null":typeof e,"")),s=null}return t=ni(S,i,t,r),t.elementType=e,t.type=s,t.lanes=n,t}function Ws(e,t,i,s){return e=ni(7,e,s,t),e.lanes=i,e}function Il(e,t,i){return e=ni(6,e,null,t),e.lanes=i,e}function pu(e){var t=ni(18,null,null,0);return t.stateNode=e,t}function Pl(e,t,i){return t=ni(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var gu=new WeakMap;function Si(e,t){if(typeof e=="object"&&e!==null){var i=gu.get(e);return i!==void 0?i:(t={value:e,source:t,stack:Mt(t)},gu.set(e,t),t)}return{value:e,source:t,stack:Mt(t)}}var Sr=[],br=0,da=null,dn=0,bi=[],yi=0,fs=null,Ui=1,qi="";function Fi(e,t){Sr[br++]=dn,Sr[br++]=da,da=e,dn=t}function Su(e,t,i){bi[yi++]=Ui,bi[yi++]=qi,bi[yi++]=fs,fs=e;var s=Ui;e=qi;var r=32-It(s)-1;s&=~(1<<r),i+=1;var n=32-It(t)+r;if(30<n){var S=r-r%5;n=(s&(1<<S)-1).toString(32),s>>=S,r-=S,Ui=1<<32-It(t)+r|i<<r|s,qi=n+e}else Ui=1<<n|i<<r|s,qi=e}function Gl(e){e.return!==null&&(Fi(e,1),Su(e,1,0))}function Wl(e){for(;e===da;)da=Sr[--br],Sr[br]=null,dn=Sr[--br],Sr[br]=null;for(;e===fs;)fs=bi[--yi],bi[yi]=null,qi=bi[--yi],bi[yi]=null,Ui=bi[--yi],bi[yi]=null}function bu(e,t){bi[yi++]=Ui,bi[yi++]=qi,bi[yi++]=fs,Ui=t.id,qi=t.overflow,fs=e}var Nt=null,ut=null,Ke=!1,ds=null,Ci=!1,Fl=Error(j(519));function _s(e){var t=Error(j(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _n(Si(t,e)),Fl}function yu(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[pt]=e,t[jt]=s,i){case"dialog":ze("cancel",t),ze("close",t);break;case"iframe":case"object":case"embed":ze("load",t);break;case"video":case"audio":for(i=0;i<Hn.length;i++)ze(Hn[i],t);break;case"source":ze("error",t);break;case"img":case"image":case"link":ze("error",t),ze("load",t);break;case"details":ze("toggle",t);break;case"input":ze("invalid",t),ea(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":ze("invalid",t);break;case"textarea":ze("invalid",t),ta(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||Uf(t.textContent,i)?(s.popover!=null&&(ze("beforetoggle",t),ze("toggle",t)),s.onScroll!=null&&ze("scroll",t),s.onScrollEnd!=null&&ze("scrollend",t),s.onClick!=null&&(t.onclick=we),t=!0):t=!1,t||_s(e,!0)}function Cu(e){for(Nt=e.return;Nt;)switch(Nt.tag){case 5:case 31:case 13:Ci=!1;return;case 27:case 3:Ci=!0;return;default:Nt=Nt.return}}function yr(e){if(e!==Nt)return!1;if(!Ke)return Cu(e),Ke=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||uc(e.type,e.memoizedProps)),i=!i),i&&ut&&_s(e),Cu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(j(317));ut=Vf(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(j(317));ut=Vf(e)}else t===27?(t=ut,Ts(e.type)?(e=vc,vc=null,ut=e):ut=t):ut=Nt?Ei(e.stateNode.nextSibling):null;return!0}function Fs(){ut=Nt=null,Ke=!1}function Kl(){var e=ds;return e!==null&&(ei===null?ei=e:ei.push.apply(ei,e),ds=null),e}function _n(e){ds===null?ds=[e]:ds.push(e)}var Yl=A(null),Ks=null,Ki=null;function vs(e,t,i){K(Yl,t._currentValue),t._currentValue=i}function Yi(e){e._currentValue=Yl.current,k(Yl)}function Vl(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 $l(e,t,i,s){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var n=r.dependencies;if(n!==null){var S=r.child;n=n.firstContext;e:for(;n!==null;){var M=n;n=r;for(var I=0;I<t.length;I++)if(M.context===t[I]){n.lanes|=i,M=n.alternate,M!==null&&(M.lanes|=i),Vl(n.return,i,e),s||(S=null);break e}n=M.next}}else if(r.tag===18){if(S=r.return,S===null)throw Error(j(341));S.lanes|=i,n=S.alternate,n!==null&&(n.lanes|=i),Vl(S,i,e),S=null}else S=r.child;if(S!==null)S.return=r;else for(S=r;S!==null;){if(S===e){S=null;break}if(r=S.sibling,r!==null){r.return=S.return,S=r;break}S=S.return}r=S}}function Cr(e,t,i,s){e=null;for(var r=t,n=!1;r!==null;){if(!n){if((r.flags&524288)!==0)n=!0;else if((r.flags&262144)!==0)break}if(r.tag===10){var S=r.alternate;if(S===null)throw Error(j(387));if(S=S.memoizedProps,S!==null){var M=r.type;ri(r.pendingProps.value,S.value)||(e!==null?e.push(M):e=[M])}}else if(r===F.current){if(S=r.alternate,S===null)throw Error(j(387));S.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(In):e=[In])}r=r.return}e!==null&&$l(t,e,i,s),t.flags|=262144}function _a(e){for(e=e.firstContext;e!==null;){if(!ri(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ys(e){Ks=e,Ki=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function zt(e){return wu(Ks,e)}function va(e,t){return Ks===null&&Ys(e),wu(e,t)}function wu(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Ki===null){if(e===null)throw Error(j(308));Ki=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ki=Ki.next=t;return i}var Y_=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()})}},V_=w.unstable_scheduleCallback,$_=w.unstable_NormalPriority,xt={$$typeof:l,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xl(){return{controller:new Y_,data:new Map,refCount:0}}function vn(e){e.refCount--,e.refCount===0&&V_($_,function(){e.controller.abort()})}var mn=null,Zl=0,wr=0,Er=null;function X_(e,t){if(mn===null){var i=mn=[];Zl=0,wr=tc(),Er={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Zl++,t.then(Eu,Eu),t}function Eu(){if(--Zl===0&&mn!==null){Er!==null&&(Er.status="fulfilled");var e=mn;mn=null,wr=0,Er=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Z_(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(r){i.push(r)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var r=0;r<i.length;r++)(0,i[r])(t)},function(r){for(s.status="rejected",s.reason=r,r=0;r<i.length;r++)(0,i[r])(void 0)}),s}var xu=q.S;q.S=function(e,t){cf=je(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&X_(e,t),xu!==null&&xu(e,t)};var Vs=A(null);function Ql(){var e=Vs.current;return e!==null?e:ot.pooledCache}function ma(e,t){t===null?K(Vs,Vs.current):K(Vs,t.pool)}function Au(){var e=Ql();return e===null?null:{parent:xt._currentValue,pool:e}}var xr=Error(j(460)),Jl=Error(j(474)),pa=Error(j(542)),ga={then:function(){}};function Du(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Tu(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(we,we),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mu(e),e;default:if(typeof t.status=="string")t.then(we,we);else{if(e=ot,e!==null&&100<e.shellSuspendCounter)throw Error(j(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=s}},function(s){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mu(e),e}throw Xs=t,xr}}function $s(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Xs=i,xr):i}}var Xs=null;function Ru(){if(Xs===null)throw Error(j(459));var e=Xs;return Xs=null,e}function Mu(e){if(e===xr||e===pa)throw Error(j(483))}var Ar=null,pn=0;function Sa(e){var t=pn;return pn+=1,Ar===null&&(Ar=[]),Tu(Ar,e,t)}function gn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ba(e,t){throw t.$$typeof===v?Error(j(525)):(e=Object.prototype.toString.call(t),Error(j(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Lu(e){function t(Y,G){if(e){var $=Y.deletions;$===null?(Y.deletions=[G],Y.flags|=16):$.push(G)}}function i(Y,G){if(!e)return null;for(;G!==null;)t(Y,G),G=G.sibling;return null}function s(Y){for(var G=new Map;Y!==null;)Y.key!==null?G.set(Y.key,Y):G.set(Y.index,Y),Y=Y.sibling;return G}function r(Y,G){return Y=Wi(Y,G),Y.index=0,Y.sibling=null,Y}function n(Y,G,$){return Y.index=$,e?($=Y.alternate,$!==null?($=$.index,$<G?(Y.flags|=67108866,G):$):(Y.flags|=67108866,G)):(Y.flags|=1048576,G)}function S(Y){return e&&Y.alternate===null&&(Y.flags|=67108866),Y}function M(Y,G,$,ue){return G===null||G.tag!==6?(G=Il($,Y.mode,ue),G.return=Y,G):(G=r(G,$),G.return=Y,G)}function I(Y,G,$,ue){var De=$.type;return De===m?ce(Y,G,$.props.children,ue,$.key):G!==null&&(G.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===g&&$s(De)===G.type)?(G=r(G,$.props),gn(G,$),G.return=Y,G):(G=fa($.type,$.key,$.props,null,Y.mode,ue),gn(G,$),G.return=Y,G)}function Z(Y,G,$,ue){return G===null||G.tag!==4||G.stateNode.containerInfo!==$.containerInfo||G.stateNode.implementation!==$.implementation?(G=Pl($,Y.mode,ue),G.return=Y,G):(G=r(G,$.children||[]),G.return=Y,G)}function ce(Y,G,$,ue,De){return G===null||G.tag!==7?(G=Ws($,Y.mode,ue,De),G.return=Y,G):(G=r(G,$),G.return=Y,G)}function he(Y,G,$){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Il(""+G,Y.mode,$),G.return=Y,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return $=fa(G.type,G.key,G.props,null,Y.mode,$),gn($,G),$.return=Y,$;case C:return G=Pl(G,Y.mode,$),G.return=Y,G;case g:return G=$s(G),he(Y,G,$)}if(ae(G)||W(G))return G=Ws(G,Y.mode,$,null),G.return=Y,G;if(typeof G.then=="function")return he(Y,Sa(G),$);if(G.$$typeof===l)return he(Y,va(Y,G),$);ba(Y,G)}return null}function ie(Y,G,$,ue){var De=G!==null?G.key:null;if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return De!==null?null:M(Y,G,""+$,ue);if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return $.key===De?I(Y,G,$,ue):null;case C:return $.key===De?Z(Y,G,$,ue):null;case g:return $=$s($),ie(Y,G,$,ue)}if(ae($)||W($))return De!==null?null:ce(Y,G,$,ue,null);if(typeof $.then=="function")return ie(Y,G,Sa($),ue);if($.$$typeof===l)return ie(Y,G,va(Y,$),ue);ba(Y,$)}return null}function le(Y,G,$,ue,De){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Y=Y.get($)||null,M(G,Y,""+ue,De);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case b:return Y=Y.get(ue.key===null?$:ue.key)||null,I(G,Y,ue,De);case C:return Y=Y.get(ue.key===null?$:ue.key)||null,Z(G,Y,ue,De);case g:return ue=$s(ue),le(Y,G,$,ue,De)}if(ae(ue)||W(ue))return Y=Y.get($)||null,ce(G,Y,ue,De,null);if(typeof ue.then=="function")return le(Y,G,$,Sa(ue),De);if(ue.$$typeof===l)return le(Y,G,$,va(G,ue),De);ba(G,ue)}return null}function ye(Y,G,$,ue){for(var De=null,Qe=null,Ee=G,Be=G=0,Pe=null;Ee!==null&&Be<$.length;Be++){Ee.index>Be?(Pe=Ee,Ee=null):Pe=Ee.sibling;var Je=ie(Y,Ee,$[Be],ue);if(Je===null){Ee===null&&(Ee=Pe);break}e&&Ee&&Je.alternate===null&&t(Y,Ee),G=n(Je,G,Be),Qe===null?De=Je:Qe.sibling=Je,Qe=Je,Ee=Pe}if(Be===$.length)return i(Y,Ee),Ke&&Fi(Y,Be),De;if(Ee===null){for(;Be<$.length;Be++)Ee=he(Y,$[Be],ue),Ee!==null&&(G=n(Ee,G,Be),Qe===null?De=Ee:Qe.sibling=Ee,Qe=Ee);return Ke&&Fi(Y,Be),De}for(Ee=s(Ee);Be<$.length;Be++)Pe=le(Ee,Y,Be,$[Be],ue),Pe!==null&&(e&&Pe.alternate!==null&&Ee.delete(Pe.key===null?Be:Pe.key),G=n(Pe,G,Be),Qe===null?De=Pe:Qe.sibling=Pe,Qe=Pe);return e&&Ee.forEach(function(Os){return t(Y,Os)}),Ke&&Fi(Y,Be),De}function Te(Y,G,$,ue){if($==null)throw Error(j(151));for(var De=null,Qe=null,Ee=G,Be=G=0,Pe=null,Je=$.next();Ee!==null&&!Je.done;Be++,Je=$.next()){Ee.index>Be?(Pe=Ee,Ee=null):Pe=Ee.sibling;var Os=ie(Y,Ee,Je.value,ue);if(Os===null){Ee===null&&(Ee=Pe);break}e&&Ee&&Os.alternate===null&&t(Y,Ee),G=n(Os,G,Be),Qe===null?De=Os:Qe.sibling=Os,Qe=Os,Ee=Pe}if(Je.done)return i(Y,Ee),Ke&&Fi(Y,Be),De;if(Ee===null){for(;!Je.done;Be++,Je=$.next())Je=he(Y,Je.value,ue),Je!==null&&(G=n(Je,G,Be),Qe===null?De=Je:Qe.sibling=Je,Qe=Je);return Ke&&Fi(Y,Be),De}for(Ee=s(Ee);!Je.done;Be++,Je=$.next())Je=le(Ee,Y,Be,Je.value,ue),Je!==null&&(e&&Je.alternate!==null&&Ee.delete(Je.key===null?Be:Je.key),G=n(Je,G,Be),Qe===null?De=Je:Qe.sibling=Je,Qe=Je);return e&&Ee.forEach(function(om){return t(Y,om)}),Ke&&Fi(Y,Be),De}function nt(Y,G,$,ue){if(typeof $=="object"&&$!==null&&$.type===m&&$.key===null&&($=$.props.children),typeof $=="object"&&$!==null){switch($.$$typeof){case b:e:{for(var De=$.key;G!==null;){if(G.key===De){if(De=$.type,De===m){if(G.tag===7){i(Y,G.sibling),ue=r(G,$.props.children),ue.return=Y,Y=ue;break e}}else if(G.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===g&&$s(De)===G.type){i(Y,G.sibling),ue=r(G,$.props),gn(ue,$),ue.return=Y,Y=ue;break e}i(Y,G);break}else t(Y,G);G=G.sibling}$.type===m?(ue=Ws($.props.children,Y.mode,ue,$.key),ue.return=Y,Y=ue):(ue=fa($.type,$.key,$.props,null,Y.mode,ue),gn(ue,$),ue.return=Y,Y=ue)}return S(Y);case C:e:{for(De=$.key;G!==null;){if(G.key===De)if(G.tag===4&&G.stateNode.containerInfo===$.containerInfo&&G.stateNode.implementation===$.implementation){i(Y,G.sibling),ue=r(G,$.children||[]),ue.return=Y,Y=ue;break e}else{i(Y,G);break}else t(Y,G);G=G.sibling}ue=Pl($,Y.mode,ue),ue.return=Y,Y=ue}return S(Y);case g:return $=$s($),nt(Y,G,$,ue)}if(ae($))return ye(Y,G,$,ue);if(W($)){if(De=W($),typeof De!="function")throw Error(j(150));return $=De.call($),Te(Y,G,$,ue)}if(typeof $.then=="function")return nt(Y,G,Sa($),ue);if($.$$typeof===l)return nt(Y,G,va(Y,$),ue);ba(Y,$)}return typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint"?($=""+$,G!==null&&G.tag===6?(i(Y,G.sibling),ue=r(G,$),ue.return=Y,Y=ue):(i(Y,G),ue=Il($,Y.mode,ue),ue.return=Y,Y=ue),S(Y)):i(Y,G)}return function(Y,G,$,ue){try{pn=0;var De=nt(Y,G,$,ue);return Ar=null,De}catch(Ee){if(Ee===xr||Ee===pa)throw Ee;var Qe=ni(29,Ee,null,Y.mode);return Qe.lanes=ue,Qe.return=Y,Qe}}}var Zs=Lu(!0),ku=Lu(!1),ms=!1;function eo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function to(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 ps(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function gs(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(et&2)!==0){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=ha(e),vu(e,null,i),t}return ua(e,s,t,i),ha(e)}function Sn(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,$r(e,i)}}function io(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var r=null,n=null;if(i=i.firstBaseUpdate,i!==null){do{var S={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};n===null?r=n=S:n=n.next=S,i=i.next}while(i!==null);n===null?r=n=t:n=n.next=t}else r=n=t;i={baseState:s.baseState,firstBaseUpdate:r,lastBaseUpdate:n,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 so=!1;function bn(){if(so){var e=Er;if(e!==null)throw e}}function yn(e,t,i,s){so=!1;var r=e.updateQueue;ms=!1;var n=r.firstBaseUpdate,S=r.lastBaseUpdate,M=r.shared.pending;if(M!==null){r.shared.pending=null;var I=M,Z=I.next;I.next=null,S===null?n=Z:S.next=Z,S=I;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,M=ce.lastBaseUpdate,M!==S&&(M===null?ce.firstBaseUpdate=Z:M.next=Z,ce.lastBaseUpdate=I))}if(n!==null){var he=r.baseState;S=0,ce=Z=I=null,M=n;do{var ie=M.lane&-536870913,le=ie!==M.lane;if(le?(Ie&ie)===ie:(s&ie)===ie){ie!==0&&ie===wr&&(so=!0),ce!==null&&(ce=ce.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ye=e,Te=M;ie=t;var nt=i;switch(Te.tag){case 1:if(ye=Te.payload,typeof ye=="function"){he=ye.call(nt,he,ie);break e}he=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Te.payload,ie=typeof ye=="function"?ye.call(nt,he,ie):ye,ie==null)break e;he=h({},he,ie);break e;case 2:ms=!0}}ie=M.callback,ie!==null&&(e.flags|=64,le&&(e.flags|=8192),le=r.callbacks,le===null?r.callbacks=[ie]:le.push(ie))}else le={lane:ie,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ce===null?(Z=ce=le,I=he):ce=ce.next=le,S|=ie;if(M=M.next,M===null){if(M=r.shared.pending,M===null)break;le=M,M=le.next,le.next=null,r.lastBaseUpdate=le,r.shared.pending=null}}while(!0);ce===null&&(I=he),r.baseState=I,r.firstBaseUpdate=Z,r.lastBaseUpdate=ce,n===null&&(r.shared.lanes=0),ws|=S,e.lanes=S,e.memoizedState=he}}function Ou(e,t){if(typeof e!="function")throw Error(j(191,e));e.call(t)}function Bu(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Ou(i[e],t)}var Dr=A(null),ya=A(0);function ju(e,t){e=is,K(ya,e),K(Dr,t),is=e|t.baseLanes}function ro(){K(ya,is),K(Dr,Dr.current)}function no(){is=ya.current,k(Dr),k(ya)}var ai=A(null),wi=null;function Ss(e){var t=e.alternate;K(yt,yt.current&1),K(ai,e),wi===null&&(t===null||Dr.current!==null||t.memoizedState!==null)&&(wi=e)}function ao(e){K(yt,yt.current),K(ai,e),wi===null&&(wi=e)}function Hu(e){e.tag===22?(K(yt,yt.current),K(ai,e),wi===null&&(wi=e)):bs()}function bs(){K(yt,yt.current),K(ai,ai.current)}function li(e){k(ai),wi===e&&(wi=null),k(yt)}var yt=A(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||dc(i)||_c(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 Vi=0,Oe=null,st=null,At=null,wa=!1,Tr=!1,Qs=!1,Ea=0,Cn=0,Rr=null,Q_=0;function gt(){throw Error(j(321))}function lo(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!ri(e[i],t[i]))return!1;return!0}function oo(e,t,i,s,r,n){return Vi=n,Oe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?Sh:Eo,Qs=!1,n=i(s,r),Qs=!1,Tr&&(n=zu(t,i,s,r)),Nu(e),n}function Nu(e){q.H=xn;var t=st!==null&&st.next!==null;if(Vi=0,At=st=Oe=null,wa=!1,Cn=0,Rr=null,t)throw Error(j(300));e===null||Dt||(e=e.dependencies,e!==null&&_a(e)&&(Dt=!0))}function zu(e,t,i,s){Oe=e;var r=0;do{if(Tr&&(Rr=null),Cn=0,Tr=!1,25<=r)throw Error(j(301));if(r+=1,At=st=null,e.updateQueue!=null){var n=e.updateQueue;n.lastEffect=null,n.events=null,n.stores=null,n.memoCache!=null&&(n.memoCache.index=0)}q.H=bh,n=t(i,s)}while(Tr);return n}function J_(){var e=q.H,t=e.useState()[0];return t=typeof t.then=="function"?wn(t):t,e=e.useState()[0],(st!==null?st.memoizedState:null)!==e&&(Oe.flags|=1024),t}function co(){var e=Ea!==0;return Ea=0,e}function uo(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function ho(e){if(wa){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wa=!1}Vi=0,At=st=Oe=null,Tr=!1,Cn=Ea=0,Rr=null}function Yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?Oe.memoizedState=At=e:At=At.next=e,At}function Ct(){if(st===null){var e=Oe.alternate;e=e!==null?e.memoizedState:null}else e=st.next;var t=At===null?Oe.memoizedState:At.next;if(t!==null)At=t,st=e;else{if(e===null)throw Oe.alternate===null?Error(j(467)):Error(j(310));st=e,e={memoizedState:st.memoizedState,baseState:st.baseState,baseQueue:st.baseQueue,queue:st.queue,next:null},At===null?Oe.memoizedState=At=e:At=At.next=e}return At}function xa(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wn(e){var t=Cn;return Cn+=1,Rr===null&&(Rr=[]),e=Tu(Rr,e,t),t=Oe,(At===null?t.memoizedState:At.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?Sh:Eo),e}function Aa(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wn(e);if(e.$$typeof===l)return zt(e)}throw Error(j(438,String(e)))}function fo(e){var t=null,i=Oe.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Oe.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=xa(),Oe.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]=U;return t.index++,i}function $i(e,t){return typeof t=="function"?t(e):t}function Da(e){var t=Ct();return _o(t,st,e)}function _o(e,t,i){var s=e.queue;if(s===null)throw Error(j(311));s.lastRenderedReducer=i;var r=e.baseQueue,n=s.pending;if(n!==null){if(r!==null){var S=r.next;r.next=n.next,n.next=S}t.baseQueue=r=n,s.pending=null}if(n=e.baseState,r===null)e.memoizedState=n;else{t=r.next;var M=S=null,I=null,Z=t,ce=!1;do{var he=Z.lane&-536870913;if(he!==Z.lane?(Ie&he)===he:(Vi&he)===he){var ie=Z.revertLane;if(ie===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null}),he===wr&&(ce=!0);else if((Vi&ie)===ie){Z=Z.next,ie===wr&&(ce=!0);continue}else he={lane:0,revertLane:Z.revertLane,gesture:null,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},I===null?(M=I=he,S=n):I=I.next=he,Oe.lanes|=ie,ws|=ie;he=Z.action,Qs&&i(n,he),n=Z.hasEagerState?Z.eagerState:i(n,he)}else ie={lane:he,revertLane:Z.revertLane,gesture:Z.gesture,action:Z.action,hasEagerState:Z.hasEagerState,eagerState:Z.eagerState,next:null},I===null?(M=I=ie,S=n):I=I.next=ie,Oe.lanes|=he,ws|=he;Z=Z.next}while(Z!==null&&Z!==t);if(I===null?S=n:I.next=M,!ri(n,e.memoizedState)&&(Dt=!0,ce&&(i=Er,i!==null)))throw i;e.memoizedState=n,e.baseState=S,e.baseQueue=I,s.lastRenderedState=n}return r===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function vo(e){var t=Ct(),i=t.queue;if(i===null)throw Error(j(311));i.lastRenderedReducer=e;var s=i.dispatch,r=i.pending,n=t.memoizedState;if(r!==null){i.pending=null;var S=r=r.next;do n=e(n,S.action),S=S.next;while(S!==r);ri(n,t.memoizedState)||(Dt=!0),t.memoizedState=n,t.baseQueue===null&&(t.baseState=n),i.lastRenderedState=n}return[n,s]}function Uu(e,t,i){var s=Oe,r=Ct(),n=Ke;if(n){if(i===void 0)throw Error(j(407));i=i()}else i=t();var S=!ri((st||r).memoizedState,i);if(S&&(r.memoizedState=i,Dt=!0),r=r.queue,go(Pu.bind(null,s,r,e),[e]),r.getSnapshot!==t||S||At!==null&&At.memoizedState.tag&1){if(s.flags|=2048,Mr(9,{destroy:void 0},Iu.bind(null,s,r,i,t),null),ot===null)throw Error(j(349));n||(Vi&127)!==0||qu(s,t,i)}return i}function qu(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Oe.updateQueue,t===null?(t=xa(),Oe.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Iu(e,t,i,s){t.value=i,t.getSnapshot=s,Gu(t)&&Wu(e)}function Pu(e,t,i){return i(function(){Gu(t)&&Wu(e)})}function Gu(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!ri(e,i)}catch{return!0}}function Wu(e){var t=Gs(e,2);t!==null&&ti(t,e,2)}function mo(e){var t=Yt();if(typeof e=="function"){var i=e;if(e=i(),Qs){Ft(!0);try{i()}finally{Ft(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:e},t}function Fu(e,t,i,s){return e.baseState=i,_o(e,st,typeof s=="function"?s:$i)}function ev(e,t,i,s,r){if(Ma(e))throw Error(j(485));if(e=t.action,e!==null){var n={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){n.listeners.push(S)}};q.T!==null?i(!0):n.isTransition=!1,s(n),i=t.pending,i===null?(n.next=t.pending=n,Ku(t,n)):(n.next=i.next,t.pending=i.next=n)}}function Ku(e,t){var i=t.action,s=t.payload,r=e.state;if(t.isTransition){var n=q.T,S={};q.T=S;try{var M=i(r,s),I=q.S;I!==null&&I(S,M),Yu(e,t,M)}catch(Z){po(e,t,Z)}finally{n!==null&&S.types!==null&&(n.types=S.types),q.T=n}}else try{n=i(r,s),Yu(e,t,n)}catch(Z){po(e,t,Z)}}function Yu(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){Vu(e,t,s)},function(s){return po(e,t,s)}):Vu(e,t,i)}function Vu(e,t,i){t.status="fulfilled",t.value=i,$u(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,Ku(e,i)))}function po(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,$u(t),t=t.next;while(t!==s)}e.action=null}function $u(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Xu(e,t){return t}function Zu(e,t){if(Ke){var i=ot.formState;if(i!==null){e:{var s=Oe;if(Ke){if(ut){t:{for(var r=ut,n=Ci;r.nodeType!==8;){if(!n){r=null;break t}if(r=Ei(r.nextSibling),r===null){r=null;break t}}n=r.data,r=n==="F!"||n==="F"?r:null}if(r){ut=Ei(r.nextSibling),s=r.data==="F!";break e}}_s(s)}s=!1}s&&(t=i[0])}}return i=Yt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xu,lastRenderedState:t},i.queue=s,i=mh.bind(null,Oe,s),s.dispatch=i,s=mo(!1),n=wo.bind(null,Oe,!1,s.queue),s=Yt(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,i=ev.bind(null,Oe,r,n,i),r.dispatch=i,s.memoizedState=e,[t,i,!1]}function Qu(e){var t=Ct();return Ju(t,st,e)}function Ju(e,t,i){if(t=_o(e,t,Xu)[0],e=Da($i)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=wn(t)}catch(S){throw S===xr?pa:S}else s=t;t=Ct();var r=t.queue,n=r.dispatch;return i!==t.memoizedState&&(Oe.flags|=2048,Mr(9,{destroy:void 0},tv.bind(null,r,i),null)),[s,n,e]}function tv(e,t){e.action=t}function eh(e){var t=Ct(),i=st;if(i!==null)return Ju(t,i,e);Ct(),t=t.memoizedState,i=Ct();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Mr(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Oe.updateQueue,t===null&&(t=xa(),Oe.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 Ct().memoizedState}function Ta(e,t,i,s){var r=Yt();Oe.flags|=e,r.memoizedState=Mr(1|t,{destroy:void 0},i,s===void 0?null:s)}function Ra(e,t,i,s){var r=Ct();s=s===void 0?null:s;var n=r.memoizedState.inst;st!==null&&s!==null&&lo(s,st.memoizedState.deps)?r.memoizedState=Mr(t,n,i,s):(Oe.flags|=e,r.memoizedState=Mr(1|t,n,i,s))}function ih(e,t){Ta(8390656,8,e,t)}function go(e,t){Ra(2048,8,e,t)}function iv(e){Oe.flags|=4;var t=Oe.updateQueue;if(t===null)t=xa(),Oe.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function sh(e){var t=Ct().memoizedState;return iv({ref:t,nextImpl:e}),function(){if((et&2)!==0)throw Error(j(440));return t.impl.apply(void 0,arguments)}}function rh(e,t){return Ra(4,2,e,t)}function nh(e,t){return Ra(4,4,e,t)}function ah(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 lh(e,t,i){i=i!=null?i.concat([e]):null,Ra(4,4,ah.bind(null,t,e),i)}function So(){}function oh(e,t){var i=Ct();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&lo(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function ch(e,t){var i=Ct();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&lo(t,s[1]))return s[0];if(s=e(),Qs){Ft(!0);try{e()}finally{Ft(!1)}}return i.memoizedState=[s,t],s}function bo(e,t,i){return i===void 0||(Vi&1073741824)!==0&&(Ie&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=hf(),Oe.lanes|=e,ws|=e,i)}function uh(e,t,i,s){return ri(i,t)?i:Dr.current!==null?(e=bo(e,i,s),ri(e,t)||(Dt=!0),e):(Vi&42)===0||(Vi&1073741824)!==0&&(Ie&261930)===0?(Dt=!0,e.memoizedState=i):(e=hf(),Oe.lanes|=e,ws|=e,t)}function hh(e,t,i,s,r){var n=te.p;te.p=n!==0&&8>n?n:8;var S=q.T,M={};q.T=M,wo(e,!1,t,i);try{var I=r(),Z=q.S;if(Z!==null&&Z(M,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ce=Z_(I,s);En(e,t,ce,ui(e))}else En(e,t,s,ui(e))}catch(he){En(e,t,{then:function(){},status:"rejected",reason:he},ui())}finally{te.p=n,S!==null&&M.types!==null&&(S.types=M.types),q.T=S}}function sv(){}function yo(e,t,i,s){if(e.tag!==5)throw Error(j(476));var r=fh(e).queue;hh(e,r,t,V,i===null?sv:function(){return dh(e),i(s)})}function fh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:V},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$i,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function dh(e){var t=fh(e);t.next===null&&(t=e.alternate.memoizedState),En(e,t.next.queue,{},ui())}function Co(){return zt(In)}function _h(){return Ct().memoizedState}function vh(){return Ct().memoizedState}function rv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=ui();e=ps(i);var s=gs(t,e,i);s!==null&&(ti(s,t,i),Sn(s,t,i)),t={cache:Xl()},e.payload=t;return}t=t.return}}function nv(e,t,i){var s=ui();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Ma(e)?ph(t,i):(i=Ul(e,t,i,s),i!==null&&(ti(i,e,s),gh(i,t,s)))}function mh(e,t,i){var s=ui();En(e,t,i,s)}function En(e,t,i,s){var r={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Ma(e))ph(t,r);else{var n=e.alternate;if(e.lanes===0&&(n===null||n.lanes===0)&&(n=t.lastRenderedReducer,n!==null))try{var S=t.lastRenderedState,M=n(S,i);if(r.hasEagerState=!0,r.eagerState=M,ri(M,S))return ua(e,t,r,0),ot===null&&ca(),!1}catch{}if(i=Ul(e,t,r,s),i!==null)return ti(i,e,s),gh(i,t,s),!0}return!1}function wo(e,t,i,s){if(s={lane:2,revertLane:tc(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Ma(e)){if(t)throw Error(j(479))}else t=Ul(e,i,s,2),t!==null&&ti(t,e,2)}function Ma(e){var t=e.alternate;return e===Oe||t!==null&&t===Oe}function ph(e,t){Tr=wa=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function gh(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,$r(e,i)}}var xn={readContext:zt,use:Aa,useCallback:gt,useContext:gt,useEffect:gt,useImperativeHandle:gt,useLayoutEffect:gt,useInsertionEffect:gt,useMemo:gt,useReducer:gt,useRef:gt,useState:gt,useDebugValue:gt,useDeferredValue:gt,useTransition:gt,useSyncExternalStore:gt,useId:gt,useHostTransitionStatus:gt,useFormState:gt,useActionState:gt,useOptimistic:gt,useMemoCache:gt,useCacheRefresh:gt};xn.useEffectEvent=gt;var Sh={readContext:zt,use:Aa,useCallback:function(e,t){return Yt().memoizedState=[e,t===void 0?null:t],e},useContext:zt,useEffect:ih,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ta(4194308,4,ah.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ta(4194308,4,e,t)},useInsertionEffect:function(e,t){Ta(4,2,e,t)},useMemo:function(e,t){var i=Yt();t=t===void 0?null:t;var s=e();if(Qs){Ft(!0);try{e()}finally{Ft(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Yt();if(i!==void 0){var r=i(t);if(Qs){Ft(!0);try{i(t)}finally{Ft(!1)}}}else r=t;return s.memoizedState=s.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},s.queue=e,e=e.dispatch=nv.bind(null,Oe,e),[s.memoizedState,e]},useRef:function(e){var t=Yt();return e={current:e},t.memoizedState=e},useState:function(e){e=mo(e);var t=e.queue,i=mh.bind(null,Oe,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:So,useDeferredValue:function(e,t){var i=Yt();return bo(i,e,t)},useTransition:function(){var e=mo(!1);return e=hh.bind(null,Oe,e.queue,!0,!1),Yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Oe,r=Yt();if(Ke){if(i===void 0)throw Error(j(407));i=i()}else{if(i=t(),ot===null)throw Error(j(349));(Ie&127)!==0||qu(s,t,i)}r.memoizedState=i;var n={value:i,getSnapshot:t};return r.queue=n,ih(Pu.bind(null,s,n,e),[e]),s.flags|=2048,Mr(9,{destroy:void 0},Iu.bind(null,s,n,i,t),null),i},useId:function(){var e=Yt(),t=ot.identifierPrefix;if(Ke){var i=qi,s=Ui;i=(s&~(1<<32-It(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=Ea++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=Q_++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Co,useFormState:Zu,useActionState:Zu,useOptimistic:function(e){var t=Yt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=wo.bind(null,Oe,!0,i),i.dispatch=t,[e,t]},useMemoCache:fo,useCacheRefresh:function(){return Yt().memoizedState=rv.bind(null,Oe)},useEffectEvent:function(e){var t=Yt(),i={impl:e};return t.memoizedState=i,function(){if((et&2)!==0)throw Error(j(440));return i.impl.apply(void 0,arguments)}}},Eo={readContext:zt,use:Aa,useCallback:oh,useContext:zt,useEffect:go,useImperativeHandle:lh,useInsertionEffect:rh,useLayoutEffect:nh,useMemo:ch,useReducer:Da,useRef:th,useState:function(){return Da($i)},useDebugValue:So,useDeferredValue:function(e,t){var i=Ct();return uh(i,st.memoizedState,e,t)},useTransition:function(){var e=Da($i)[0],t=Ct().memoizedState;return[typeof e=="boolean"?e:wn(e),t]},useSyncExternalStore:Uu,useId:_h,useHostTransitionStatus:Co,useFormState:Qu,useActionState:Qu,useOptimistic:function(e,t){var i=Ct();return Fu(i,st,e,t)},useMemoCache:fo,useCacheRefresh:vh};Eo.useEffectEvent=sh;var bh={readContext:zt,use:Aa,useCallback:oh,useContext:zt,useEffect:go,useImperativeHandle:lh,useInsertionEffect:rh,useLayoutEffect:nh,useMemo:ch,useReducer:vo,useRef:th,useState:function(){return vo($i)},useDebugValue:So,useDeferredValue:function(e,t){var i=Ct();return st===null?bo(i,e,t):uh(i,st.memoizedState,e,t)},useTransition:function(){var e=vo($i)[0],t=Ct().memoizedState;return[typeof e=="boolean"?e:wn(e),t]},useSyncExternalStore:Uu,useId:_h,useHostTransitionStatus:Co,useFormState:eh,useActionState:eh,useOptimistic:function(e,t){var i=Ct();return st!==null?Fu(i,st,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:fo,useCacheRefresh:vh};bh.useEffectEvent=sh;function xo(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:h({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Ao={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=ui(),r=ps(s);r.payload=t,i!=null&&(r.callback=i),t=gs(e,r,s),t!==null&&(ti(t,e,s),Sn(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=ui(),r=ps(s);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=gs(e,r,s),t!==null&&(ti(t,e,s),Sn(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=ui(),s=ps(i);s.tag=2,t!=null&&(s.callback=t),t=gs(e,s,i),t!==null&&(ti(t,e,i),Sn(t,e,i))}};function yh(e,t,i,s,r,n,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,n,S):t.prototype&&t.prototype.isPureReactComponent?!hn(i,s)||!hn(r,n):!0}function Ch(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&&Ao.enqueueReplaceState(t,t.state,null)}function Js(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=h({},i));for(var r in e)i[r]===void 0&&(i[r]=e[r])}return i}function wh(e){oa(e)}function Eh(e){console.error(e)}function xh(e){oa(e)}function La(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Ah(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Do(e,t,i){return i=ps(i),i.tag=3,i.payload={element:null},i.callback=function(){La(e,t)},i}function Dh(e){return e=ps(e),e.tag=3,e}function Th(e,t,i,s){var r=i.type.getDerivedStateFromError;if(typeof r=="function"){var n=s.value;e.payload=function(){return r(n)},e.callback=function(){Ah(t,i,s)}}var S=i.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){Ah(t,i,s),typeof r!="function"&&(Es===null?Es=new Set([this]):Es.add(this));var M=s.stack;this.componentDidCatch(s.value,{componentStack:M!==null?M:""})})}function av(e,t,i,s,r){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Cr(t,i,r,!0),i=ai.current,i!==null){switch(i.tag){case 31:case 13:return wi===null?Ga():i.alternate===null&&St===0&&(St=3),i.flags&=-257,i.flags|=65536,i.lanes=r,s===ga?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Qo(e,s,r)),!1;case 22:return i.flags|=65536,s===ga?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)),Qo(e,s,r)),!1}throw Error(j(435,i.tag))}return Qo(e,s,r),Ga(),!1}if(Ke)return t=ai.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==Fl&&(e=Error(j(422),{cause:s}),_n(Si(e,i)))):(s!==Fl&&(t=Error(j(423),{cause:s}),_n(Si(t,i))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,s=Si(s,i),r=Do(e.stateNode,s,r),io(e,r),St!==4&&(St=2)),!1;var n=Error(j(520),{cause:s});if(n=Si(n,i),On===null?On=[n]:On.push(n),St!==4&&(St=2),t===null)return!0;s=Si(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=r&-r,i.lanes|=e,e=Do(i.stateNode,s,e),io(i,e),!1;case 1:if(t=i.type,n=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||n!==null&&typeof n.componentDidCatch=="function"&&(Es===null||!Es.has(n))))return i.flags|=65536,r&=-r,i.lanes|=r,r=Dh(r),Th(r,e,i,s),io(i,r),!1}i=i.return}while(i!==null);return!1}var To=Error(j(461)),Dt=!1;function Ut(e,t,i,s){t.child=e===null?ku(t,null,i,s):Zs(t,e.child,i,s)}function Rh(e,t,i,s,r){i=i.render;var n=t.ref;if("ref"in s){var S={};for(var M in s)M!=="ref"&&(S[M]=s[M])}else S=s;return Ys(t),s=oo(e,t,i,S,n,r),M=co(),e!==null&&!Dt?(uo(e,t,r),Xi(e,t,r)):(Ke&&M&&Gl(t),t.flags|=1,Ut(e,t,s,r),t.child)}function Mh(e,t,i,s,r){if(e===null){var n=i.type;return typeof n=="function"&&!ql(n)&&n.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=n,Lh(e,t,n,s,r)):(e=fa(i.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!Ho(e,r)){var S=n.memoizedProps;if(i=i.compare,i=i!==null?i:hn,i(S,s)&&e.ref===t.ref)return Xi(e,t,r)}return t.flags|=1,e=Wi(n,s),e.ref=t.ref,e.return=t,t.child=e}function Lh(e,t,i,s,r){if(e!==null){var n=e.memoizedProps;if(hn(n,s)&&e.ref===t.ref)if(Dt=!1,t.pendingProps=s=n,Ho(e,r))(e.flags&131072)!==0&&(Dt=!0);else return t.lanes=e.lanes,Xi(e,t,r)}return Ro(e,t,i,s,r)}function kh(e,t,i,s){var r=s.children,n=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(n=n!==null?n.baseLanes|i:i,e!==null){for(s=t.child=e.child,r=0;s!==null;)r=r|s.lanes|s.childLanes,s=s.sibling;s=r&~n}else s=0,t.child=null;return Oh(e,t,n,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ma(t,n!==null?n.cachePool:null),n!==null?ju(t,n):ro(),Hu(t);else return s=t.lanes=536870912,Oh(e,t,n!==null?n.baseLanes|i:i,i,s)}else n!==null?(ma(t,n.cachePool),ju(t,n),bs(),t.memoizedState=null):(e!==null&&ma(t,null),ro(),bs());return Ut(e,t,r,i),t.child}function An(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Oh(e,t,i,s,r){var n=Ql();return n=n===null?null:{parent:xt._currentValue,pool:n},t.memoizedState={baseLanes:i,cachePool:n},e!==null&&ma(t,null),ro(),Hu(t),e!==null&&Cr(e,t,s,!0),t.childLanes=r,null}function ka(e,t){return t=Ba({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Bh(e,t,i){return Zs(t,e.child,null,i),e=ka(t,t.pendingProps),e.flags|=2,li(t),t.memoizedState=null,e}function lv(e,t,i){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ke){if(s.mode==="hidden")return e=ka(t,s),t.lanes=536870912,An(null,e);if(ao(t),(e=ut)?(e=Yf(e,Ci),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fs!==null?{id:Ui,overflow:qi}:null,retryLane:536870912,hydrationErrors:null},i=pu(e),i.return=t,t.child=i,Nt=t,ut=null)):e=null,e===null)throw _s(t);return t.lanes=536870912,null}return ka(t,s)}var n=e.memoizedState;if(n!==null){var S=n.dehydrated;if(ao(t),r)if(t.flags&256)t.flags&=-257,t=Bh(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(j(558));else if(Dt||Cr(e,t,i,!1),r=(i&e.childLanes)!==0,Dt||r){if(s=ot,s!==null&&(S=$n(s,i),S!==0&&S!==n.retryLane))throw n.retryLane=S,Gs(e,S),ti(s,e,S),To;Ga(),t=Bh(e,t,i)}else e=n.treeContext,ut=Ei(S.nextSibling),Nt=t,Ke=!0,ds=null,Ci=!1,e!==null&&bu(t,e),t=ka(t,s),t.flags|=4096;return t}return e=Wi(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Oa(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(j(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function Ro(e,t,i,s,r){return Ys(t),i=oo(e,t,i,s,void 0,r),s=co(),e!==null&&!Dt?(uo(e,t,r),Xi(e,t,r)):(Ke&&s&&Gl(t),t.flags|=1,Ut(e,t,i,r),t.child)}function jh(e,t,i,s,r,n){return Ys(t),t.updateQueue=null,i=zu(t,s,i,r),Nu(e),s=co(),e!==null&&!Dt?(uo(e,t,n),Xi(e,t,n)):(Ke&&s&&Gl(t),t.flags|=1,Ut(e,t,i,n),t.child)}function Hh(e,t,i,s,r){if(Ys(t),t.stateNode===null){var n=gr,S=i.contextType;typeof S=="object"&&S!==null&&(n=zt(S)),n=new i(s,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Ao,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=s,n.state=t.memoizedState,n.refs={},eo(t),S=i.contextType,n.context=typeof S=="object"&&S!==null?zt(S):gr,n.state=t.memoizedState,S=i.getDerivedStateFromProps,typeof S=="function"&&(xo(t,i,S,s),n.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(S=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),S!==n.state&&Ao.enqueueReplaceState(n,n.state,null),yn(t,s,n,r),bn(),n.state=t.memoizedState),typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){n=t.stateNode;var M=t.memoizedProps,I=Js(i,M);n.props=I;var Z=n.context,ce=i.contextType;S=gr,typeof ce=="object"&&ce!==null&&(S=zt(ce));var he=i.getDerivedStateFromProps;ce=typeof he=="function"||typeof n.getSnapshotBeforeUpdate=="function",M=t.pendingProps!==M,ce||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(M||Z!==S)&&Ch(t,n,s,S),ms=!1;var ie=t.memoizedState;n.state=ie,yn(t,s,n,r),bn(),Z=t.memoizedState,M||ie!==Z||ms?(typeof he=="function"&&(xo(t,i,he,s),Z=t.memoizedState),(I=ms||yh(t,i,I,s,ie,Z,S))?(ce||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount()),typeof n.componentDidMount=="function"&&(t.flags|=4194308)):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=Z),n.props=s,n.state=Z,n.context=S,s=I):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{n=t.stateNode,to(e,t),S=t.memoizedProps,ce=Js(i,S),n.props=ce,he=t.pendingProps,ie=n.context,Z=i.contextType,I=gr,typeof Z=="object"&&Z!==null&&(I=zt(Z)),M=i.getDerivedStateFromProps,(Z=typeof M=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(S!==he||ie!==I)&&Ch(t,n,s,I),ms=!1,ie=t.memoizedState,n.state=ie,yn(t,s,n,r),bn();var le=t.memoizedState;S!==he||ie!==le||ms||e!==null&&e.dependencies!==null&&_a(e.dependencies)?(typeof M=="function"&&(xo(t,i,M,s),le=t.memoizedState),(ce=ms||yh(t,i,ce,s,ie,le,I)||e!==null&&e.dependencies!==null&&_a(e.dependencies))?(Z||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(s,le,I),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(s,le,I)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||S===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=le),n.props=s,n.state=le,n.context=I,s=ce):(typeof n.componentDidUpdate!="function"||S===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),s=!1)}return n=s,Oa(e,t),s=(t.flags&128)!==0,n||s?(n=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:n.render(),t.flags|=1,e!==null&&s?(t.child=Zs(t,e.child,null,r),t.child=Zs(t,null,i,r)):Ut(e,t,i,r),t.memoizedState=n.state,e=t.child):e=Xi(e,t,r),e}function Nh(e,t,i,s){return Fs(),t.flags|=256,Ut(e,t,i,s),t.child}var Mo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Lo(e){return{baseLanes:e,cachePool:Au()}}function ko(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=ci),e}function zh(e,t,i){var s=t.pendingProps,r=!1,n=(t.flags&128)!==0,S;if((S=n)||(S=e!==null&&e.memoizedState===null?!1:(yt.current&2)!==0),S&&(r=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ke){if(r?Ss(t):bs(),(e=ut)?(e=Yf(e,Ci),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fs!==null?{id:Ui,overflow:qi}:null,retryLane:536870912,hydrationErrors:null},i=pu(e),i.return=t,t.child=i,Nt=t,ut=null)):e=null,e===null)throw _s(t);return _c(e)?t.lanes=32:t.lanes=536870912,null}var M=s.children;return s=s.fallback,r?(bs(),r=t.mode,M=Ba({mode:"hidden",children:M},r),s=Ws(s,r,i,null),M.return=t,s.return=t,M.sibling=s,t.child=M,s=t.child,s.memoizedState=Lo(i),s.childLanes=ko(e,S,i),t.memoizedState=Mo,An(null,s)):(Ss(t),Oo(t,M))}var I=e.memoizedState;if(I!==null&&(M=I.dehydrated,M!==null)){if(n)t.flags&256?(Ss(t),t.flags&=-257,t=Bo(e,t,i)):t.memoizedState!==null?(bs(),t.child=e.child,t.flags|=128,t=null):(bs(),M=s.fallback,r=t.mode,s=Ba({mode:"visible",children:s.children},r),M=Ws(M,r,i,null),M.flags|=2,s.return=t,M.return=t,s.sibling=M,t.child=s,Zs(t,e.child,null,i),s=t.child,s.memoizedState=Lo(i),s.childLanes=ko(e,S,i),t.memoizedState=Mo,t=An(null,s));else if(Ss(t),_c(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var Z=S.dgst;S=Z,s=Error(j(419)),s.stack="",s.digest=S,_n({value:s,source:null,stack:null}),t=Bo(e,t,i)}else if(Dt||Cr(e,t,i,!1),S=(i&e.childLanes)!==0,Dt||S){if(S=ot,S!==null&&(s=$n(S,i),s!==0&&s!==I.retryLane))throw I.retryLane=s,Gs(e,s),ti(S,e,s),To;dc(M)||Ga(),t=Bo(e,t,i)}else dc(M)?(t.flags|=192,t.child=e.child,t=null):(e=I.treeContext,ut=Ei(M.nextSibling),Nt=t,Ke=!0,ds=null,Ci=!1,e!==null&&bu(t,e),t=Oo(t,s.children),t.flags|=4096);return t}return r?(bs(),M=s.fallback,r=t.mode,I=e.child,Z=I.sibling,s=Wi(I,{mode:"hidden",children:s.children}),s.subtreeFlags=I.subtreeFlags&65011712,Z!==null?M=Wi(Z,M):(M=Ws(M,r,i,null),M.flags|=2),M.return=t,s.return=t,s.sibling=M,t.child=s,An(null,s),s=t.child,M=e.child.memoizedState,M===null?M=Lo(i):(r=M.cachePool,r!==null?(I=xt._currentValue,r=r.parent!==I?{parent:I,pool:I}:r):r=Au(),M={baseLanes:M.baseLanes|i,cachePool:r}),s.memoizedState=M,s.childLanes=ko(e,S,i),t.memoizedState=Mo,An(e.child,s)):(Ss(t),i=e.child,e=i.sibling,i=Wi(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(S=t.deletions,S===null?(t.deletions=[e],t.flags|=16):S.push(e)),t.child=i,t.memoizedState=null,i)}function Oo(e,t){return t=Ba({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ba(e,t){return e=ni(22,e,null,t),e.lanes=0,e}function Bo(e,t,i){return Zs(t,e.child,null,i),e=Oo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Uh(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Vl(e.return,t,i)}function jo(e,t,i,s,r,n){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:r,treeForkCount:n}:(S.isBackwards=t,S.rendering=null,S.renderingStartTime=0,S.last=s,S.tail=i,S.tailMode=r,S.treeForkCount=n)}function qh(e,t,i){var s=t.pendingProps,r=s.revealOrder,n=s.tail;s=s.children;var S=yt.current,M=(S&2)!==0;if(M?(S=S&1|2,t.flags|=128):S&=1,K(yt,S),Ut(e,t,s,i),s=Ke?dn:0,!M&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Uh(e,i,t);else if(e.tag===19)Uh(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(r){case"forwards":for(i=t.child,r=null;i!==null;)e=i.alternate,e!==null&&Ca(e)===null&&(r=i),i=i.sibling;i=r,i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),jo(t,!1,r,i,n,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Ca(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}jo(t,!0,i,null,n,s);break;case"together":jo(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Xi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ws|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Cr(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(j(153));if(t.child!==null){for(e=t.child,i=Wi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Wi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Ho(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_a(e)))}function ov(e,t,i){switch(t.tag){case 3:L(t,t.stateNode.containerInfo),vs(t,xt,e.memoizedState.cache),Fs();break;case 27:case 5:ve(t);break;case 4:L(t,t.stateNode.containerInfo);break;case 10:vs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ao(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Ss(t),t.flags|=128,null):(i&t.child.childLanes)!==0?zh(e,t,i):(Ss(t),e=Xi(e,t,i),e!==null?e.sibling:null);Ss(t);break;case 19:var r=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Cr(e,t,i,!1),s=(i&t.childLanes)!==0),r){if(s)return qh(e,t,i);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),K(yt,yt.current),s)break;return null;case 22:return t.lanes=0,kh(e,t,i,t.pendingProps);case 24:vs(t,xt,e.memoizedState.cache)}return Xi(e,t,i)}function Ih(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Dt=!0;else{if(!Ho(e,i)&&(t.flags&128)===0)return Dt=!1,ov(e,t,i);Dt=(e.flags&131072)!==0}else Dt=!1,Ke&&(t.flags&1048576)!==0&&Su(t,dn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=$s(t.elementType),t.type=e,typeof e=="function")ql(e)?(s=Js(e,s),t.tag=1,t=Hh(null,t,e,s,i)):(t.tag=0,t=Ro(null,t,e,s,i));else{if(e!=null){var r=e.$$typeof;if(r===_){t.tag=11,t=Rh(null,t,e,s,i);break e}else if(r===D){t.tag=14,t=Mh(null,t,e,s,i);break e}}throw t=Q(e)||e,Error(j(306,t,""))}}return t;case 0:return Ro(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,r=Js(s,t.pendingProps),Hh(e,t,s,r,i);case 3:e:{if(L(t,t.stateNode.containerInfo),e===null)throw Error(j(387));s=t.pendingProps;var n=t.memoizedState;r=n.element,to(e,t),yn(t,s,null,i);var S=t.memoizedState;if(s=S.cache,vs(t,xt,s),s!==n.cache&&$l(t,[xt],i,!0),bn(),s=S.element,n.isDehydrated)if(n={element:s,isDehydrated:!1,cache:S.cache},t.updateQueue.baseState=n,t.memoizedState=n,t.flags&256){t=Nh(e,t,s,i);break e}else if(s!==r){r=Si(Error(j(424)),t),_n(r),t=Nh(e,t,s,i);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,ut=Ei(e.firstChild),Nt=t,Ke=!0,ds=null,Ci=!0,i=ku(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Fs(),s===r){t=Xi(e,t,i);break e}Ut(e,t,s,i)}t=t.child}return t;case 26:return Oa(e,t),e===null?(i=Jf(t.type,null,t.pendingProps,null))?t.memoizedState=i:Ke||(i=t.type,e=t.pendingProps,s=Xa(pe.current).createElement(i),s[pt]=t,s[jt]=e,qt(s,i,e),bt(s),t.stateNode=s):t.memoizedState=Jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&Ke&&(s=t.stateNode=Xf(t.type,t.pendingProps,pe.current),Nt=t,Ci=!0,r=ut,Ts(t.type)?(vc=r,ut=Ei(s.firstChild)):ut=r),Ut(e,t,t.pendingProps.children,i),Oa(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ke&&((r=s=ut)&&(s=zv(s,t.type,t.pendingProps,Ci),s!==null?(t.stateNode=s,Nt=t,ut=Ei(s.firstChild),Ci=!1,r=!0):r=!1),r||_s(t)),ve(t),r=t.type,n=t.pendingProps,S=e!==null?e.memoizedProps:null,s=n.children,uc(r,n)?s=null:S!==null&&uc(r,S)&&(t.flags|=32),t.memoizedState!==null&&(r=oo(e,t,J_,null,null,i),In._currentValue=r),Oa(e,t),Ut(e,t,s,i),t.child;case 6:return e===null&&Ke&&((e=i=ut)&&(i=Uv(i,t.pendingProps,Ci),i!==null?(t.stateNode=i,Nt=t,ut=null,e=!0):e=!1),e||_s(t)),null;case 13:return zh(e,t,i);case 4:return L(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Zs(t,null,s,i):Ut(e,t,s,i),t.child;case 11:return Rh(e,t,t.type,t.pendingProps,i);case 7:return Ut(e,t,t.pendingProps,i),t.child;case 8:return Ut(e,t,t.pendingProps.children,i),t.child;case 12:return Ut(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,vs(t,t.type,s.value),Ut(e,t,s.children,i),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,Ys(t),r=zt(r),s=s(r),t.flags|=1,Ut(e,t,s,i),t.child;case 14:return Mh(e,t,t.type,t.pendingProps,i);case 15:return Lh(e,t,t.type,t.pendingProps,i);case 19:return qh(e,t,i);case 31:return lv(e,t,i);case 22:return kh(e,t,i,t.pendingProps);case 24:return Ys(t),s=zt(xt),e===null?(r=Ql(),r===null&&(r=ot,n=Xl(),r.pooledCache=n,n.refCount++,n!==null&&(r.pooledCacheLanes|=i),r=n),t.memoizedState={parent:s,cache:r},eo(t),vs(t,xt,r)):((e.lanes&i)!==0&&(to(e,t),yn(t,null,null,i),bn()),r=e.memoizedState,n=t.memoizedState,r.parent!==s?(r={parent:s,cache:s},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),vs(t,xt,s)):(s=n.cache,vs(t,xt,s),s!==r.cache&&$l(t,[xt],i,!0))),Ut(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(j(156,t.tag))}function Zi(e){e.flags|=4}function No(e,t,i,s,r){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(r&335544128)===r)if(e.stateNode.complete)e.flags|=8192;else if(vf())e.flags|=8192;else throw Xs=ga,Jl}else e.flags&=-16777217}function Ph(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!rd(t))if(vf())e.flags|=8192;else throw Xs=ga,Jl}function ja(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Vn():536870912,e.lanes|=t,Br|=t)}function Dn(e,t){if(!Ke)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 ht(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags&65011712,s|=r.flags&65011712,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)i|=r.lanes|r.childLanes,s|=r.subtreeFlags,s|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function cv(e,t,i){var s=t.pendingProps;switch(Wl(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ht(t),null;case 1:return ht(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Yi(xt),ne(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(yr(t)?Zi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Kl())),ht(t),null;case 26:var r=t.type,n=t.memoizedState;return e===null?(Zi(t),n!==null?(ht(t),Ph(t,n)):(ht(t),No(t,r,null,s,i))):n?n!==e.memoizedState?(Zi(t),ht(t),Ph(t,n)):(ht(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Zi(t),ht(t),No(t,r,e,s,i)),null;case 27:if(Se(t),i=pe.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Zi(t);else{if(!s){if(t.stateNode===null)throw Error(j(166));return ht(t),null}e=re.current,yr(t)?yu(t):(e=Xf(r,s,i),t.stateNode=e,Zi(t))}return ht(t),null;case 5:if(Se(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Zi(t);else{if(!s){if(t.stateNode===null)throw Error(j(166));return ht(t),null}if(n=re.current,yr(t))yu(t);else{var S=Xa(pe.current);switch(n){case 1:n=S.createElementNS("http://www.w3.org/2000/svg",r);break;case 2:n=S.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;default:switch(r){case"svg":n=S.createElementNS("http://www.w3.org/2000/svg",r);break;case"math":n=S.createElementNS("http://www.w3.org/1998/Math/MathML",r);break;case"script":n=S.createElement("div"),n.innerHTML="<script><\/script>",n=n.removeChild(n.firstChild);break;case"select":n=typeof s.is=="string"?S.createElement("select",{is:s.is}):S.createElement("select"),s.multiple?n.multiple=!0:s.size&&(n.size=s.size);break;default:n=typeof s.is=="string"?S.createElement(r,{is:s.is}):S.createElement(r)}}n[pt]=t,n[jt]=s;e:for(S=t.child;S!==null;){if(S.tag===5||S.tag===6)n.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===t)break e;for(;S.sibling===null;){if(S.return===null||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}t.stateNode=n;e:switch(qt(n,r,s),r){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&Zi(t)}}return ht(t),No(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Zi(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(j(166));if(e=pe.current,yr(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,r=Nt,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[pt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Uf(e.nodeValue,i)),e||_s(t,!0)}else e=Xa(e).createTextNode(s),e[pt]=t,t.stateNode=e}return ht(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=yr(t),i!==null){if(e===null){if(!s)throw Error(j(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(j(557));e[pt]=t}else Fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),e=!1}else i=Kl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(li(t),t):(li(t),null);if((t.flags&128)!==0)throw Error(j(558))}return ht(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=yr(t),s!==null&&s.dehydrated!==null){if(e===null){if(!r)throw Error(j(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(j(317));r[pt]=t}else Fs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),r=!1}else r=Kl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(li(t),t):(li(t),null)}return li(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,r=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(r=s.alternate.memoizedState.cachePool.pool),n=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(n=s.memoizedState.cachePool.pool),n!==r&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),ja(t,t.updateQueue),ht(t),null);case 4:return ne(),e===null&&nc(t.stateNode.containerInfo),ht(t),null;case 10:return Yi(t.type),ht(t),null;case 19:if(k(yt),s=t.memoizedState,s===null)return ht(t),null;if(r=(t.flags&128)!==0,n=s.rendering,n===null)if(r)Dn(s,!1);else{if(St!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=Ca(e),n!==null){for(t.flags|=128,Dn(s,!1),e=n.updateQueue,t.updateQueue=e,ja(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)mu(i,e),i=i.sibling;return K(yt,yt.current&1|2),Ke&&Fi(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&je()>qa&&(t.flags|=128,r=!0,Dn(s,!1),t.lanes=4194304)}else{if(!r)if(e=Ca(n),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,ja(t,e),Dn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!n.alternate&&!Ke)return ht(t),null}else 2*je()-s.renderingStartTime>qa&&i!==536870912&&(t.flags|=128,r=!0,Dn(s,!1),t.lanes=4194304);s.isBackwards?(n.sibling=t.child,t.child=n):(e=s.last,e!==null?e.sibling=n:t.child=n,s.last=n)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=je(),e.sibling=null,i=yt.current,K(yt,r?i&1|2:i&1),Ke&&Fi(t,s.treeForkCount),e):(ht(t),null);case 22:case 23:return li(t),no(),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&&(ht(t),t.subtreeFlags&6&&(t.flags|=8192)):ht(t),i=t.updateQueue,i!==null&&ja(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&&k(Vs),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Yi(xt),ht(t),null;case 25:return null;case 30:return null}throw Error(j(156,t.tag))}function uv(e,t){switch(Wl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(xt),ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Se(t),null;case 31:if(t.memoizedState!==null){if(li(t),t.alternate===null)throw Error(j(340));Fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(li(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));Fs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return k(yt),null;case 4:return ne(),null;case 10:return Yi(t.type),null;case 22:case 23:return li(t),no(),e!==null&&k(Vs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(xt),null;case 25:return null;default:return null}}function Gh(e,t){switch(Wl(t),t.tag){case 3:Yi(xt),ne();break;case 26:case 27:case 5:Se(t);break;case 4:ne();break;case 31:t.memoizedState!==null&&li(t);break;case 13:li(t);break;case 19:k(yt);break;case 10:Yi(t.type);break;case 22:case 23:li(t),no(),e!==null&&k(Vs);break;case 24:Yi(xt)}}function Tn(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var r=s.next;i=r;do{if((i.tag&e)===e){s=void 0;var n=i.create,S=i.inst;s=n(),S.destroy=s}i=i.next}while(i!==r)}}catch(M){it(t,t.return,M)}}function ys(e,t,i){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var n=r.next;s=n;do{if((s.tag&e)===e){var S=s.inst,M=S.destroy;if(M!==void 0){S.destroy=void 0,r=t;var I=i,Z=M;try{Z()}catch(ce){it(r,I,ce)}}}s=s.next}while(s!==n)}}catch(ce){it(t,t.return,ce)}}function Wh(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Bu(t,i)}catch(s){it(e,e.return,s)}}}function Fh(e,t,i){i.props=Js(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){it(e,t,s)}}function Rn(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(r){it(e,t,r)}}function Ii(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(r){it(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(r){it(e,t,r)}else i.current=null}function Kh(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(r){it(e,e.return,r)}}function zo(e,t,i){try{var s=e.stateNode;kv(s,e.type,i,t),s[jt]=t}catch(r){it(e,e.return,r)}}function Yh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ts(e.type)||e.tag===4}function Uo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Yh(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&&Ts(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 qo(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=we));else if(s!==4&&(s===27&&Ts(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(qo(e,t,i),e=e.sibling;e!==null;)qo(e,t,i),e=e.sibling}function Ha(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&&Ts(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Ha(e,t,i),e=e.sibling;e!==null;)Ha(e,t,i),e=e.sibling}function Vh(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,r=t.attributes;r.length;)t.removeAttributeNode(r[0]);qt(t,s,i),t[pt]=e,t[jt]=i}catch(n){it(e,e.return,n)}}var Qi=!1,Tt=!1,Io=!1,$h=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function hv(e,t){if(e=e.containerInfo,oc=sl,e=lu(e),Ol(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 r=s.anchorOffset,n=s.focusNode;s=s.focusOffset;try{i.nodeType,n.nodeType}catch{i=null;break e}var S=0,M=-1,I=-1,Z=0,ce=0,he=e,ie=null;t:for(;;){for(var le;he!==i||r!==0&&he.nodeType!==3||(M=S+r),he!==n||s!==0&&he.nodeType!==3||(I=S+s),he.nodeType===3&&(S+=he.nodeValue.length),(le=he.firstChild)!==null;)ie=he,he=le;for(;;){if(he===e)break t;if(ie===i&&++Z===r&&(M=S),ie===n&&++ce===s&&(I=S),(le=he.nextSibling)!==null)break;he=ie,ie=he.parentNode}he=le}i=M===-1||I===-1?null:{start:M,end:I}}else i=null}i=i||{start:0,end:0}}else i=null;for(cc={focusedElem:e,selectionRange:i},sl=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,n=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++)r=e[i],r.ref.impl=r.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&n!==null){e=void 0,i=t,r=n.memoizedProps,n=n.memoizedState,s=i.stateNode;try{var ye=Js(i.type,r);e=s.getSnapshotBeforeUpdate(ye,n),s.__reactInternalSnapshotBeforeUpdate=e}catch(Te){it(i,i.return,Te)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)fc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fc(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(j(163))}if(e=t.sibling,e!==null){e.return=t.return,Ot=e;break}Ot=t.return}}function Xh(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:es(e,i),s&4&&Tn(5,i);break;case 1:if(es(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(S){it(i,i.return,S)}else{var r=Js(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){it(i,i.return,S)}}s&64&&Wh(i),s&512&&Rn(i,i.return);break;case 3:if(es(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{Bu(e,t)}catch(S){it(i,i.return,S)}}break;case 27:t===null&&s&4&&Vh(i);case 26:case 5:es(e,i),t===null&&s&4&&Kh(i),s&512&&Rn(i,i.return);break;case 12:es(e,i);break;case 31:es(e,i),s&4&&Jh(e,i);break;case 13:es(e,i),s&4&&ef(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=bv.bind(null,i),qv(e,i))));break;case 22:if(s=i.memoizedState!==null||Qi,!s){t=t!==null&&t.memoizedState!==null||Tt,r=Qi;var n=Tt;Qi=s,(Tt=t)&&!n?ts(e,i,(i.subtreeFlags&8772)!==0):es(e,i),Qi=r,Tt=n}break;case 30:break;default:es(e,i)}}function Zh(e){var t=e.alternate;t!==null&&(e.alternate=null,Zh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Gt(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 ft=null,Zt=!1;function Ji(e,t,i){for(i=i.child;i!==null;)Qh(e,t,i),i=i.sibling}function Qh(e,t,i){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(Ni,i)}catch{}switch(i.tag){case 26:Tt||Ii(i,t),Ji(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Tt||Ii(i,t);var s=ft,r=Zt;Ts(i.type)&&(ft=i.stateNode,Zt=!1),Ji(e,t,i),zn(i.stateNode),ft=s,Zt=r;break;case 5:Tt||Ii(i,t);case 6:if(s=ft,r=Zt,ft=null,Ji(e,t,i),ft=s,Zt=r,ft!==null)if(Zt)try{(ft.nodeType===9?ft.body:ft.nodeName==="HTML"?ft.ownerDocument.body:ft).removeChild(i.stateNode)}catch(n){it(i,t,n)}else try{ft.removeChild(i.stateNode)}catch(n){it(i,t,n)}break;case 18:ft!==null&&(Zt?(e=ft,Ff(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Pr(e)):Ff(ft,i.stateNode));break;case 4:s=ft,r=Zt,ft=i.stateNode.containerInfo,Zt=!0,Ji(e,t,i),ft=s,Zt=r;break;case 0:case 11:case 14:case 15:ys(2,i,t),Tt||ys(4,i,t),Ji(e,t,i);break;case 1:Tt||(Ii(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&Fh(i,t,s)),Ji(e,t,i);break;case 21:Ji(e,t,i);break;case 22:Tt=(s=Tt)||i.memoizedState!==null,Ji(e,t,i),Tt=s;break;default:Ji(e,t,i)}}function Jh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Pr(e)}catch(i){it(t,t.return,i)}}}function ef(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Pr(e)}catch(i){it(t,t.return,i)}}function fv(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new $h),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new $h),t;default:throw Error(j(435,e.tag))}}function Na(e,t){var i=fv(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var r=yv.bind(null,e,s);s.then(r,r)}})}function Qt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var r=i[s],n=e,S=t,M=S;e:for(;M!==null;){switch(M.tag){case 27:if(Ts(M.type)){ft=M.stateNode,Zt=!1;break e}break;case 5:ft=M.stateNode,Zt=!1;break e;case 3:case 4:ft=M.stateNode.containerInfo,Zt=!0;break e}M=M.return}if(ft===null)throw Error(j(160));Qh(n,S,r),ft=null,Zt=!1,n=r.alternate,n!==null&&(n.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)tf(t,e),t=t.sibling}var Bi=null;function tf(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qt(t,e),Jt(e),s&4&&(ys(3,e,e.return),Tn(3,e),ys(5,e,e.return));break;case 1:Qt(t,e),Jt(e),s&512&&(Tt||i===null||Ii(i,i.return)),s&64&&Qi&&(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 r=Bi;if(Qt(t,e),Jt(e),s&512&&(Tt||i===null||Ii(i,i.return)),s&4){var n=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,r=r.ownerDocument||r;t:switch(s){case"title":n=r.getElementsByTagName("title")[0],(!n||n[Ns]||n[pt]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=r.createElement(s),r.head.insertBefore(n,r.querySelector("head > title"))),qt(n,s,i),n[pt]=e,bt(n),s=n;break e;case"link":var S=id("link","href",r).get(s+(i.href||""));if(S){for(var M=0;M<S.length;M++)if(n=S[M],n.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&n.getAttribute("rel")===(i.rel==null?null:i.rel)&&n.getAttribute("title")===(i.title==null?null:i.title)&&n.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){S.splice(M,1);break t}}n=r.createElement(s),qt(n,s,i),r.head.appendChild(n);break;case"meta":if(S=id("meta","content",r).get(s+(i.content||""))){for(M=0;M<S.length;M++)if(n=S[M],n.getAttribute("content")===(i.content==null?null:""+i.content)&&n.getAttribute("name")===(i.name==null?null:i.name)&&n.getAttribute("property")===(i.property==null?null:i.property)&&n.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&n.getAttribute("charset")===(i.charSet==null?null:i.charSet)){S.splice(M,1);break t}}n=r.createElement(s),qt(n,s,i),r.head.appendChild(n);break;default:throw Error(j(468,s))}n[pt]=e,bt(n),s=n}e.stateNode=s}else sd(r,e.type,e.stateNode);else e.stateNode=td(r,s,e.memoizedProps);else n!==s?(n===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):n.count--,s===null?sd(r,e.type,e.stateNode):td(r,s,e.memoizedProps)):s===null&&e.stateNode!==null&&zo(e,e.memoizedProps,i.memoizedProps)}break;case 27:Qt(t,e),Jt(e),s&512&&(Tt||i===null||Ii(i,i.return)),i!==null&&s&4&&zo(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Qt(t,e),Jt(e),s&512&&(Tt||i===null||Ii(i,i.return)),e.flags&32){r=e.stateNode;try{cs(r,"")}catch(ye){it(e,e.return,ye)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,zo(e,r,i!==null?i.memoizedProps:r)),s&1024&&(Io=!0);break;case 6:if(Qt(t,e),Jt(e),s&4){if(e.stateNode===null)throw Error(j(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(ye){it(e,e.return,ye)}}break;case 3:if(Ja=null,r=Bi,Bi=Za(t.containerInfo),Qt(t,e),Bi=r,Jt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Pr(t.containerInfo)}catch(ye){it(e,e.return,ye)}Io&&(Io=!1,sf(e));break;case 4:s=Bi,Bi=Za(e.stateNode.containerInfo),Qt(t,e),Jt(e),Bi=s;break;case 12:Qt(t,e),Jt(e);break;case 31:Qt(t,e),Jt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Na(e,s)));break;case 13:Qt(t,e),Jt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Ua=je()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Na(e,s)));break;case 22:r=e.memoizedState!==null;var I=i!==null&&i.memoizedState!==null,Z=Qi,ce=Tt;if(Qi=Z||r,Tt=ce||I,Qt(t,e),Tt=ce,Qi=Z,Jt(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(i===null||I||Qi||Tt||er(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){I=i=t;try{if(n=I.stateNode,r)S=n.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{M=I.stateNode;var he=I.memoizedProps.style,ie=he!=null&&he.hasOwnProperty("display")?he.display:null;M.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ye){it(I,I.return,ye)}}}else if(t.tag===6){if(i===null){I=t;try{I.stateNode.nodeValue=r?"":I.memoizedProps}catch(ye){it(I,I.return,ye)}}}else if(t.tag===18){if(i===null){I=t;try{var le=I.stateNode;r?Kf(le,!0):Kf(I.stateNode,!1)}catch(ye){it(I,I.return,ye)}}}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,Na(e,i))));break;case 19:Qt(t,e),Jt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Na(e,s)));break;case 30:break;case 21:break;default:Qt(t,e),Jt(e)}}function Jt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(Yh(s)){i=s;break}s=s.return}if(i==null)throw Error(j(160));switch(i.tag){case 27:var r=i.stateNode,n=Uo(e);Ha(e,n,r);break;case 5:var S=i.stateNode;i.flags&32&&(cs(S,""),i.flags&=-33);var M=Uo(e);Ha(e,M,S);break;case 3:case 4:var I=i.stateNode.containerInfo,Z=Uo(e);qo(e,Z,I);break;default:throw Error(j(161))}}catch(ce){it(e,e.return,ce)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function sf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;sf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function es(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Xh(e,t.alternate,t),t=t.sibling}function er(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ys(4,t,t.return),er(t);break;case 1:Ii(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Fh(t,t.return,i),er(t);break;case 27:zn(t.stateNode);case 26:case 5:Ii(t,t.return),er(t);break;case 22:t.memoizedState===null&&er(t);break;case 30:er(t);break;default:er(t)}e=e.sibling}}function ts(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,r=e,n=t,S=n.flags;switch(n.tag){case 0:case 11:case 15:ts(r,n,i),Tn(4,n);break;case 1:if(ts(r,n,i),s=n,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(Z){it(s,s.return,Z)}if(s=n,r=s.updateQueue,r!==null){var M=s.stateNode;try{var I=r.shared.hiddenCallbacks;if(I!==null)for(r.shared.hiddenCallbacks=null,r=0;r<I.length;r++)Ou(I[r],M)}catch(Z){it(s,s.return,Z)}}i&&S&64&&Wh(n),Rn(n,n.return);break;case 27:Vh(n);case 26:case 5:ts(r,n,i),i&&s===null&&S&4&&Kh(n),Rn(n,n.return);break;case 12:ts(r,n,i);break;case 31:ts(r,n,i),i&&S&4&&Jh(r,n);break;case 13:ts(r,n,i),i&&S&4&&ef(r,n);break;case 22:n.memoizedState===null&&ts(r,n,i),Rn(n,n.return);break;case 30:break;default:ts(r,n,i)}t=t.sibling}}function Po(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&&vn(i))}function Go(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vn(e))}function ji(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)rf(e,t,i,s),t=t.sibling}function rf(e,t,i,s){var r=t.flags;switch(t.tag){case 0:case 11:case 15:ji(e,t,i,s),r&2048&&Tn(9,t);break;case 1:ji(e,t,i,s);break;case 3:ji(e,t,i,s),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&vn(e)));break;case 12:if(r&2048){ji(e,t,i,s),e=t.stateNode;try{var n=t.memoizedProps,S=n.id,M=n.onPostCommit;typeof M=="function"&&M(S,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(I){it(t,t.return,I)}}else ji(e,t,i,s);break;case 31:ji(e,t,i,s);break;case 13:ji(e,t,i,s);break;case 23:break;case 22:n=t.stateNode,S=t.alternate,t.memoizedState!==null?n._visibility&2?ji(e,t,i,s):Mn(e,t):n._visibility&2?ji(e,t,i,s):(n._visibility|=2,Lr(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Po(S,t);break;case 24:ji(e,t,i,s),r&2048&&Go(t.alternate,t);break;default:ji(e,t,i,s)}}function Lr(e,t,i,s,r){for(r=r&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var n=e,S=t,M=i,I=s,Z=S.flags;switch(S.tag){case 0:case 11:case 15:Lr(n,S,M,I,r),Tn(8,S);break;case 23:break;case 22:var ce=S.stateNode;S.memoizedState!==null?ce._visibility&2?Lr(n,S,M,I,r):Mn(n,S):(ce._visibility|=2,Lr(n,S,M,I,r)),r&&Z&2048&&Po(S.alternate,S);break;case 24:Lr(n,S,M,I,r),r&&Z&2048&&Go(S.alternate,S);break;default:Lr(n,S,M,I,r)}t=t.sibling}}function Mn(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,r=s.flags;switch(s.tag){case 22:Mn(i,s),r&2048&&Po(s.alternate,s);break;case 24:Mn(i,s),r&2048&&Go(s.alternate,s);break;default:Mn(i,s)}t=t.sibling}}var Ln=8192;function kr(e,t,i){if(e.subtreeFlags&Ln)for(e=e.child;e!==null;)nf(e,t,i),e=e.sibling}function nf(e,t,i){switch(e.tag){case 26:kr(e,t,i),e.flags&Ln&&e.memoizedState!==null&&Qv(i,Bi,e.memoizedState,e.memoizedProps);break;case 5:kr(e,t,i);break;case 3:case 4:var s=Bi;Bi=Za(e.stateNode.containerInfo),kr(e,t,i),Bi=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Ln,Ln=16777216,kr(e,t,i),Ln=s):kr(e,t,i));break;default:kr(e,t,i)}}function af(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 kn(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];Ot=s,of(s,e)}af(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)lf(e),e=e.sibling}function lf(e){switch(e.tag){case 0:case 11:case 15:kn(e),e.flags&2048&&ys(9,e,e.return);break;case 3:kn(e);break;case 12:kn(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,za(e)):kn(e);break;default:kn(e)}}function za(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];Ot=s,of(s,e)}af(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ys(8,t,t.return),za(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,za(t));break;default:za(t)}e=e.sibling}}function of(e,t){for(;Ot!==null;){var i=Ot;switch(i.tag){case 0:case 11:case 15:ys(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:vn(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,Ot=s;else e:for(i=e;Ot!==null;){s=Ot;var r=s.sibling,n=s.return;if(Zh(s),s===i){Ot=null;break e}if(r!==null){r.return=n,Ot=r;break e}Ot=n}}}var dv={getCacheForType:function(e){var t=zt(xt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return zt(xt).controller.signal}},_v=typeof WeakMap=="function"?WeakMap:Map,et=0,ot=null,Ne=null,Ie=0,tt=0,oi=null,Cs=!1,Or=!1,Wo=!1,is=0,St=0,ws=0,tr=0,Fo=0,ci=0,Br=0,On=null,ei=null,Ko=!1,Ua=0,cf=0,qa=1/0,Ia=null,Es=null,Rt=0,xs=null,jr=null,ss=0,Yo=0,Vo=null,uf=null,Bn=0,$o=null;function ui(){return(et&2)!==0&&Ie!==0?Ie&-Ie:q.T!==null?tc():Gi()}function hf(){if(ci===0)if((Ie&536870912)===0||Ke){var e=as;as<<=1,(as&3932160)===0&&(as=262144),ci=e}else ci=536870912;return e=ai.current,e!==null&&(e.flags|=32),ci}function ti(e,t,i){(e===ot&&(tt===2||tt===9)||e.cancelPendingCommit!==null)&&(Hr(e,0),As(e,Ie,ci,!1)),Hs(e,i),((et&2)===0||e!==ot)&&(e===ot&&((et&2)===0&&(tr|=i),St===4&&As(e,Ie,ci,!1)),Pi(e))}function ff(e,t,i){if((et&6)!==0)throw Error(j(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||js(e,t),r=s?pv(e,t):Zo(e,t,!0),n=s;do{if(r===0){Or&&!s&&As(e,t,0,!1);break}else{if(i=e.current.alternate,n&&!vv(i)){r=Zo(e,t,!1),n=!1;continue}if(r===2){if(n=t,e.errorRecoveryDisabledLanes&n)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){t=S;e:{var M=e;r=On;var I=M.current.memoizedState.isDehydrated;if(I&&(Hr(M,S).flags|=256),S=Zo(M,S,!1),S!==2){if(Wo&&!I){M.errorRecoveryDisabledLanes|=n,tr|=n,r=4;break e}n=ei,ei=r,n!==null&&(ei===null?ei=n:ei.push.apply(ei,n))}r=S}if(n=!1,r!==2)continue}}if(r===1){Hr(e,0),As(e,t,0,!0);break}e:{switch(s=e,n=r,n){case 0:case 1:throw Error(j(345));case 4:if((t&4194048)!==t)break;case 6:As(s,t,ci,!Cs);break e;case 2:ei=null;break;case 3:case 5:break;default:throw Error(j(329))}if((t&62914560)===t&&(r=Ua+300-je(),10<r)){if(As(s,t,ci,!Cs),or(s,0,!0)!==0)break e;ss=t,s.timeoutHandle=Gf(df.bind(null,s,i,ei,Ia,Ko,t,ci,tr,Br,Cs,n,"Throttled",-0,0),r);break e}df(s,i,ei,Ia,Ko,t,ci,tr,Br,Cs,n,null,-0,0)}}break}while(!0);Pi(e)}function df(e,t,i,s,r,n,S,M,I,Z,ce,he,ie,le){if(e.timeoutHandle=-1,he=t.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:we},nf(t,n,he);var ye=(n&62914560)===n?Ua-je():(n&4194048)===n?cf-je():0;if(ye=Jv(he,ye),ye!==null){ss=n,e.cancelPendingCommit=ye(yf.bind(null,e,t,n,i,s,r,S,M,I,ce,he,null,ie,le)),As(e,n,S,!Z);return}}yf(e,t,n,i,s,r,S,M,I)}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 r=i[s],n=r.getSnapshot;r=r.value;try{if(!ri(n(),r))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 As(e,t,i,s){t&=~Fo,t&=~tr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var n=31-It(r),S=1<<n;s[n]=-1,r&=~S}i!==0&&_i(e,i,t)}function Pa(){return(et&6)===0?(jn(0),!1):!0}function Xo(){if(Ne!==null){if(tt===0)var e=Ne.return;else e=Ne,Ki=Ks=null,ho(e),Ar=null,pn=0,e=Ne;for(;e!==null;)Gh(e.alternate,e),e=e.return;Ne=null}}function Hr(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,jv(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ss=0,Xo(),ot=e,Ne=i=Wi(e.current,null),Ie=t,tt=0,oi=null,Cs=!1,Or=js(e,t),Wo=!1,Br=ci=Fo=tr=ws=St=0,ei=On=null,Ko=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var r=31-It(s),n=1<<r;t|=e[r],s&=~n}return is=t,ca(),i}function _f(e,t){Oe=null,q.H=xn,t===xr||t===pa?(t=Ru(),tt=3):t===Jl?(t=Ru(),tt=4):tt=t===To?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,oi=t,Ne===null&&(St=1,La(e,Si(t,e.current)))}function vf(){var e=ai.current;return e===null?!0:(Ie&4194048)===Ie?wi===null:(Ie&62914560)===Ie||(Ie&536870912)!==0?e===wi:!1}function mf(){var e=q.H;return q.H=xn,e===null?xn:e}function pf(){var e=q.A;return q.A=dv,e}function Ga(){St=4,Cs||(Ie&4194048)!==Ie&&ai.current!==null||(Or=!0),(ws&134217727)===0&&(tr&134217727)===0||ot===null||As(ot,Ie,ci,!1)}function Zo(e,t,i){var s=et;et|=2;var r=mf(),n=pf();(ot!==e||Ie!==t)&&(Ia=null,Hr(e,t)),t=!1;var S=St;e:do try{if(tt!==0&&Ne!==null){var M=Ne,I=oi;switch(tt){case 8:Xo(),S=6;break e;case 3:case 2:case 9:case 6:ai.current===null&&(t=!0);var Z=tt;if(tt=0,oi=null,Nr(e,M,I,Z),i&&Or){S=0;break e}break;default:Z=tt,tt=0,oi=null,Nr(e,M,I,Z)}}mv(),S=St;break}catch(ce){_f(e,ce)}while(!0);return t&&e.shellSuspendCounter++,Ki=Ks=null,et=s,q.H=r,q.A=n,Ne===null&&(ot=null,Ie=0,ca()),S}function mv(){for(;Ne!==null;)gf(Ne)}function pv(e,t){var i=et;et|=2;var s=mf(),r=pf();ot!==e||Ie!==t?(Ia=null,qa=je()+500,Hr(e,t)):Or=js(e,t);e:do try{if(tt!==0&&Ne!==null){t=Ne;var n=oi;t:switch(tt){case 1:tt=0,oi=null,Nr(e,t,n,1);break;case 2:case 9:if(Du(n)){tt=0,oi=null,Sf(t);break}t=function(){tt!==2&&tt!==9||ot!==e||(tt=7),Pi(e)},n.then(t,t);break e;case 3:tt=7;break e;case 4:tt=5;break e;case 7:Du(n)?(tt=0,oi=null,Sf(t)):(tt=0,oi=null,Nr(e,t,n,7));break;case 5:var S=null;switch(Ne.tag){case 26:S=Ne.memoizedState;case 5:case 27:var M=Ne;if(S?rd(S):M.stateNode.complete){tt=0,oi=null;var I=M.sibling;if(I!==null)Ne=I;else{var Z=M.return;Z!==null?(Ne=Z,Wa(Z)):Ne=null}break t}}tt=0,oi=null,Nr(e,t,n,5);break;case 6:tt=0,oi=null,Nr(e,t,n,6);break;case 8:Xo(),St=6;break e;default:throw Error(j(462))}}gv();break}catch(ce){_f(e,ce)}while(!0);return Ki=Ks=null,q.H=s,q.A=r,et=i,Ne!==null?0:(ot=null,Ie=0,ca(),St)}function gv(){for(;Ne!==null&&!Le();)gf(Ne)}function gf(e){var t=Ih(e.alternate,e,is);e.memoizedProps=e.pendingProps,t===null?Wa(e):Ne=t}function Sf(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=jh(i,t,t.pendingProps,t.type,void 0,Ie);break;case 11:t=jh(i,t,t.pendingProps,t.type.render,t.ref,Ie);break;case 5:ho(t);default:Gh(i,t),t=Ne=mu(t,is),t=Ih(i,t,is)}e.memoizedProps=e.pendingProps,t===null?Wa(e):Ne=t}function Nr(e,t,i,s){Ki=Ks=null,ho(t),Ar=null,pn=0;var r=t.return;try{if(av(e,r,t,i,Ie)){St=1,La(e,Si(i,e.current)),Ne=null;return}}catch(n){if(r!==null)throw Ne=r,n;St=1,La(e,Si(i,e.current)),Ne=null;return}t.flags&32768?(Ke||s===1?e=!0:Or||(Ie&536870912)!==0?e=!1:(Cs=e=!0,(s===2||s===9||s===3||s===6)&&(s=ai.current,s!==null&&s.tag===13&&(s.flags|=16384))),bf(t,e)):Wa(t)}function Wa(e){var t=e;do{if((t.flags&32768)!==0){bf(t,Cs);return}e=t.return;var i=cv(t.alternate,t,is);if(i!==null){Ne=i;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);St===0&&(St=5)}function bf(e,t){do{var i=uv(e.alternate,e);if(i!==null){i.flags&=32767,Ne=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=i}while(e!==null);St=6,Ne=null}function yf(e,t,i,s,r,n,S,M,I){e.cancelPendingCommit=null;do Fa();while(Rt!==0);if((et&6)!==0)throw Error(j(327));if(t!==null){if(t===e.current)throw Error(j(177));if(n=t.lanes|t.childLanes,n|=zl,Cl(e,i,n,S,M,I),e===ot&&(Ne=ot=null,Ie=0),jr=t,xs=e,ss=i,Yo=n,Vo=r,uf=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Cv(mt,function(){return Af(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=q.T,q.T=null,r=te.p,te.p=2,S=et,et|=4;try{hv(e,t,i)}finally{et=S,te.p=r,q.T=s}}Rt=1,Cf(),wf(),Ef()}}function Cf(){if(Rt===1){Rt=0;var e=xs,t=jr,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=q.T,q.T=null;var s=te.p;te.p=2;var r=et;et|=4;try{tf(t,e);var n=cc,S=lu(e.containerInfo),M=n.focusedElem,I=n.selectionRange;if(S!==M&&M&&M.ownerDocument&&au(M.ownerDocument.documentElement,M)){if(I!==null&&Ol(M)){var Z=I.start,ce=I.end;if(ce===void 0&&(ce=Z),"selectionStart"in M)M.selectionStart=Z,M.selectionEnd=Math.min(ce,M.value.length);else{var he=M.ownerDocument||document,ie=he&&he.defaultView||window;if(ie.getSelection){var le=ie.getSelection(),ye=M.textContent.length,Te=Math.min(I.start,ye),nt=I.end===void 0?Te:Math.min(I.end,ye);!le.extend&&Te>nt&&(S=nt,nt=Te,Te=S);var Y=nu(M,Te),G=nu(M,nt);if(Y&&G&&(le.rangeCount!==1||le.anchorNode!==Y.node||le.anchorOffset!==Y.offset||le.focusNode!==G.node||le.focusOffset!==G.offset)){var $=he.createRange();$.setStart(Y.node,Y.offset),le.removeAllRanges(),Te>nt?(le.addRange($),le.extend(G.node,G.offset)):($.setEnd(G.node,G.offset),le.addRange($))}}}}for(he=[],le=M;le=le.parentNode;)le.nodeType===1&&he.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<he.length;M++){var ue=he[M];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}sl=!!oc,cc=oc=null}finally{et=r,te.p=s,q.T=i}}e.current=t,Rt=2}}function wf(){if(Rt===2){Rt=0;var e=xs,t=jr,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=q.T,q.T=null;var s=te.p;te.p=2;var r=et;et|=4;try{Xh(e,t.alternate,t)}finally{et=r,te.p=s,q.T=i}}Rt=3}}function Ef(){if(Rt===4||Rt===3){Rt=0,Xe();var e=xs,t=jr,i=ss,s=uf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Rt=5:(Rt=0,jr=xs=null,xf(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(Es=null),Ze(i),t=t.stateNode,kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(Ni,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=q.T,r=te.p,te.p=2,q.T=null;try{for(var n=e.onRecoverableError,S=0;S<s.length;S++){var M=s[S];n(M.value,{componentStack:M.stack})}}finally{q.T=t,te.p=r}}(ss&3)!==0&&Fa(),Pi(e),r=e.pendingLanes,(i&261930)!==0&&(r&42)!==0?e===$o?Bn++:(Bn=0,$o=e):Bn=0,jn(0)}}function xf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,vn(t)))}function Fa(){return Cf(),wf(),Ef(),Af()}function Af(){if(Rt!==5)return!1;var e=xs,t=Yo;Yo=0;var i=Ze(ss),s=q.T,r=te.p;try{te.p=32>i?32:i,q.T=null,i=Vo,Vo=null;var n=xs,S=ss;if(Rt=0,jr=xs=null,ss=0,(et&6)!==0)throw Error(j(331));var M=et;if(et|=4,lf(n.current),rf(n,n.current,S,i),et=M,jn(0,!1),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(Ni,n)}catch{}return!0}finally{te.p=r,q.T=s,xf(e,t)}}function Df(e,t,i){t=Si(i,t),t=Do(e.stateNode,t,2),e=gs(e,t,2),e!==null&&(Hs(e,2),Pi(e))}function it(e,t,i){if(e.tag===3)Df(e,e,i);else for(;t!==null;){if(t.tag===3){Df(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Es===null||!Es.has(s))){e=Si(i,e),i=Dh(2),s=gs(t,i,2),s!==null&&(Th(i,s,t,e),Hs(s,2),Pi(s));break}}t=t.return}}function Qo(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new _v;var r=new Set;s.set(t,r)}else r=s.get(t),r===void 0&&(r=new Set,s.set(t,r));r.has(i)||(Wo=!0,r.add(i),e=Sv.bind(null,e,t,i),t.then(e,e))}function Sv(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,ot===e&&(Ie&i)===i&&(St===4||St===3&&(Ie&62914560)===Ie&&300>je()-Ua?(et&2)===0&&Hr(e,0):Fo|=i,Br===Ie&&(Br=0)),Pi(e)}function Tf(e,t){t===0&&(t=Vn()),e=Gs(e,t),e!==null&&(Hs(e,t),Pi(e))}function bv(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Tf(e,i)}function yv(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,r=e.memoizedState;r!==null&&(i=r.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(j(314))}s!==null&&s.delete(t),Tf(e,i)}function Cv(e,t){return ge(e,t)}var Ka=null,zr=null,Jo=!1,Ya=!1,ec=!1,Ds=0;function Pi(e){e!==zr&&e.next===null&&(zr===null?Ka=zr=e:zr=zr.next=e),Ya=!0,Jo||(Jo=!0,Ev())}function jn(e,t){if(!ec&&Ya){ec=!0;do for(var i=!1,s=Ka;s!==null;){if(e!==0){var r=s.pendingLanes;if(r===0)var n=0;else{var S=s.suspendedLanes,M=s.pingedLanes;n=(1<<31-It(42|e)+1)-1,n&=r&~(S&~M),n=n&201326741?n&201326741|1:n?n|2:0}n!==0&&(i=!0,kf(s,n))}else n=Ie,n=or(s,s===ot?n:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(n&3)===0||js(s,n)||(i=!0,kf(s,n));s=s.next}while(i);ec=!1}}function wv(){Rf()}function Rf(){Ya=Jo=!1;var e=0;Ds!==0&&Bv()&&(e=Ds);for(var t=je(),i=null,s=Ka;s!==null;){var r=s.next,n=Mf(s,t);n===0?(s.next=null,i===null?Ka=r:i.next=r,r===null&&(zr=i)):(i=s,(e!==0||(n&3)!==0)&&(Ya=!0)),s=r}Rt!==0&&Rt!==5||jn(e),Ds!==0&&(Ds=0)}function Mf(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,r=e.expirationTimes,n=e.pendingLanes&-62914561;0<n;){var S=31-It(n),M=1<<S,I=r[S];I===-1?((M&i)===0||(M&s)!==0)&&(r[S]=yl(M,t)):I<=t&&(e.expiredLanes|=M),n&=~M}if(t=ot,i=Ie,i=or(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(tt===2||tt===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Ce(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||js(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&Ce(s),Ze(i)){case 2:case 8:i=lt;break;case 32:i=mt;break;case 268435456:i=Lt;break;default:i=mt}return s=Lf.bind(null,e),i=ge(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&Ce(s),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(Rt!==0&&Rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Fa()&&e.callbackNode!==i)return null;var s=Ie;return s=or(e,e===ot?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(ff(e,s,t),Mf(e,je()),e.callbackNode!=null&&e.callbackNode===i?Lf.bind(null,e):null)}function kf(e,t){if(Fa())return null;ff(e,t,!0)}function Ev(){Hv(function(){(et&6)!==0?ge(Ge,wv):Rf()})}function tc(){if(Ds===0){var e=wr;e===0&&(e=Bs,Bs<<=1,(Bs&261888)===0&&(Bs=256)),Ds=e}return Ds}function Of(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:de(""+e)}function Bf(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 xv(e,t,i,s,r){if(t==="submit"&&i&&i.stateNode===r){var n=Of((r[jt]||null).action),S=s.submitter;S&&(t=(t=S[jt]||null)?Of(t.formAction):S.getAttribute("formAction"),t!==null&&(n=t,S=null));var M=new na("action","action",null,s,r);e.push({event:M,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ds!==0){var I=S?Bf(r,S):new FormData(r);yo(i,{pending:!0,data:I,method:r.method,action:n},null,I)}}else typeof n=="function"&&(M.preventDefault(),I=S?Bf(r,S):new FormData(r),yo(i,{pending:!0,data:I,method:r.method,action:n},n,I))},currentTarget:r}]})}}for(var ic=0;ic<Nl.length;ic++){var sc=Nl[ic],Av=sc.toLowerCase(),Dv=sc[0].toUpperCase()+sc.slice(1);Oi(Av,"on"+Dv)}Oi(uu,"onAnimationEnd"),Oi(hu,"onAnimationIteration"),Oi(fu,"onAnimationStart"),Oi("dblclick","onDoubleClick"),Oi("focusin","onFocus"),Oi("focusout","onBlur"),Oi(G_,"onTransitionRun"),Oi(W_,"onTransitionStart"),Oi(F_,"onTransitionCancel"),Oi(du,"onTransitionEnd"),Ti("onMouseEnter",["mouseout","mouseover"]),Ti("onMouseLeave",["mouseout","mouseover"]),Ti("onPointerEnter",["pointerout","pointerover"]),Ti("onPointerLeave",["pointerout","pointerover"]),Vt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Vt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Vt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Vt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Vt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Vt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hn="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(" "),Tv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Hn));function jf(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],r=s.event;s=s.listeners;e:{var n=void 0;if(t)for(var S=s.length-1;0<=S;S--){var M=s[S],I=M.instance,Z=M.currentTarget;if(M=M.listener,I!==n&&r.isPropagationStopped())break e;n=M,r.currentTarget=Z;try{n(r)}catch(ce){oa(ce)}r.currentTarget=null,n=I}else for(S=0;S<s.length;S++){if(M=s[S],I=M.instance,Z=M.currentTarget,M=M.listener,I!==n&&r.isPropagationStopped())break e;n=M,r.currentTarget=Z;try{n(r)}catch(ce){oa(ce)}r.currentTarget=null,n=I}}}}function ze(e,t){var i=t[zi];i===void 0&&(i=t[zi]=new Set);var s=e+"__bubble";i.has(s)||(Hf(t,e,2,!1),i.add(s))}function rc(e,t,i){var s=0;t&&(s|=4),Hf(i,e,s,t)}var Va="_reactListening"+Math.random().toString(36).slice(2);function nc(e){if(!e[Va]){e[Va]=!0,Zr.forEach(function(i){i!=="selectionchange"&&(Tv.has(i)||rc(i,!1,e),rc(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Va]||(t[Va]=!0,rc("selectionchange",!1,t))}}function Hf(e,t,i,s){switch(hd(t)){case 2:var r=im;break;case 8:r=sm;break;default:r=bc}i=r.bind(null,t,i,e),r=void 0,!us||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),s?r!==void 0?e.addEventListener(t,i,{capture:!0,passive:r}):e.addEventListener(t,i,!0):r!==void 0?e.addEventListener(t,i,{passive:r}):e.addEventListener(t,i,!1)}function ac(e,t,i,s,r){var n=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var S=s.tag;if(S===3||S===4){var M=s.stateNode.containerInfo;if(M===r)break;if(S===4)for(S=s.return;S!==null;){var I=S.tag;if((I===3||I===4)&&S.stateNode.containerInfo===r)return;S=S.return}for(;M!==null;){if(S=Ht(M),S===null)return;if(I=S.tag,I===5||I===6||I===26||I===27){s=n=S;continue e}M=M.parentNode}}s=s.return}_t(function(){var Z=n,ce=Re(i),he=[];e:{var ie=_u.get(e);if(ie!==void 0){var le=na,ye=e;switch(e){case"keypress":if(dr(i)===0)break e;case"keydown":case"keyup":le=y_;break;case"focusin":ye="focus",le=Tl;break;case"focusout":ye="blur",le=Tl;break;case"beforeblur":case"afterblur":le=Tl;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=Gc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=c_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=E_;break;case uu:case hu:case fu:le=f_;break;case du:le=A_;break;case"scroll":case"scrollend":le=l_;break;case"wheel":le=T_;break;case"copy":case"cut":case"paste":le=__;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Fc;break;case"toggle":case"beforetoggle":le=M_}var Te=(t&4)!==0,nt=!Te&&(e==="scroll"||e==="scrollend"),Y=Te?ie!==null?ie+"Capture":null:ie;Te=[];for(var G=Z,$;G!==null;){var ue=G;if($=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||$===null||Y===null||(ue=Li(G,Y),ue!=null&&Te.push(Nn(G,ue,$))),nt)break;G=G.return}0<Te.length&&(ie=new le(ie,ye,null,i,ce),he.push({event:ie,listeners:Te}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",le=e==="mouseout"||e==="pointerout",ie&&i!==xe&&(ye=i.relatedTarget||i.fromElement)&&(Ht(ye)||ye[Di]))break e;if((le||ie)&&(ie=ce.window===ce?ce:(ie=ce.ownerDocument)?ie.defaultView||ie.parentWindow:window,le?(ye=i.relatedTarget||i.toElement,le=Z,ye=ye?Ht(ye):null,ye!==null&&(nt=se(ye),Te=ye.tag,ye!==nt||Te!==5&&Te!==27&&Te!==6)&&(ye=null)):(le=null,ye=Z),le!==ye)){if(Te=Gc,ue="onMouseLeave",Y="onMouseEnter",G="mouse",(e==="pointerout"||e==="pointerover")&&(Te=Fc,ue="onPointerLeave",Y="onPointerEnter",G="pointer"),nt=le==null?ie:zs(le),$=ye==null?ie:zs(ye),ie=new Te(ue,G+"leave",le,i,ce),ie.target=nt,ie.relatedTarget=$,ue=null,Ht(ce)===Z&&(Te=new Te(Y,G+"enter",ye,i,ce),Te.target=$,Te.relatedTarget=nt,ue=Te),nt=ue,le&&ye)t:{for(Te=Rv,Y=le,G=ye,$=0,ue=Y;ue;ue=Te(ue))$++;ue=0;for(var De=G;De;De=Te(De))ue++;for(;0<$-ue;)Y=Te(Y),$--;for(;0<ue-$;)G=Te(G),ue--;for(;$--;){if(Y===G||G!==null&&Y===G.alternate){Te=Y;break t}Y=Te(Y),G=Te(G)}Te=null}else Te=null;le!==null&&Nf(he,ie,le,Te,!1),ye!==null&&nt!==null&&Nf(he,nt,ye,Te,!0)}}e:{if(ie=Z?zs(Z):window,le=ie.nodeName&&ie.nodeName.toLowerCase(),le==="select"||le==="input"&&ie.type==="file")var Qe=Jc;else if(Zc(ie))if(eu)Qe=q_;else{Qe=z_;var Ee=N_}else le=ie.nodeName,!le||le.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?Z&&H(Z.elementType)&&(Qe=Jc):Qe=U_;if(Qe&&(Qe=Qe(e,Z))){Qc(he,Qe,i,ce);break e}Ee&&Ee(e,ie,Z),e==="focusout"&&Z&&ie.type==="number"&&Z.memoizedProps.value!=null&&fr(ie,"number",ie.value)}switch(Ee=Z?zs(Z):window,e){case"focusin":(Zc(Ee)||Ee.contentEditable==="true")&&(vr=Ee,Bl=Z,fn=null);break;case"focusout":fn=Bl=vr=null;break;case"mousedown":jl=!0;break;case"contextmenu":case"mouseup":case"dragend":jl=!1,ou(he,i,ce);break;case"selectionchange":if(P_)break;case"keydown":case"keyup":ou(he,i,ce)}var Be;if(Ml)e:{switch(e){case"compositionstart":var Pe="onCompositionStart";break e;case"compositionend":Pe="onCompositionEnd";break e;case"compositionupdate":Pe="onCompositionUpdate";break e}Pe=void 0}else _r?$c(e,i)&&(Pe="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Pe="onCompositionStart");Pe&&(Kc&&i.locale!=="ko"&&(_r||Pe!=="onCompositionStart"?Pe==="onCompositionEnd"&&_r&&(Be=pi()):(si=ce,rn="value"in si?si.value:si.textContent,_r=!0)),Ee=$a(Z,Pe),0<Ee.length&&(Pe=new Wc(Pe,e,null,i,ce),he.push({event:Pe,listeners:Ee}),Be?Pe.data=Be:(Be=Xc(i),Be!==null&&(Pe.data=Be)))),(Be=k_?O_(e,i):B_(e,i))&&(Pe=$a(Z,"onBeforeInput"),0<Pe.length&&(Ee=new Wc("onBeforeInput","beforeinput",null,i,ce),he.push({event:Ee,listeners:Pe}),Ee.data=Be)),xv(he,e,Z,i,ce)}jf(he,t)})}function Nn(e,t,i){return{instance:e,listener:t,currentTarget:i}}function $a(e,t){for(var i=t+"Capture",s=[];e!==null;){var r=e,n=r.stateNode;if(r=r.tag,r!==5&&r!==26&&r!==27||n===null||(r=Li(e,i),r!=null&&s.unshift(Nn(e,r,n)),r=Li(e,t),r!=null&&s.push(Nn(e,r,n))),e.tag===3)return s;e=e.return}return[]}function Rv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Nf(e,t,i,s,r){for(var n=t._reactName,S=[];i!==null&&i!==s;){var M=i,I=M.alternate,Z=M.stateNode;if(M=M.tag,I!==null&&I===s)break;M!==5&&M!==26&&M!==27||Z===null||(I=Z,r?(Z=Li(i,n),Z!=null&&S.unshift(Nn(i,Z,I))):r||(Z=Li(i,n),Z!=null&&S.push(Nn(i,Z,I)))),i=i.return}S.length!==0&&e.push({event:t,listeners:S})}var Mv=/\r\n?/g,Lv=/\u0000|\uFFFD/g;function zf(e){return(typeof e=="string"?e:""+e).replace(Mv,`
9
- `).replace(Lv,"")}function Uf(e,t){return t=zf(t),zf(e)===t}function rt(e,t,i,s,r,n){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||cs(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&cs(e,""+s);break;case"className":Mi(e,"class",s);break;case"tabIndex":Mi(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Mi(e,i,s);break;case"style":ra(e,s,n);break;case"data":if(t!=="object"){Mi(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=de(""+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 n=="function"&&(i==="formAction"?(t!=="input"&&rt(e,t,"name",r.name,r,null),rt(e,t,"formEncType",r.formEncType,r,null),rt(e,t,"formMethod",r.formMethod,r,null),rt(e,t,"formTarget",r.formTarget,r,null)):(rt(e,t,"encType",r.encType,r,null),rt(e,t,"method",r.method,r,null),rt(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=de(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=we);break;case"onScroll":s!=null&&ze("scroll",e);break;case"onScrollEnd":s!=null&&ze("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(j(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(j(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=de(""+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":ze("beforetoggle",e),ze("toggle",e),Ri(e,"popover",s);break;case"xlinkActuate":vi(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":vi(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":vi(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":vi(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":vi(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":vi(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":vi(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":vi(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":vi(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Ri(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=J.get(i)||i,Ri(e,i,s))}}function lc(e,t,i,s,r,n){switch(i){case"style":ra(e,s,n);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(j(61));if(i=s.__html,i!=null){if(r.children!=null)throw Error(j(60));e.innerHTML=i}}break;case"children":typeof s=="string"?cs(e,s):(typeof s=="number"||typeof s=="bigint")&&cs(e,""+s);break;case"onScroll":s!=null&&ze("scroll",e);break;case"onScrollEnd":s!=null&&ze("scrollend",e);break;case"onClick":s!=null&&(e.onclick=we);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qr.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(r=i.endsWith("Capture"),t=i.slice(2,r?i.length-7:void 0),n=e[jt]||null,n=n!=null?n[i]:null,typeof n=="function"&&e.removeEventListener(t,n,r),typeof s=="function")){typeof n!="function"&&n!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,r);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Ri(e,i,s)}}}function qt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",e),ze("load",e);var s=!1,r=!1,n;for(n in i)if(i.hasOwnProperty(n)){var S=i[n];if(S!=null)switch(n){case"src":s=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(j(137,t));default:rt(e,t,n,S,i,null)}}r&&rt(e,t,"srcSet",i.srcSet,i,null),s&&rt(e,t,"src",i.src,i,null);return;case"input":ze("invalid",e);var M=n=S=r=null,I=null,Z=null;for(s in i)if(i.hasOwnProperty(s)){var ce=i[s];if(ce!=null)switch(s){case"name":r=ce;break;case"type":S=ce;break;case"checked":I=ce;break;case"defaultChecked":Z=ce;break;case"value":n=ce;break;case"defaultValue":M=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(j(137,t));break;default:rt(e,t,s,ce,i,null)}}ea(e,n,M,I,Z,S,r,!1);return;case"select":ze("invalid",e),s=S=n=null;for(r in i)if(i.hasOwnProperty(r)&&(M=i[r],M!=null))switch(r){case"value":n=M;break;case"defaultValue":S=M;break;case"multiple":s=M;default:rt(e,t,r,M,i,null)}t=n,i=S,e.multiple=!!s,t!=null?mi(e,!!s,t,!1):i!=null&&mi(e,!!s,i,!0);return;case"textarea":ze("invalid",e),n=r=s=null;for(S in i)if(i.hasOwnProperty(S)&&(M=i[S],M!=null))switch(S){case"value":s=M;break;case"defaultValue":r=M;break;case"children":n=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(j(91));break;default:rt(e,t,S,M,i,null)}ta(e,s,r,n);return;case"option":for(I in i)i.hasOwnProperty(I)&&(s=i[I],s!=null)&&(I==="selected"?e.selected=s&&typeof s!="function"&&typeof s!="symbol":rt(e,t,I,s,i,null));return;case"dialog":ze("beforetoggle",e),ze("toggle",e),ze("cancel",e),ze("close",e);break;case"iframe":case"object":ze("load",e);break;case"video":case"audio":for(s=0;s<Hn.length;s++)ze(Hn[s],e);break;case"image":ze("error",e),ze("load",e);break;case"details":ze("toggle",e);break;case"embed":case"source":case"link":ze("error",e),ze("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(Z in i)if(i.hasOwnProperty(Z)&&(s=i[Z],s!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":throw Error(j(137,t));default:rt(e,t,Z,s,i,null)}return;default:if(H(t)){for(ce in i)i.hasOwnProperty(ce)&&(s=i[ce],s!==void 0&&lc(e,t,ce,s,i,void 0));return}}for(M in i)i.hasOwnProperty(M)&&(s=i[M],s!=null&&rt(e,t,M,s,i,null))}function kv(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 r=null,n=null,S=null,M=null,I=null,Z=null,ce=null;for(le in i){var he=i[le];if(i.hasOwnProperty(le)&&he!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":I=he;default:s.hasOwnProperty(le)||rt(e,t,le,null,s,he)}}for(var ie in s){var le=s[ie];if(he=i[ie],s.hasOwnProperty(ie)&&(le!=null||he!=null))switch(ie){case"type":n=le;break;case"name":r=le;break;case"checked":Z=le;break;case"defaultChecked":ce=le;break;case"value":S=le;break;case"defaultValue":M=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(j(137,t));break;default:le!==he&&rt(e,t,ie,le,s,he)}}hr(e,S,M,I,Z,ce,n,r);return;case"select":le=S=M=ie=null;for(n in i)if(I=i[n],i.hasOwnProperty(n)&&I!=null)switch(n){case"value":break;case"multiple":le=I;default:s.hasOwnProperty(n)||rt(e,t,n,null,s,I)}for(r in s)if(n=s[r],I=i[r],s.hasOwnProperty(r)&&(n!=null||I!=null))switch(r){case"value":ie=n;break;case"defaultValue":M=n;break;case"multiple":S=n;default:n!==I&&rt(e,t,r,n,s,I)}t=M,i=S,s=le,ie!=null?mi(e,!!i,ie,!1):!!s!=!!i&&(t!=null?mi(e,!!i,t,!0):mi(e,!!i,i?[]:"",!1));return;case"textarea":le=ie=null;for(M in i)if(r=i[M],i.hasOwnProperty(M)&&r!=null&&!s.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:rt(e,t,M,null,s,r)}for(S in s)if(r=s[S],n=i[S],s.hasOwnProperty(S)&&(r!=null||n!=null))switch(S){case"value":ie=r;break;case"defaultValue":le=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(j(91));break;default:r!==n&&rt(e,t,S,r,s,n)}sn(e,ie,le);return;case"option":for(var ye in i)ie=i[ye],i.hasOwnProperty(ye)&&ie!=null&&!s.hasOwnProperty(ye)&&(ye==="selected"?e.selected=!1:rt(e,t,ye,null,s,ie));for(I in s)ie=s[I],le=i[I],s.hasOwnProperty(I)&&ie!==le&&(ie!=null||le!=null)&&(I==="selected"?e.selected=ie&&typeof ie!="function"&&typeof ie!="symbol":rt(e,t,I,ie,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 Te in i)ie=i[Te],i.hasOwnProperty(Te)&&ie!=null&&!s.hasOwnProperty(Te)&&rt(e,t,Te,null,s,ie);for(Z in s)if(ie=s[Z],le=i[Z],s.hasOwnProperty(Z)&&ie!==le&&(ie!=null||le!=null))switch(Z){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(j(137,t));break;default:rt(e,t,Z,ie,s,le)}return;default:if(H(t)){for(var nt in i)ie=i[nt],i.hasOwnProperty(nt)&&ie!==void 0&&!s.hasOwnProperty(nt)&&lc(e,t,nt,void 0,s,ie);for(ce in s)ie=s[ce],le=i[ce],!s.hasOwnProperty(ce)||ie===le||ie===void 0&&le===void 0||lc(e,t,ce,ie,s,le);return}}for(var Y in i)ie=i[Y],i.hasOwnProperty(Y)&&ie!=null&&!s.hasOwnProperty(Y)&&rt(e,t,Y,null,s,ie);for(he in s)ie=s[he],le=i[he],!s.hasOwnProperty(he)||ie===le||ie==null&&le==null||rt(e,t,he,ie,s,le)}function qf(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ov(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var r=i[s],n=r.transferSize,S=r.initiatorType,M=r.duration;if(n&&M&&qf(S)){for(S=0,M=r.responseEnd,s+=1;s<i.length;s++){var I=i[s],Z=I.startTime;if(Z>M)break;var ce=I.transferSize,he=I.initiatorType;ce&&qf(he)&&(I=I.responseEnd,S+=ce*(I<M?1:(M-Z)/(I-Z)))}if(--s,t+=8*(n+S)/(r.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 oc=null,cc=null;function Xa(e){return e.nodeType===9?e:e.ownerDocument}function If(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 uc(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 hc=null;function Bv(){var e=window.event;return e&&e.type==="popstate"?e===hc?!1:(hc=e,!0):(hc=null,!1)}var Gf=typeof setTimeout=="function"?setTimeout:void 0,jv=typeof clearTimeout=="function"?clearTimeout:void 0,Wf=typeof Promise=="function"?Promise:void 0,Hv=typeof queueMicrotask=="function"?queueMicrotask:typeof Wf<"u"?function(e){return Wf.resolve(null).then(e).catch(Nv)}:Gf;function Nv(e){setTimeout(function(){throw e})}function Ts(e){return e==="head"}function Ff(e,t){var i=t,s=0;do{var r=i.nextSibling;if(e.removeChild(i),r&&r.nodeType===8)if(i=r.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(r),Pr(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")zn(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,zn(i);for(var n=i.firstChild;n;){var S=n.nextSibling,M=n.nodeName;n[Ns]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&n.rel.toLowerCase()==="stylesheet"||i.removeChild(n),n=S}}else i==="body"&&zn(e.ownerDocument.body);i=r}while(i);Pr(t)}function Kf(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 fc(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":fc(i),Gt(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function zv(e,t,i,s){for(;e.nodeType===1;){var r=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Ns])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(n=e.getAttribute("rel"),n==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(n!==r.rel||e.getAttribute("href")!==(r.href==null||r.href===""?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(n=e.getAttribute("src"),(n!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&n&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var n=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===n)return e}else return e;if(e=Ei(e.nextSibling),e===null)break}return null}function Uv(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Ei(e.nextSibling),e===null))return null;return e}function Yf(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ei(e.nextSibling),e===null))return null;return e}function dc(e){return e.data==="$?"||e.data==="$~"}function _c(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function qv(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 Ei(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 vc=null;function Vf(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Ei(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function $f(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 Xf(e,t,i){switch(t=Xa(i),e){case"html":if(e=t.documentElement,!e)throw Error(j(452));return e;case"head":if(e=t.head,!e)throw Error(j(453));return e;case"body":if(e=t.body,!e)throw Error(j(454));return e;default:throw Error(j(451))}}function zn(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Gt(e)}var xi=new Map,Zf=new Set;function Za(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var rs=te.d;te.d={f:Iv,r:Pv,D:Gv,C:Wv,L:Fv,m:Kv,X:Vv,S:Yv,M:$v};function Iv(){var e=rs.f(),t=Pa();return e||t}function Pv(e){var t=ls(e);t!==null&&t.tag===5&&t.type==="form"?dh(t):rs.r(e)}var Ur=typeof document>"u"?null:document;function Qf(e,t,i){var s=Ur;if(s&&typeof t=="string"&&t){var r=Kt(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof i=="string"&&(r+='[crossorigin="'+i+'"]'),Zf.has(r)||(Zf.add(r),e={rel:e,crossOrigin:i,href:t},s.querySelector(r)===null&&(t=s.createElement("link"),qt(t,"link",e),bt(t),s.head.appendChild(t)))}}function Gv(e){rs.D(e),Qf("dns-prefetch",e,null)}function Wv(e,t){rs.C(e,t),Qf("preconnect",e,t)}function Fv(e,t,i){rs.L(e,t,i);var s=Ur;if(s&&e&&t){var r='link[rel="preload"][as="'+Kt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+Kt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+Kt(i.imageSizes)+'"]')):r+='[href="'+Kt(e)+'"]';var n=r;switch(t){case"style":n=qr(e);break;case"script":n=Ir(e)}xi.has(n)||(e=h({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),xi.set(n,e),s.querySelector(r)!==null||t==="style"&&s.querySelector(Un(n))||t==="script"&&s.querySelector(qn(n))||(t=s.createElement("link"),qt(t,"link",e),bt(t),s.head.appendChild(t)))}}function Kv(e,t){rs.m(e,t);var i=Ur;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Kt(s)+'"][href="'+Kt(e)+'"]',n=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=Ir(e)}if(!xi.has(n)&&(e=h({rel:"modulepreload",href:e},t),xi.set(n,e),i.querySelector(r)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(qn(n)))return}s=i.createElement("link"),qt(s,"link",e),bt(s),i.head.appendChild(s)}}}function Yv(e,t,i){rs.S(e,t,i);var s=Ur;if(s&&e){var r=os(s).hoistableStyles,n=qr(e);t=t||"default";var S=r.get(n);if(!S){var M={loading:0,preload:null};if(S=s.querySelector(Un(n)))M.loading=5;else{e=h({rel:"stylesheet",href:e,"data-precedence":t},i),(i=xi.get(n))&&mc(e,i);var I=S=s.createElement("link");bt(I),qt(I,"link",e),I._p=new Promise(function(Z,ce){I.onload=Z,I.onerror=ce}),I.addEventListener("load",function(){M.loading|=1}),I.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Qa(S,t,s)}S={type:"stylesheet",instance:S,count:1,state:M},r.set(n,S)}}}function Vv(e,t){rs.X(e,t);var i=Ur;if(i&&e){var s=os(i).hoistableScripts,r=Ir(e),n=s.get(r);n||(n=i.querySelector(qn(r)),n||(e=h({src:e,async:!0},t),(t=xi.get(r))&&pc(e,t),n=i.createElement("script"),bt(n),qt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function $v(e,t){rs.M(e,t);var i=Ur;if(i&&e){var s=os(i).hoistableScripts,r=Ir(e),n=s.get(r);n||(n=i.querySelector(qn(r)),n||(e=h({src:e,async:!0,type:"module"},t),(t=xi.get(r))&&pc(e,t),n=i.createElement("script"),bt(n),qt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function Jf(e,t,i,s){var r=(r=pe.current)?Za(r):null;if(!r)throw Error(j(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=qr(i.href),i=os(r).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=qr(i.href);var n=os(r).hoistableStyles,S=n.get(e);if(S||(r=r.ownerDocument||r,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},n.set(e,S),(n=r.querySelector(Un(e)))&&!n._p&&(S.instance=n,S.state.loading=5),xi.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},xi.set(e,i),n||Xv(r,e,i,S.state))),t&&s===null)throw Error(j(528,""));return S}if(t&&s!==null)throw Error(j(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ir(i),i=os(r).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(j(444,e))}}function qr(e){return'href="'+Kt(e)+'"'}function Un(e){return'link[rel="stylesheet"]['+e+"]"}function ed(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Xv(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}),qt(t,"link",i),bt(t),e.head.appendChild(t))}function Ir(e){return'[src="'+Kt(e)+'"]'}function qn(e){return"script[async]"+e}function td(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+Kt(i.href)+'"]');if(s)return t.instance=s,bt(s),s;var r=h({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),bt(s),qt(s,"style",r),Qa(s,i.precedence,e),t.instance=s;case"stylesheet":r=qr(i.href);var n=e.querySelector(Un(r));if(n)return t.state.loading|=4,t.instance=n,bt(n),n;s=ed(i),(r=xi.get(r))&&mc(s,r),n=(e.ownerDocument||e).createElement("link"),bt(n);var S=n;return S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),qt(n,"link",s),t.state.loading|=4,Qa(n,i.precedence,e),t.instance=n;case"script":return n=Ir(i.src),(r=e.querySelector(qn(n)))?(t.instance=r,bt(r),r):(s=i,(r=xi.get(n))&&(s=h({},i),pc(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),bt(r),qt(r,"link",s),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(j(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Qa(s,i.precedence,e));return t.instance}function Qa(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=s.length?s[s.length-1]:null,n=r,S=0;S<s.length;S++){var M=s[S];if(M.dataset.precedence===t)n=M;else if(n!==r)break}n?n.parentNode.insertBefore(e,n.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function pc(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 id(e,t,i){if(Ja===null){var s=new Map,r=Ja=new Map;r.set(i,s)}else r=Ja,s=r.get(i),s||(s=new Map,r.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),r=0;r<i.length;r++){var n=i[r];if(!(n[Ns]||n[pt]||e==="link"&&n.getAttribute("rel")==="stylesheet")&&n.namespaceURI!=="http://www.w3.org/2000/svg"){var S=n.getAttribute(t)||"";S=e+S;var M=s.get(S);M?M.push(n):s.set(S,[n])}}return s}function sd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function Zv(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;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!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 rd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Qv(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 r=qr(s.href),n=t.querySelector(Un(r));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=el.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=n,bt(n);return}n=t.ownerDocument||t,s=ed(s),(r=xi.get(r))&&mc(s,r),n=n.createElement("link"),bt(n);var S=n;S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),qt(n,"link",s),i.instance=n}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=el.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var gc=0;function Jv(e,t){return e.stylesheets&&e.count===0&&il(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&il(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&gc===0&&(gc=62500*Ov());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&il(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>gc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function el(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)il(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var tl=null;function il(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,tl=new Map,t.forEach(em,e),tl=null,el.call(e))}function em(e,t){if(!(t.state.loading&4)){var i=tl.get(e);if(i)var s=i.get(null);else{i=new Map,tl.set(e,i);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),n=0;n<r.length;n++){var S=r[n];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(i.set(S.dataset.precedence,S),s=S)}s&&i.set(null,s)}r=t.instance,S=r.getAttribute("data-precedence"),n=i.get(S)||s,n===s&&i.set(null,r),i.set(S,r),this.count++,s=el.bind(this),r.addEventListener("load",s),r.addEventListener("error",s),n?n.parentNode.insertBefore(r,n.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var In={$$typeof:l,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function tm(e,t,i,s,r,n,S,M,I){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=Vr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vr(0),this.hiddenUpdates=Vr(null),this.identifierPrefix=s,this.onUncaughtError=r,this.onCaughtError=n,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function nd(e,t,i,s,r,n,S,M,I,Z,ce,he){return e=new tm(e,t,i,S,I,Z,ce,he,M),t=1,n===!0&&(t|=24),n=ni(3,null,null,t),e.current=n,n.stateNode=e,t=Xl(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:s,isDehydrated:i,cache:t},eo(n),e}function ad(e){return e?(e=gr,e):gr}function ld(e,t,i,s,r,n){r=ad(r),s.context===null?s.context=r:s.pendingContext=r,s=ps(t),s.payload={element:i},n=n===void 0?null:n,n!==null&&(s.callback=n),i=gs(e,s,t),i!==null&&(ti(i,e,t),Sn(i,e,t))}function od(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Sc(e,t){od(e,t),(e=e.alternate)&&od(e,t)}function cd(e){if(e.tag===13||e.tag===31){var t=Gs(e,67108864);t!==null&&ti(t,e,67108864),Sc(e,67108864)}}function ud(e){if(e.tag===13||e.tag===31){var t=ui();t=Bt(t);var i=Gs(e,t);i!==null&&ti(i,e,t),Sc(e,t)}}var sl=!0;function im(e,t,i,s){var r=q.T;q.T=null;var n=te.p;try{te.p=2,bc(e,t,i,s)}finally{te.p=n,q.T=r}}function sm(e,t,i,s){var r=q.T;q.T=null;var n=te.p;try{te.p=8,bc(e,t,i,s)}finally{te.p=n,q.T=r}}function bc(e,t,i,s){if(sl){var r=yc(s);if(r===null)ac(e,t,s,rl,i),fd(e,s);else if(nm(r,e,t,i,s))s.stopPropagation();else if(fd(e,s),t&4&&-1<rm.indexOf(e)){for(;r!==null;){var n=ls(r);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var S=Pt(n.pendingLanes);if(S!==0){var M=n;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var I=1<<31-It(S);M.entanglements[1]|=I,S&=~I}Pi(n),(et&6)===0&&(qa=je()+500,jn(0))}}break;case 31:case 13:M=Gs(n,2),M!==null&&ti(M,n,2),Pa(),Sc(n,2)}if(n=yc(s),n===null&&ac(e,t,s,rl,i),n===r)break;r=n}r!==null&&s.stopPropagation()}else ac(e,t,s,null,i)}}function yc(e){return e=Re(e),Cc(e)}var rl=null;function Cc(e){if(rl=null,e=Ht(e),e!==null){var t=se(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=X(t),e!==null)return e;e=null}else if(i===31){if(e=u(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 rl=e,null}function hd(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(dt()){case Ge:return 2;case lt:return 8;case mt:case fi:return 32;case Lt:return 268435456;default:return 32}default:return 32}}var wc=!1,Rs=null,Ms=null,Ls=null,Pn=new Map,Gn=new Map,ks=[],rm="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 fd(e,t){switch(e){case"focusin":case"focusout":Rs=null;break;case"dragenter":case"dragleave":Ms=null;break;case"mouseover":case"mouseout":Ls=null;break;case"pointerover":case"pointerout":Pn.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gn.delete(t.pointerId)}}function Wn(e,t,i,s,r,n){return e===null||e.nativeEvent!==n?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:n,targetContainers:[r]},t!==null&&(t=ls(t),t!==null&&cd(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function nm(e,t,i,s,r){switch(t){case"focusin":return Rs=Wn(Rs,e,t,i,s,r),!0;case"dragenter":return Ms=Wn(Ms,e,t,i,s,r),!0;case"mouseover":return Ls=Wn(Ls,e,t,i,s,r),!0;case"pointerover":var n=r.pointerId;return Pn.set(n,Wn(Pn.get(n)||null,e,t,i,s,r)),!0;case"gotpointercapture":return n=r.pointerId,Gn.set(n,Wn(Gn.get(n)||null,e,t,i,s,r)),!0}return!1}function dd(e){var t=Ht(e.target);if(t!==null){var i=se(t);if(i!==null){if(t=i.tag,t===13){if(t=X(i),t!==null){e.blockedOn=t,Xr(e.priority,function(){ud(i)});return}}else if(t===31){if(t=u(i),t!==null){e.blockedOn=t,Xr(e.priority,function(){ud(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 nl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=yc(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);xe=s,i.target.dispatchEvent(s),xe=null}else return t=ls(i),t!==null&&cd(t),e.blockedOn=i,!1;t.shift()}return!0}function _d(e,t,i){nl(e)&&i.delete(t)}function am(){wc=!1,Rs!==null&&nl(Rs)&&(Rs=null),Ms!==null&&nl(Ms)&&(Ms=null),Ls!==null&&nl(Ls)&&(Ls=null),Pn.forEach(_d),Gn.forEach(_d)}function al(e,t){e.blockedOn===t&&(e.blockedOn=null,wc||(wc=!0,w.unstable_scheduleCallback(w.unstable_NormalPriority,am)))}var ll=null;function vd(e){ll!==e&&(ll=e,w.unstable_scheduleCallback(w.unstable_NormalPriority,function(){ll===e&&(ll=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],r=e[t+2];if(typeof s!="function"){if(Cc(s||i)===null)continue;break}var n=ls(i);n!==null&&(e.splice(t,3),t-=3,yo(n,{pending:!0,data:r,method:i.method,action:s},s,r))}}))}function Pr(e){function t(I){return al(I,e)}Rs!==null&&al(Rs,e),Ms!==null&&al(Ms,e),Ls!==null&&al(Ls,e),Pn.forEach(t),Gn.forEach(t);for(var i=0;i<ks.length;i++){var s=ks[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<ks.length&&(i=ks[0],i.blockedOn===null);)dd(i),i.blockedOn===null&&ks.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var r=i[s],n=i[s+1],S=r[jt]||null;if(typeof n=="function")S||vd(i);else if(S){var M=null;if(n&&n.hasAttribute("formAction")){if(r=n,S=n[jt]||null)M=S.formAction;else if(Cc(r)!==null)continue}else M=S.action;typeof M=="function"?i[s+1]=M:(i.splice(s,3),s-=3),vd(i)}}}function md(){function e(n){n.canIntercept&&n.info==="react-transition"&&n.intercept({handler:function(){return new Promise(function(S){return r=S})},focusReset:"manual",scroll:"manual"})}function t(){r!==null&&(r(),r=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var n=navigation.currentEntry;n&&n.url!=null&&navigation.navigate(n.url,{state:n.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,r=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),r!==null&&(r(),r=null)}}}function Ec(e){this._internalRoot=e}ol.prototype.render=Ec.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(j(409));var i=t.current,s=ui();ld(i,s,e,t,null,null)},ol.prototype.unmount=Ec.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ld(e.current,2,null,e,null,null),Pa(),t[Di]=null}};function ol(e){this._internalRoot=e}ol.prototype.unstable_scheduleHydration=function(e){if(e){var t=Gi();e={blockedOn:null,target:e,priority:t};for(var i=0;i<ks.length&&t!==0&&t<ks[i].priority;i++);ks.splice(i,0,e),i===0&&dd(e)}};var pd=B.version;if(pd!=="19.2.8")throw Error(j(527,pd,"19.2.8"));te.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(j(188)):(e=Object.keys(e).join(","),Error(j(268,e)));return e=d(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var lm={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var cl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cl.isDisabled&&cl.supportsFiber)try{Ni=cl.inject(lm),kt=cl}catch{}}return Kn.createRoot=function(e,t){if(!ee(e))throw Error(j(299));var i=!1,s="",r=wh,n=Eh,S=xh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(n=t.onCaughtError),t.onRecoverableError!==void 0&&(S=t.onRecoverableError)),t=nd(e,1,!1,null,null,i,s,null,r,n,S,md),e[Di]=t.current,nc(e),new Ec(t)},Kn.hydrateRoot=function(e,t,i){if(!ee(e))throw Error(j(299));var s=!1,r="",n=wh,S=Eh,M=xh,I=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(n=i.onUncaughtError),i.onCaughtError!==void 0&&(S=i.onCaughtError),i.onRecoverableError!==void 0&&(M=i.onRecoverableError),i.formState!==void 0&&(I=i.formState)),t=nd(e,1,!0,t,i??null,s,r,I,n,S,M,md),t.context=ad(null),i=t.current,s=ui(),s=Bt(s),r=ps(s),r.callback=null,gs(i,r,s),i=s,t.current.lanes=i,Hs(t,i),Pi(t),e[Di]=t.current,nc(e),new ol(t)},Kn.version="19.2.8",Kn}var Dd;function pm(){if(Dd)return Dc.exports;Dd=1;function w(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(w)}catch(B){console.error(B)}}return w(),Dc.exports=mm(),Dc.exports}var gm=pm(),Lc={exports:{}},Td;function Sm(){return Td||(Td=1,(function(w,B){(function(O,j){w.exports=j()})(globalThis,(()=>(()=>{var O={4567:function(X,u,f){var d=this&&this.__decorate||function(a,l,_,x){var E,D=arguments.length,g=D<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(a,l,_,x);else for(var T=a.length-1;T>=0;T--)(E=a[T])&&(g=(D<3?E(g):D>3?E(l,_,g):E(l,_))||g);return D>3&&g&&Object.defineProperty(l,_,g),g},y=this&&this.__param||function(a,l){return function(_,x){l(_,x,a)}};Object.defineProperty(u,"__esModule",{value:!0}),u.AccessibilityManager=void 0;const h=f(9042),v=f(9924),b=f(844),C=f(4725),m=f(2585),o=f(3656);let c=u.AccessibilityManager=class extends b.Disposable{constructor(a,l,_,x){super(),this._terminal=a,this._coreBrowserService=_,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 E=0;E<this._terminal.rows;E++)this._rowElements[E]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[E]);if(this._topBoundaryFocusListener=E=>this._handleBoundaryFocus(E,0),this._bottomBoundaryFocusListener=E=>this._handleBoundaryFocus(E,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 v.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((E=>this._handleResize(E.rows)))),this.register(this._terminal.onRender((E=>this._refreshRows(E.start,E.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((E=>this._handleChar(E)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
10
- `)))),this.register(this._terminal.onA11yTab((E=>this._handleTab(E)))),this.register(this._terminal.onKey((E=>this._handleKey(E.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,o.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(a){for(let l=0;l<a;l++)this._handleChar(" ")}_handleChar(a){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==a&&(this._charsToAnnounce+=a):this._charsToAnnounce+=a,a===`
11
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=h.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(a){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(a)||this._charsToConsume.push(a)}_refreshRows(a,l){this._liveRegionDebouncer.refresh(a,l,this._terminal.rows)}_renderRows(a,l){const _=this._terminal.buffer,x=_.lines.length.toString();for(let E=a;E<=l;E++){const D=_.lines.get(_.ydisp+E),g=[],T=D?.translateToString(!0,void 0,void 0,g)||"",U=(_.ydisp+E+1).toString(),P=this._rowElements[E];P&&(T.length===0?(P.innerText=" ",this._rowColumns.set(P,[0,1])):(P.textContent=T,this._rowColumns.set(P,g)),P.setAttribute("aria-posinset",U),P.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(a,l){const _=a.target,x=this._rowElements[l===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||a.relatedTarget!==x)return;let E,D;if(l===0?(E=_,D=this._rowElements.pop(),this._rowContainer.removeChild(D)):(E=this._rowElements.shift(),D=_,this._rowContainer.removeChild(E)),E.removeEventListener("focus",this._topBoundaryFocusListener),D.removeEventListener("focus",this._bottomBoundaryFocusListener),l===0){const g=this._createAccessibilityTreeNode();this._rowElements.unshift(g),this._rowContainer.insertAdjacentElement("afterbegin",g)}else{const g=this._createAccessibilityTreeNode();this._rowElements.push(g),this._rowContainer.appendChild(g)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(l===0?-1:1),this._rowElements[l===0?1:this._rowElements.length-2].focus(),a.preventDefault(),a.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const a=document.getSelection();if(!a)return;if(a.isCollapsed)return void(this._rowContainer.contains(a.anchorNode)&&this._terminal.clearSelection());if(!a.anchorNode||!a.focusNode)return void console.error("anchorNode and/or focusNode are null");let l={node:a.anchorNode,offset:a.anchorOffset},_={node:a.focusNode,offset:a.focusOffset};if((l.node.compareDocumentPosition(_.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===_.node&&l.offset>_.offset)&&([l,_]=[_,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.node))return;const x=this._rowElements.slice(-1)[0];if(_.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(_={node:x,offset:x.textContent?.length??0}),!this._rowContainer.contains(_.node))return;const E=({node:T,offset:U})=>{const P=T instanceof Text?T.parentNode:T;let W=parseInt(P?.getAttribute("aria-posinset"),10)-1;if(isNaN(W))return console.warn("row is invalid. Race condition?"),null;const N=this._rowColumns.get(P);if(!N)return console.warn("columns is null. Race condition?"),null;let Q=U<N.length?N[U]:N.slice(-1)[0]+1;return Q>=this._terminal.cols&&(++W,Q=0),{row:W,column:Q}},D=E(l),g=E(_);if(D&&g){if(D.row>g.row||D.row===g.row&&D.column>=g.column)throw new Error("invalid range");this._terminal.select(D.column,D.row,(g.row-D.row)*this._terminal.cols-D.column+g.column)}}_handleResize(a){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);for(;this._rowElements.length>a;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const a=this._coreBrowserService.mainDocument.createElement("div");return a.setAttribute("role","listitem"),a.tabIndex=-1,this._refreshRowDimensions(a),a}_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 a=0;a<this._terminal.rows;a++)this._refreshRowDimensions(this._rowElements[a])}}_refreshRowDimensions(a){a.style.height=`${this._renderService.dimensions.css.cell.height}px`}};u.AccessibilityManager=c=d([y(1,m.IInstantiationService),y(2,C.ICoreBrowserService),y(3,C.IRenderService)],c)},3614:(X,u)=>{function f(v){return v.replace(/\r?\n/g,"\r")}function d(v,b){return b?"\x1B[200~"+v+"\x1B[201~":v}function y(v,b,C,m){v=d(v=f(v),C.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),C.triggerDataEvent(v,!0),b.value=""}function h(v,b,C){const m=C.getBoundingClientRect(),o=v.clientX-m.left-10,c=v.clientY-m.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${o}px`,b.style.top=`${c}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(u,"__esModule",{value:!0}),u.rightClickHandler=u.moveTextAreaUnderMouseCursor=u.paste=u.handlePasteEvent=u.copyHandler=u.bracketTextForPaste=u.prepareTextForTerminal=void 0,u.prepareTextForTerminal=f,u.bracketTextForPaste=d,u.copyHandler=function(v,b){v.clipboardData&&v.clipboardData.setData("text/plain",b.selectionText),v.preventDefault()},u.handlePasteEvent=function(v,b,C,m){v.stopPropagation(),v.clipboardData&&y(v.clipboardData.getData("text/plain"),b,C,m)},u.paste=y,u.moveTextAreaUnderMouseCursor=h,u.rightClickHandler=function(v,b,C,m,o){h(v,b,C),o&&m.rightClickSelect(v),b.value=m.selectionText,b.select()}},7239:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ColorContrastCache=void 0;const d=f(1505);u.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(y,h,v){this._css.set(y,h,v)}getCss(y,h){return this._css.get(y,h)}setColor(y,h,v){this._color.set(y,h,v)}getColor(y,h){return this._color.get(y,h)}clear(){this._color.clear(),this._css.clear()}}},3656:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.addDisposableDomListener=void 0,u.addDisposableDomListener=function(f,d,y,h){f.addEventListener(d,y,h);let v=!1;return{dispose:()=>{v||(v=!0,f.removeEventListener(d,y,h))}}}},3551:function(X,u,f){var d=this&&this.__decorate||function(c,a,l,_){var x,E=arguments.length,D=E<3?a:_===null?_=Object.getOwnPropertyDescriptor(a,l):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(c,a,l,_);else for(var g=c.length-1;g>=0;g--)(x=c[g])&&(D=(E<3?x(D):E>3?x(a,l,D):x(a,l))||D);return E>3&&D&&Object.defineProperty(a,l,D),D},y=this&&this.__param||function(c,a){return function(l,_){a(l,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.Linkifier=void 0;const h=f(3656),v=f(8460),b=f(844),C=f(2585),m=f(4725);let o=u.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(c,a,l,_,x){super(),this._element=c,this._mouseService=a,this._renderService=l,this._bufferService=_,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new v.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new v.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,h.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,h.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,h.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(c){this._lastMouseEvent=c;const a=this._positionFromMouseEvent(c,this._element,this._mouseService);if(!a)return;this._isMouseOut=!1;const l=c.composedPath();for(let _=0;_<l.length;_++){const x=l[_];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&a.x===this._lastBufferCell.x&&a.y===this._lastBufferCell.y||(this._handleHover(a),this._lastBufferCell=a)}_handleHover(c){if(this._activeLine!==c.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(c,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,c)||(this._clearCurrentLink(),this._askForLink(c,!0))}_askForLink(c,a){this._activeProviderReplies&&a||(this._activeProviderReplies?.forEach((_=>{_?.forEach((x=>{x.link.dispose&&x.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=c.y);let l=!1;for(const[_,x]of this._linkProviderService.linkProviders.entries())a?this._activeProviderReplies?.get(_)&&(l=this._checkLinkProviderResult(_,c,l)):x.provideLinks(c.y,(E=>{if(this._isMouseOut)return;const D=E?.map((g=>({link:g})));this._activeProviderReplies?.set(_,D),l=this._checkLinkProviderResult(_,c,l),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(c.y,this._activeProviderReplies)}))}_removeIntersectingLinks(c,a){const l=new Set;for(let _=0;_<a.size;_++){const x=a.get(_);if(x)for(let E=0;E<x.length;E++){const D=x[E],g=D.link.range.start.y<c?0:D.link.range.start.x,T=D.link.range.end.y>c?this._bufferService.cols:D.link.range.end.x;for(let U=g;U<=T;U++){if(l.has(U)){x.splice(E--,1);break}l.add(U)}}}}_checkLinkProviderResult(c,a,l){if(!this._activeProviderReplies)return l;const _=this._activeProviderReplies.get(c);let x=!1;for(let E=0;E<c;E++)this._activeProviderReplies.has(E)&&!this._activeProviderReplies.get(E)||(x=!0);if(!x&&_){const E=_.find((D=>this._linkAtPosition(D.link,a)));E&&(l=!0,this._handleNewLink(E))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let E=0;E<this._activeProviderReplies.size;E++){const D=this._activeProviderReplies.get(E)?.find((g=>this._linkAtPosition(g.link,a)));if(D){l=!0,this._handleNewLink(D);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(c){if(!this._currentLink)return;const a=this._positionFromMouseEvent(c,this._element,this._mouseService);a&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,a)&&this._currentLink.link.activate(c,this._currentLink.link.text)}_clearCurrentLink(c,a){this._currentLink&&this._lastMouseEvent&&(!c||!a||this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=a)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(c){if(!this._lastMouseEvent)return;const a=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);a&&this._linkAtPosition(c.link,a)&&(this._currentLink=c,this._currentLink.state={decorations:{underline:c.link.decorations===void 0||c.link.decorations.underline,pointerCursor:c.link.decorations===void 0||c.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,c.link,this._lastMouseEvent),c.link.decorations={},Object.defineProperties(c.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:l=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:l=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(c.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((l=>{if(!this._currentLink)return;const _=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(_,x),this._lastMouseEvent)){const E=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);E&&this._askForLink(E,!1)}}))))}_linkHover(c,a,l){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!0),this._currentLink.state.decorations.pointerCursor&&c.classList.add("xterm-cursor-pointer")),a.hover&&a.hover(l,a.text)}_fireUnderlineEvent(c,a){const l=c.range,_=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-_-1,l.end.x,l.end.y-_-1,void 0);(a?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(c,a,l){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(a,!1),this._currentLink.state.decorations.pointerCursor&&c.classList.remove("xterm-cursor-pointer")),a.leave&&a.leave(l,a.text)}_linkAtPosition(c,a){const l=c.range.start.y*this._bufferService.cols+c.range.start.x,_=c.range.end.y*this._bufferService.cols+c.range.end.x,x=a.y*this._bufferService.cols+a.x;return l<=x&&x<=_}_positionFromMouseEvent(c,a,l){const _=l.getCoords(c,a,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(c,a,l,_,x){return{x1:c,y1:a,x2:l,y2:_,cols:this._bufferService.cols,fg:x}}};u.Linkifier=o=d([y(1,m.IMouseService),y(2,m.IRenderService),y(3,C.IBufferService),y(4,m.ILinkProviderService)],o)},9042:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.tooMuchOutput=u.promptLabel=void 0,u.promptLabel="Terminal input",u.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(X,u,f){var d=this&&this.__decorate||function(m,o,c,a){var l,_=arguments.length,x=_<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,c):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(m,o,c,a);else for(var E=m.length-1;E>=0;E--)(l=m[E])&&(x=(_<3?l(x):_>3?l(o,c,x):l(o,c))||x);return _>3&&x&&Object.defineProperty(o,c,x),x},y=this&&this.__param||function(m,o){return function(c,a){o(c,a,m)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OscLinkProvider=void 0;const h=f(511),v=f(2585);let b=u.OscLinkProvider=class{constructor(m,o,c){this._bufferService=m,this._optionsService=o,this._oscLinkService=c}provideLinks(m,o){const c=this._bufferService.buffer.lines.get(m-1);if(!c)return void o(void 0);const a=[],l=this._optionsService.rawOptions.linkHandler,_=new h.CellData,x=c.getTrimmedLength();let E=-1,D=-1,g=!1;for(let T=0;T<x;T++)if(D!==-1||c.hasContent(T)){if(c.loadCell(T,_),_.hasExtendedAttrs()&&_.extended.urlId){if(D===-1){D=T,E=_.extended.urlId;continue}g=_.extended.urlId!==E}else D!==-1&&(g=!0);if(g||D!==-1&&T===x-1){const U=this._oscLinkService.getLinkData(E)?.uri;if(U){const P={start:{x:D+1,y:m},end:{x:T+(g||T!==x-1?0:1),y:m}};let W=!1;if(!l?.allowNonHttpProtocols)try{const N=new URL(U);["http:","https:"].includes(N.protocol)||(W=!0)}catch{W=!0}W||a.push({text:U,range:P,activate:(N,Q)=>l?l.activate(N,Q,P):C(0,Q),hover:(N,Q)=>l?.hover?.(N,Q,P),leave:(N,Q)=>l?.leave?.(N,Q,P)})}g=!1,_.hasExtendedAttrs()&&_.extended.urlId?(D=T,E=_.extended.urlId):(D=-1,E=-1)}}o(a)}};function C(m,o){if(confirm(`Do you want to navigate to ${o}?
12
-
13
- WARNING: This link could potentially be dangerous`)){const c=window.open();if(c){try{c.opener=null}catch{}c.location.href=o}else console.warn("Opening link blocked as opener could not be cleared")}}u.OscLinkProvider=b=d([y(0,v.IBufferService),y(1,v.IOptionsService),y(2,v.IOscLinkService)],b)},6193:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.RenderDebouncer=void 0,u.RenderDebouncer=class{constructor(f,d){this._renderCallback=f,this._coreBrowserService=d,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(f){return this._refreshCallbacks.push(f),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(f,d,y){this._rowCount=y,f=f!==void 0?f:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,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 f=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const f of this._refreshCallbacks)f(0);this._refreshCallbacks=[]}}},3236:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Terminal=void 0;const d=f(3614),y=f(3656),h=f(3551),v=f(9042),b=f(3730),C=f(1680),m=f(3107),o=f(5744),c=f(2950),a=f(1296),l=f(428),_=f(4269),x=f(5114),E=f(8934),D=f(3230),g=f(9312),T=f(4725),U=f(6731),P=f(8055),W=f(8969),N=f(8460),Q=f(844),ae=f(6114),q=f(8437),te=f(2584),V=f(7399),R=f(5941),z=f(9074),A=f(2585),k=f(5435),K=f(4567),re=f(779);class me extends W.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(F={}){super(F),this.browser=ae,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new Q.MutableDisposable),this._onCursorMove=this.register(new N.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new N.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new N.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new N.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new N.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new N.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new N.EventEmitter),this._onBlur=this.register(new N.EventEmitter),this._onA11yCharEmitter=this.register(new N.EventEmitter),this._onA11yTabEmitter=this.register(new N.EventEmitter),this._onWillOpen=this.register(new N.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(z.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(re.LinkProviderService),this._instantiationService.setService(T.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((L,ne)=>this.refresh(L,ne)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((L=>this._reportWindowsOptions(L)))),this.register(this._inputHandler.onColor((L=>this._handleColorEvent(L)))),this.register((0,N.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,N.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,N.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((L=>this._afterResize(L.cols,L.rows)))),this.register((0,Q.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(F){if(this._themeService)for(const L of F){let ne,ve="";switch(L.index){case 256:ne="foreground",ve="10";break;case 257:ne="background",ve="11";break;case 258:ne="cursor",ve="12";break;default:ne="ansi",ve="4;"+L.index}switch(L.type){case 0:const Se=P.color.toColorRGB(ne==="ansi"?this._themeService.colors.ansi[L.index]:this._themeService.colors[ne]);this.coreService.triggerDataEvent(`${te.C0.ESC}]${ve};${(0,R.toRgbString)(Se)}${te.C1_ESCAPED.ST}`);break;case 1:if(ne==="ansi")this._themeService.modifyColors((be=>be.ansi[L.index]=P.channels.toColor(...L.color)));else{const be=ne;this._themeService.modifyColors((Me=>Me[be]=P.channels.toColor(...L.color)))}break;case 2:this._themeService.restoreColor(L.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(F){F?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(F){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(te.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(te.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 F=this.buffer.ybase+this.buffer.y,L=this.buffer.lines.get(F);if(!L)return;const ne=Math.min(this.buffer.x,this.cols-1),ve=this._renderService.dimensions.css.cell.height,Se=L.getWidth(ne),be=this._renderService.dimensions.css.cell.width*Se,Me=this.buffer.y*this._renderService.dimensions.css.cell.height,Ue=ne*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ue+"px",this.textarea.style.top=Me+"px",this.textarea.style.width=be+"px",this.textarea.style.height=ve+"px",this.textarea.style.lineHeight=ve+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(L=>{this.hasSelection()&&(0,d.copyHandler)(L,this._selectionService)})));const F=L=>(0,d.handlePasteEvent)(L,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",F)),this.register((0,y.addDisposableDomListener)(this.element,"paste",F)),ae.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(L=>{L.button===2&&(0,d.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(L=>{(0,d.rightClickHandler)(L,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),ae.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(L=>{L.button===1&&(0,d.moveTextAreaUnderMouseCursor)(L,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",(F=>this._keyUp(F)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",(F=>this._keyDown(F)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",(F=>this._keyPress(F)),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",(F=>this._compositionHelper.compositionupdate(F)))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,y.addDisposableDomListener)(this.textarea,"input",(F=>this._inputEvent(F)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(F){if(!F)throw new Error("Terminal requires a parent element.");if(F.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=F.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"),F.appendChild(this.element);const L=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),L.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,y.addDisposableDomListener)(this.screenElement,"mousemove",(ne=>this.updateCursorStyle(ne)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),L.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),ae.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,F.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(T.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",(ne=>this._handleTextAreaFocus(ne)))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(T.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(U.ThemeService),this._instantiationService.setService(T.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(T.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(D.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(T.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((ne=>this._onRender.fire(ne)))),this.onResize((ne=>this._renderService.resize(ne.cols,ne.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(c.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(E.MouseService),this._instantiationService.setService(T.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(h.Linkifier,this.screenElement)),this.element.appendChild(L);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(C.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.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(g.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(T.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((ne=>this.scrollLines(ne.amount,ne.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ne=>this._renderService.handleSelectionChanged(ne.start,ne.end,ne.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ne=>{this.textarea.value=ne,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ne=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(ne=>this._selectionService.handleMouseDown(ne)))),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(K.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(ne=>this._handleScreenReaderModeOptionChange(ne)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ne=>{!this._overviewRulerRenderer&&ne&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(a.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const F=this,L=this.element;function ne(be){const Me=F._mouseService.getMouseReportCoords(be,F.screenElement);if(!Me)return!1;let Ue,He;switch(be.overrideType||be.type){case"mousemove":He=32,be.buttons===void 0?(Ue=3,be.button!==void 0&&(Ue=be.button<3?be.button:3)):Ue=1&be.buttons?0:4&be.buttons?1:2&be.buttons?2:3;break;case"mouseup":He=0,Ue=be.button<3?be.button:3;break;case"mousedown":He=1,Ue=be.button<3?be.button:3;break;case"wheel":if(F._customWheelEventHandler&&F._customWheelEventHandler(be)===!1||F.viewport.getLinesScrolled(be)===0)return!1;He=be.deltaY<0?0:1,Ue=4;break;default:return!1}return!(He===void 0||Ue===void 0||Ue>4)&&F.coreMouseService.triggerMouseEvent({col:Me.col,row:Me.row,x:Me.x,y:Me.y,button:Ue,action:He,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const ve={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Se={mouseup:be=>(ne(be),be.buttons||(this._document.removeEventListener("mouseup",ve.mouseup),ve.mousedrag&&this._document.removeEventListener("mousemove",ve.mousedrag)),this.cancel(be)),wheel:be=>(ne(be),this.cancel(be,!0)),mousedrag:be=>{be.buttons&&ne(be)},mousemove:be=>{be.buttons||ne(be)}};this.register(this.coreMouseService.onProtocolChange((be=>{be?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(be)),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&be?ve.mousemove||(L.addEventListener("mousemove",Se.mousemove),ve.mousemove=Se.mousemove):(L.removeEventListener("mousemove",ve.mousemove),ve.mousemove=null),16&be?ve.wheel||(L.addEventListener("wheel",Se.wheel,{passive:!1}),ve.wheel=Se.wheel):(L.removeEventListener("wheel",ve.wheel),ve.wheel=null),2&be?ve.mouseup||(ve.mouseup=Se.mouseup):(this._document.removeEventListener("mouseup",ve.mouseup),ve.mouseup=null),4&be?ve.mousedrag||(ve.mousedrag=Se.mousedrag):(this._document.removeEventListener("mousemove",ve.mousedrag),ve.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(L,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return ne(be),ve.mouseup&&this._document.addEventListener("mouseup",ve.mouseup),ve.mousedrag&&this._document.addEventListener("mousemove",ve.mousedrag),this.cancel(be)}))),this.register((0,y.addDisposableDomListener)(L,"wheel",(be=>{if(!ve.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const Me=this.viewport.getLinesScrolled(be);if(Me===0)return;const Ue=te.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let He="";for(let at=0;at<Math.abs(Me);at++)He+=Ue;return this.coreService.triggerDataEvent(He,!0),this.cancel(be,!0)}return this.viewport.handleWheel(be)?this.cancel(be):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(L,"touchstart",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(L,"touchmove",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(be)?void 0:this.cancel(be)}),{passive:!1}))}refresh(F,L){this._renderService?.refreshRows(F,L)}updateCursorStyle(F){this._selectionService?.shouldColumnSelect(F)?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(F,L,ne=0){ne===1?(super.scrollLines(F,L,ne),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(F)}paste(F){(0,d.paste)(F,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(F){this._customKeyEventHandler=F}attachCustomWheelEventHandler(F){this._customWheelEventHandler=F}registerLinkProvider(F){return this._linkProviderService.registerLinkProvider(F)}registerCharacterJoiner(F){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const L=this._characterJoinerService.register(F);return this.refresh(0,this.rows-1),L}deregisterCharacterJoiner(F){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(F)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(F){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+F)}registerDecoration(F){return this._decorationService.registerDecoration(F)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(F,L,ne){this._selectionService.setSelection(F,L,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(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(F,L){this._selectionService?.selectLines(F,L)}_keyDown(F){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1)return!1;const L=this.browser.isMac&&this.options.macOptionIsMeta&&F.altKey;if(!L&&!this._compositionHelper.keydown(F))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;L||F.key!=="Dead"&&F.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ne=(0,V.evaluateKeyboardEvent)(F,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(F),ne.type===3||ne.type===2){const ve=this.rows-1;return this.scrollLines(ne.type===2?-ve:ve),this.cancel(F,!0)}return ne.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,F)||(ne.cancel&&this.cancel(F,!0),!ne.key||!!(F.key&&!F.ctrlKey&&!F.altKey&&!F.metaKey&&F.key.length===1&&F.key.charCodeAt(0)>=65&&F.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ne.key!==te.C0.ETX&&ne.key!==te.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ne.key,domEvent:F}),this._showCursor(),this.coreService.triggerDataEvent(ne.key,!0),!this.optionsService.rawOptions.screenReaderMode||F.altKey||F.ctrlKey?this.cancel(F,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(F,L){const ne=F.isMac&&!this.options.macOptionIsMeta&&L.altKey&&!L.ctrlKey&&!L.metaKey||F.isWindows&&L.altKey&&L.ctrlKey&&!L.metaKey||F.isWindows&&L.getModifierState("AltGraph");return L.type==="keypress"?ne:ne&&(!L.keyCode||L.keyCode>47)}_keyUp(F){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1||((function(L){return L.keyCode===16||L.keyCode===17||L.keyCode===18})(F)||this.focus(),this.updateCursorStyle(F),this._keyPressHandled=!1)}_keyPress(F){let L;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1)return!1;if(this.cancel(F),F.charCode)L=F.charCode;else if(F.which===null||F.which===void 0)L=F.keyCode;else{if(F.which===0||F.charCode===0)return!1;L=F.which}return!(!L||(F.altKey||F.ctrlKey||F.metaKey)&&!this._isThirdLevelShift(this.browser,F)||(L=String.fromCharCode(L),this._onKey.fire({key:L,domEvent:F}),this._showCursor(),this.coreService.triggerDataEvent(L,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(F){if(F.data&&F.inputType==="insertText"&&(!F.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const L=F.data;return this.coreService.triggerDataEvent(L,!0),this.cancel(F),!0}return!1}resize(F,L){F!==this.cols||L!==this.rows?super.resize(F,L):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(F,L){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let F=1;F<this.rows;F++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const F=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=F,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(te.C0.ESC+"[I"):this.coreService.triggerDataEvent(te.C0.ESC+"[O")}_reportWindowsOptions(F){if(this._renderService)switch(F){case k.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const L=this._renderService.dimensions.css.canvas.width.toFixed(0),ne=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${te.C0.ESC}[4;${ne};${L}t`);break;case k.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ve=this._renderService.dimensions.css.cell.width.toFixed(0),Se=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${te.C0.ESC}[6;${Se};${ve}t`)}}cancel(F,L){if(this.options.cancelEvents||L)return F.preventDefault(),F.stopPropagation(),!1}}u.Terminal=me},9924:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.TimeBasedDebouncer=void 0,u.TimeBasedDebouncer=class{constructor(f,d=1e3){this._renderCallback=f,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(f,d,y){this._rowCount=y,f=f!==void 0?f:0,d=d!==void 0?d:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,f):f,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,d):d;const h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){const v=h-this._lastRefreshMs,b=this._debounceThresholdMS-v;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 f=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(f,d)}}},1680:function(X,u,f){var d=this&&this.__decorate||function(c,a,l,_){var x,E=arguments.length,D=E<3?a:_===null?_=Object.getOwnPropertyDescriptor(a,l):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(c,a,l,_);else for(var g=c.length-1;g>=0;g--)(x=c[g])&&(D=(E<3?x(D):E>3?x(a,l,D):x(a,l))||D);return E>3&&D&&Object.defineProperty(a,l,D),D},y=this&&this.__param||function(c,a){return function(l,_){a(l,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.Viewport=void 0;const h=f(3656),v=f(4725),b=f(8460),C=f(844),m=f(2585);let o=u.Viewport=class extends C.Disposable{constructor(c,a,l,_,x,E,D,g){super(),this._viewportElement=c,this._scrollArea=a,this._bufferService=l,this._optionsService=_,this._charSizeService=x,this._renderService=E,this._coreBrowserService=D,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,h.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((T=>this._activeBuffer=T.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((T=>this._renderDimensions=T))),this._handleThemeChange(g.colors),this.register(g.onChangeColors((T=>this._handleThemeChange(T)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(c){this._viewportElement.style.backgroundColor=c.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(c){if(c)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 a=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==a&&(this._lastRecordedBufferHeight=a,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const c=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==c&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=c),this._refreshAnimationFrame=null}syncScrollArea(c=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(c);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(c)}_handleScroll(c){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 a=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const c=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(c*(this._smoothScrollState.target-this._smoothScrollState.origin)),c<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(c,a){const l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(a<0&&this._viewportElement.scrollTop!==0||a>0&&l<this._lastRecordedBufferHeight)||(c.cancelable&&c.preventDefault(),!1)}handleWheel(c){const a=this._getPixelsScrolled(c);return a!==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+a:this._smoothScrollState.target+=a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=a,this._bubbleScroll(c,a))}scrollLines(c){if(c!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const a=c*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+a,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:c,suppressScrollEvent:!1})}_getPixelsScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let a=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_LINE?a*=this._currentRowHeight:c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._currentRowHeight*this._bufferService.rows),a}getBufferElements(c,a){let l,_="";const x=[],E=a??this._bufferService.buffer.lines.length,D=this._bufferService.buffer.lines;for(let g=c;g<E;g++){const T=D.get(g);if(!T)continue;const U=D.get(g+1)?.isWrapped;if(_+=T.translateToString(!U),!U||g===D.length-1){const P=document.createElement("div");P.textContent=_,x.push(P),_.length>0&&(l=P),_=""}}return{bufferElements:x,cursorElement:l}}getLinesScrolled(c){if(c.deltaY===0||c.shiftKey)return 0;let a=this._applyScrollModifier(c.deltaY,c);return c.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(a/=this._currentRowHeight+0,this._wheelPartialScroll+=a,a=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):c.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(a*=this._bufferService.rows),a}_applyScrollModifier(c,a){const l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&a.altKey||l==="ctrl"&&a.ctrlKey||l==="shift"&&a.shiftKey?c*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:c*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(c){this._lastTouchY=c.touches[0].pageY}handleTouchMove(c){const a=this._lastTouchY-c.touches[0].pageY;return this._lastTouchY=c.touches[0].pageY,a!==0&&(this._viewportElement.scrollTop+=a,this._bubbleScroll(c,a))}};u.Viewport=o=d([y(2,m.IBufferService),y(3,m.IOptionsService),y(4,v.ICharSizeService),y(5,v.IRenderService),y(6,v.ICoreBrowserService),y(7,v.IThemeService)],o)},3107:function(X,u,f){var d=this&&this.__decorate||function(m,o,c,a){var l,_=arguments.length,x=_<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,c):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(m,o,c,a);else for(var E=m.length-1;E>=0;E--)(l=m[E])&&(x=(_<3?l(x):_>3?l(o,c,x):l(o,c))||x);return _>3&&x&&Object.defineProperty(o,c,x),x},y=this&&this.__param||function(m,o){return function(c,a){o(c,a,m)}};Object.defineProperty(u,"__esModule",{value:!0}),u.BufferDecorationRenderer=void 0;const h=f(4725),v=f(844),b=f(2585);let C=u.BufferDecorationRenderer=class extends v.Disposable{constructor(m,o,c,a,l){super(),this._screenElement=m,this._bufferService=o,this._coreBrowserService=c,this._decorationService=a,this._renderService=l,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((_=>this._removeDecoration(_)))),this.register((0,v.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 m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){const o=this._coreBrowserService.mainDocument.createElement("div");o.classList.add("xterm-decoration"),o.classList.toggle("xterm-decoration-top-layer",m?.options?.layer==="top"),o.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,o.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",o.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",o.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const c=m.options.x??0;return c&&c>this._bufferService.cols&&(o.style.display="none"),this._refreshXPosition(m,o),o}_refreshStyle(m){const o=m.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let c=this._decorationElements.get(m);c||(c=this._createElement(m),m.element=c,this._decorationElements.set(m,c),this._container.appendChild(c),m.onDispose((()=>{this._decorationElements.delete(m),c.remove()}))),c.style.top=o*this._renderService.dimensions.css.cell.height+"px",c.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(c)}}_refreshXPosition(m,o=m.element){if(!o)return;const c=m.options.x??0;(m.options.anchor||"left")==="right"?o.style.right=c?c*this._renderService.dimensions.css.cell.width+"px":"":o.style.left=c?c*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){this._decorationElements.get(m)?.remove(),this._decorationElements.delete(m),m.dispose()}};u.BufferDecorationRenderer=C=d([y(1,b.IBufferService),y(2,h.ICoreBrowserService),y(3,b.IDecorationService),y(4,h.IRenderService)],C)},5871:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ColorZoneStore=void 0,u.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(f){if(f.options.overviewRulerOptions){for(const d of this._zones)if(d.color===f.options.overviewRulerOptions.color&&d.position===f.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,f.marker.line))return;if(this._lineAdjacentToZone(d,f.marker.line,f.options.overviewRulerOptions.position))return void this._addLineToZone(d,f.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=f.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=f.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=f.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=f.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:f.options.overviewRulerOptions.color,position:f.options.overviewRulerOptions.position,startBufferLine:f.marker.line,endBufferLine:f.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(f){this._linePadding=f}_lineIntersectsZone(f,d){return d>=f.startBufferLine&&d<=f.endBufferLine}_lineAdjacentToZone(f,d,y){return d>=f.startBufferLine-this._linePadding[y||"full"]&&d<=f.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(f,d){f.startBufferLine=Math.min(f.startBufferLine,d),f.endBufferLine=Math.max(f.endBufferLine,d)}}},5744:function(X,u,f){var d=this&&this.__decorate||function(l,_,x,E){var D,g=arguments.length,T=g<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(l,_,x,E);else for(var U=l.length-1;U>=0;U--)(D=l[U])&&(T=(g<3?D(T):g>3?D(_,x,T):D(_,x))||T);return g>3&&T&&Object.defineProperty(_,x,T),T},y=this&&this.__param||function(l,_){return function(x,E){_(x,E,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OverviewRulerRenderer=void 0;const h=f(5871),v=f(4725),b=f(844),C=f(2585),m={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},c={full:0,left:0,center:0,right:0};let a=u.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,_,x,E,D,g,T){super(),this._viewportElement=l,this._screenElement=_,this._bufferService=x,this._decorationService=E,this._renderService=D,this._optionsService=g,this._coreBrowserService=T,this._colorZoneStore=new h.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(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const U=this._canvas.getContext("2d");if(!U)throw new Error("Ctx cannot be null");this._ctx=U,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{this._canvas?.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 l=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=l,o.center=_,o.right=l,this._refreshDrawHeightConstants(),c.full=0,c.left=0,c.center=o.left,c.right=o.left+o.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const l=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(l,12),6)*this._coreBrowserService.dpr);m.left=_,m.center=_,m.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.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 _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;const l=this._colorZoneStore.zones;for(const _ of l)_.position!=="full"&&this._renderColorZone(_);for(const _ of l)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(c[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-m[l.position||"full"]/2),o[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[l.position||"full"]))}_queueRefresh(l,_){this._shouldUpdateDimensions=l||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};u.OverviewRulerRenderer=a=d([y(2,C.IBufferService),y(3,C.IDecorationService),y(4,v.IRenderService),y(5,C.IOptionsService),y(6,v.ICoreBrowserService)],a)},2950:function(X,u,f){var d=this&&this.__decorate||function(m,o,c,a){var l,_=arguments.length,x=_<3?o:a===null?a=Object.getOwnPropertyDescriptor(o,c):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(m,o,c,a);else for(var E=m.length-1;E>=0;E--)(l=m[E])&&(x=(_<3?l(x):_>3?l(o,c,x):l(o,c))||x);return _>3&&x&&Object.defineProperty(o,c,x),x},y=this&&this.__param||function(m,o){return function(c,a){o(c,a,m)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CompositionHelper=void 0;const h=f(4725),v=f(2585),b=f(2584);let C=u.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,o,c,a,l,_){this._textarea=m,this._compositionView=o,this._bufferService=c,this._optionsService=a,this._coreService=l,this._renderService=_,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(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){const o={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let c;this._isSendingComposition=!1,o.start+=this._dataAlreadySent.length,c=this._isComposing?this._textarea.value.substring(o.start,o.end):this._textarea.value.substring(o.start),c.length>0&&this._coreService.triggerDataEvent(c,!0)}}),0)}else{this._isSendingComposition=!1;const o=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(o,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const o=this._textarea.value,c=o.replace(m,"");this._dataAlreadySent=c,o.length>m.length?this._coreService.triggerDataEvent(c,!0):o.length<m.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):o.length===m.length&&o!==m&&this._coreService.triggerDataEvent(o,!0)}}),0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._renderService.dimensions.css.cell.height,a=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=o*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=a+"px",this._compositionView.style.height=c+"px",this._compositionView.style.lineHeight=c+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const _=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=a+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}m||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};u.CompositionHelper=C=d([y(2,v.IBufferService),y(3,v.IOptionsService),y(4,v.ICoreService),y(5,h.IRenderService)],C)},9806:(X,u)=>{function f(d,y,h){const v=h.getBoundingClientRect(),b=d.getComputedStyle(h),C=parseInt(b.getPropertyValue("padding-left")),m=parseInt(b.getPropertyValue("padding-top"));return[y.clientX-v.left-C,y.clientY-v.top-m]}Object.defineProperty(u,"__esModule",{value:!0}),u.getCoords=u.getCoordsRelativeToElement=void 0,u.getCoordsRelativeToElement=f,u.getCoords=function(d,y,h,v,b,C,m,o,c){if(!C)return;const a=f(d,y,h);return a?(a[0]=Math.ceil((a[0]+(c?m/2:0))/m),a[1]=Math.ceil(a[1]/o),a[0]=Math.min(Math.max(a[0],1),v+(c?1:0)),a[1]=Math.min(Math.max(a[1],1),b),a):void 0}},9504:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.moveToCellSequence=void 0;const d=f(2584);function y(o,c,a,l){const _=o-h(o,a),x=c-h(c,a),E=Math.abs(_-x)-(function(D,g,T){let U=0;const P=D-h(D,T),W=g-h(g,T);for(let N=0;N<Math.abs(P-W);N++){const Q=v(D,g)==="A"?-1:1;T.buffer.lines.get(P+Q*N)?.isWrapped&&U++}return U})(o,c,a);return m(E,C(v(o,c),l))}function h(o,c){let a=0,l=c.buffer.lines.get(o),_=l?.isWrapped;for(;_&&o>=0&&o<c.rows;)a++,l=c.buffer.lines.get(--o),_=l?.isWrapped;return a}function v(o,c){return o>c?"A":"B"}function b(o,c,a,l,_,x){let E=o,D=c,g="";for(;E!==a||D!==l;)E+=_?1:-1,_&&E>x.cols-1?(g+=x.buffer.translateBufferLineToString(D,!1,o,E),E=0,o=0,D++):!_&&E<0&&(g+=x.buffer.translateBufferLineToString(D,!1,0,o+1),E=x.cols-1,o=E,D--);return g+x.buffer.translateBufferLineToString(D,!1,o,E)}function C(o,c){const a=c?"O":"[";return d.C0.ESC+a+o}function m(o,c){o=Math.floor(o);let a="";for(let l=0;l<o;l++)a+=c;return a}u.moveToCellSequence=function(o,c,a,l){const _=a.buffer.x,x=a.buffer.y;if(!a.buffer.hasScrollback)return(function(g,T,U,P,W,N){return y(T,P,W,N).length===0?"":m(b(g,T,g,T-h(T,W),!1,W).length,C("D",N))})(_,x,0,c,a,l)+y(x,c,a,l)+(function(g,T,U,P,W,N){let Q;Q=y(T,P,W,N).length>0?P-h(P,W):T;const ae=P,q=(function(te,V,R,z,A,k){let K;return K=y(R,z,A,k).length>0?z-h(z,A):V,te<R&&K<=z||te>=R&&K<z?"C":"D"})(g,T,U,P,W,N);return m(b(g,Q,U,ae,q==="C",W).length,C(q,N))})(_,x,o,c,a,l);let E;if(x===c)return E=_>o?"D":"C",m(Math.abs(_-o),C(E,l));E=x>c?"D":"C";const D=Math.abs(x-c);return m((function(g,T){return T.cols-g})(x>c?o:_,a)+(D-1)*a.cols+1+((x>c?_:o)-1),C(E,l))}},1296:function(X,u,f){var d=this&&this.__decorate||function(N,Q,ae,q){var te,V=arguments.length,R=V<3?Q:q===null?q=Object.getOwnPropertyDescriptor(Q,ae):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(N,Q,ae,q);else for(var z=N.length-1;z>=0;z--)(te=N[z])&&(R=(V<3?te(R):V>3?te(Q,ae,R):te(Q,ae))||R);return V>3&&R&&Object.defineProperty(Q,ae,R),R},y=this&&this.__param||function(N,Q){return function(ae,q){Q(ae,q,N)}};Object.defineProperty(u,"__esModule",{value:!0}),u.DomRenderer=void 0;const h=f(3787),v=f(2550),b=f(2223),C=f(6171),m=f(6052),o=f(4725),c=f(8055),a=f(8460),l=f(844),_=f(2585),x="xterm-dom-renderer-owner-",E="xterm-rows",D="xterm-fg-",g="xterm-bg-",T="xterm-focus",U="xterm-selection";let P=1,W=u.DomRenderer=class extends l.Disposable{constructor(N,Q,ae,q,te,V,R,z,A,k,K,re,me){super(),this._terminal=N,this._document=Q,this._element=ae,this._screenElement=q,this._viewportElement=te,this._helperContainer=V,this._linkifier2=R,this._charSizeService=A,this._optionsService=k,this._bufferService=K,this._coreBrowserService=re,this._themeService=me,this._terminalClass=P++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new a.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(E),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(U),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,C.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((pe=>this._injectCss(pe)))),this._injectCss(this._themeService.colors),this._rowFactory=z.createInstance(h.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((pe=>this._handleLinkHover(pe)))),this.register(this._linkifier2.onHideLinkUnderline((pe=>this._handleLinkLeave(pe)))),this.register((0,l.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 v.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 N=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*N,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*N),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/N),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/N),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 ae of this._rowElements)ae.style.width=`${this.dimensions.css.canvas.width}px`,ae.style.height=`${this.dimensions.css.cell.height}px`,ae.style.lineHeight=`${this.dimensions.css.cell.height}px`,ae.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const Q=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=Q,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(N){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let Q=`${this._terminalSelector} .${E} { color: ${N.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;Q+=`${this._terminalSelector} .${E} .xterm-dim { color: ${c.color.multiplyOpacity(N.foreground,.5).css};}`,Q+=`${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 ae=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,te=`blink_block_${this._terminalClass}`;Q+=`@keyframes ${ae} { 50% { border-bottom-style: hidden; }}`,Q+=`@keyframes ${q} { 50% { box-shadow: none; }}`,Q+=`@keyframes ${te} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,Q+=`${this._terminalSelector} .${E}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${ae} 1s step-end infinite;}${this._terminalSelector} .${E}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${E}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css};}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${N.cursor.css} !important; color: ${N.cursorAccent.css} !important;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${N.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${N.cursor.css} inset;}${this._terminalSelector} .${E} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${N.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,Q+=`${this._terminalSelector} .${U} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${U} div { position: absolute; background-color: ${N.selectionBackgroundOpaque.css};}${this._terminalSelector} .${U} div { position: absolute; background-color: ${N.selectionInactiveBackgroundOpaque.css};}`;for(const[V,R]of N.ansi.entries())Q+=`${this._terminalSelector} .${D}${V} { color: ${R.css}; }${this._terminalSelector} .${D}${V}.xterm-dim { color: ${c.color.multiplyOpacity(R,.5).css}; }${this._terminalSelector} .${g}${V} { background-color: ${R.css}; }`;Q+=`${this._terminalSelector} .${D}${b.INVERTED_DEFAULT_COLOR} { color: ${c.color.opaque(N.background).css}; }${this._terminalSelector} .${D}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${c.color.multiplyOpacity(c.color.opaque(N.background),.5).css}; }${this._terminalSelector} .${g}${b.INVERTED_DEFAULT_COLOR} { background-color: ${N.foreground.css}; }`,this._themeStyleElement.textContent=Q}_setDefaultSpacing(){const N=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${N}px`,this._rowFactory.defaultSpacing=N}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(N,Q){for(let ae=this._rowElements.length;ae<=Q;ae++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>Q;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,Q){this._refreshRowElements(N,Q),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(T),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(T),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(N,Q,ae){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,Q,ae),this.renderRows(0,this._bufferService.rows-1),!N||!Q)return;this._selectionRenderModel.update(this._terminal,N,Q,ae);const q=this._selectionRenderModel.viewportStartRow,te=this._selectionRenderModel.viewportEndRow,V=this._selectionRenderModel.viewportCappedStartRow,R=this._selectionRenderModel.viewportCappedEndRow;if(V>=this._bufferService.rows||R<0)return;const z=this._document.createDocumentFragment();if(ae){const A=N[0]>Q[0];z.appendChild(this._createSelectionElement(V,A?Q[0]:N[0],A?N[0]:Q[0],R-V+1))}else{const A=q===V?N[0]:0,k=V===te?Q[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(V,A,k));const K=R-V-1;if(z.appendChild(this._createSelectionElement(V+1,0,this._bufferService.cols,K)),V!==R){const re=te===R?Q[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(R,0,re))}}this._selectionContainer.appendChild(z)}_createSelectionElement(N,Q,ae,q=1){const te=this._document.createElement("div"),V=Q*this.dimensions.css.cell.width;let R=this.dimensions.css.cell.width*(ae-Q);return V+R>this.dimensions.css.canvas.width&&(R=this.dimensions.css.canvas.width-V),te.style.height=q*this.dimensions.css.cell.height+"px",te.style.top=N*this.dimensions.css.cell.height+"px",te.style.left=`${V}px`,te.style.width=`${R}px`,te}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 N of this._rowElements)N.replaceChildren()}renderRows(N,Q){const ae=this._bufferService.buffer,q=ae.ybase+ae.y,te=Math.min(ae.x,this._bufferService.cols-1),V=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=N;A<=Q;A++){const k=A+ae.ydisp,K=this._rowElements[A],re=ae.lines.get(k);if(!K||!re)break;K.replaceChildren(...this._rowFactory.createRow(re,k,k===q,R,z,te,V,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!0)}_handleLinkLeave(N){this._setCellUnderline(N.x1,N.x2,N.y1,N.y2,N.cols,!1)}_setCellUnderline(N,Q,ae,q,te,V){ae<0&&(N=0),q<0&&(Q=0);const R=this._bufferService.rows-1;ae=Math.max(Math.min(ae,R),0),q=Math.max(Math.min(q,R),0),te=Math.min(te,this._bufferService.cols);const z=this._bufferService.buffer,A=z.ybase+z.y,k=Math.min(z.x,te-1),K=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,me=this._optionsService.rawOptions.cursorInactiveStyle;for(let pe=ae;pe<=q;++pe){const F=pe+z.ydisp,L=this._rowElements[pe],ne=z.lines.get(F);if(!L||!ne)break;L.replaceChildren(...this._rowFactory.createRow(ne,F,F===A,re,me,k,K,this.dimensions.css.cell.width,this._widthCache,V?pe===ae?N:0:-1,V?(pe===q?Q:te)-1:-1))}}};u.DomRenderer=W=d([y(7,_.IInstantiationService),y(8,o.ICharSizeService),y(9,_.IOptionsService),y(10,_.IBufferService),y(11,o.ICoreBrowserService),y(12,o.IThemeService)],W)},3787:function(X,u,f){var d=this&&this.__decorate||function(E,D,g,T){var U,P=arguments.length,W=P<3?D:T===null?T=Object.getOwnPropertyDescriptor(D,g):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")W=Reflect.decorate(E,D,g,T);else for(var N=E.length-1;N>=0;N--)(U=E[N])&&(W=(P<3?U(W):P>3?U(D,g,W):U(D,g))||W);return P>3&&W&&Object.defineProperty(D,g,W),W},y=this&&this.__param||function(E,D){return function(g,T){D(g,T,E)}};Object.defineProperty(u,"__esModule",{value:!0}),u.DomRendererRowFactory=void 0;const h=f(2223),v=f(643),b=f(511),C=f(2585),m=f(8055),o=f(4725),c=f(4269),a=f(6171),l=f(3734);let _=u.DomRendererRowFactory=class{constructor(E,D,g,T,U,P,W){this._document=E,this._characterJoinerService=D,this._optionsService=g,this._coreBrowserService=T,this._coreService=U,this._decorationService=P,this._themeService=W,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(E,D,g){this._selectionStart=E,this._selectionEnd=D,this._columnSelectMode=g}createRow(E,D,g,T,U,P,W,N,Q,ae,q){const te=[],V=this._characterJoinerService.getJoinedCharacters(D),R=this._themeService.colors;let z,A=E.getNoBgTrimmedLength();g&&A<P+1&&(A=P+1);let k=0,K="",re=0,me=0,pe=0,F=!1,L=0,ne=!1,ve=0;const Se=[],be=ae!==-1&&q!==-1;for(let Me=0;Me<A;Me++){E.loadCell(Me,this._workCell);let Ue=this._workCell.getWidth();if(Ue===0)continue;let He=!1,at=Me,Ae=this._workCell;if(V.length>0&&Me===V[0][0]){He=!0;const qe=V.shift();Ae=new c.JoinedCellData(this._workCell,E.translateToString(!0,qe[0],qe[1]),qe[1]-qe[0]),at=qe[1]-1,Ue=Ae.getWidth()}const Mt=this._isCellInSelection(Me,D),fe=g&&Me===P,ge=be&&Me>=ae&&Me<=q;let Ce=!1;this._decorationService.forEachDecorationAtCell(Me,D,void 0,(qe=>{Ce=!0}));let Le=Ae.getChars()||v.WHITESPACE_CELL_CHAR;if(Le===" "&&(Ae.isUnderline()||Ae.isOverline())&&(Le=" "),ve=Ue*N-Q.get(Le,Ae.isBold(),Ae.isItalic()),z){if(k&&(Mt&&ne||!Mt&&!ne&&Ae.bg===re)&&(Mt&&ne&&R.selectionForeground||Ae.fg===me)&&Ae.extended.ext===pe&&ge===F&&ve===L&&!fe&&!He&&!Ce){Ae.isInvisible()?K+=v.WHITESPACE_CELL_CHAR:K+=Le,k++;continue}k&&(z.textContent=K),z=this._document.createElement("span"),k=0,K=""}else z=this._document.createElement("span");if(re=Ae.bg,me=Ae.fg,pe=Ae.extended.ext,F=ge,L=ve,ne=Mt,He&&P>=Me&&P<=at&&(P=Me),!this._coreService.isCursorHidden&&fe&&this._coreService.isCursorInitialized){if(Se.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&Se.push("xterm-cursor-blink"),Se.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(U)switch(U){case"outline":Se.push("xterm-cursor-outline");break;case"block":Se.push("xterm-cursor-block");break;case"bar":Se.push("xterm-cursor-bar");break;case"underline":Se.push("xterm-cursor-underline")}}if(Ae.isBold()&&Se.push("xterm-bold"),Ae.isItalic()&&Se.push("xterm-italic"),Ae.isDim()&&Se.push("xterm-dim"),K=Ae.isInvisible()?v.WHITESPACE_CELL_CHAR:Ae.getChars()||v.WHITESPACE_CELL_CHAR,Ae.isUnderline()&&(Se.push(`xterm-underline-${Ae.extended.underlineStyle}`),K===" "&&(K=" "),!Ae.isUnderlineColorDefault()))if(Ae.isUnderlineColorRGB())z.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(Ae.getUnderlineColor()).join(",")})`;else{let qe=Ae.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ae.isBold()&&qe<8&&(qe+=8),z.style.textDecorationColor=R.ansi[qe].css}Ae.isOverline()&&(Se.push("xterm-overline"),K===" "&&(K=" ")),Ae.isStrikethrough()&&Se.push("xterm-strikethrough"),ge&&(z.style.textDecoration="underline");let Xe=Ae.getFgColor(),je=Ae.getFgColorMode(),dt=Ae.getBgColor(),Ge=Ae.getBgColorMode();const lt=!!Ae.isInverse();if(lt){const qe=Xe;Xe=dt,dt=qe;const Ni=je;je=Ge,Ge=Ni}let mt,fi,Lt,di=!1;switch(this._decorationService.forEachDecorationAtCell(Me,D,void 0,(qe=>{qe.options.layer!=="top"&&di||(qe.backgroundColorRGB&&(Ge=50331648,dt=qe.backgroundColorRGB.rgba>>8&16777215,mt=qe.backgroundColorRGB),qe.foregroundColorRGB&&(je=50331648,Xe=qe.foregroundColorRGB.rgba>>8&16777215,fi=qe.foregroundColorRGB),di=qe.options.layer==="top")})),!di&&Mt&&(mt=this._coreBrowserService.isFocused?R.selectionBackgroundOpaque:R.selectionInactiveBackgroundOpaque,dt=mt.rgba>>8&16777215,Ge=50331648,di=!0,R.selectionForeground&&(je=50331648,Xe=R.selectionForeground.rgba>>8&16777215,fi=R.selectionForeground)),di&&Se.push("xterm-decoration-top"),Ge){case 16777216:case 33554432:Lt=R.ansi[dt],Se.push(`xterm-bg-${dt}`);break;case 50331648:Lt=m.channels.toColor(dt>>16,dt>>8&255,255&dt),this._addStyle(z,`background-color:#${x((dt>>>0).toString(16),"0",6)}`);break;default:lt?(Lt=R.foreground,Se.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Lt=R.background}switch(mt||Ae.isDim()&&(mt=m.color.multiplyOpacity(Lt,.5)),je){case 16777216:case 33554432:Ae.isBold()&&Xe<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Xe+=8),this._applyMinimumContrast(z,Lt,R.ansi[Xe],Ae,mt,void 0)||Se.push(`xterm-fg-${Xe}`);break;case 50331648:const qe=m.channels.toColor(Xe>>16&255,Xe>>8&255,255&Xe);this._applyMinimumContrast(z,Lt,qe,Ae,mt,fi)||this._addStyle(z,`color:#${x(Xe.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(z,Lt,R.foreground,Ae,mt,fi)||lt&&Se.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}Se.length&&(z.className=Se.join(" "),Se.length=0),fe||He||Ce?z.textContent=K:k++,ve!==this.defaultSpacing&&(z.style.letterSpacing=`${ve}px`),te.push(z),Me=at}return z&&k&&(z.textContent=K),te}_applyMinimumContrast(E,D,g,T,U,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,a.treatGlyphAsBackgroundColor)(T.getCode()))return!1;const W=this._getContrastCache(T);let N;if(U||P||(N=W.getColor(D.rgba,g.rgba)),N===void 0){const Q=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);N=m.color.ensureContrastRatio(U||D,P||g,Q),W.setColor((U||D).rgba,(P||g).rgba,N??null)}return!!N&&(this._addStyle(E,`color:${N.css}`),!0)}_getContrastCache(E){return E.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(E,D){E.setAttribute("style",`${E.getAttribute("style")||""}${D};`)}_isCellInSelection(E,D){const g=this._selectionStart,T=this._selectionEnd;return!(!g||!T)&&(this._columnSelectMode?g[0]<=T[0]?E>=g[0]&&D>=g[1]&&E<T[0]&&D<=T[1]:E<g[0]&&D>=g[1]&&E>=T[0]&&D<=T[1]:D>g[1]&&D<T[1]||g[1]===T[1]&&D===g[1]&&E>=g[0]&&E<T[0]||g[1]<T[1]&&D===T[1]&&E<T[0]||g[1]<T[1]&&D===g[1]&&E>=g[0])}};function x(E,D,g){for(;E.length<g;)E=D+E;return E}u.DomRendererRowFactory=_=d([y(1,o.ICharacterJoinerService),y(2,C.IOptionsService),y(3,o.ICoreBrowserService),y(4,C.ICoreService),y(5,C.IDecorationService),y(6,o.IThemeService)],_)},2550:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WidthCache=void 0,u.WidthCache=class{constructor(f,d){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=f.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 y=f.createElement("span");y.classList.add("xterm-char-measure-element");const h=f.createElement("span");h.classList.add("xterm-char-measure-element"),h.style.fontWeight="bold";const v=f.createElement("span");v.classList.add("xterm-char-measure-element"),v.style.fontStyle="italic";const b=f.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[y,h,v,b],this._container.appendChild(y),this._container.appendChild(h),this._container.appendChild(v),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(f,d,y,h){f===this._font&&d===this._fontSize&&y===this._weight&&h===this._weightBold||(this._font=f,this._fontSize=d,this._weight=y,this._weightBold=h,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${h}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${h}`,this.clear())}get(f,d,y){let h=0;if(!d&&!y&&f.length===1&&(h=f.charCodeAt(0))<256){if(this._flat[h]!==-9999)return this._flat[h];const C=this._measure(f,0);return C>0&&(this._flat[h]=C),C}let v=f;d&&(v+="B"),y&&(v+="I");let b=this._holey.get(v);if(b===void 0){let C=0;d&&(C|=1),y&&(C|=2),b=this._measure(f,C),b>0&&this._holey.set(v,b)}return b}_measure(f,d){const y=this._measureElements[d];return y.textContent=f.repeat(32),y.offsetWidth/32}}},2223:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.TEXT_BASELINE=u.DIM_OPACITY=u.INVERTED_DEFAULT_COLOR=void 0;const d=f(6114);u.INVERTED_DEFAULT_COLOR=257,u.DIM_OPACITY=.5,u.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(X,u)=>{function f(y){return 57508<=y&&y<=57558}function d(y){return y>=128512&&y<=128591||y>=127744&&y<=128511||y>=128640&&y<=128767||y>=9728&&y<=9983||y>=9984&&y<=10175||y>=65024&&y<=65039||y>=129280&&y<=129535||y>=127462&&y<=127487}Object.defineProperty(u,"__esModule",{value:!0}),u.computeNextVariantOffset=u.createRenderDimensions=u.treatGlyphAsBackgroundColor=u.allowRescaling=u.isEmoji=u.isRestrictedPowerlineGlyph=u.isPowerlineGlyph=u.throwIfFalsy=void 0,u.throwIfFalsy=function(y){if(!y)throw new Error("value must not be falsy");return y},u.isPowerlineGlyph=f,u.isRestrictedPowerlineGlyph=function(y){return 57520<=y&&y<=57527},u.isEmoji=d,u.allowRescaling=function(y,h,v,b){return h===1&&v>Math.ceil(1.5*b)&&y!==void 0&&y>255&&!d(y)&&!f(y)&&!(function(C){return 57344<=C&&C<=63743})(y)},u.treatGlyphAsBackgroundColor=function(y){return f(y)||(function(h){return 9472<=h&&h<=9631})(y)},u.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}}}},u.computeNextVariantOffset=function(y,h,v=0){return(y-(2*Math.round(h)-v))%(2*Math.round(h))}},6052:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createSelectionRenderModel=void 0;class f{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(y,h,v,b=!1){if(this.selectionStart=h,this.selectionEnd=v,!h||!v||h[0]===v[0]&&h[1]===v[1])return void this.clear();const C=y.buffers.active.ydisp,m=h[1]-C,o=v[1]-C,c=Math.max(m,0),a=Math.min(o,y.rows-1);c>=y.rows||a<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=m,this.viewportEndRow=o,this.viewportCappedStartRow=c,this.viewportCappedEndRow=a,this.startCol=h[0],this.endCol=v[0])}isCellSelected(y,h,v){return!!this.hasSelection&&(v-=y.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?h>=this.startCol&&v>=this.viewportCappedStartRow&&h<this.endCol&&v<=this.viewportCappedEndRow:h<this.startCol&&v>=this.viewportCappedStartRow&&h>=this.endCol&&v<=this.viewportCappedEndRow:v>this.viewportStartRow&&v<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&v===this.viewportStartRow&&h>=this.startCol&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportEndRow&&h<this.endCol||this.viewportStartRow<this.viewportEndRow&&v===this.viewportStartRow&&h>=this.startCol)}}u.createSelectionRenderModel=function(){return new f}},456:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.SelectionModel=void 0,u.SelectionModel=class{constructor(f){this._bufferService=f,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 f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?f%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)-1]:[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[f,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const f=this.selectionStart[0]+this.selectionStartLength;return f>this._bufferService.cols?[f%this._bufferService.cols,this.selectionStart[1]+Math.floor(f/this._bufferService.cols)]:[Math.max(f,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const f=this.selectionStart,d=this.selectionEnd;return!(!f||!d)&&(f[1]>d[1]||f[1]===d[1]&&f[0]>d[0])}handleTrim(f){return this.selectionStart&&(this.selectionStart[1]-=f),this.selectionEnd&&(this.selectionEnd[1]-=f),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(X,u,f){var d=this&&this.__decorate||function(a,l,_,x){var E,D=arguments.length,g=D<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(a,l,_,x);else for(var T=a.length-1;T>=0;T--)(E=a[T])&&(g=(D<3?E(g):D>3?E(l,_,g):E(l,_))||g);return D>3&&g&&Object.defineProperty(l,_,g),g},y=this&&this.__param||function(a,l){return function(_,x){l(_,x,a)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CharSizeService=void 0;const h=f(2585),v=f(8460),b=f(844);let C=u.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(a,l,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new v.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new c(this._optionsService))}catch{this._measureStrategy=this.register(new o(a,l,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const a=this._measureStrategy.measure();a.width===this.width&&a.height===this.height||(this.width=a.width,this.height=a.height,this._onCharSizeChange.fire())}};u.CharSizeService=C=d([y(2,h.IOptionsService)],C);class m extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,_){l!==void 0&&l>0&&_!==void 0&&_>0&&(this._result.width=l,this._result.height=_)}}class o extends m{constructor(l,_,x){super(),this._document=l,this._parentElement=_,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 c extends m{constructor(l){super(),this._optionsService=l,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(X,u,f){var d=this&&this.__decorate||function(c,a,l,_){var x,E=arguments.length,D=E<3?a:_===null?_=Object.getOwnPropertyDescriptor(a,l):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(c,a,l,_);else for(var g=c.length-1;g>=0;g--)(x=c[g])&&(D=(E<3?x(D):E>3?x(a,l,D):x(a,l))||D);return E>3&&D&&Object.defineProperty(a,l,D),D},y=this&&this.__param||function(c,a){return function(l,_){a(l,_,c)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CharacterJoinerService=u.JoinedCellData=void 0;const h=f(3734),v=f(643),b=f(511),C=f(2585);class m extends h.AttributeData{constructor(a,l,_){super(),this.content=0,this.combinedData="",this.fg=a.fg,this.bg=a.bg,this.combinedData=l,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(a){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}u.JoinedCellData=m;let o=u.CharacterJoinerService=class Xd{constructor(a){this._bufferService=a,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(a){const l={id:this._nextCharacterJoinerId++,handler:a};return this._characterJoiners.push(l),l.id}deregister(a){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===a)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(a){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(a);if(!l||l.length===0)return[];const _=[],x=l.translateToString(!0);let E=0,D=0,g=0,T=l.getFg(0),U=l.getBg(0);for(let P=0;P<l.getTrimmedLength();P++)if(l.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==T||this._workCell.bg!==U){if(P-E>1){const W=this._getJoinedRanges(x,g,D,l,E);for(let N=0;N<W.length;N++)_.push(W[N])}E=P,g=D,T=this._workCell.fg,U=this._workCell.bg}D+=this._workCell.getChars().length||v.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-E>1){const P=this._getJoinedRanges(x,g,D,l,E);for(let W=0;W<P.length;W++)_.push(P[W])}return _}_getJoinedRanges(a,l,_,x,E){const D=a.substring(l,_);let g=[];try{g=this._characterJoiners[0].handler(D)}catch(T){console.error(T)}for(let T=1;T<this._characterJoiners.length;T++)try{const U=this._characterJoiners[T].handler(D);for(let P=0;P<U.length;P++)Xd._mergeRanges(g,U[P])}catch(U){console.error(U)}return this._stringRangesToCellRanges(g,x,E),g}_stringRangesToCellRanges(a,l,_){let x=0,E=!1,D=0,g=a[x];if(g){for(let T=_;T<this._bufferService.cols;T++){const U=l.getWidth(T),P=l.getString(T).length||v.WHITESPACE_CELL_CHAR.length;if(U!==0){if(!E&&g[0]<=D&&(g[0]=T,E=!0),g[1]<=D){if(g[1]=T,g=a[++x],!g)break;g[0]<=D?(g[0]=T,E=!0):E=!1}D+=P}}g&&(g[1]=this._bufferService.cols)}}static _mergeRanges(a,l){let _=!1;for(let x=0;x<a.length;x++){const E=a[x];if(_){if(l[1]<=E[0])return a[x-1][1]=l[1],a;if(l[1]<=E[1])return a[x-1][1]=Math.max(l[1],E[1]),a.splice(x,1),a;a.splice(x,1),x--}else{if(l[1]<=E[0])return a.splice(x,0,l),a;if(l[1]<=E[1])return E[0]=Math.min(l[0],E[0]),a;l[0]<E[1]&&(E[0]=Math.min(l[0],E[0]),_=!0)}}return _?a[a.length-1][1]=l[1]:a.push(l),a}};u.CharacterJoinerService=o=d([y(0,C.IBufferService)],o)},5114:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CoreBrowserService=void 0;const d=f(844),y=f(8460),h=f(3656);class v extends d.Disposable{constructor(m,o,c){super(),this._textarea=m,this._window=o,this.mainDocument=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new y.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new y.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((a=>this._screenDprMonitor.setWindow(a)))),this.register((0,y.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(m){this._window!==m&&(this._window=m,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}}u.CoreBrowserService=v;class b extends d.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new y.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(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,h.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.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:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.LinkProviderService=void 0;const d=f(844);class y extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(v){return this.linkProviders.push(v),{dispose:()=>{const b=this.linkProviders.indexOf(v);b!==-1&&this.linkProviders.splice(b,1)}}}}u.LinkProviderService=y},8934:function(X,u,f){var d=this&&this.__decorate||function(C,m,o,c){var a,l=arguments.length,_=l<3?m:c===null?c=Object.getOwnPropertyDescriptor(m,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(C,m,o,c);else for(var x=C.length-1;x>=0;x--)(a=C[x])&&(_=(l<3?a(_):l>3?a(m,o,_):a(m,o))||_);return l>3&&_&&Object.defineProperty(m,o,_),_},y=this&&this.__param||function(C,m){return function(o,c){m(o,c,C)}};Object.defineProperty(u,"__esModule",{value:!0}),u.MouseService=void 0;const h=f(4725),v=f(9806);let b=u.MouseService=class{constructor(C,m){this._renderService=C,this._charSizeService=m}getCoords(C,m,o,c,a){return(0,v.getCoords)(window,C,m,o,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(C,m){const o=(0,v.getCoordsRelativeToElement)(window,C,m);if(this._charSizeService.hasValidSize)return o[0]=Math.min(Math.max(o[0],0),this._renderService.dimensions.css.canvas.width-1),o[1]=Math.min(Math.max(o[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(o[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(o[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(o[0]),y:Math.floor(o[1])}}};u.MouseService=b=d([y(0,h.IRenderService),y(1,h.ICharSizeService)],b)},3230:function(X,u,f){var d=this&&this.__decorate||function(a,l,_,x){var E,D=arguments.length,g=D<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(a,l,_,x);else for(var T=a.length-1;T>=0;T--)(E=a[T])&&(g=(D<3?E(g):D>3?E(l,_,g):E(l,_))||g);return D>3&&g&&Object.defineProperty(l,_,g),g},y=this&&this.__param||function(a,l){return function(_,x){l(_,x,a)}};Object.defineProperty(u,"__esModule",{value:!0}),u.RenderService=void 0;const h=f(6193),v=f(4725),b=f(8460),C=f(844),m=f(7226),o=f(2585);let c=u.RenderService=class extends C.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(a,l,_,x,E,D,g,T){super(),this._rowCount=a,this._charSizeService=x,this._renderer=this.register(new C.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new C.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 h.RenderDebouncer(((U,P)=>this._renderRows(U,P)),g),this.register(this._renderDebouncer),this.register(g.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(D.onResize((()=>this._fullRefresh()))),this.register(D.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(_.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(E.onDecorationRegistered((()=>this._fullRefresh()))),this.register(E.onDecorationRemoved((()=>this._fullRefresh()))),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(D.cols,D.rows),this._fullRefresh()}))),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(D.buffer.y,D.buffer.y,!0)))),this.register(T.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(g.window,l),this.register(g.onWindowChange((U=>this._registerIntersectionObserver(U,l))))}_registerIntersectionObserver(a,l){if("IntersectionObserver"in a){const _=new a.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});_.observe(l),this._observerDisposable.value=(0,C.toDisposable)((()=>_.disconnect()))}}_handleIntersectionChange(a){this._isPaused=a.isIntersecting===void 0?a.intersectionRatio===0:!a.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(a,l,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(a,l,this._rowCount))}_renderRows(a,l){this._renderer.value&&(a=Math.min(a,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(a,l),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:a,end:l}),this._onRender.fire({start:a,end:l}),this._isNextRenderRedrawOnly=!0)}resize(a,l){this._rowCount=l,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(a){this._renderer.value=a,this._renderer.value&&(this._renderer.value.onRequestRedraw((l=>this.refreshRows(l.start,l.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(a){return this._renderDebouncer.addRefreshCallback(a)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(a,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(a,l))):this._renderer.value.handleResize(a,l),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(a,l,_){this._selectionState.start=a,this._selectionState.end=l,this._selectionState.columnSelectMode=_,this._renderer.value?.handleSelectionChanged(a,l,_)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};u.RenderService=c=d([y(2,o.IOptionsService),y(3,v.ICharSizeService),y(4,o.IDecorationService),y(5,o.IBufferService),y(6,v.ICoreBrowserService),y(7,v.IThemeService)],c)},9312:function(X,u,f){var d=this&&this.__decorate||function(g,T,U,P){var W,N=arguments.length,Q=N<3?T:P===null?P=Object.getOwnPropertyDescriptor(T,U):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")Q=Reflect.decorate(g,T,U,P);else for(var ae=g.length-1;ae>=0;ae--)(W=g[ae])&&(Q=(N<3?W(Q):N>3?W(T,U,Q):W(T,U))||Q);return N>3&&Q&&Object.defineProperty(T,U,Q),Q},y=this&&this.__param||function(g,T){return function(U,P){T(U,P,g)}};Object.defineProperty(u,"__esModule",{value:!0}),u.SelectionService=void 0;const h=f(9806),v=f(9504),b=f(456),C=f(4725),m=f(8460),o=f(844),c=f(6114),a=f(4841),l=f(511),_=f(2585),x=" ",E=new RegExp(x,"g");let D=u.SelectionService=class extends o.Disposable{constructor(g,T,U,P,W,N,Q,ae,q){super(),this._element=g,this._screenElement=T,this._linkifier=U,this._bufferService=P,this._coreService=W,this._mouseService=N,this._optionsService=Q,this._renderService=ae,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=te=>this._handleMouseMove(te),this._mouseUpListener=te=>this._handleMouseUp(te),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((te=>this._handleTrim(te))),this.register(this._bufferService.buffers.onBufferActivate((te=>this._handleBufferActivate(te)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,o.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 g=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!g||!T||g[0]===T[0]&&g[1]===T[1])}get selectionText(){const g=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;if(!g||!T)return"";const U=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(g[0]===T[0])return"";const W=g[0]<T[0]?g[0]:T[0],N=g[0]<T[0]?T[0]:g[0];for(let Q=g[1];Q<=T[1];Q++){const ae=U.translateBufferLineToString(Q,!0,W,N);P.push(ae)}}else{const W=g[1]===T[1]?T[0]:void 0;P.push(U.translateBufferLineToString(g[1],!0,g[0],W));for(let N=g[1]+1;N<=T[1]-1;N++){const Q=U.lines.get(N),ae=U.translateBufferLineToString(N,!0);Q?.isWrapped?P[P.length-1]+=ae:P.push(ae)}if(g[1]!==T[1]){const N=U.lines.get(T[1]),Q=U.translateBufferLineToString(T[1],!0,0,T[0]);N&&N.isWrapped?P[P.length-1]+=Q:P.push(Q)}}return P.map((W=>W.replace(E," "))).join(c.isWindows?`\r
14
- `:`
15
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(g){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),c.isLinux&&g&&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(g){const T=this._getMouseBufferCoords(g),U=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(U&&P&&T)&&this._areCoordsInSelection(T,U,P)}isCellInSelection(g,T){const U=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!U||!P)&&this._areCoordsInSelection([g,T],U,P)}_areCoordsInSelection(g,T,U){return g[1]>T[1]&&g[1]<U[1]||T[1]===U[1]&&g[1]===T[1]&&g[0]>=T[0]&&g[0]<U[0]||T[1]<U[1]&&g[1]===U[1]&&g[0]<U[0]||T[1]<U[1]&&g[1]===T[1]&&g[0]>=T[0]}_selectWordAtCursor(g,T){const U=this._linkifier.currentLink?.link?.range;if(U)return this._model.selectionStart=[U.start.x-1,U.start.y-1],this._model.selectionStartLength=(0,a.getRangeLength)(U,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const P=this._getMouseBufferCoords(g);return!!P&&(this._selectWordAt(P,T),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(g,T){this._model.clearSelection(),g=Math.max(g,0),T=Math.min(T,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,g],this._model.selectionEnd=[this._bufferService.cols,T],this.refresh(),this._onSelectionChange.fire()}_handleTrim(g){this._model.handleTrim(g)&&this.refresh()}_getMouseBufferCoords(g){const T=this._mouseService.getCoords(g,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(T)return T[0]--,T[1]--,T[1]+=this._bufferService.buffer.ydisp,T}_getMouseEventScrollAmount(g){let T=(0,h.getCoordsRelativeToElement)(this._coreBrowserService.window,g,this._screenElement)[1];const U=this._renderService.dimensions.css.canvas.height;return T>=0&&T<=U?0:(T>U&&(T-=U),T=Math.min(Math.max(T,-50),50),T/=50,T/Math.abs(T)+Math.round(14*T))}shouldForceSelection(g){return c.isMac?g.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:g.shiftKey}handleMouseDown(g){if(this._mouseDownTimeStamp=g.timeStamp,(g.button!==2||!this.hasSelection)&&g.button===0){if(!this._enabled){if(!this.shouldForceSelection(g))return;g.stopPropagation()}g.preventDefault(),this._dragScrollAmount=0,this._enabled&&g.shiftKey?this._handleIncrementalClick(g):g.detail===1?this._handleSingleClick(g):g.detail===2?this._handleDoubleClick(g):g.detail===3&&this._handleTripleClick(g),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(g){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(g))}_handleSingleClick(g){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(g)?3:0,this._model.selectionStart=this._getMouseBufferCoords(g),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const T=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);T&&T.length!==this._model.selectionStart[0]&&T.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(g){this._selectWordAtCursor(g,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(g){const T=this._getMouseBufferCoords(g);T&&(this._activeSelectionMode=2,this._selectLineAt(T[1]))}shouldColumnSelect(g){return g.altKey&&!(c.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(g){if(g.stopImmediatePropagation(),!this._model.selectionStart)return;const T=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(g),!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(g),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const U=this._bufferService.buffer;if(this._model.selectionEnd[1]<U.lines.length){const P=U.lines.get(this._model.selectionEnd[1]);P&&P.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}T&&T[0]===this._model.selectionEnd[0]&&T[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const g=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(g.ydisp+this._bufferService.rows,g.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=g.ydisp),this.refresh()}}_handleMouseUp(g){const T=g.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&T<500&&g.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const U=this._mouseService.getCoords(g,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(U&&U[0]!==void 0&&U[1]!==void 0){const P=(0,v.moveToCellSequence)(U[0]-1,U[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const g=this._model.finalSelectionStart,T=this._model.finalSelectionEnd,U=!(!g||!T||g[0]===T[0]&&g[1]===T[1]);U?g&&T&&(this._oldSelectionStart&&this._oldSelectionEnd&&g[0]===this._oldSelectionStart[0]&&g[1]===this._oldSelectionStart[1]&&T[0]===this._oldSelectionEnd[0]&&T[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(g,T,U)):this._oldHasSelection&&this._fireOnSelectionChange(g,T,U)}_fireOnSelectionChange(g,T,U){this._oldSelectionStart=g,this._oldSelectionEnd=T,this._oldHasSelection=U,this._onSelectionChange.fire()}_handleBufferActivate(g){this.clearSelection(),this._trimListener.dispose(),this._trimListener=g.activeBuffer.lines.onTrim((T=>this._handleTrim(T)))}_convertViewportColToCharacterIndex(g,T){let U=T;for(let P=0;T>=P;P++){const W=g.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?U--:W>1&&T!==P&&(U+=W-1)}return U}setSelection(g,T,U){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[g,T],this._model.selectionStartLength=U,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(g){this._isClickInSelection(g)||(this._selectWordAtCursor(g,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(g,T,U=!0,P=!0){if(g[0]>=this._bufferService.cols)return;const W=this._bufferService.buffer,N=W.lines.get(g[1]);if(!N)return;const Q=W.translateBufferLineToString(g[1],!1);let ae=this._convertViewportColToCharacterIndex(N,g[0]),q=ae;const te=g[0]-ae;let V=0,R=0,z=0,A=0;if(Q.charAt(ae)===" "){for(;ae>0&&Q.charAt(ae-1)===" ";)ae--;for(;q<Q.length&&Q.charAt(q+1)===" ";)q++}else{let re=g[0],me=g[0];N.getWidth(re)===0&&(V++,re--),N.getWidth(me)===2&&(R++,me++);const pe=N.getString(me).length;for(pe>1&&(A+=pe-1,q+=pe-1);re>0&&ae>0&&!this._isCharWordSeparator(N.loadCell(re-1,this._workCell));){N.loadCell(re-1,this._workCell);const F=this._workCell.getChars().length;this._workCell.getWidth()===0?(V++,re--):F>1&&(z+=F-1,ae-=F-1),ae--,re--}for(;me<N.length&&q+1<Q.length&&!this._isCharWordSeparator(N.loadCell(me+1,this._workCell));){N.loadCell(me+1,this._workCell);const F=this._workCell.getChars().length;this._workCell.getWidth()===2?(R++,me++):F>1&&(A+=F-1,q+=F-1),q++,me++}}q++;let k=ae+te-V+z,K=Math.min(this._bufferService.cols,q-ae+V+R-z-A);if(T||Q.slice(ae,q).trim()!==""){if(U&&k===0&&N.getCodePoint(0)!==32){const re=W.lines.get(g[1]-1);if(re&&N.isWrapped&&re.getCodePoint(this._bufferService.cols-1)!==32){const me=this._getWordAt([this._bufferService.cols-1,g[1]-1],!1,!0,!1);if(me){const pe=this._bufferService.cols-me.start;k-=pe,K+=pe}}}if(P&&k+K===this._bufferService.cols&&N.getCodePoint(this._bufferService.cols-1)!==32){const re=W.lines.get(g[1]+1);if(re?.isWrapped&&re.getCodePoint(0)!==32){const me=this._getWordAt([0,g[1]+1],!1,!1,!0);me&&(K+=me.length)}}return{start:k,length:K}}}_selectWordAt(g,T){const U=this._getWordAt(g,T);if(U){for(;U.start<0;)U.start+=this._bufferService.cols,g[1]--;this._model.selectionStart=[U.start,g[1]],this._model.selectionStartLength=U.length}}_selectToWordAt(g){const T=this._getWordAt(g,!0);if(T){let U=g[1];for(;T.start<0;)T.start+=this._bufferService.cols,U--;if(!this._model.areSelectionValuesReversed())for(;T.start+T.length>this._bufferService.cols;)T.length-=this._bufferService.cols,U++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?T.start:T.start+T.length,U]}}_isCharWordSeparator(g){return g.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(g.getChars())>=0}_selectLineAt(g){const T=this._bufferService.buffer.getWrappedRangeForLine(g),U={start:{x:0,y:T.first},end:{x:this._bufferService.cols-1,y:T.last}};this._model.selectionStart=[0,T.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,a.getRangeLength)(U,this._bufferService.cols)}};u.SelectionService=D=d([y(3,_.IBufferService),y(4,_.ICoreService),y(5,C.IMouseService),y(6,_.IOptionsService),y(7,C.IRenderService),y(8,C.ICoreBrowserService)],D)},4725:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ILinkProviderService=u.IThemeService=u.ICharacterJoinerService=u.ISelectionService=u.IRenderService=u.IMouseService=u.ICoreBrowserService=u.ICharSizeService=void 0;const d=f(8343);u.ICharSizeService=(0,d.createDecorator)("CharSizeService"),u.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),u.IMouseService=(0,d.createDecorator)("MouseService"),u.IRenderService=(0,d.createDecorator)("RenderService"),u.ISelectionService=(0,d.createDecorator)("SelectionService"),u.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),u.IThemeService=(0,d.createDecorator)("ThemeService"),u.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(X,u,f){var d=this&&this.__decorate||function(D,g,T,U){var P,W=arguments.length,N=W<3?g:U===null?U=Object.getOwnPropertyDescriptor(g,T):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(D,g,T,U);else for(var Q=D.length-1;Q>=0;Q--)(P=D[Q])&&(N=(W<3?P(N):W>3?P(g,T,N):P(g,T))||N);return W>3&&N&&Object.defineProperty(g,T,N),N},y=this&&this.__param||function(D,g){return function(T,U){g(T,U,D)}};Object.defineProperty(u,"__esModule",{value:!0}),u.ThemeService=u.DEFAULT_ANSI_COLORS=void 0;const h=f(7239),v=f(8055),b=f(8460),C=f(844),m=f(2585),o=v.css.toColor("#ffffff"),c=v.css.toColor("#000000"),a=v.css.toColor("#ffffff"),l=v.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};u.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const D=[v.css.toColor("#2e3436"),v.css.toColor("#cc0000"),v.css.toColor("#4e9a06"),v.css.toColor("#c4a000"),v.css.toColor("#3465a4"),v.css.toColor("#75507b"),v.css.toColor("#06989a"),v.css.toColor("#d3d7cf"),v.css.toColor("#555753"),v.css.toColor("#ef2929"),v.css.toColor("#8ae234"),v.css.toColor("#fce94f"),v.css.toColor("#729fcf"),v.css.toColor("#ad7fa8"),v.css.toColor("#34e2e2"),v.css.toColor("#eeeeec")],g=[0,95,135,175,215,255];for(let T=0;T<216;T++){const U=g[T/36%6|0],P=g[T/6%6|0],W=g[T%6];D.push({css:v.channels.toCss(U,P,W),rgba:v.channels.toRgba(U,P,W)})}for(let T=0;T<24;T++){const U=8+10*T;D.push({css:v.channels.toCss(U,U,U),rgba:v.channels.toRgba(U,U,U)})}return D})());let x=u.ThemeService=class extends C.Disposable{get colors(){return this._colors}constructor(D){super(),this._optionsService=D,this._contrastCache=new h.ColorContrastCache,this._halfContrastCache=new h.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:o,background:c,cursor:a,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:v.color.blend(c,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:v.color.blend(c,_),ansi:u.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(D={}){const g=this._colors;if(g.foreground=E(D.foreground,o),g.background=E(D.background,c),g.cursor=E(D.cursor,a),g.cursorAccent=E(D.cursorAccent,l),g.selectionBackgroundTransparent=E(D.selectionBackground,_),g.selectionBackgroundOpaque=v.color.blend(g.background,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundTransparent=E(D.selectionInactiveBackground,g.selectionBackgroundTransparent),g.selectionInactiveBackgroundOpaque=v.color.blend(g.background,g.selectionInactiveBackgroundTransparent),g.selectionForeground=D.selectionForeground?E(D.selectionForeground,v.NULL_COLOR):void 0,g.selectionForeground===v.NULL_COLOR&&(g.selectionForeground=void 0),v.color.isOpaque(g.selectionBackgroundTransparent)&&(g.selectionBackgroundTransparent=v.color.opacity(g.selectionBackgroundTransparent,.3)),v.color.isOpaque(g.selectionInactiveBackgroundTransparent)&&(g.selectionInactiveBackgroundTransparent=v.color.opacity(g.selectionInactiveBackgroundTransparent,.3)),g.ansi=u.DEFAULT_ANSI_COLORS.slice(),g.ansi[0]=E(D.black,u.DEFAULT_ANSI_COLORS[0]),g.ansi[1]=E(D.red,u.DEFAULT_ANSI_COLORS[1]),g.ansi[2]=E(D.green,u.DEFAULT_ANSI_COLORS[2]),g.ansi[3]=E(D.yellow,u.DEFAULT_ANSI_COLORS[3]),g.ansi[4]=E(D.blue,u.DEFAULT_ANSI_COLORS[4]),g.ansi[5]=E(D.magenta,u.DEFAULT_ANSI_COLORS[5]),g.ansi[6]=E(D.cyan,u.DEFAULT_ANSI_COLORS[6]),g.ansi[7]=E(D.white,u.DEFAULT_ANSI_COLORS[7]),g.ansi[8]=E(D.brightBlack,u.DEFAULT_ANSI_COLORS[8]),g.ansi[9]=E(D.brightRed,u.DEFAULT_ANSI_COLORS[9]),g.ansi[10]=E(D.brightGreen,u.DEFAULT_ANSI_COLORS[10]),g.ansi[11]=E(D.brightYellow,u.DEFAULT_ANSI_COLORS[11]),g.ansi[12]=E(D.brightBlue,u.DEFAULT_ANSI_COLORS[12]),g.ansi[13]=E(D.brightMagenta,u.DEFAULT_ANSI_COLORS[13]),g.ansi[14]=E(D.brightCyan,u.DEFAULT_ANSI_COLORS[14]),g.ansi[15]=E(D.brightWhite,u.DEFAULT_ANSI_COLORS[15]),D.extendedAnsi){const T=Math.min(g.ansi.length-16,D.extendedAnsi.length);for(let U=0;U<T;U++)g.ansi[U+16]=E(D.extendedAnsi[U],u.DEFAULT_ANSI_COLORS[U+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(D){this._restoreColor(D),this._onChangeColors.fire(this.colors)}_restoreColor(D){if(D!==void 0)switch(D){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[D]=this._restoreColors.ansi[D]}else for(let g=0;g<this._restoreColors.ansi.length;++g)this._colors.ansi[g]=this._restoreColors.ansi[g]}modifyColors(D){D(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 E(D,g){if(D!==void 0)try{return v.css.toColor(D)}catch{}return g}u.ThemeService=x=d([y(0,m.IOptionsService)],x)},6349:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CircularList=void 0;const d=f(8460),y=f(844);class h extends y.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 C=new Array(b);for(let m=0;m<Math.min(b,this.length);m++)C[m]=this._array[this._getCyclicIndex(m)];this._array=C,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let C=this._length;C<b;C++)this._array[C]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,C){this._array[this._getCyclicIndex(b)]=C}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,C,...m){if(C){for(let o=b;o<this._length-C;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+C)];this._length-=C,this.onDeleteEmitter.fire({index:b,amount:C})}for(let o=this._length-1;o>=b;o--)this._array[this._getCyclicIndex(o+m.length)]=this._array[this._getCyclicIndex(o)];for(let o=0;o<m.length;o++)this._array[this._getCyclicIndex(b+o)]=m[o];if(m.length&&this.onInsertEmitter.fire({index:b,amount:m.length}),this._length+m.length>this._maxLength){const o=this._length+m.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=m.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,C,m){if(!(C<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let c=C-1;c>=0;c--)this.set(b+c+m,this.get(b+c));const o=b+C+m-this._length;if(o>0)for(this._length+=o;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let o=0;o<C;o++)this.set(b+o+m,this.get(b+o))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}u.CircularList=h},1439:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.clone=void 0,u.clone=function f(d,y=5){if(typeof d!="object")return d;const h=Array.isArray(d)?[]:{};for(const v in d)h[v]=y<=1?d[v]:d[v]&&f(d[v],y-1);return h}},8055:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.contrastRatio=u.toPaddedHex=u.rgba=u.rgb=u.css=u.color=u.channels=u.NULL_COLOR=void 0;let f=0,d=0,y=0,h=0;var v,b,C,m,o;function c(l){const _=l.toString(16);return _.length<2?"0"+_:_}function a(l,_){return l<_?(_+.05)/(l+.05):(l+.05)/(_+.05)}u.NULL_COLOR={css:"#00000000",rgba:0},(function(l){l.toCss=function(_,x,E,D){return D!==void 0?`#${c(_)}${c(x)}${c(E)}${c(D)}`:`#${c(_)}${c(x)}${c(E)}`},l.toRgba=function(_,x,E,D=255){return(_<<24|x<<16|E<<8|D)>>>0},l.toColor=function(_,x,E,D){return{css:l.toCss(_,x,E,D),rgba:l.toRgba(_,x,E,D)}}})(v||(u.channels=v={})),(function(l){function _(x,E){return h=Math.round(255*E),[f,d,y]=o.toChannels(x.rgba),{css:v.toCss(f,d,y,h),rgba:v.toRgba(f,d,y,h)}}l.blend=function(x,E){if(h=(255&E.rgba)/255,h===1)return{css:E.css,rgba:E.rgba};const D=E.rgba>>24&255,g=E.rgba>>16&255,T=E.rgba>>8&255,U=x.rgba>>24&255,P=x.rgba>>16&255,W=x.rgba>>8&255;return f=U+Math.round((D-U)*h),d=P+Math.round((g-P)*h),y=W+Math.round((T-W)*h),{css:v.toCss(f,d,y),rgba:v.toRgba(f,d,y)}},l.isOpaque=function(x){return(255&x.rgba)==255},l.ensureContrastRatio=function(x,E,D){const g=o.ensureContrastRatio(x.rgba,E.rgba,D);if(g)return v.toColor(g>>24&255,g>>16&255,g>>8&255)},l.opaque=function(x){const E=(255|x.rgba)>>>0;return[f,d,y]=o.toChannels(E),{css:v.toCss(f,d,y),rgba:E}},l.opacity=_,l.multiplyOpacity=function(x,E){return h=255&x.rgba,_(x,h*E/255)},l.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(b||(u.color=b={})),(function(l){let _,x;try{const E=document.createElement("canvas");E.width=1,E.height=1;const D=E.getContext("2d",{willReadFrequently:!0});D&&(_=D,_.globalCompositeOperation="copy",x=_.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(E){if(E.match(/#[\da-f]{3,8}/i))switch(E.length){case 4:return f=parseInt(E.slice(1,2).repeat(2),16),d=parseInt(E.slice(2,3).repeat(2),16),y=parseInt(E.slice(3,4).repeat(2),16),v.toColor(f,d,y);case 5:return f=parseInt(E.slice(1,2).repeat(2),16),d=parseInt(E.slice(2,3).repeat(2),16),y=parseInt(E.slice(3,4).repeat(2),16),h=parseInt(E.slice(4,5).repeat(2),16),v.toColor(f,d,y,h);case 7:return{css:E,rgba:(parseInt(E.slice(1),16)<<8|255)>>>0};case 9:return{css:E,rgba:parseInt(E.slice(1),16)>>>0}}const D=E.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(D)return f=parseInt(D[1]),d=parseInt(D[2]),y=parseInt(D[3]),h=Math.round(255*(D[5]===void 0?1:parseFloat(D[5]))),v.toColor(f,d,y,h);if(!_||!x)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=x,_.fillStyle=E,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[f,d,y,h]=_.getImageData(0,0,1,1).data,h!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:v.toRgba(f,d,y,h),css:E}}})(C||(u.css=C={})),(function(l){function _(x,E,D){const g=x/255,T=E/255,U=D/255;return .2126*(g<=.03928?g/12.92:Math.pow((g+.055)/1.055,2.4))+.7152*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))+.0722*(U<=.03928?U/12.92:Math.pow((U+.055)/1.055,2.4))}l.relativeLuminance=function(x){return _(x>>16&255,x>>8&255,255&x)},l.relativeLuminance2=_})(m||(u.rgb=m={})),(function(l){function _(E,D,g){const T=E>>24&255,U=E>>16&255,P=E>>8&255;let W=D>>24&255,N=D>>16&255,Q=D>>8&255,ae=a(m.relativeLuminance2(W,N,Q),m.relativeLuminance2(T,U,P));for(;ae<g&&(W>0||N>0||Q>0);)W-=Math.max(0,Math.ceil(.1*W)),N-=Math.max(0,Math.ceil(.1*N)),Q-=Math.max(0,Math.ceil(.1*Q)),ae=a(m.relativeLuminance2(W,N,Q),m.relativeLuminance2(T,U,P));return(W<<24|N<<16|Q<<8|255)>>>0}function x(E,D,g){const T=E>>24&255,U=E>>16&255,P=E>>8&255;let W=D>>24&255,N=D>>16&255,Q=D>>8&255,ae=a(m.relativeLuminance2(W,N,Q),m.relativeLuminance2(T,U,P));for(;ae<g&&(W<255||N<255||Q<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),N=Math.min(255,N+Math.ceil(.1*(255-N))),Q=Math.min(255,Q+Math.ceil(.1*(255-Q))),ae=a(m.relativeLuminance2(W,N,Q),m.relativeLuminance2(T,U,P));return(W<<24|N<<16|Q<<8|255)>>>0}l.blend=function(E,D){if(h=(255&D)/255,h===1)return D;const g=D>>24&255,T=D>>16&255,U=D>>8&255,P=E>>24&255,W=E>>16&255,N=E>>8&255;return f=P+Math.round((g-P)*h),d=W+Math.round((T-W)*h),y=N+Math.round((U-N)*h),v.toRgba(f,d,y)},l.ensureContrastRatio=function(E,D,g){const T=m.relativeLuminance(E>>8),U=m.relativeLuminance(D>>8);if(a(T,U)<g){if(U<T){const N=_(E,D,g),Q=a(T,m.relativeLuminance(N>>8));if(Q<g){const ae=x(E,D,g);return Q>a(T,m.relativeLuminance(ae>>8))?N:ae}return N}const P=x(E,D,g),W=a(T,m.relativeLuminance(P>>8));if(W<g){const N=_(E,D,g);return W>a(T,m.relativeLuminance(N>>8))?P:N}return P}},l.reduceLuminance=_,l.increaseLuminance=x,l.toChannels=function(E){return[E>>24&255,E>>16&255,E>>8&255,255&E]}})(o||(u.rgba=o={})),u.toPaddedHex=c,u.contrastRatio=a},8969:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CoreTerminal=void 0;const d=f(844),y=f(2585),h=f(4348),v=f(7866),b=f(744),C=f(7302),m=f(6975),o=f(8460),c=f(1753),a=f(1480),l=f(7994),_=f(9282),x=f(5435),E=f(5981),D=f(2660);let g=!1;class T extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new o.EventEmitter),this._onScroll.event((P=>{this._onScrollApi?.fire(P.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(P){for(const W in P)this.optionsService.options[W]=P[W]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new o.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new o.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new o.EventEmitter),this._instantiationService=new h.InstantiationService,this.optionsService=this.register(new C.OptionsService(P)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(v.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(c.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(a.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(D.OscLinkService),this._instantiationService.setService(y.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,o.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,o.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,o.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,o.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((W=>{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((W=>{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 E.WriteBuffer(((W,N)=>this._inputHandler.parse(W,N)))),this.register((0,o.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,W){this._writeBuffer.write(P,W)}writeSync(P,W){this._logService.logLevel<=y.LogLevelEnum.WARN&&!g&&(this._logService.warn("writeSync is unreliable and will be removed soon."),g=!0),this._writeBuffer.writeSync(P,W)}input(P,W=!0){this.coreService.triggerDataEvent(P,W)}resize(P,W){isNaN(P)||isNaN(W)||(P=Math.max(P,b.MINIMUM_COLS),W=Math.max(W,b.MINIMUM_ROWS),this._bufferService.resize(P,W))}scroll(P,W=!1){this._bufferService.scroll(P,W)}scrollLines(P,W,N){this._bufferService.scrollLines(P,W,N)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const W=P-this._bufferService.buffer.ydisp;W!==0&&this.scrollLines(W)}registerEscHandler(P,W){return this._inputHandler.registerEscHandler(P,W)}registerDcsHandler(P,W){return this._inputHandler.registerDcsHandler(P,W)}registerCsiHandler(P,W){return this._inputHandler.registerCsiHandler(P,W)}registerOscHandler(P,W){return this._inputHandler.registerOscHandler(P,W)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const W=this.optionsService.rawOptions.windowsPty;W&&W.buildNumber!==void 0&&W.buildNumber!==void 0?P=W.backend==="conpty"&&W.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},(()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const W of P)W.dispose()}))}}}u.CoreTerminal=T},8460:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.runAndSubscribe=u.forwardEvent=u.EventEmitter=void 0,u.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=f=>(this._listeners.push(f),{dispose:()=>{if(!this._disposed){for(let d=0;d<this._listeners.length;d++)if(this._listeners[d]===f)return void this._listeners.splice(d,1)}}})),this._event}fire(f,d){const y=[];for(let h=0;h<this._listeners.length;h++)y.push(this._listeners[h]);for(let h=0;h<y.length;h++)y[h].call(void 0,f,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},u.forwardEvent=function(f,d){return f((y=>d.fire(y)))},u.runAndSubscribe=function(f,d){return d(void 0),f((y=>d(y)))}},5435:function(X,u,f){var d=this&&this.__decorate||function(V,R,z,A){var k,K=arguments.length,re=K<3?R:A===null?A=Object.getOwnPropertyDescriptor(R,z):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")re=Reflect.decorate(V,R,z,A);else for(var me=V.length-1;me>=0;me--)(k=V[me])&&(re=(K<3?k(re):K>3?k(R,z,re):k(R,z))||re);return K>3&&re&&Object.defineProperty(R,z,re),re},y=this&&this.__param||function(V,R){return function(z,A){R(z,A,V)}};Object.defineProperty(u,"__esModule",{value:!0}),u.InputHandler=u.WindowsOptionsReportType=void 0;const h=f(2584),v=f(7116),b=f(2015),C=f(844),m=f(482),o=f(8437),c=f(8460),a=f(643),l=f(511),_=f(3734),x=f(2585),E=f(1480),D=f(6242),g=f(6351),T=f(5941),U={"(":0,")":1,"*":2,"+":3,"-":1,".":2},P=131072;function W(V,R){if(V>24)return R.setWinLines||!1;switch(V){case 1:return!!R.restoreWin;case 2:return!!R.minimizeWin;case 3:return!!R.setWinPosition;case 4:return!!R.setWinSizePixels;case 5:return!!R.raiseWin;case 6:return!!R.lowerWin;case 7:return!!R.refreshWin;case 8:return!!R.setWinSizeChars;case 9:return!!R.maximizeWin;case 10:return!!R.fullscreenWin;case 11:return!!R.getWinState;case 13:return!!R.getWinPosition;case 14:return!!R.getWinSizePixels;case 15:return!!R.getScreenSizePixels;case 16:return!!R.getCellSizePixels;case 18:return!!R.getWinSizeChars;case 19:return!!R.getScreenSizeChars;case 20:return!!R.getIconTitle;case 21:return!!R.getWinTitle;case 22:return!!R.pushTitle;case 23:return!!R.popTitle;case 24:return!!R.setWinLines}return!1}var N;(function(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(u.WindowsOptionsReportType=N={}));let Q=0;class ae extends C.Disposable{getAttrData(){return this._curAttrData}constructor(R,z,A,k,K,re,me,pe,F=new b.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=z,this._coreService=A,this._logService=k,this._optionsService=K,this._oscLinkService=re,this._coreMouseService=me,this._unicodeService=pe,this._parser=F,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new c.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new c.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new c.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new c.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new c.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new c.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new c.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new c.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new c.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new c.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new c.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new c.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new c.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 q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((L=>this._activeBuffer=L.activeBuffer))),this._parser.setCsiHandlerFallback(((L,ne)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(L),params:ne.toArray()})})),this._parser.setEscHandlerFallback((L=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(L)})})),this._parser.setExecuteHandlerFallback((L=>{this._logService.debug("Unknown EXECUTE code: ",{code:L})})),this._parser.setOscHandlerFallback(((L,ne,ve)=>{this._logService.debug("Unknown OSC code: ",{identifier:L,action:ne,data:ve})})),this._parser.setDcsHandlerFallback(((L,ne,ve)=>{ne==="HOOK"&&(ve=ve.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(L),action:ne,payload:ve})})),this._parser.setPrintHandler(((L,ne,ve)=>this.print(L,ne,ve))),this._parser.registerCsiHandler({final:"@"},(L=>this.insertChars(L))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(L=>this.scrollLeft(L))),this._parser.registerCsiHandler({final:"A"},(L=>this.cursorUp(L))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(L=>this.scrollRight(L))),this._parser.registerCsiHandler({final:"B"},(L=>this.cursorDown(L))),this._parser.registerCsiHandler({final:"C"},(L=>this.cursorForward(L))),this._parser.registerCsiHandler({final:"D"},(L=>this.cursorBackward(L))),this._parser.registerCsiHandler({final:"E"},(L=>this.cursorNextLine(L))),this._parser.registerCsiHandler({final:"F"},(L=>this.cursorPrecedingLine(L))),this._parser.registerCsiHandler({final:"G"},(L=>this.cursorCharAbsolute(L))),this._parser.registerCsiHandler({final:"H"},(L=>this.cursorPosition(L))),this._parser.registerCsiHandler({final:"I"},(L=>this.cursorForwardTab(L))),this._parser.registerCsiHandler({final:"J"},(L=>this.eraseInDisplay(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(L=>this.eraseInDisplay(L,!0))),this._parser.registerCsiHandler({final:"K"},(L=>this.eraseInLine(L,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(L=>this.eraseInLine(L,!0))),this._parser.registerCsiHandler({final:"L"},(L=>this.insertLines(L))),this._parser.registerCsiHandler({final:"M"},(L=>this.deleteLines(L))),this._parser.registerCsiHandler({final:"P"},(L=>this.deleteChars(L))),this._parser.registerCsiHandler({final:"S"},(L=>this.scrollUp(L))),this._parser.registerCsiHandler({final:"T"},(L=>this.scrollDown(L))),this._parser.registerCsiHandler({final:"X"},(L=>this.eraseChars(L))),this._parser.registerCsiHandler({final:"Z"},(L=>this.cursorBackwardTab(L))),this._parser.registerCsiHandler({final:"`"},(L=>this.charPosAbsolute(L))),this._parser.registerCsiHandler({final:"a"},(L=>this.hPositionRelative(L))),this._parser.registerCsiHandler({final:"b"},(L=>this.repeatPrecedingCharacter(L))),this._parser.registerCsiHandler({final:"c"},(L=>this.sendDeviceAttributesPrimary(L))),this._parser.registerCsiHandler({prefix:">",final:"c"},(L=>this.sendDeviceAttributesSecondary(L))),this._parser.registerCsiHandler({final:"d"},(L=>this.linePosAbsolute(L))),this._parser.registerCsiHandler({final:"e"},(L=>this.vPositionRelative(L))),this._parser.registerCsiHandler({final:"f"},(L=>this.hVPosition(L))),this._parser.registerCsiHandler({final:"g"},(L=>this.tabClear(L))),this._parser.registerCsiHandler({final:"h"},(L=>this.setMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(L=>this.setModePrivate(L))),this._parser.registerCsiHandler({final:"l"},(L=>this.resetMode(L))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(L=>this.resetModePrivate(L))),this._parser.registerCsiHandler({final:"m"},(L=>this.charAttributes(L))),this._parser.registerCsiHandler({final:"n"},(L=>this.deviceStatus(L))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(L=>this.deviceStatusPrivate(L))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(L=>this.softReset(L))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(L=>this.setCursorStyle(L))),this._parser.registerCsiHandler({final:"r"},(L=>this.setScrollRegion(L))),this._parser.registerCsiHandler({final:"s"},(L=>this.saveCursor(L))),this._parser.registerCsiHandler({final:"t"},(L=>this.windowOptions(L))),this._parser.registerCsiHandler({final:"u"},(L=>this.restoreCursor(L))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(L=>this.insertColumns(L))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(L=>this.deleteColumns(L))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(L=>this.selectProtected(L))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(L=>this.requestMode(L,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(L=>this.requestMode(L,!1))),this._parser.setExecuteHandler(h.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(h.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(h.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(h.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(h.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(h.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(h.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(h.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(h.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(h.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new D.OscHandler((L=>(this.setTitle(L),this.setIconName(L),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((L=>this.setIconName(L)))),this._parser.registerOscHandler(2,new D.OscHandler((L=>this.setTitle(L)))),this._parser.registerOscHandler(4,new D.OscHandler((L=>this.setOrReportIndexedColor(L)))),this._parser.registerOscHandler(8,new D.OscHandler((L=>this.setHyperlink(L)))),this._parser.registerOscHandler(10,new D.OscHandler((L=>this.setOrReportFgColor(L)))),this._parser.registerOscHandler(11,new D.OscHandler((L=>this.setOrReportBgColor(L)))),this._parser.registerOscHandler(12,new D.OscHandler((L=>this.setOrReportCursorColor(L)))),this._parser.registerOscHandler(104,new D.OscHandler((L=>this.restoreIndexedColor(L)))),this._parser.registerOscHandler(110,new D.OscHandler((L=>this.restoreFgColor(L)))),this._parser.registerOscHandler(111,new D.OscHandler((L=>this.restoreBgColor(L)))),this._parser.registerOscHandler(112,new D.OscHandler((L=>this.restoreCursorColor(L)))),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 L in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:L},(()=>this.selectCharset("("+L))),this._parser.registerEscHandler({intermediates:")",final:L},(()=>this.selectCharset(")"+L))),this._parser.registerEscHandler({intermediates:"*",final:L},(()=>this.selectCharset("*"+L))),this._parser.registerEscHandler({intermediates:"+",final:L},(()=>this.selectCharset("+"+L))),this._parser.registerEscHandler({intermediates:"-",final:L},(()=>this.selectCharset("-"+L))),this._parser.registerEscHandler({intermediates:".",final:L},(()=>this.selectCharset("."+L))),this._parser.registerEscHandler({intermediates:"/",final:L},(()=>this.selectCharset("/"+L)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((L=>(this._logService.error("Parsing error: ",L),L))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler(((L,ne)=>this.requestStatusString(L,ne))))}_preserveStack(R,z,A,k){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=z,this._parseStack.decodedLength=A,this._parseStack.position=k}_logSlowResolvingAsync(R){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([R,new Promise(((z,A)=>setTimeout((()=>A("#SLOW_TIMEOUT")),5e3)))]).catch((z=>{if(z!=="#SLOW_TIMEOUT")throw z;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(R,z){let A,k=this._activeBuffer.x,K=this._activeBuffer.y,re=0;const me=this._parseStack.paused;if(me){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,z))return this._logSlowResolvingAsync(A),A;k=this._parseStack.cursorStartX,K=this._parseStack.cursorStartY,this._parseStack.paused=!1,R.length>P&&(re=this._parseStack.position+P)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof R=="string"?` "${R}"`:` "${Array.prototype.map.call(R,(L=>String.fromCharCode(L))).join("")}"`),typeof R=="string"?R.split("").map((L=>L.charCodeAt(0))):R),this._parseBuffer.length<R.length&&this._parseBuffer.length<P&&(this._parseBuffer=new Uint32Array(Math.min(R.length,P))),me||this._dirtyRowTracker.clearRange(),R.length>P)for(let L=re;L<R.length;L+=P){const ne=L+P<R.length?L+P:R.length,ve=typeof R=="string"?this._stringDecoder.decode(R.substring(L,ne),this._parseBuffer):this._utf8Decoder.decode(R.subarray(L,ne),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,ve))return this._preserveStack(k,K,ve,L),this._logSlowResolvingAsync(A),A}else if(!me){const L=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,L))return this._preserveStack(k,K,L,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===k&&this._activeBuffer.y===K||this._onCursorMove.fire();const pe=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),F=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);F<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(F,this._bufferService.rows-1),Math.min(pe,this._bufferService.rows-1))}print(R,z,A){let k,K;const re=this._charsetService.charset,me=this._optionsService.rawOptions.screenReaderMode,pe=this._bufferService.cols,F=this._coreService.decPrivateModes.wraparound,L=this._coreService.modes.insertMode,ne=this._curAttrData;let ve=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-z>0&&ve.getWidth(this._activeBuffer.x-1)===2&&ve.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ne);let Se=this._parser.precedingJoinState;for(let be=z;be<A;++be){if(k=R[be],k<127&&re){const at=re[String.fromCharCode(k)];at&&(k=at.charCodeAt(0))}const Me=this._unicodeService.charProperties(k,Se);K=E.UnicodeService.extractWidth(Me);const Ue=E.UnicodeService.extractShouldJoin(Me),He=Ue?E.UnicodeService.extractWidth(Se):0;if(Se=Me,me&&this._onA11yChar.fire((0,m.stringFromCodePoint)(k)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+K-He>pe){if(F){const at=ve;let Ae=this._activeBuffer.x-He;for(this._activeBuffer.x=He,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),ve=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),He>0&&ve instanceof o.BufferLine&&ve.copyCellsFrom(at,Ae,0,He,!1);Ae<pe;)at.setCellFromCodepoint(Ae++,0,1,ne)}else if(this._activeBuffer.x=pe-1,K===2)continue}if(Ue&&this._activeBuffer.x){const at=ve.getWidth(this._activeBuffer.x-1)?1:2;ve.addCodepointToCell(this._activeBuffer.x-at,k,K);for(let Ae=K-He;--Ae>=0;)ve.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}else if(L&&(ve.insertCells(this._activeBuffer.x,K-He,this._activeBuffer.getNullCell(ne)),ve.getWidth(pe-1)===2&&ve.setCellFromCodepoint(pe-1,a.NULL_CELL_CODE,a.NULL_CELL_WIDTH,ne)),ve.setCellFromCodepoint(this._activeBuffer.x++,k,K,ne),K>0)for(;--K;)ve.setCellFromCodepoint(this._activeBuffer.x++,0,0,ne)}this._parser.precedingJoinState=Se,this._activeBuffer.x<pe&&A-z>0&&ve.getWidth(this._activeBuffer.x)===0&&!ve.hasContent(this._activeBuffer.x)&&ve.setCellFromCodepoint(this._activeBuffer.x,0,1,ne),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(R,z){return R.final!=="t"||R.prefix||R.intermediates?this._parser.registerCsiHandler(R,z):this._parser.registerCsiHandler(R,(A=>!W(A.params[0],this._optionsService.rawOptions.windowOptions)||z(A)))}registerDcsHandler(R,z){return this._parser.registerDcsHandler(R,new g.DcsHandler(z))}registerEscHandler(R,z){return this._parser.registerEscHandler(R,z)}registerOscHandler(R,z){return this._parser.registerOscHandler(R,new D.OscHandler(z))}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(){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&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const R=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);R.hasWidth(this._activeBuffer.x)&&!R.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const R=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-R),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(R=this._bufferService.cols-1){this._activeBuffer.x=Math.min(R,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(R,z){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=R,this._activeBuffer.y=this._activeBuffer.scrollTop+z):(this._activeBuffer.x=R,this._activeBuffer.y=z),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(R,z){this._restrictCursor(),this._setCursor(this._activeBuffer.x+R,this._activeBuffer.y+z)}cursorUp(R){const z=this._activeBuffer.y-this._activeBuffer.scrollTop;return z>=0?this._moveCursor(0,-Math.min(z,R.params[0]||1)):this._moveCursor(0,-(R.params[0]||1)),!0}cursorDown(R){const z=this._activeBuffer.scrollBottom-this._activeBuffer.y;return z>=0?this._moveCursor(0,Math.min(z,R.params[0]||1)):this._moveCursor(0,R.params[0]||1),!0}cursorForward(R){return this._moveCursor(R.params[0]||1,0),!0}cursorBackward(R){return this._moveCursor(-(R.params[0]||1),0),!0}cursorNextLine(R){return this.cursorDown(R),this._activeBuffer.x=0,!0}cursorPrecedingLine(R){return this.cursorUp(R),this._activeBuffer.x=0,!0}cursorCharAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(R){return this._setCursor(R.length>=2?(R.params[1]||1)-1:0,(R.params[0]||1)-1),!0}charPosAbsolute(R){return this._setCursor((R.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(R){return this._moveCursor(R.params[0]||1,0),!0}linePosAbsolute(R){return this._setCursor(this._activeBuffer.x,(R.params[0]||1)-1),!0}vPositionRelative(R){return this._moveCursor(0,R.params[0]||1),!0}hVPosition(R){return this.cursorPosition(R),!0}tabClear(R){const z=R.params[0];return z===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:z===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=R.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(R){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let z=R.params[0]||1;for(;z--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(R){const z=R.params[0];return z===1&&(this._curAttrData.bg|=536870912),z!==2&&z!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(R,z,A,k=!1,K=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);re.replaceCells(z,A,this._activeBuffer.getNullCell(this._eraseAttrData()),K),k&&(re.isWrapped=!1)}_resetBufferLine(R,z=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),z),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+R),A.isWrapped=!1)}eraseInDisplay(R,z=!1){let A;switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);A<this._bufferService.rows;A++)this._resetBufferLine(A,z);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,z),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,z);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,z);this._dirtyRowTracker.markDirty(0);break;case 3:const k=this._activeBuffer.lines.length-this._bufferService.rows;k>0&&(this._activeBuffer.lines.trimStart(k),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-k,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-k,0),this._onScroll.fire(0))}return!0}eraseInLine(R,z=!1){switch(this._restrictCursor(this._bufferService.cols),R.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,z);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,z);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,z)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(R){this._restrictCursor();let z=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-k+1;for(;z--;)this._activeBuffer.lines.splice(K-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(R){this._restrictCursor();let z=R.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let k;for(k=this._bufferService.rows-1-this._activeBuffer.scrollBottom,k=this._bufferService.rows-1+this._activeBuffer.ybase-k;z--;)this._activeBuffer.lines.splice(A,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}insertChars(R){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.insertCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(R){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.deleteCells(this._activeBuffer.x,R.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(R){let z=R.params[0]||1;for(;z--;)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(R){let z=R.params[0]||1;for(;z--;)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(o.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);k.deleteCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);k.insertCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);k.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(R){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const z=R.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const k=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);k.deleteCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),k.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(R){this._restrictCursor();const z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return z&&(z.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(R.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(R){const z=this._parser.precedingJoinState;if(!z)return!0;const A=R.params[0]||1,k=E.UnicodeService.extractWidth(z),K=this._activeBuffer.x-k,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(K),me=new Uint32Array(re.length*A);let pe=0;for(let L=0;L<re.length;){const ne=re.codePointAt(L)||0;me[pe++]=ne,L+=ne>65535?2:1}let F=pe;for(let L=1;L<A;++L)me.copyWithin(F,0,pe),F+=pe;return this.print(me,0,F),!0}sendDeviceAttributesPrimary(R){return R.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(h.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(h.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(R){return R.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(h.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(h.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(R.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(h.C0.ESC+"[>83;40003;0c")),!0}_is(R){return(this._optionsService.rawOptions.termName+"").indexOf(R)===0}setMode(R){for(let z=0;z<R.length;z++)switch(R.params[z]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(R){for(let z=0;z<R.length;z++)switch(R.params[z]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.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(R){for(let z=0;z<R.length;z++)switch(R.params[z]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(R){for(let z=0;z<R.length;z++)switch(R.params[z]){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(),R.params[z]===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(R,z){const A=this._coreService.decPrivateModes,{activeProtocol:k,activeEncoding:K}=this._coreMouseService,re=this._coreService,{buffers:me,cols:pe}=this._bufferService,{active:F,alt:L}=me,ne=this._optionsService.rawOptions,ve=Ue=>Ue?1:2,Se=R.params[0];return be=Se,Me=z?Se===2?4:Se===4?ve(re.modes.insertMode):Se===12?3:Se===20?ve(ne.convertEol):0:Se===1?ve(A.applicationCursorKeys):Se===3?ne.windowOptions.setWinLines?pe===80?2:pe===132?1:0:0:Se===6?ve(A.origin):Se===7?ve(A.wraparound):Se===8?3:Se===9?ve(k==="X10"):Se===12?ve(ne.cursorBlink):Se===25?ve(!re.isCursorHidden):Se===45?ve(A.reverseWraparound):Se===66?ve(A.applicationKeypad):Se===67?4:Se===1e3?ve(k==="VT200"):Se===1002?ve(k==="DRAG"):Se===1003?ve(k==="ANY"):Se===1004?ve(A.sendFocus):Se===1005?4:Se===1006?ve(K==="SGR"):Se===1015?4:Se===1016?ve(K==="SGR_PIXELS"):Se===1048?1:Se===47||Se===1047||Se===1049?ve(F===L):Se===2004?ve(A.bracketedPasteMode):0,re.triggerDataEvent(`${h.C0.ESC}[${z?"":"?"}${be};${Me}$y`),!0;var be,Me}_updateAttrColor(R,z,A,k,K){return z===2?(R|=50331648,R&=-16777216,R|=_.AttributeData.fromColorRGB([A,k,K])):z===5&&(R&=-50331904,R|=33554432|255&A),R}_extractColor(R,z,A){const k=[0,0,-1,0,0,0];let K=0,re=0;do{if(k[re+K]=R.params[z+re],R.hasSubParams(z+re)){const me=R.getSubParams(z+re);let pe=0;do k[1]===5&&(K=1),k[re+pe+1+K]=me[pe];while(++pe<me.length&&pe+re+1+K<k.length);break}if(k[1]===5&&re+K>=2||k[1]===2&&re+K>=5)break;k[1]&&(K=1)}while(++re+z<R.length&&re+K<k.length);for(let me=2;me<k.length;++me)k[me]===-1&&(k[me]=0);switch(k[0]){case 38:A.fg=this._updateAttrColor(A.fg,k[1],k[3],k[4],k[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,k[1],k[3],k[4],k[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,k[1],k[3],k[4],k[5])}return re}_processUnderline(R,z){z.extended=z.extended.clone(),(!~R||R>5)&&(R=1),z.extended.underlineStyle=R,z.fg|=268435456,R===0&&(z.fg&=-268435457),z.updateExtended()}_processSGR0(R){R.fg=o.DEFAULT_ATTR_DATA.fg,R.bg=o.DEFAULT_ATTR_DATA.bg,R.extended=R.extended.clone(),R.extended.underlineStyle=0,R.extended.underlineColor&=-67108864,R.updateExtended()}charAttributes(R){if(R.length===1&&R.params[0]===0)return this._processSGR0(this._curAttrData),!0;const z=R.length;let A;const k=this._curAttrData;for(let K=0;K<z;K++)A=R.params[K],A>=30&&A<=37?(k.fg&=-50331904,k.fg|=16777216|A-30):A>=40&&A<=47?(k.bg&=-50331904,k.bg|=16777216|A-40):A>=90&&A<=97?(k.fg&=-50331904,k.fg|=16777224|A-90):A>=100&&A<=107?(k.bg&=-50331904,k.bg|=16777224|A-100):A===0?this._processSGR0(k):A===1?k.fg|=134217728:A===3?k.bg|=67108864:A===4?(k.fg|=268435456,this._processUnderline(R.hasSubParams(K)?R.getSubParams(K)[0]:1,k)):A===5?k.fg|=536870912:A===7?k.fg|=67108864:A===8?k.fg|=1073741824:A===9?k.fg|=2147483648:A===2?k.bg|=134217728:A===21?this._processUnderline(2,k):A===22?(k.fg&=-134217729,k.bg&=-134217729):A===23?k.bg&=-67108865:A===24?(k.fg&=-268435457,this._processUnderline(0,k)):A===25?k.fg&=-536870913:A===27?k.fg&=-67108865:A===28?k.fg&=-1073741825:A===29?k.fg&=2147483647:A===39?(k.fg&=-67108864,k.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):A===49?(k.bg&=-67108864,k.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?K+=this._extractColor(R,K,k):A===53?k.bg|=1073741824:A===55?k.bg&=-1073741825:A===59?(k.extended=k.extended.clone(),k.extended.underlineColor=-1,k.updateExtended()):A===100?(k.fg&=-67108864,k.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,k.bg&=-67108864,k.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(R){switch(R.params[0]){case 5:this._coreService.triggerDataEvent(`${h.C0.ESC}[0n`);break;case 6:const z=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[${z};${A}R`)}return!0}deviceStatusPrivate(R){if(R.params[0]===6){const z=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${h.C0.ESC}[?${z};${A}R`)}return!0}softReset(R){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=o.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(R){const z=R.params[0]||1;switch(z){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 A=z%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(R){const z=R.params[0]||1;let A;return(R.length<2||(A=R.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>z&&(this._activeBuffer.scrollTop=z-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(R){if(!W(R.params[0],this._optionsService.rawOptions.windowOptions))return!0;const z=R.length>1?R.params[1]:0;switch(R.params[0]){case 14:z!==2&&this._onRequestWindowsOptionsReport.fire(N.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(N.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${h.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:z!==0&&z!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),z!==0&&z!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:z!==0&&z!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),z!==0&&z!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(R){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(R){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(R){return this._windowTitle=R,this._onTitleChange.fire(R),!0}setIconName(R){return this._iconName=R,!0}setOrReportIndexedColor(R){const z=[],A=R.split(";");for(;A.length>1;){const k=A.shift(),K=A.shift();if(/^\d+$/.exec(k)){const re=parseInt(k);if(te(re))if(K==="?")z.push({type:0,index:re});else{const me=(0,T.parseColor)(K);me&&z.push({type:1,index:re,color:me})}}}return z.length&&this._onColor.fire(z),!0}setHyperlink(R){const z=R.split(";");return!(z.length<2)&&(z[1]?this._createHyperlink(z[0],z[1]):!z[0]&&this._finishHyperlink())}_createHyperlink(R,z){this._getCurrentLinkId()&&this._finishHyperlink();const A=R.split(":");let k;const K=A.findIndex((re=>re.startsWith("id=")));return K!==-1&&(k=A[K].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:k,uri:z}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(R,z){const A=R.split(";");for(let k=0;k<A.length&&!(z>=this._specialColors.length);++k,++z)if(A[k]==="?")this._onColor.fire([{type:0,index:this._specialColors[z]}]);else{const K=(0,T.parseColor)(A[k]);K&&this._onColor.fire([{type:1,index:this._specialColors[z],color:K}])}return!0}setOrReportFgColor(R){return this._setOrReportSpecialColor(R,0)}setOrReportBgColor(R){return this._setOrReportSpecialColor(R,1)}setOrReportCursorColor(R){return this._setOrReportSpecialColor(R,2)}restoreIndexedColor(R){if(!R)return this._onColor.fire([{type:2}]),!0;const z=[],A=R.split(";");for(let k=0;k<A.length;++k)if(/^\d+$/.exec(A[k])){const K=parseInt(A[k]);te(K)&&z.push({type:2,index:K})}return z.length&&this._onColor.fire(z),!0}restoreFgColor(R){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(R){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(R){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,v.DEFAULT_CHARSET),!0}selectCharset(R){return R.length!==2?(this.selectDefaultCharset(),!0):(R[0]==="/"||this._charsetService.setgCharset(U[R[0]],v.CHARSETS[R[1]]||v.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 R=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,R,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=o.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=o.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(R){return this._charsetService.setgLevel(R),!0}screenAlignmentPattern(){const R=new l.CellData;R.content=4194373,R.fg=this._curAttrData.fg,R.bg=this._curAttrData.bg,this._setCursor(0,0);for(let z=0;z<this._bufferService.rows;++z){const A=this._activeBuffer.ybase+this._activeBuffer.y+z,k=this._activeBuffer.lines.get(A);k&&(k.fill(R),k.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,z){const A=this._bufferService.buffer,k=this._optionsService.rawOptions;return(K=>(this._coreService.triggerDataEvent(`${h.C0.ESC}${K}${h.C0.ESC}\\`),!0))(R==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:R==='"p'?'P1$r61;1"p':R==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:R==="m"?"P1$r0m":R===" q"?`P1$r${{block:2,underline:4,bar:6}[k.cursorStyle]-(k.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,z){this._dirtyRowTracker.markRangeDirty(R,z)}}u.InputHandler=ae;let q=class{constructor(V){this._bufferService=V,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(V){V<this.start?this.start=V:V>this.end&&(this.end=V)}markRangeDirty(V,R){V>R&&(Q=V,V=R,R=Q),V<this.start&&(this.start=V),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function te(V){return 0<=V&&V<256}q=d([y(0,x.IBufferService)],q)},844:(X,u)=>{function f(d){for(const y of d)y.dispose();d.length=0}Object.defineProperty(u,"__esModule",{value:!0}),u.getDisposeArrayDisposable=u.disposeArray=u.toDisposable=u.MutableDisposable=u.Disposable=void 0,u.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 y=this._disposables.indexOf(d);y!==-1&&this._disposables.splice(y,1)}},u.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){this._isDisposed||d===this._value||(this._value?.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},u.toDisposable=function(d){return{dispose:d}},u.disposeArray=f,u.getDisposeArrayDisposable=function(d){return{dispose:()=>f(d)}}},1505:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.FourKeyMap=u.TwoKeyMap=void 0;class f{constructor(){this._data={}}set(y,h,v){this._data[y]||(this._data[y]={}),this._data[y][h]=v}get(y,h){return this._data[y]?this._data[y][h]:void 0}clear(){this._data={}}}u.TwoKeyMap=f,u.FourKeyMap=class{constructor(){this._data=new f}set(d,y,h,v,b){this._data.get(d,y)||this._data.set(d,y,new f),this._data.get(d,y).set(h,v,b)}get(d,y,h,v){return this._data.get(d,y)?.get(h,v)}clear(){this._data.clear()}}},6114:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.isChromeOS=u.isLinux=u.isWindows=u.isIphone=u.isIpad=u.isMac=u.getSafariVersion=u.isSafari=u.isLegacyEdge=u.isFirefox=u.isNode=void 0,u.isNode=typeof process<"u"&&"title"in process;const f=u.isNode?"node":navigator.userAgent,d=u.isNode?"node":navigator.platform;u.isFirefox=f.includes("Firefox"),u.isLegacyEdge=f.includes("Edge"),u.isSafari=/^((?!chrome|android).)*safari/i.test(f),u.getSafariVersion=function(){if(!u.isSafari)return 0;const y=f.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},u.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),u.isIpad=d==="iPad",u.isIphone=d==="iPhone",u.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),u.isLinux=d.indexOf("Linux")>=0,u.isChromeOS=/\bCrOS\b/.test(f)},6106:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.SortedList=void 0;let f=0;u.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(f=this._search(this._getKey(d)),this._array.splice(f,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const y=this._getKey(d);if(y===void 0||(f=this._search(y),f===-1)||this._getKey(this._array[f])!==y)return!1;do if(this._array[f]===d)return this._array.splice(f,1),!0;while(++f<this._array.length&&this._getKey(this._array[f])===y);return!1}*getKeyIterator(d){if(this._array.length!==0&&(f=this._search(d),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===d))do yield this._array[f];while(++f<this._array.length&&this._getKey(this._array[f])===d)}forEachByKey(d,y){if(this._array.length!==0&&(f=this._search(d),!(f<0||f>=this._array.length)&&this._getKey(this._array[f])===d))do y(this._array[f]);while(++f<this._array.length&&this._getKey(this._array[f])===d)}values(){return[...this._array].values()}_search(d){let y=0,h=this._array.length-1;for(;h>=y;){let v=y+h>>1;const b=this._getKey(this._array[v]);if(b>d)h=v-1;else{if(!(b<d)){for(;v>0&&this._getKey(this._array[v-1])===d;)v--;return v}y=v+1}}return y}}},7226:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DebouncedIdleTask=u.IdleTaskQueue=u.PriorityTaskQueue=void 0;const d=f(6114);class y{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 C=0,m=0,o=b.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(C=Date.now(),this._tasks[this._i]()||this._i++,C=Math.max(1,Date.now()-C),m=Math.max(C,m),c=b.timeRemaining(),1.5*m>c)return o-C<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-C))}ms`),void this._start();o=c}this.clear()}}class h extends y{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const C=Date.now()+b;return{timeRemaining:()=>Math.max(0,C-Date.now())}}}u.PriorityTaskQueue=h,u.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(v){return requestIdleCallback(v)}_cancelCallback(v){cancelIdleCallback(v)}}:h,u.DebouncedIdleTask=class{constructor(){this._queue=new u.IdleTaskQueue}set(v){this._queue.clear(),this._queue.enqueue(v)}flush(){this._queue.flush()}}},9282:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.updateWindowsModeWrappedState=void 0;const d=f(643);u.updateWindowsModeWrappedState=function(y){const h=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),v=h?.get(y.cols-1),b=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);b&&v&&(b.isWrapped=v[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&v[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ExtendedAttrs=u.AttributeData=void 0;class f{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){const h=new f;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}}u.AttributeData=f;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}get underlineVariantOffset(){const h=(3758096384&this._ext)>>29;return h<0?4294967288^h:h}set underlineVariantOffset(h){this._ext&=536870911,this._ext|=h<<29&3758096384}constructor(h=0,v=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=v}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}u.ExtendedAttrs=d},9092:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Buffer=u.MAX_BUFFER_SIZE=void 0;const d=f(6349),y=f(7226),h=f(3734),v=f(8437),b=f(4634),C=f(511),m=f(643),o=f(4863),c=f(7116);u.MAX_BUFFER_SIZE=4294967295,u.Buffer=class{constructor(a,l,_){this._hasScrollback=a,this._optionsService=l,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=v.DEFAULT_ATTR_DATA.clone(),this.savedCharset=c.DEFAULT_CHARSET,this.markers=[],this._nullCell=C.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=C.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new y.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(a){return a?(this._nullCell.fg=a.fg,this._nullCell.bg=a.bg,this._nullCell.extended=a.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new h.ExtendedAttrs),this._nullCell}getWhitespaceCell(a){return a?(this._whitespaceCell.fg=a.fg,this._whitespaceCell.bg=a.bg,this._whitespaceCell.extended=a.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new h.ExtendedAttrs),this._whitespaceCell}getBlankLine(a,l){return new v.BufferLine(this._bufferService.cols,this.getNullCell(a),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const a=this.ybase+this.y-this.ydisp;return a>=0&&a<this._rows}_getCorrectBufferLength(a){if(!this._hasScrollback)return a;const l=a+this._optionsService.rawOptions.scrollback;return l>u.MAX_BUFFER_SIZE?u.MAX_BUFFER_SIZE:l}fillViewportRows(a){if(this.lines.length===0){a===void 0&&(a=v.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(a))}}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(a,l){const _=this.getNullCell(v.DEFAULT_ATTR_DATA);let x=0;const E=this._getCorrectBufferLength(l);if(E>this.lines.maxLength&&(this.lines.maxLength=E),this.lines.length>0){if(this._cols<a)for(let g=0;g<this.lines.length;g++)x+=+this.lines.get(g).resize(a,_);let D=0;if(this._rows<l)for(let g=this._rows;g<l;g++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new v.BufferLine(a,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+D+1?(this.ybase--,D++,this.ydisp>0&&this.ydisp--):this.lines.push(new v.BufferLine(a,_)));else for(let g=this._rows;g>l;g--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(E<this.lines.maxLength){const g=this.lines.length-E;g>0&&(this.lines.trimStart(g),this.ybase=Math.max(this.ybase-g,0),this.ydisp=Math.max(this.ydisp-g,0),this.savedY=Math.max(this.savedY-g,0)),this.lines.maxLength=E}this.x=Math.min(this.x,a-1),this.y=Math.min(this.y,l-1),D&&(this.y+=D),this.savedX=Math.min(this.savedX,a-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(a,l),this._cols>a))for(let D=0;D<this.lines.length;D++)x+=+this.lines.get(D).resize(a,_);this._cols=a,this._rows=l,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let a=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,a=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return a}get _isReflowEnabled(){const a=this._optionsService.rawOptions.windowsPty;return a&&a.buildNumber?this._hasScrollback&&a.backend==="conpty"&&a.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(a,l){this._cols!==a&&(a>this._cols?this._reflowLarger(a,l):this._reflowSmaller(a,l))}_reflowLarger(a,l){const _=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,a,this.ybase+this.y,this.getNullCell(v.DEFAULT_ATTR_DATA));if(_.length>0){const x=(0,b.reflowLargerCreateNewLayout)(this.lines,_);(0,b.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(a,l,x.countRemoved)}}_reflowLargerAdjustViewport(a,l,_){const x=this.getNullCell(v.DEFAULT_ATTR_DATA);let E=_;for(;E-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new v.BufferLine(a,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(a,l){const _=this.getNullCell(v.DEFAULT_ATTR_DATA),x=[];let E=0;for(let D=this.lines.length-1;D>=0;D--){let g=this.lines.get(D);if(!g||!g.isWrapped&&g.getTrimmedLength()<=a)continue;const T=[g];for(;g.isWrapped&&D>0;)g=this.lines.get(--D),T.unshift(g);const U=this.ybase+this.y;if(U>=D&&U<D+T.length)continue;const P=T[T.length-1].getTrimmedLength(),W=(0,b.reflowSmallerGetNewLineLengths)(T,this._cols,a),N=W.length-T.length;let Q;Q=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+N):Math.max(0,this.lines.length-this.lines.maxLength+N);const ae=[];for(let A=0;A<N;A++){const k=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);ae.push(k)}ae.length>0&&(x.push({start:D+T.length+E,newLines:ae}),E+=ae.length),T.push(...ae);let q=W.length-1,te=W[q];te===0&&(q--,te=W[q]);let V=T.length-N-1,R=P;for(;V>=0;){const A=Math.min(R,te);if(T[q]===void 0)break;if(T[q].copyCellsFrom(T[V],R-A,te-A,A,!0),te-=A,te===0&&(q--,te=W[q]),R-=A,R===0){V--;const k=Math.max(V,0);R=(0,b.getWrappedLineTrimmedLength)(T,k,this._cols)}}for(let A=0;A<T.length;A++)W[A]<a&&T[A].setCell(W[A],_);let z=N-Q;for(;z-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+E)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+N,this.ybase+l-1)}if(x.length>0){const D=[],g=[];for(let q=0;q<this.lines.length;q++)g.push(this.lines.get(q));const T=this.lines.length;let U=T-1,P=0,W=x[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+E);let N=0;for(let q=Math.min(this.lines.maxLength-1,T+E-1);q>=0;q--)if(W&&W.start>U+N){for(let te=W.newLines.length-1;te>=0;te--)this.lines.set(q--,W.newLines[te]);q++,D.push({index:U+1,amount:W.newLines.length}),N+=W.newLines.length,W=x[++P]}else this.lines.set(q,g[U--]);let Q=0;for(let q=D.length-1;q>=0;q--)D[q].index+=Q,this.lines.onInsertEmitter.fire(D[q]),Q+=D[q].amount;const ae=Math.max(0,T+E-this.lines.maxLength);ae>0&&this.lines.onTrimEmitter.fire(ae)}}translateBufferLineToString(a,l,_=0,x){const E=this.lines.get(a);return E?E.translateToString(l,_,x):""}getWrappedRangeForLine(a){let l=a,_=a;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:l,last:_}}setupTabStops(a){for(a!=null?this.tabs[a]||(a=this.prevStop(a)):(this.tabs={},a=0);a<this._cols;a+=this._optionsService.rawOptions.tabStopWidth)this.tabs[a]=!0}prevStop(a){for(a==null&&(a=this.x);!this.tabs[--a]&&a>0;);return a>=this._cols?this._cols-1:a<0?0:a}nextStop(a){for(a==null&&(a=this.x);!this.tabs[++a]&&a<this._cols;);return a>=this._cols?this._cols-1:a<0?0:a}clearMarkers(a){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===a&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let a=0;a<this.markers.length;a++)this.markers[a].dispose(),this.markers.splice(a--,1);this._isClearing=!1}addMarker(a){const l=new o.Marker(a);return this.markers.push(l),l.register(this.lines.onTrim((_=>{l.line-=_,l.line<0&&l.dispose()}))),l.register(this.lines.onInsert((_=>{l.line>=_.index&&(l.line+=_.amount)}))),l.register(this.lines.onDelete((_=>{l.line>=_.index&&l.line<_.index+_.amount&&l.dispose(),l.line>_.index&&(l.line-=_.amount)}))),l.register(l.onDispose((()=>this._removeMarker(l)))),l}_removeMarker(a){this._isClearing||this.markers.splice(this.markers.indexOf(a),1)}}},8437:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferLine=u.DEFAULT_ATTR_DATA=void 0;const d=f(3734),y=f(511),h=f(643),v=f(482);u.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class C{constructor(o,c,a=!1){this.isWrapped=a,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);const l=c||y.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);for(let _=0;_<o;++_)this.setCell(_,l);this.length=o}get(o){const c=this._data[3*o+0],a=2097151&c;return[this._data[3*o+1],2097152&c?this._combined[o]:a?(0,v.stringFromCodePoint)(a):"",c>>22,2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):a]}set(o,c){this._data[3*o+1]=c[h.CHAR_DATA_ATTR_INDEX],c[h.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=c[1],this._data[3*o+0]=2097152|o|c[h.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=c[h.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[h.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(o){return this._data[3*o+0]>>22}hasWidth(o){return 12582912&this._data[3*o+0]}getFg(o){return this._data[3*o+1]}getBg(o){return this._data[3*o+2]}hasContent(o){return 4194303&this._data[3*o+0]}getCodePoint(o){const c=this._data[3*o+0];return 2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&c}isCombined(o){return 2097152&this._data[3*o+0]}getString(o){const c=this._data[3*o+0];return 2097152&c?this._combined[o]:2097151&c?(0,v.stringFromCodePoint)(2097151&c):""}isProtected(o){return 536870912&this._data[3*o+2]}loadCell(o,c){return b=3*o,c.content=this._data[b+0],c.fg=this._data[b+1],c.bg=this._data[b+2],2097152&c.content&&(c.combinedData=this._combined[o]),268435456&c.bg&&(c.extended=this._extendedAttrs[o]),c}setCell(o,c){2097152&c.content&&(this._combined[o]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[o]=c.extended),this._data[3*o+0]=c.content,this._data[3*o+1]=c.fg,this._data[3*o+2]=c.bg}setCellFromCodepoint(o,c,a,l){268435456&l.bg&&(this._extendedAttrs[o]=l.extended),this._data[3*o+0]=c|a<<22,this._data[3*o+1]=l.fg,this._data[3*o+2]=l.bg}addCodepointToCell(o,c,a){let l=this._data[3*o+0];2097152&l?this._combined[o]+=(0,v.stringFromCodePoint)(c):2097151&l?(this._combined[o]=(0,v.stringFromCodePoint)(2097151&l)+(0,v.stringFromCodePoint)(c),l&=-2097152,l|=2097152):l=c|4194304,a&&(l&=-12582913,l|=a<<22),this._data[3*o+0]=l}insertCells(o,c,a){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),c<this.length-o){const l=new y.CellData;for(let _=this.length-o-c-1;_>=0;--_)this.setCell(o+c+_,this.loadCell(o+_,l));for(let _=0;_<c;++_)this.setCell(o+_,a)}else for(let l=o;l<this.length;++l)this.setCell(l,a);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,a)}deleteCells(o,c,a){if(o%=this.length,c<this.length-o){const l=new y.CellData;for(let _=0;_<this.length-o-c;++_)this.setCell(o+_,this.loadCell(o+c+_,l));for(let _=this.length-c;_<this.length;++_)this.setCell(_,a)}else for(let l=o;l<this.length;++l)this.setCell(l,a);o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),this.getWidth(o)!==0||this.hasContent(o)||this.setCellFromCodepoint(o,0,1,a)}replaceCells(o,c,a,l=!1){if(l)for(o&&this.getWidth(o-1)===2&&!this.isProtected(o-1)&&this.setCellFromCodepoint(o-1,0,1,a),c<this.length&&this.getWidth(c-1)===2&&!this.isProtected(c)&&this.setCellFromCodepoint(c,0,1,a);o<c&&o<this.length;)this.isProtected(o)||this.setCell(o,a),o++;else for(o&&this.getWidth(o-1)===2&&this.setCellFromCodepoint(o-1,0,1,a),c<this.length&&this.getWidth(c-1)===2&&this.setCellFromCodepoint(c,0,1,a);o<c&&o<this.length;)this.setCell(o++,a)}resize(o,c){if(o===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const a=3*o;if(o>this.length){if(this._data.buffer.byteLength>=4*a)this._data=new Uint32Array(this._data.buffer,0,a);else{const l=new Uint32Array(a);l.set(this._data),this._data=l}for(let l=this.length;l<o;++l)this.setCell(l,c)}else{this._data=this._data.subarray(0,a);const l=Object.keys(this._combined);for(let x=0;x<l.length;x++){const E=parseInt(l[x],10);E>=o&&delete this._combined[E]}const _=Object.keys(this._extendedAttrs);for(let x=0;x<_.length;x++){const E=parseInt(_[x],10);E>=o&&delete this._extendedAttrs[E]}}return this.length=o,4*a*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const o=new Uint32Array(this._data.length);return o.set(this._data),this._data=o,1}return 0}fill(o,c=!1){if(c)for(let a=0;a<this.length;++a)this.isProtected(a)||this.setCell(a,o);else{this._combined={},this._extendedAttrs={};for(let a=0;a<this.length;++a)this.setCell(a,o)}}copyFrom(o){this.length!==o.length?this._data=new Uint32Array(o._data):this._data.set(o._data),this.length=o.length,this._combined={};for(const c in o._combined)this._combined[c]=o._combined[c];this._extendedAttrs={};for(const c in o._extendedAttrs)this._extendedAttrs[c]=o._extendedAttrs[c];this.isWrapped=o.isWrapped}clone(){const o=new C(0);o._data=new Uint32Array(this._data),o.length=this.length;for(const c in this._combined)o._combined[c]=this._combined[c];for(const c in this._extendedAttrs)o._extendedAttrs[c]=this._extendedAttrs[c];return o.isWrapped=this.isWrapped,o}getTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0}getNoBgTrimmedLength(){for(let o=this.length-1;o>=0;--o)if(4194303&this._data[3*o+0]||50331648&this._data[3*o+2])return o+(this._data[3*o+0]>>22);return 0}copyCellsFrom(o,c,a,l,_){const x=o._data;if(_)for(let D=l-1;D>=0;D--){for(let g=0;g<3;g++)this._data[3*(a+D)+g]=x[3*(c+D)+g];268435456&x[3*(c+D)+2]&&(this._extendedAttrs[a+D]=o._extendedAttrs[c+D])}else for(let D=0;D<l;D++){for(let g=0;g<3;g++)this._data[3*(a+D)+g]=x[3*(c+D)+g];268435456&x[3*(c+D)+2]&&(this._extendedAttrs[a+D]=o._extendedAttrs[c+D])}const E=Object.keys(o._combined);for(let D=0;D<E.length;D++){const g=parseInt(E[D],10);g>=c&&(this._combined[g-c+a]=o._combined[g])}}translateToString(o,c,a,l){c=c??0,a=a??this.length,o&&(a=Math.min(a,this.getTrimmedLength())),l&&(l.length=0);let _="";for(;c<a;){const x=this._data[3*c+0],E=2097151&x,D=2097152&x?this._combined[c]:E?(0,v.stringFromCodePoint)(E):h.WHITESPACE_CELL_CHAR;if(_+=D,l)for(let g=0;g<D.length;++g)l.push(c);c+=x>>22||1}return l&&l.push(c),_}}u.BufferLine=C},4841:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.getRangeLength=void 0,u.getRangeLength=function(f,d){if(f.start.y>f.end.y)throw new Error(`Buffer range end (${f.end.x}, ${f.end.y}) cannot be before start (${f.start.x}, ${f.start.y})`);return d*(f.end.y-f.start.y)+(f.end.x-f.start.x+1)}},4634:(X,u)=>{function f(d,y,h){if(y===d.length-1)return d[y].getTrimmedLength();const v=!d[y].hasContent(h-1)&&d[y].getWidth(h-1)===1,b=d[y+1].getWidth(0)===2;return v&&b?h-1:h}Object.defineProperty(u,"__esModule",{value:!0}),u.getWrappedLineTrimmedLength=u.reflowSmallerGetNewLineLengths=u.reflowLargerApplyNewLayout=u.reflowLargerCreateNewLayout=u.reflowLargerGetLinesToRemove=void 0,u.reflowLargerGetLinesToRemove=function(d,y,h,v,b){const C=[];for(let m=0;m<d.length-1;m++){let o=m,c=d.get(++o);if(!c.isWrapped)continue;const a=[d.get(m)];for(;o<d.length&&c.isWrapped;)a.push(c),c=d.get(++o);if(v>=m&&v<o){m+=a.length-1;continue}let l=0,_=f(a,l,y),x=1,E=0;for(;x<a.length;){const g=f(a,x,y),T=g-E,U=h-_,P=Math.min(T,U);a[l].copyCellsFrom(a[x],E,_,P,!1),_+=P,_===h&&(l++,_=0),E+=P,E===g&&(x++,E=0),_===0&&l!==0&&a[l-1].getWidth(h-1)===2&&(a[l].copyCellsFrom(a[l-1],h-1,_++,1,!1),a[l-1].setCell(h-1,b))}a[l].replaceCells(_,h,b);let D=0;for(let g=a.length-1;g>0&&(g>l||a[g].getTrimmedLength()===0);g--)D++;D>0&&(C.push(m+a.length-D),C.push(D)),m+=a.length-1}return C},u.reflowLargerCreateNewLayout=function(d,y){const h=[];let v=0,b=y[v],C=0;for(let m=0;m<d.length;m++)if(b===m){const o=y[++v];d.onDeleteEmitter.fire({index:m-C,amount:o}),m+=o-1,C+=o,b=y[++v]}else h.push(m);return{layout:h,countRemoved:C}},u.reflowLargerApplyNewLayout=function(d,y){const h=[];for(let v=0;v<y.length;v++)h.push(d.get(y[v]));for(let v=0;v<h.length;v++)d.set(v,h[v]);d.length=y.length},u.reflowSmallerGetNewLineLengths=function(d,y,h){const v=[],b=d.map(((c,a)=>f(d,a,y))).reduce(((c,a)=>c+a));let C=0,m=0,o=0;for(;o<b;){if(b-o<h){v.push(b-o);break}C+=h;const c=f(d,m,y);C>c&&(C-=c,m++);const a=d[m].getWidth(C-1)===2;a&&C--;const l=a?h-1:h;v.push(l),o+=l}return v},u.getWrappedLineTrimmedLength=f},5295:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferSet=void 0;const d=f(8460),y=f(844),h=f(9092);class v extends y.Disposable{constructor(C,m){super(),this._optionsService=C,this._bufferService=m,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 h.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new h.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(C){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(C),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(C,m){this._normal.resize(C,m),this._alt.resize(C,m),this.setupTabStops(C)}setupTabStops(C){this._normal.setupTabStops(C),this._alt.setupTabStops(C)}}u.BufferSet=v},511:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CellData=void 0;const d=f(482),y=f(643),h=f(3734);class v extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(C){const m=new v;return m.setFromCharData(C),m}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(C){this.fg=C[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(C[y.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(C[y.CHAR_DATA_CHAR_INDEX].length===2){const o=C[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const c=C[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(o-55296)+c-56320+65536|C[y.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=C[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|C[y.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=C[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|C[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}u.CellData=v},643:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WHITESPACE_CELL_CODE=u.WHITESPACE_CELL_WIDTH=u.WHITESPACE_CELL_CHAR=u.NULL_CELL_CODE=u.NULL_CELL_WIDTH=u.NULL_CELL_CHAR=u.CHAR_DATA_CODE_INDEX=u.CHAR_DATA_WIDTH_INDEX=u.CHAR_DATA_CHAR_INDEX=u.CHAR_DATA_ATTR_INDEX=u.DEFAULT_EXT=u.DEFAULT_ATTR=u.DEFAULT_COLOR=void 0,u.DEFAULT_COLOR=0,u.DEFAULT_ATTR=256|u.DEFAULT_COLOR<<9,u.DEFAULT_EXT=0,u.CHAR_DATA_ATTR_INDEX=0,u.CHAR_DATA_CHAR_INDEX=1,u.CHAR_DATA_WIDTH_INDEX=2,u.CHAR_DATA_CODE_INDEX=3,u.NULL_CELL_CHAR="",u.NULL_CELL_WIDTH=1,u.NULL_CELL_CODE=0,u.WHITESPACE_CELL_CHAR=" ",u.WHITESPACE_CELL_WIDTH=1,u.WHITESPACE_CELL_CODE=32},4863:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Marker=void 0;const d=f(8460),y=f(844);class h{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=h._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,y.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}u.Marker=h,h._nextId=1},7116:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DEFAULT_CHARSET=u.CHARSETS=void 0,u.CHARSETS={},u.DEFAULT_CHARSET=u.CHARSETS.B,u.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:"≥","{":"π","|":"≠","}":"£","~":"·"},u.CHARSETS.A={"#":"£"},u.CHARSETS.B=void 0,u.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},u.CHARSETS.C=u.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},u.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},u.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},u.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},u.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},u.CHARSETS.E=u.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},u.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},u.CHARSETS.H=u.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},u.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(X,u)=>{var f,d,y;Object.defineProperty(u,"__esModule",{value:!0}),u.C1_ESCAPED=u.C1=u.C0=void 0,(function(h){h.NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=`
16
- `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="\x1B",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL=""})(f||(u.C0=f={})),(function(h){h.PAD="€",h.HOP="",h.BPH="‚",h.NBH="ƒ",h.IND="„",h.NEL="…",h.SSA="†",h.ESA="‡",h.HTS="ˆ",h.HTJ="‰",h.VTS="Š",h.PLD="‹",h.PLU="Œ",h.RI="",h.SS2="Ž",h.SS3="",h.DCS="",h.PU1="‘",h.PU2="’",h.STS="“",h.CCH="”",h.MW="•",h.SPA="–",h.EPA="—",h.SOS="˜",h.SGCI="™",h.SCI="š",h.CSI="›",h.ST="œ",h.OSC="",h.PM="ž",h.APC="Ÿ"})(d||(u.C1=d={})),(function(h){h.ST=`${f.ESC}\\`})(y||(u.C1_ESCAPED=y={}))},7399:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.evaluateKeyboardEvent=void 0;const d=f(2584),y={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:["'",'"']};u.evaluateKeyboardEvent=function(h,v,b,C){const m={type:0,cancel:!1,key:void 0},o=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?m.key=v?d.C0.ESC+"OA":d.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?m.key=v?d.C0.ESC+"OD":d.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?m.key=v?d.C0.ESC+"OC":d.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(m.key=v?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:m.key=h.ctrlKey?"\b":d.C0.DEL,h.altKey&&(m.key=d.C0.ESC+m.key);break;case 9:if(h.shiftKey){m.key=d.C0.ESC+"[Z";break}m.key=d.C0.HT,m.cancel=!0;break;case 13:m.key=h.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,m.cancel=!0;break;case 27:m.key=d.C0.ESC,h.altKey&&(m.key=d.C0.ESC+d.C0.ESC),m.cancel=!0;break;case 37:if(h.metaKey)break;o?(m.key=d.C0.ESC+"[1;"+(o+1)+"D",m.key===d.C0.ESC+"[1;3D"&&(m.key=d.C0.ESC+(b?"b":"[1;5D"))):m.key=v?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(h.metaKey)break;o?(m.key=d.C0.ESC+"[1;"+(o+1)+"C",m.key===d.C0.ESC+"[1;3C"&&(m.key=d.C0.ESC+(b?"f":"[1;5C"))):m.key=v?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(h.metaKey)break;o?(m.key=d.C0.ESC+"[1;"+(o+1)+"A",b||m.key!==d.C0.ESC+"[1;3A"||(m.key=d.C0.ESC+"[1;5A")):m.key=v?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(h.metaKey)break;o?(m.key=d.C0.ESC+"[1;"+(o+1)+"B",b||m.key!==d.C0.ESC+"[1;3B"||(m.key=d.C0.ESC+"[1;5B")):m.key=v?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(m.key=d.C0.ESC+"[2~");break;case 46:m.key=o?d.C0.ESC+"[3;"+(o+1)+"~":d.C0.ESC+"[3~";break;case 36:m.key=o?d.C0.ESC+"[1;"+(o+1)+"H":v?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:m.key=o?d.C0.ESC+"[1;"+(o+1)+"F":v?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:h.shiftKey?m.type=2:h.ctrlKey?m.key=d.C0.ESC+"[5;"+(o+1)+"~":m.key=d.C0.ESC+"[5~";break;case 34:h.shiftKey?m.type=3:h.ctrlKey?m.key=d.C0.ESC+"[6;"+(o+1)+"~":m.key=d.C0.ESC+"[6~";break;case 112:m.key=o?d.C0.ESC+"[1;"+(o+1)+"P":d.C0.ESC+"OP";break;case 113:m.key=o?d.C0.ESC+"[1;"+(o+1)+"Q":d.C0.ESC+"OQ";break;case 114:m.key=o?d.C0.ESC+"[1;"+(o+1)+"R":d.C0.ESC+"OR";break;case 115:m.key=o?d.C0.ESC+"[1;"+(o+1)+"S":d.C0.ESC+"OS";break;case 116:m.key=o?d.C0.ESC+"[15;"+(o+1)+"~":d.C0.ESC+"[15~";break;case 117:m.key=o?d.C0.ESC+"[17;"+(o+1)+"~":d.C0.ESC+"[17~";break;case 118:m.key=o?d.C0.ESC+"[18;"+(o+1)+"~":d.C0.ESC+"[18~";break;case 119:m.key=o?d.C0.ESC+"[19;"+(o+1)+"~":d.C0.ESC+"[19~";break;case 120:m.key=o?d.C0.ESC+"[20;"+(o+1)+"~":d.C0.ESC+"[20~";break;case 121:m.key=o?d.C0.ESC+"[21;"+(o+1)+"~":d.C0.ESC+"[21~";break;case 122:m.key=o?d.C0.ESC+"[23;"+(o+1)+"~":d.C0.ESC+"[23~";break;case 123:m.key=o?d.C0.ESC+"[24;"+(o+1)+"~":d.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(b&&!C||!h.altKey||h.metaKey)!b||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?m.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(m.key=d.C0.US),h.key==="@"&&(m.key=d.C0.NUL)):h.keyCode===65&&(m.type=1);else{const c=y[h.keyCode],a=c?.[h.shiftKey?1:0];if(a)m.key=d.C0.ESC+a;else if(h.keyCode>=65&&h.keyCode<=90){const l=h.ctrlKey?h.keyCode-64:h.keyCode+32;let _=String.fromCharCode(l);h.shiftKey&&(_=_.toUpperCase()),m.key=d.C0.ESC+_}else if(h.keyCode===32)m.key=d.C0.ESC+(h.ctrlKey?d.C0.NUL:" ");else if(h.key==="Dead"&&h.code.startsWith("Key")){let l=h.code.slice(3,4);h.shiftKey||(l=l.toLowerCase()),m.key=d.C0.ESC+l,m.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?m.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?m.key=d.C0.NUL:h.keyCode>=51&&h.keyCode<=55?m.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?m.key=d.C0.DEL:h.keyCode===219?m.key=d.C0.ESC:h.keyCode===220?m.key=d.C0.FS:h.keyCode===221&&(m.key=d.C0.GS)}return m}},482:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Utf8ToUtf32=u.StringToUtf32=u.utf32ToString=u.stringFromCodePoint=void 0,u.stringFromCodePoint=function(f){return f>65535?(f-=65536,String.fromCharCode(55296+(f>>10))+String.fromCharCode(f%1024+56320)):String.fromCharCode(f)},u.utf32ToString=function(f,d=0,y=f.length){let h="";for(let v=d;v<y;++v){let b=f[v];b>65535?(b-=65536,h+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):h+=String.fromCharCode(b)}return h},u.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(f,d){const y=f.length;if(!y)return 0;let h=0,v=0;if(this._interim){const b=f.charCodeAt(v++);56320<=b&&b<=57343?d[h++]=1024*(this._interim-55296)+b-56320+65536:(d[h++]=this._interim,d[h++]=b),this._interim=0}for(let b=v;b<y;++b){const C=f.charCodeAt(b);if(55296<=C&&C<=56319){if(++b>=y)return this._interim=C,h;const m=f.charCodeAt(b);56320<=m&&m<=57343?d[h++]=1024*(C-55296)+m-56320+65536:(d[h++]=C,d[h++]=m)}else C!==65279&&(d[h++]=C)}return h}},u.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(f,d){const y=f.length;if(!y)return 0;let h,v,b,C,m=0,o=0,c=0;if(this.interim[0]){let _=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let E,D=0;for(;(E=63&this.interim[++D])&&D<4;)x<<=6,x|=E;const g=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=g-D;for(;c<T;){if(c>=y)return 0;if(E=f[c++],(192&E)!=128){c--,_=!0;break}this.interim[D++]=E,x<<=6,x|=63&E}_||(g===2?x<128?c--:d[m++]=x:g===3?x<2048||x>=55296&&x<=57343||x===65279||(d[m++]=x):x<65536||x>1114111||(d[m++]=x)),this.interim.fill(0)}const a=y-4;let l=c;for(;l<y;){for(;!(!(l<a)||128&(h=f[l])||128&(v=f[l+1])||128&(b=f[l+2])||128&(C=f[l+3]));)d[m++]=h,d[m++]=v,d[m++]=b,d[m++]=C,l+=4;if(h=f[l++],h<128)d[m++]=h;else if((224&h)==192){if(l>=y)return this.interim[0]=h,m;if(v=f[l++],(192&v)!=128){l--;continue}if(o=(31&h)<<6|63&v,o<128){l--;continue}d[m++]=o}else if((240&h)==224){if(l>=y)return this.interim[0]=h,m;if(v=f[l++],(192&v)!=128){l--;continue}if(l>=y)return this.interim[0]=h,this.interim[1]=v,m;if(b=f[l++],(192&b)!=128){l--;continue}if(o=(15&h)<<12|(63&v)<<6|63&b,o<2048||o>=55296&&o<=57343||o===65279)continue;d[m++]=o}else if((248&h)==240){if(l>=y)return this.interim[0]=h,m;if(v=f[l++],(192&v)!=128){l--;continue}if(l>=y)return this.interim[0]=h,this.interim[1]=v,m;if(b=f[l++],(192&b)!=128){l--;continue}if(l>=y)return this.interim[0]=h,this.interim[1]=v,this.interim[2]=b,m;if(C=f[l++],(192&C)!=128){l--;continue}if(o=(7&h)<<18|(63&v)<<12|(63&b)<<6|63&C,o<65536||o>1114111)continue;d[m++]=o}}return m}}},225:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeV6=void 0;const d=f(1480),y=[[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]],h=[[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 v;u.UnicodeV6=class{constructor(){if(this.version="6",!v){v=new Uint8Array(65536),v.fill(1),v[0]=0,v.fill(0,1,32),v.fill(0,127,160),v.fill(2,4352,4448),v[9001]=2,v[9002]=2,v.fill(2,11904,42192),v[12351]=1,v.fill(2,44032,55204),v.fill(2,63744,64256),v.fill(2,65040,65050),v.fill(2,65072,65136),v.fill(2,65280,65377),v.fill(2,65504,65511);for(let b=0;b<y.length;++b)v.fill(0,y[b][0],y[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?v[b]:(function(C,m){let o,c=0,a=m.length-1;if(C<m[0][0]||C>m[a][1])return!1;for(;a>=c;)if(o=c+a>>1,C>m[o][1])c=o+1;else{if(!(C<m[o][0]))return!0;a=o-1}return!1})(b,h)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,C){let m=this.wcwidth(b),o=m===0&&C!==0;if(o){const c=d.UnicodeService.extractWidth(C);c===0?o=!1:c>m&&(m=c)}return d.UnicodeService.createPropertyValue(0,m,o)}}},5981:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.WriteBuffer=void 0;const d=f(8460),y=f(844);class h extends y.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,C){if(C!==void 0&&this._syncCalls>C)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 m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const o=this._callbacks.shift();o&&o()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,C){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(C),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(C)}_innerWrite(b=0,C=!0){const m=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],c=this._action(o,C);if(c){const l=_=>Date.now()-m>=12?setTimeout((()=>this._innerWrite(0,_))):this._innerWrite(m,_);return void c.catch((_=>(queueMicrotask((()=>{throw _})),Promise.resolve(!1)))).then(l)}const a=this._callbacks[this._bufferOffset];if(a&&a(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-m>=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()}}u.WriteBuffer=h},5941:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.toRgbString=u.parseColor=void 0;const f=/^([\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 y(h,v){const b=h.toString(16),C=b.length<2?"0"+b:b;switch(v){case 4:return b[0];case 8:return C;case 12:return(C+C).slice(0,3);default:return C+C}}u.parseColor=function(h){if(!h)return;let v=h.toLowerCase();if(v.indexOf("rgb:")===0){v=v.slice(4);const b=f.exec(v);if(b){const C=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/C*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/C*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/C*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),d.exec(v)&&[3,6,9,12].includes(v.length))){const b=v.length/3,C=[0,0,0];for(let m=0;m<3;++m){const o=parseInt(v.slice(b*m,b*m+b),16);C[m]=b===1?o<<4:b===2?o:b===3?o>>4:o>>8}return C}},u.toRgbString=function(h,v=16){const[b,C,m]=h;return`rgb:${y(b,v)}/${y(C,v)}/${y(m,v)}`}},5770:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.PAYLOAD_LIMIT=void 0,u.PAYLOAD_LIMIT=1e7},6351:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DcsHandler=u.DcsParser=void 0;const d=f(482),y=f(8742),h=f(5770),v=[];u.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=v,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=v}registerHandler(C,m){this._handlers[C]===void 0&&(this._handlers[C]=[]);const o=this._handlers[C];return o.push(m),{dispose:()=>{const c=o.indexOf(m);c!==-1&&o.splice(c,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}reset(){if(this._active.length)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(C,m){if(this.reset(),this._ident=C,this._active=this._handlers[C]||v,this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(C,m,o){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(C,m,o);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(C,m,o))}unhook(C,m=!0){if(this._active.length){let o=!1,c=this._active.length-1,a=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,o=m,a=this._stack.fallThrough,this._stack.paused=!1),!a&&o===!1){for(;c>=0&&(o=this._active[c].unhook(C),o!==!0);c--)if(o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,o;c--}for(;c>=0;c--)if(o=this._active[c].unhook(!1),o instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,o}else this._handlerFb(this._ident,"UNHOOK",C);this._active=v,this._ident=0}};const b=new y.Params;b.addParam(0),u.DcsHandler=class{constructor(C){this._handler=C,this._data="",this._params=b,this._hitLimit=!1}hook(C){this._params=C.length>1||C.params[0]?C.clone():b,this._data="",this._hitLimit=!1}put(C,m,o){this._hitLimit||(this._data+=(0,d.utf32ToString)(C,m,o),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(C){let m=!1;if(this._hitLimit)m=!1;else if(C&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then((o=>(this._params=b,this._data="",this._hitLimit=!1,o)));return this._params=b,this._data="",this._hitLimit=!1,m}}},2015:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.EscapeSequenceParser=u.VT500_TRANSITION_TABLE=u.TransitionTable=void 0;const d=f(844),y=f(8742),h=f(6242),v=f(6351);class b{constructor(c){this.table=new Uint8Array(c)}setDefault(c,a){this.table.fill(c<<4|a)}add(c,a,l,_){this.table[a<<8|c]=l<<4|_}addMany(c,a,l,_){for(let x=0;x<c.length;x++)this.table[a<<8|c[x]]=l<<4|_}}u.TransitionTable=b;const C=160;u.VT500_TRANSITION_TABLE=(function(){const o=new b(4095),c=Array.apply(null,Array(256)).map(((D,g)=>g)),a=(D,g)=>c.slice(D,g),l=a(32,127),_=a(0,24);_.push(25),_.push.apply(_,a(28,32));const x=a(0,14);let E;for(E in o.setDefault(1,0),o.addMany(l,0,2,0),x)o.addMany([24,26,153,154],E,3,0),o.addMany(a(128,144),E,3,0),o.addMany(a(144,152),E,3,0),o.add(156,E,0,0),o.add(27,E,11,1),o.add(157,E,4,8),o.addMany([152,158,159],E,0,7),o.add(155,E,11,3),o.add(144,E,11,9);return o.addMany(_,0,3,0),o.addMany(_,1,3,1),o.add(127,1,0,1),o.addMany(_,8,0,8),o.addMany(_,3,3,3),o.add(127,3,0,3),o.addMany(_,4,3,4),o.add(127,4,0,4),o.addMany(_,6,3,6),o.addMany(_,5,3,5),o.add(127,5,0,5),o.addMany(_,2,3,2),o.add(127,2,0,2),o.add(93,1,4,8),o.addMany(l,8,5,8),o.add(127,8,5,8),o.addMany([156,27,24,26,7],8,6,0),o.addMany(a(28,32),8,0,8),o.addMany([88,94,95],1,0,7),o.addMany(l,7,0,7),o.addMany(_,7,0,7),o.add(156,7,0,0),o.add(127,7,0,7),o.add(91,1,11,3),o.addMany(a(64,127),3,7,0),o.addMany(a(48,60),3,8,4),o.addMany([60,61,62,63],3,9,4),o.addMany(a(48,60),4,8,4),o.addMany(a(64,127),4,7,0),o.addMany([60,61,62,63],4,0,6),o.addMany(a(32,64),6,0,6),o.add(127,6,0,6),o.addMany(a(64,127),6,0,0),o.addMany(a(32,48),3,9,5),o.addMany(a(32,48),5,9,5),o.addMany(a(48,64),5,0,6),o.addMany(a(64,127),5,7,0),o.addMany(a(32,48),4,9,5),o.addMany(a(32,48),1,9,2),o.addMany(a(32,48),2,9,2),o.addMany(a(48,127),2,10,0),o.addMany(a(48,80),1,10,0),o.addMany(a(81,88),1,10,0),o.addMany([89,90,92],1,10,0),o.addMany(a(96,127),1,10,0),o.add(80,1,11,9),o.addMany(_,9,0,9),o.add(127,9,0,9),o.addMany(a(28,32),9,0,9),o.addMany(a(32,48),9,9,12),o.addMany(a(48,60),9,8,10),o.addMany([60,61,62,63],9,9,10),o.addMany(_,11,0,11),o.addMany(a(32,128),11,0,11),o.addMany(a(28,32),11,0,11),o.addMany(_,10,0,10),o.add(127,10,0,10),o.addMany(a(28,32),10,0,10),o.addMany(a(48,60),10,8,10),o.addMany([60,61,62,63],10,0,11),o.addMany(a(32,48),10,9,12),o.addMany(_,12,0,12),o.add(127,12,0,12),o.addMany(a(28,32),12,0,12),o.addMany(a(32,48),12,9,12),o.addMany(a(48,64),12,0,11),o.addMany(a(64,127),12,12,13),o.addMany(a(64,127),10,12,13),o.addMany(a(64,127),9,12,13),o.addMany(_,13,13,13),o.addMany(l,13,13,13),o.add(127,13,0,13),o.addMany([27,156,24,26],13,14,0),o.add(C,0,2,0),o.add(C,8,5,8),o.add(C,6,0,6),o.add(C,11,0,11),o.add(C,13,13,13),o})();class m extends d.Disposable{constructor(c=u.VT500_TRANSITION_TABLE){super(),this._transitions=c,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new y.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(a,l,_)=>{},this._executeHandlerFb=a=>{},this._csiHandlerFb=(a,l)=>{},this._escHandlerFb=a=>{},this._errorHandlerFb=a=>a,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 h.OscParser),this._dcsParser=this.register(new v.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(c,a=[64,126]){let l=0;if(c.prefix){if(c.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=c.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(c.intermediates){if(c.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<c.intermediates.length;++x){const E=c.intermediates.charCodeAt(x);if(32>E||E>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=E}}if(c.final.length!==1)throw new Error("final must be a single byte");const _=c.final.charCodeAt(0);if(a[0]>_||_>a[1])throw new Error(`final must be in range ${a[0]} .. ${a[1]}`);return l<<=8,l|=_,l}identToString(c){const a=[];for(;c;)a.push(String.fromCharCode(255&c)),c>>=8;return a.reverse().join("")}setPrintHandler(c){this._printHandler=c}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(c,a){const l=this._identifier(c,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const _=this._escHandlers[l];return _.push(a),{dispose:()=>{const x=_.indexOf(a);x!==-1&&_.splice(x,1)}}}clearEscHandler(c){this._escHandlers[this._identifier(c,[48,126])]&&delete this._escHandlers[this._identifier(c,[48,126])]}setEscHandlerFallback(c){this._escHandlerFb=c}setExecuteHandler(c,a){this._executeHandlers[c.charCodeAt(0)]=a}clearExecuteHandler(c){this._executeHandlers[c.charCodeAt(0)]&&delete this._executeHandlers[c.charCodeAt(0)]}setExecuteHandlerFallback(c){this._executeHandlerFb=c}registerCsiHandler(c,a){const l=this._identifier(c);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const _=this._csiHandlers[l];return _.push(a),{dispose:()=>{const x=_.indexOf(a);x!==-1&&_.splice(x,1)}}}clearCsiHandler(c){this._csiHandlers[this._identifier(c)]&&delete this._csiHandlers[this._identifier(c)]}setCsiHandlerFallback(c){this._csiHandlerFb=c}registerDcsHandler(c,a){return this._dcsParser.registerHandler(this._identifier(c),a)}clearDcsHandler(c){this._dcsParser.clearHandler(this._identifier(c))}setDcsHandlerFallback(c){this._dcsParser.setHandlerFallback(c)}registerOscHandler(c,a){return this._oscParser.registerHandler(c,a)}clearOscHandler(c){this._oscParser.clearHandler(c)}setOscHandlerFallback(c){this._oscParser.setHandlerFallback(c)}setErrorHandler(c){this._errorHandler=c}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(c,a,l,_,x){this._parseStack.state=c,this._parseStack.handlers=a,this._parseStack.handlerPos=l,this._parseStack.transition=_,this._parseStack.chunkPos=x}parse(c,a,l){let _,x=0,E=0,D=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,D=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const g=this._parseStack.handlers;let T=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&T>-1){for(;T>=0&&(_=g[T](this._params),_!==!0);T--)if(_ instanceof Promise)return this._parseStack.handlerPos=T,_}this._parseStack.handlers=[];break;case 4:if(l===!1&&T>-1){for(;T>=0&&(_=g[T](),_!==!0);T--)if(_ instanceof Promise)return this._parseStack.handlerPos=T,_}this._parseStack.handlers=[];break;case 6:if(x=c[this._parseStack.chunkPos],_=this._dcsParser.unhook(x!==24&&x!==26,l),_)return _;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=c[this._parseStack.chunkPos],_=this._oscParser.end(x!==24&&x!==26,l),_)return _;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,D=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let g=D;g<a;++g){switch(x=c[g],E=this._transitions.table[this.currentState<<8|(x<160?x:C)],E>>4){case 2:for(let N=g+1;;++N){if(N>=a||(x=c[N])<32||x>126&&x<C){this._printHandler(c,g,N),g=N-1;break}if(++N>=a||(x=c[N])<32||x>126&&x<C){this._printHandler(c,g,N),g=N-1;break}if(++N>=a||(x=c[N])<32||x>126&&x<C){this._printHandler(c,g,N),g=N-1;break}if(++N>=a||(x=c[N])<32||x>126&&x<C){this._printHandler(c,g,N),g=N-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:g,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const T=this._csiHandlers[this._collect<<8|x];let U=T?T.length-1:-1;for(;U>=0&&(_=T[U](this._params),_!==!0);U--)if(_ instanceof Promise)return this._preserveStack(3,T,U,E,g),_;U<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(++g<a&&(x=c[g])>47&&x<60);g--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:const P=this._escHandlers[this._collect<<8|x];let W=P?P.length-1:-1;for(;W>=0&&(_=P[W](),_!==!0);W--)if(_ instanceof Promise)return this._preserveStack(4,P,W,E,g),_;W<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 N=g+1;;++N)if(N>=a||(x=c[N])===24||x===26||x===27||x>127&&x<C){this._dcsParser.put(c,g,N),g=N-1;break}break;case 14:if(_=this._dcsParser.unhook(x!==24&&x!==26),_)return this._preserveStack(6,[],0,E,g),_;x===27&&(E|=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 N=g+1;;N++)if(N>=a||(x=c[N])<32||x>127&&x<C){this._oscParser.put(c,g,N),g=N-1;break}break;case 6:if(_=this._oscParser.end(x!==24&&x!==26),_)return this._preserveStack(5,[],0,E,g),_;x===27&&(E|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&E}}}u.EscapeSequenceParser=m},6242:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.OscHandler=u.OscParser=void 0;const d=f(5770),y=f(482),h=[];u.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(v,b){this._handlers[v]===void 0&&(this._handlers[v]=[]);const C=this._handlers[v];return C.push(b),{dispose:()=>{const m=C.indexOf(b);m!==-1&&C.splice(m,1)}}}clearHandler(v){this._handlers[v]&&delete this._handlers[v]}setHandlerFallback(v){this._handlerFb=v}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let v=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;v>=0;--v)this._active[v].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].start();else this._handlerFb(this._id,"START")}_put(v,b,C){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(v,b,C);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(v,b,C))}start(){this.reset(),this._state=1}put(v,b,C){if(this._state!==3){if(this._state===1)for(;b<C;){const m=v[b++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&C-b>0&&this._put(v,b,C)}}end(v,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let C=!1,m=this._active.length-1,o=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,C=b,o=this._stack.fallThrough,this._stack.paused=!1),!o&&C===!1){for(;m>=0&&(C=this._active[m].end(v),C!==!0);m--)if(C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,C;m--}for(;m>=0;m--)if(C=this._active[m].end(!1),C instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,C}else this._handlerFb(this._id,"END",v);this._active=h,this._id=-1,this._state=0}}},u.OscHandler=class{constructor(v){this._handler=v,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(v,b,C){this._hitLimit||(this._data+=(0,y.utf32ToString)(v,b,C),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(v){let b=!1;if(this._hitLimit)b=!1;else if(v&&(b=this._handler(this._data),b instanceof Promise))return b.then((C=>(this._data="",this._hitLimit=!1,C)));return this._data="",this._hitLimit=!1,b}}},8742:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.Params=void 0;const f=2147483647;class d{static fromArray(h){const v=new d;if(!h.length)return v;for(let b=Array.isArray(h[0])?1:0;b<h.length;++b){const C=h[b];if(Array.isArray(C))for(let m=0;m<C.length;++m)v.addSubParam(C[m]);else v.addParam(C)}return v}constructor(h=32,v=32){if(this.maxLength=h,this.maxSubParamsLength=v,v>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(v),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const h=new d(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){const h=[];for(let v=0;v<this.length;++v){h.push(this.params[v]);const b=this._subParamsIdx[v]>>8,C=255&this._subParamsIdx[v];C-b>0&&h.push(Array.prototype.slice.call(this._subParams,b,C))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>f?f:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>f?f:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){const v=this._subParamsIdx[h]>>8,b=255&this._subParamsIdx[h];return b-v>0?this._subParams.subarray(v,b):null}getSubParamsAll(){const h={};for(let v=0;v<this.length;++v){const b=this._subParamsIdx[v]>>8,C=255&this._subParamsIdx[v];C-b>0&&(h[v]=this._subParams.slice(b,C))}return h}addDigit(h){let v;if(this._rejectDigits||!(v=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,C=b[v-1];b[v-1]=~C?Math.min(10*C+h,f):h}}u.Params=d},5741:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.AddonManager=void 0,u.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let f=this._addons.length-1;f>=0;f--)this._addons[f].instance.dispose()}loadAddon(f,d){const y={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(y),d.dispose=()=>this._wrappedAddonDispose(y),d.activate(f)}_wrappedAddonDispose(f){if(f.isDisposed)return;let d=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===f){d=y;break}if(d===-1)throw new Error("Could not dispose an addon that has not been loaded");f.isDisposed=!0,f.dispose.apply(f.instance),this._addons.splice(d,1)}}},8771:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferApiView=void 0;const d=f(3785),y=f(511);u.BufferApiView=class{constructor(h,v){this._buffer=h,this.type=v}init(h){return this._buffer=h,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(h){const v=this._buffer.lines.get(h);if(v)return new d.BufferLineApiView(v)}getNullCell(){return new y.CellData}}},3785:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferLineApiView=void 0;const d=f(511);u.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,h){if(!(y<0||y>=this._line.length))return h?(this._line.loadCell(y,h),h):this._line.loadCell(y,new d.CellData)}translateToString(y,h,v){return this._line.translateToString(y,h,v)}}},8285:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.BufferNamespaceApi=void 0;const d=f(8771),y=f(8460),h=f(844);class v extends h.Disposable{constructor(C){super(),this._core=C,this._onBufferChange=this.register(new y.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)}}u.BufferNamespaceApi=v},7975:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.ParserApi=void 0,u.ParserApi=class{constructor(f){this._core=f}registerCsiHandler(f,d){return this._core.registerCsiHandler(f,(y=>d(y.toArray())))}addCsiHandler(f,d){return this.registerCsiHandler(f,d)}registerDcsHandler(f,d){return this._core.registerDcsHandler(f,((y,h)=>d(y,h.toArray())))}addDcsHandler(f,d){return this.registerDcsHandler(f,d)}registerEscHandler(f,d){return this._core.registerEscHandler(f,d)}addEscHandler(f,d){return this.registerEscHandler(f,d)}registerOscHandler(f,d){return this._core.registerOscHandler(f,d)}addOscHandler(f,d){return this.registerOscHandler(f,d)}}},7090:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeApi=void 0,u.UnicodeApi=class{constructor(f){this._core=f}register(f){this._core.unicodeService.register(f)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(f){this._core.unicodeService.activeVersion=f}}},744:function(X,u,f){var d=this&&this.__decorate||function(o,c,a,l){var _,x=arguments.length,E=x<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,a):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,c,a,l);else for(var D=o.length-1;D>=0;D--)(_=o[D])&&(E=(x<3?_(E):x>3?_(c,a,E):_(c,a))||E);return x>3&&E&&Object.defineProperty(c,a,E),E},y=this&&this.__param||function(o,c){return function(a,l){c(a,l,o)}};Object.defineProperty(u,"__esModule",{value:!0}),u.BufferService=u.MINIMUM_ROWS=u.MINIMUM_COLS=void 0;const h=f(8460),v=f(844),b=f(5295),C=f(2585);u.MINIMUM_COLS=2,u.MINIMUM_ROWS=1;let m=u.BufferService=class extends v.Disposable{get buffer(){return this.buffers.active}constructor(o){super(),this.isUserScrolling=!1,this._onResize=this.register(new h.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(o.rawOptions.cols||0,u.MINIMUM_COLS),this.rows=Math.max(o.rawOptions.rows||0,u.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(o,this))}resize(o,c){this.cols=o,this.rows=c,this.buffers.resize(o,c),this._onResize.fire({cols:o,rows:c})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(o,c=!1){const a=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===o.fg&&l.getBg(0)===o.bg||(l=a.getBlankLine(o,c),this._cachedBlankLine=l),l.isWrapped=c;const _=a.ybase+a.scrollTop,x=a.ybase+a.scrollBottom;if(a.scrollTop===0){const E=a.lines.isFull;x===a.lines.length-1?E?a.lines.recycle().copyFrom(l):a.lines.push(l.clone()):a.lines.splice(x+1,0,l.clone()),E?this.isUserScrolling&&(a.ydisp=Math.max(a.ydisp-1,0)):(a.ybase++,this.isUserScrolling||a.ydisp++)}else{const E=x-_+1;a.lines.shiftElements(_+1,E-1,-1),a.lines.set(x,l.clone())}this.isUserScrolling||(a.ydisp=a.ybase),this._onScroll.fire(a.ydisp)}scrollLines(o,c,a){const l=this.buffer;if(o<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else o+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const _=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+o,l.ybase),0),_!==l.ydisp&&(c||this._onScroll.fire(l.ydisp))}};u.BufferService=m=d([y(0,C.IOptionsService)],m)},7994:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.CharsetService=void 0,u.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(f){this.glevel=f,this.charset=this._charsets[f]}setgCharset(f,d){this._charsets[f]=d,this.glevel===f&&(this.charset=d)}}},1753:function(X,u,f){var d=this&&this.__decorate||function(l,_,x,E){var D,g=arguments.length,T=g<3?_:E===null?E=Object.getOwnPropertyDescriptor(_,x):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(l,_,x,E);else for(var U=l.length-1;U>=0;U--)(D=l[U])&&(T=(g<3?D(T):g>3?D(_,x,T):D(_,x))||T);return g>3&&T&&Object.defineProperty(_,x,T),T},y=this&&this.__param||function(l,_){return function(x,E){_(x,E,l)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CoreMouseService=void 0;const h=f(2585),v=f(8460),b=f(844),C={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function m(l,_){let x=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(x|=64,x|=l.action):(x|=3&l.button,4&l.button&&(x|=64),8&l.button&&(x|=128),l.action===32?x|=32:l.action!==0||_||(x|=3)),x}const o=String.fromCharCode,c={DEFAULT:l=>{const _=[m(l,!1)+32,l.col+32,l.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${o(_[0])}${o(_[1])}${o(_[2])}`},SGR:l=>{const _=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${m(l,!0)};${l.col};${l.row}${_}`},SGR_PIXELS:l=>{const _=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${m(l,!0)};${l.x};${l.y}${_}`}};let a=u.CoreMouseService=class extends b.Disposable{constructor(l,_){super(),this._bufferService=l,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new v.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const x of Object.keys(C))this.addProtocol(x,C[x]);for(const x of Object.keys(c))this.addEncoding(x,c[x]);this.reset()}addProtocol(l,_){this._protocols[l]=_}addEncoding(l,_){this._encodings[l]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const _=this._encodings[this._activeEncoding](l);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,_,x){if(x){if(l.x!==_.x||l.y!==_.y)return!1}else if(l.col!==_.col||l.row!==_.row)return!1;return l.button===_.button&&l.action===_.action&&l.ctrl===_.ctrl&&l.alt===_.alt&&l.shift===_.shift}};u.CoreMouseService=a=d([y(0,h.IBufferService),y(1,h.ICoreService)],a)},6975:function(X,u,f){var d=this&&this.__decorate||function(a,l,_,x){var E,D=arguments.length,g=D<3?l:x===null?x=Object.getOwnPropertyDescriptor(l,_):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(a,l,_,x);else for(var T=a.length-1;T>=0;T--)(E=a[T])&&(g=(D<3?E(g):D>3?E(l,_,g):E(l,_))||g);return D>3&&g&&Object.defineProperty(l,_,g),g},y=this&&this.__param||function(a,l){return function(_,x){l(_,x,a)}};Object.defineProperty(u,"__esModule",{value:!0}),u.CoreService=void 0;const h=f(1439),v=f(8460),b=f(844),C=f(2585),m=Object.freeze({insertMode:!1}),o=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let c=u.CoreService=class extends b.Disposable{constructor(a,l,_){super(),this._bufferService=a,this._logService=l,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new v.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new v.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new v.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new v.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,h.clone)(m),this.decPrivateModes=(0,h.clone)(o)}reset(){this.modes=(0,h.clone)(m),this.decPrivateModes=(0,h.clone)(o)}triggerDataEvent(a,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${a}"`,(()=>a.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(a)}triggerBinaryEvent(a){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${a}"`,(()=>a.split("").map((l=>l.charCodeAt(0))))),this._onBinary.fire(a))}};u.CoreService=c=d([y(0,C.IBufferService),y(1,C.ILogService),y(2,C.IOptionsService)],c)},9074:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.DecorationService=void 0;const d=f(8055),y=f(8460),h=f(844),v=f(6106);let b=0,C=0;class m extends h.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new v.SortedList((a=>a?.marker.line)),this._onDecorationRegistered=this.register(new y.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new y.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,h.toDisposable)((()=>this.reset())))}registerDecoration(a){if(a.marker.isDisposed)return;const l=new o(a);if(l){const _=l.marker.onDispose((()=>l.dispose()));l.onDispose((()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),_.dispose())})),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const a of this._decorations.values())a.dispose();this._decorations.clear()}*getDecorationsAtCell(a,l,_){let x=0,E=0;for(const D of this._decorations.getKeyIterator(l))x=D.options.x??0,E=x+(D.options.width??1),a>=x&&a<E&&(!_||(D.options.layer??"bottom")===_)&&(yield D)}forEachDecorationAtCell(a,l,_,x){this._decorations.forEachByKey(l,(E=>{b=E.options.x??0,C=b+(E.options.width??1),a>=b&&a<C&&(!_||(E.options.layer??"bottom")===_)&&x(E)}))}}u.DecorationService=m;class o extends h.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(a){super(),this.options=a,this.onRenderEmitter=this.register(new y.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new y.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=a.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.InstantiationService=u.ServiceCollection=void 0;const d=f(2585),y=f(8343);class h{constructor(...b){this._entries=new Map;for(const[C,m]of b)this.set(C,m)}set(b,C){const m=this._entries.get(b);return this._entries.set(b,C),m}forEach(b){for(const[C,m]of this._entries.entries())b(C,m)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}u.ServiceCollection=h,u.InstantiationService=class{constructor(){this._services=new h,this._services.set(d.IInstantiationService,this)}setService(v,b){this._services.set(v,b)}getService(v){return this._services.get(v)}createInstance(v,...b){const C=(0,y.getServiceDependencies)(v).sort(((c,a)=>c.index-a.index)),m=[];for(const c of C){const a=this._services.get(c.id);if(!a)throw new Error(`[createInstance] ${v.name} depends on UNKNOWN service ${c.id}.`);m.push(a)}const o=C.length>0?C[0].index:b.length;if(b.length!==o)throw new Error(`[createInstance] First service dependency of ${v.name} at position ${o+1} conflicts with ${b.length} static arguments`);return new v(...b,...m)}}},7866:function(X,u,f){var d=this&&this.__decorate||function(o,c,a,l){var _,x=arguments.length,E=x<3?c:l===null?l=Object.getOwnPropertyDescriptor(c,a):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(o,c,a,l);else for(var D=o.length-1;D>=0;D--)(_=o[D])&&(E=(x<3?_(E):x>3?_(c,a,E):_(c,a))||E);return x>3&&E&&Object.defineProperty(c,a,E),E},y=this&&this.__param||function(o,c){return function(a,l){c(a,l,o)}};Object.defineProperty(u,"__esModule",{value:!0}),u.traceCall=u.setTraceLogger=u.LogService=void 0;const h=f(844),v=f(2585),b={trace:v.LogLevelEnum.TRACE,debug:v.LogLevelEnum.DEBUG,info:v.LogLevelEnum.INFO,warn:v.LogLevelEnum.WARN,error:v.LogLevelEnum.ERROR,off:v.LogLevelEnum.OFF};let C,m=u.LogService=class extends h.Disposable{get logLevel(){return this._logLevel}constructor(o){super(),this._optionsService=o,this._logLevel=v.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),C=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(o){for(let c=0;c<o.length;c++)typeof o[c]=="function"&&(o[c]=o[c]())}_log(o,c,a){this._evalLazyOptionalParams(a),o.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+c,...a)}trace(o,...c){this._logLevel<=v.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,o,c)}debug(o,...c){this._logLevel<=v.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,o,c)}info(o,...c){this._logLevel<=v.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,o,c)}warn(o,...c){this._logLevel<=v.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,o,c)}error(o,...c){this._logLevel<=v.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,o,c)}};u.LogService=m=d([y(0,v.IOptionsService)],m),u.setTraceLogger=function(o){C=o},u.traceCall=function(o,c,a){if(typeof a.value!="function")throw new Error("not supported");const l=a.value;a.value=function(..._){if(C.logLevel!==v.LogLevelEnum.TRACE)return l.apply(this,_);C.trace(`GlyphRenderer#${l.name}(${_.map((E=>JSON.stringify(E))).join(", ")})`);const x=l.apply(this,_);return C.trace(`GlyphRenderer#${l.name} return`,x),x}}},7302:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.OptionsService=u.DEFAULT_OPTIONS=void 0;const d=f(8460),y=f(844),h=f(6114);u.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:h.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const v=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends y.Disposable{constructor(m){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const o={...u.DEFAULT_OPTIONS};for(const c in m)if(c in o)try{const a=m[c];o[c]=this._sanitizeAndValidateOption(c,a)}catch(a){console.error(a)}this.rawOptions=o,this.options={...o},this._setupOptions(),this.register((0,y.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(m,o){return this.onOptionChange((c=>{c===m&&o(this.rawOptions[m])}))}onMultipleOptionChange(m,o){return this.onOptionChange((c=>{m.indexOf(c)!==-1&&o()}))}_setupOptions(){const m=c=>{if(!(c in u.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);return this.rawOptions[c]},o=(c,a)=>{if(!(c in u.DEFAULT_OPTIONS))throw new Error(`No option with key "${c}"`);a=this._sanitizeAndValidateOption(c,a),this.rawOptions[c]!==a&&(this.rawOptions[c]=a,this._onOptionChange.fire(c))};for(const c in this.rawOptions){const a={get:m.bind(this,c),set:o.bind(this,c)};Object.defineProperty(this.options,c,a)}}_sanitizeAndValidateOption(m,o){switch(m){case"cursorStyle":if(o||(o=u.DEFAULT_OPTIONS[m]),!(function(c){return c==="block"||c==="underline"||c==="bar"})(o))throw new Error(`"${o}" is not a valid value for ${m}`);break;case"wordSeparator":o||(o=u.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof o=="number"&&1<=o&&o<=1e3)break;o=v.includes(o)?o:u.DEFAULT_OPTIONS[m];break;case"cursorWidth":o=Math.floor(o);case"lineHeight":case"tabStopWidth":if(o<1)throw new Error(`${m} cannot be less than 1, value: ${o}`);break;case"minimumContrastRatio":o=Math.max(1,Math.min(21,Math.round(10*o)/10));break;case"scrollback":if((o=Math.min(o,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${o}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(o<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${o}`);break;case"rows":case"cols":if(!o&&o!==0)throw new Error(`${m} must be numeric, value: ${o}`);break;case"windowsPty":o=o??{}}return o}}u.OptionsService=b},2660:function(X,u,f){var d=this&&this.__decorate||function(b,C,m,o){var c,a=arguments.length,l=a<3?C:o===null?o=Object.getOwnPropertyDescriptor(C,m):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(b,C,m,o);else for(var _=b.length-1;_>=0;_--)(c=b[_])&&(l=(a<3?c(l):a>3?c(C,m,l):c(C,m))||l);return a>3&&l&&Object.defineProperty(C,m,l),l},y=this&&this.__param||function(b,C){return function(m,o){C(m,o,b)}};Object.defineProperty(u,"__esModule",{value:!0}),u.OscLinkService=void 0;const h=f(2585);let v=u.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const C=this._bufferService.buffer;if(b.id===void 0){const _=C.addMarker(C.ybase+C.y),x={data:b,id:this._nextId++,lines:[_]};return _.onDispose((()=>this._removeMarkerFromLink(x,_))),this._dataByLinkId.set(x.id,x),x.id}const m=b,o=this._getEntryIdKey(m),c=this._entriesWithId.get(o);if(c)return this.addLineToLink(c.id,C.ybase+C.y),c.id;const a=C.addMarker(C.ybase+C.y),l={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[a]};return a.onDispose((()=>this._removeMarkerFromLink(l,a))),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(b,C){const m=this._dataByLinkId.get(b);if(m&&m.lines.every((o=>o.line!==C))){const o=this._bufferService.buffer.addMarker(C);m.lines.push(o),o.onDispose((()=>this._removeMarkerFromLink(m,o)))}}getLinkData(b){return this._dataByLinkId.get(b)?.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,C){const m=b.lines.indexOf(C);m!==-1&&(b.lines.splice(m,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};u.OscLinkService=v=d([y(0,h.IBufferService)],v)},8343:(X,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.createDecorator=u.getServiceDependencies=u.serviceRegistry=void 0;const f="di$target",d="di$dependencies";u.serviceRegistry=new Map,u.getServiceDependencies=function(y){return y[d]||[]},u.createDecorator=function(y){if(u.serviceRegistry.has(y))return u.serviceRegistry.get(y);const h=function(v,b,C){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,o,c){o[f]===o?o[d].push({id:m,index:c}):(o[d]=[{id:m,index:c}],o[f]=o)})(h,v,C)};return h.toString=()=>y,u.serviceRegistry.set(y,h),h}},2585:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.IDecorationService=u.IUnicodeService=u.IOscLinkService=u.IOptionsService=u.ILogService=u.LogLevelEnum=u.IInstantiationService=u.ICharsetService=u.ICoreService=u.ICoreMouseService=u.IBufferService=void 0;const d=f(8343);var y;u.IBufferService=(0,d.createDecorator)("BufferService"),u.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),u.ICoreService=(0,d.createDecorator)("CoreService"),u.ICharsetService=(0,d.createDecorator)("CharsetService"),u.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(h){h[h.TRACE=0]="TRACE",h[h.DEBUG=1]="DEBUG",h[h.INFO=2]="INFO",h[h.WARN=3]="WARN",h[h.ERROR=4]="ERROR",h[h.OFF=5]="OFF"})(y||(u.LogLevelEnum=y={})),u.ILogService=(0,d.createDecorator)("LogService"),u.IOptionsService=(0,d.createDecorator)("OptionsService"),u.IOscLinkService=(0,d.createDecorator)("OscLinkService"),u.IUnicodeService=(0,d.createDecorator)("UnicodeService"),u.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(X,u,f)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.UnicodeService=void 0;const d=f(8460),y=f(225);class h{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,C,m=!1){return(16777215&b)<<3|(3&C)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new y.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 C=0,m=0;const o=b.length;for(let c=0;c<o;++c){let a=b.charCodeAt(c);if(55296<=a&&a<=56319){if(++c>=o)return C+this.wcwidth(a);const x=b.charCodeAt(c);56320<=x&&x<=57343?a=1024*(a-55296)+x-56320+65536:C+=this.wcwidth(x)}const l=this.charProperties(a,m);let _=h.extractWidth(l);h.extractShouldJoin(l)&&(_-=h.extractWidth(m)),C+=_,m=l}return C}charProperties(b,C){return this._activeProvider.charProperties(b,C)}}u.UnicodeService=h}},j={};function ee(X){var u=j[X];if(u!==void 0)return u.exports;var f=j[X]={exports:{}};return O[X].call(f.exports,f,f.exports,ee),f.exports}var se={};return(()=>{var X=se;Object.defineProperty(X,"__esModule",{value:!0}),X.Terminal=void 0;const u=ee(9042),f=ee(3236),d=ee(844),y=ee(5741),h=ee(8285),v=ee(7975),b=ee(7090),C=["cols","rows"];class m extends d.Disposable{constructor(c){super(),this._core=this.register(new f.Terminal(c)),this._addonManager=this.register(new y.AddonManager),this._publicOptions={...this._core.options};const a=_=>this._core.options[_],l=(_,x)=>{this._checkReadonlyOptions(_),this._core.options[_]=x};for(const _ in this._core.options){const x={get:a.bind(this,_),set:l.bind(this,_)};Object.defineProperty(this._publicOptions,_,x)}}_checkReadonlyOptions(c){if(C.includes(c))throw new Error(`Option "${c}" 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 v.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 h.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const c=this._core.coreService.decPrivateModes;let a="none";switch(this._core.coreMouseService.activeProtocol){case"X10":a="x10";break;case"VT200":a="vt200";break;case"DRAG":a="drag";break;case"ANY":a="any"}return{applicationCursorKeysMode:c.applicationCursorKeys,applicationKeypadMode:c.applicationKeypad,bracketedPasteMode:c.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:a,originMode:c.origin,reverseWraparoundMode:c.reverseWraparound,sendFocusMode:c.sendFocus,wraparoundMode:c.wraparound}}get options(){return this._publicOptions}set options(c){for(const a in c)this._publicOptions[a]=c[a]}blur(){this._core.blur()}focus(){this._core.focus()}input(c,a=!0){this._core.input(c,a)}resize(c,a){this._verifyIntegers(c,a),this._core.resize(c,a)}open(c){this._core.open(c)}attachCustomKeyEventHandler(c){this._core.attachCustomKeyEventHandler(c)}attachCustomWheelEventHandler(c){this._core.attachCustomWheelEventHandler(c)}registerLinkProvider(c){return this._core.registerLinkProvider(c)}registerCharacterJoiner(c){return this._checkProposedApi(),this._core.registerCharacterJoiner(c)}deregisterCharacterJoiner(c){this._checkProposedApi(),this._core.deregisterCharacterJoiner(c)}registerMarker(c=0){return this._verifyIntegers(c),this._core.registerMarker(c)}registerDecoration(c){return this._checkProposedApi(),this._verifyPositiveIntegers(c.x??0,c.width??0,c.height??0),this._core.registerDecoration(c)}hasSelection(){return this._core.hasSelection()}select(c,a,l){this._verifyIntegers(c,a,l),this._core.select(c,a,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(c,a){this._verifyIntegers(c,a),this._core.selectLines(c,a)}dispose(){super.dispose()}scrollLines(c){this._verifyIntegers(c),this._core.scrollLines(c)}scrollPages(c){this._verifyIntegers(c),this._core.scrollPages(c)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(c){this._verifyIntegers(c),this._core.scrollToLine(c)}clear(){this._core.clear()}write(c,a){this._core.write(c,a)}writeln(c,a){this._core.write(c),this._core.write(`\r
17
- `,a)}paste(c){this._core.paste(c)}refresh(c,a){this._verifyIntegers(c,a),this._core.refresh(c,a)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(c){this._addonManager.loadAddon(this,c)}static get strings(){return u}_verifyIntegers(...c){for(const a of c)if(a===1/0||isNaN(a)||a%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...c){for(const a of c)if(a&&(a===1/0||isNaN(a)||a%1!=0||a<0))throw new Error("This API only accepts positive integers")}}X.Terminal=m})(),se})()))})(Lc)),Lc.exports}var bm=Sm(),kc={exports:{}},Rd;function ym(){return Rd||(Rd=1,(function(w,B){(function(O,j){w.exports=j()})(self,(()=>(()=>{var O={};return(()=>{var j=O;Object.defineProperty(j,"__esModule",{value:!0}),j.FitAddon=void 0,j.FitAddon=class{activate(ee){this._terminal=ee}dispose(){}fit(){const ee=this.proposeDimensions();if(!ee||!this._terminal||isNaN(ee.cols)||isNaN(ee.rows))return;const se=this._terminal._core;this._terminal.rows===ee.rows&&this._terminal.cols===ee.cols||(se._renderService.clear(),this._terminal.resize(ee.cols,ee.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const ee=this._terminal._core,se=ee._renderService.dimensions;if(se.css.cell.width===0||se.css.cell.height===0)return;const X=this._terminal.options.scrollback===0?0:ee.viewport.scrollBarWidth,u=window.getComputedStyle(this._terminal.element.parentElement),f=parseInt(u.getPropertyValue("height")),d=Math.max(0,parseInt(u.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),h=f-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),v=d-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-X;return{cols:Math.max(2,Math.floor(v/se.css.cell.width)),rows:Math.max(1,Math.floor(h/se.css.cell.height))}}}})(),O})()))})(kc)),kc.exports}var Cm=ym();const pl=16e3,wm=.004,Em=["audio/webm;codecs=opus","audio/webm","audio/mp4"];function Zd(w){if(!w.length)return 0;let B=0;for(const O of w)B+=O*O;return Math.sqrt(B/w.length)}function Md(w,B=wm){return Zd(w)<B}async function xm(w){const B=new AudioContext;try{const O=await B.decodeAudioData(await w.arrayBuffer()),j=Math.max(1,Math.ceil(O.duration*pl)),ee=new OfflineAudioContext(1,j,pl),se=ee.createBufferSource();return se.buffer=O,se.connect(ee.destination),se.start(),(await ee.startRendering()).getChannelData(0)}finally{B.close()}}class Ld{constructor(){this.stream=null,this.recorder=null,this.chunks=[]}async start(){this.stream=await navigator.mediaDevices.getUserMedia({audio:!0});const B=Em.find(O=>MediaRecorder.isTypeSupported(O));this.recorder=new MediaRecorder(this.stream,B?{mimeType:B}:void 0),this.chunks=[],this.recorder.ondataavailable=O=>{O.data.size&&this.chunks.push(O.data)},this.recorder.start()}stop(){return new Promise(B=>{const O=this.recorder;if(!O||O.state==="inactive"){this.dispose(),B(null);return}O.onstop=()=>{const j=new Blob(this.chunks,{type:O.mimeType||"audio/webm"});if(this.dispose(),!j.size){B(null);return}xm(j).then(B,()=>B(null))},O.stop()})}cancel(){const B=this.recorder;B&&B.state!=="inactive"&&(B.onstop=null,B.stop()),this.dispose()}dispose(){this.stream?.getTracks().forEach(B=>B.stop()),this.stream=null,this.recorder=null,this.chunks=[]}}function ul(w){const B=w.replace(/^.*@/,""),O=B.replace(/:\d+$/,"");return O.includes(":")?B:O}const ml="\x1B",kd="\x07",Am=new RegExp(ml+"\\][^"+kd+ml+"]*(?:"+kd+"|"+ml+"\\\\)","g"),Dm=new RegExp(ml+"\\[[0-9;?]*[A-Za-z]","g");function Tm(w){return/[#$%>]\s*$/.test(w.replace(Am,"").replace(Dm,""))}const Rm=60,Mm=200;function Lm(w){if(w.type!=="keydown"||!(w.ctrlKey||w.metaKey)||!w.shiftKey)return null;const B=w.key.toLowerCase();return B==="c"?"copy":B==="v"?"paste":null}function gl(w){return w instanceof Error?w.message:String(w)}function km(w,B,O){if(B.mark(),typeof w.terminal.paste=="function"){w.terminal.paste(O);return}w.writeToPty?.(O)}function Qd(w=()=>Date.now()){let B=Number.NEGATIVE_INFINITY;return{mark(){B=w()},isDuplicate(){return w()-B<Mm}}}function Om(w,B){const O=j=>{B.isDuplicate()&&(j.preventDefault(),j.stopPropagation(),j.stopImmediatePropagation?.())};return w.addEventListener("paste",O,!0),()=>w.removeEventListener("paste",O,!0)}function Bm(w,B=Qd()){return O=>{const j=Lm(O);if(!j)return!0;if(O.preventDefault(),O.stopPropagation(),j==="copy"){const ee=w.terminal.getSelection();return ee&&w.clipboard.copyText(ee).catch(se=>{w.onError(gl(se))}),!1}return w.clipboard.readText().then(ee=>{ee&&km(w,B,ee)}).catch(ee=>{w.onError(gl(ee))}),!1}}const jm=new Set(["c","p","s"]);function Hm(w){return w?[...w].some(B=>jm.has(B)):!0}function Nm(w){const B=w.replace(/\s+/g,"");if(!/^[A-Za-z0-9+/]*={0,2}$/.test(B))return null;try{const O=atob(B),j=Uint8Array.from(O,ee=>ee.charCodeAt(0));return new TextDecoder().decode(j)}catch{return null}}function zm(w){const B=w.indexOf(";");if(B===-1||!Hm(w.slice(0,B)))return null;const O=w.slice(B+1);return O==="?"||!O?null:Nm(O)}function Um(w){const B=w.terminal.parser;if(!B)return()=>{};const O=B.registerOscHandler(52,j=>{const ee=zm(j);return ee!==null&&w.clipboard.copyText(ee).catch(se=>{w.onError(gl(se))}),!0});return()=>{O&&typeof O.dispose=="function"&&O.dispose()}}function qm(w){const{terminal:B}=w;if(typeof B.onSelectionChange!="function")return()=>{};let O,j=null;const ee=B.onSelectionChange(()=>{O&&clearTimeout(O),O=setTimeout(()=>{if(O=void 0,w.isCopyOnSelectEnabled&&!w.isCopyOnSelectEnabled())return;const se=B.getSelection();!se||se===j||(j=se,w.clipboard.copyText(se).catch(X=>{j=null,w.onError(gl(X))}))},Rm)});return()=>{O&&clearTimeout(O),ee&&typeof ee.dispose=="function"&&ee.dispose()}}function Im(w){const B=Qd();w.terminal.attachCustomKeyEventHandler(Bm(w,B));const O=[Um(w),qm(w),w.pasteEventTarget?Om(w.pasteEventTarget,B):()=>{}];return()=>{for(const j of O.reverse())j()}}function Pm(w){let B=!1;return{onMouseDown(O){B=O.target===O.currentTarget},onClick(O){const j=B&&O.target===O.currentTarget;B=!1,j&&w()}}}function ir(w){const B=_e.useRef(w);B.current=w;const O=_e.useRef(null);return O.current||(O.current=Pm(()=>B.current())),O.current}function $e({name:w,className:B=""}){const O={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:`icon-svg ${B}`.trim(),"aria-hidden":!0};switch(w){case"plus":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M12 5v14M5 12h14"})});case"panel-left":return p.jsxs("svg",{...O,children:[p.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),p.jsx("path",{d:"M9 4v16"})]});case"panel-left-open":return p.jsxs("svg",{...O,children:[p.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),p.jsx("path",{d:"M9 4v16M6 9l2 3-2 3"})]});case"grid":return p.jsxs("svg",{...O,children:[p.jsx("rect",{x:"4",y:"4",width:"7",height:"7",rx:"1"}),p.jsx("rect",{x:"13",y:"4",width:"7",height:"7",rx:"1"}),p.jsx("rect",{x:"4",y:"13",width:"7",height:"7",rx:"1"}),p.jsx("rect",{x:"13",y:"13",width:"7",height:"7",rx:"1"})]});case"sessions":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M4 7h16M4 12h16M4 17h10"})});case"ssh":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M7 17l5-5-5-5M12 17h7"})});case"history":return p.jsxs("svg",{...O,children:[p.jsx("path",{d:"M4 12a8 8 0 1 0 2.3-5.7L4 8.5M4 4v4.5h4.5"}),p.jsx("path",{d:"M12 7v5l3 2"})]});case"spark":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8L12 3z"})});case"settings":return p.jsxs("svg",{...O,children:[p.jsx("circle",{cx:"12",cy:"12",r:"3"}),p.jsx("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9c.3.6.9 1 1.6 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z"})]});case"sun":return p.jsxs("svg",{...O,children:[p.jsx("circle",{cx:"12",cy:"12",r:"4"}),p.jsx("path",{d:"M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41"})]});case"moon":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M20.5 15.5A8.5 8.5 0 0 1 8.5 3.5 8.5 8.5 0 1 0 20.5 15.5z"})});case"stack":return p.jsx("svg",{...O,children:p.jsx("rect",{x:"5",y:"5",width:"14",height:"14",rx:"1.5"})});case"maximize":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M8 4H4v4M16 4h4v4M4 16v4h4M20 16v4h-4"})});case"restore":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M8 8h12v12H8zM4 16V4h12"})});case"chevron-left":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M15 5l-7 7 7 7"})});case"chevron-right":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M9 5l7 7-7 7"})});case"split-v":return p.jsxs("svg",{...O,children:[p.jsx("rect",{x:"4",y:"5",width:"7",height:"14",rx:"1"}),p.jsx("rect",{x:"13",y:"5",width:"7",height:"14",rx:"1"})]});case"split-h":return p.jsxs("svg",{...O,children:[p.jsx("rect",{x:"4",y:"4",width:"16",height:"7",rx:"1"}),p.jsx("rect",{x:"4",y:"13",width:"16",height:"7",rx:"1"})]});case"x":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M6 6l12 12M18 6L6 18"})});case"mic":return p.jsxs("svg",{...O,children:[p.jsx("rect",{x:"9",y:"2.5",width:"6",height:"12",rx:"3"}),p.jsx("path",{d:"M5 11.5a7 7 0 0 0 14 0"}),p.jsx("path",{d:"M12 18.5V21"})]});case"check":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M5 13l4.5 4.5L19 7"})});case"transfer":return p.jsxs("svg",{...O,children:[p.jsx("path",{d:"M8 20V6M8 6L4.5 9.5M8 6l3.5 3.5"}),p.jsx("path",{d:"M16 4v14M16 18l3.5-3.5M16 18l-3.5-3.5"})]});case"folder":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6h4l2 2.5h7A1.5 1.5 0 0 1 19 10v7.5A1.5 1.5 0 0 1 17.5 19h-13A1.5 1.5 0 0 1 3 17.5z"})});case"file":return p.jsxs("svg",{...O,children:[p.jsx("path",{d:"M6 3.5h7L18 8v12.5H6z"}),p.jsx("path",{d:"M13 3.5V8h5"})]});case"link":return p.jsxs("svg",{...O,children:[p.jsx("path",{d:"M10 13a4 4 0 0 0 5.7 0l2.3-2.3a4 4 0 0 0-5.7-5.7L11 6.3"}),p.jsx("path",{d:"M14 11a4 4 0 0 0-5.7 0L6 13.3a4 4 0 0 0 5.7 5.7L13 17.7"})]});case"folder-plus":return p.jsxs("svg",{...O,children:[p.jsx("path",{d:"M3 7.5A1.5 1.5 0 0 1 4.5 6h4l2 2.5h7A1.5 1.5 0 0 1 19 10v7.5A1.5 1.5 0 0 1 17.5 19h-13A1.5 1.5 0 0 1 3 17.5z"}),p.jsx("path",{d:"M11 11v5M8.5 13.5h5"})]});case"trash":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M4.5 7h15M9 7V4.5h6V7M6.5 7l1 13h9l1-13"})});case"pencil":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M4 20h4L20 8l-4-4L4 16z"})});case"refresh":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M20 12a8 8 0 1 1-2.3-5.7L20 8.5M20 4v4.5h-4.5"})});case"arrow-up":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M12 20V4M12 4l-6 6M12 4l6 6"})});case"arrow-down":return p.jsx("svg",{...O,children:p.jsx("path",{d:"M12 4v16M12 20l-6-6M12 20l6-6"})});case"level-up":return p.jsxs("svg",{...O,children:[p.jsx("path",{d:"M5 12l7-7 7 7"}),p.jsx("path",{d:"M12 5v14"})]});default:return p.jsx("span",{className:"icon","aria-hidden":"true",children:"•"})}}const ar="\x1B",Sl="\x07",Gm=new RegExp(ar+"\\]7;([^"+Sl+ar+"]*)(?:"+Sl+"|"+ar+"\\\\)","g"),Wm=new RegExp(ar+"\\][^"+Sl+ar+"]*(?:"+Sl+"|"+ar+"\\\\)","g"),Fm=new RegExp(ar+"\\[[0-9;?]*[ -/]*[@-~]","g");function Km(w){const B=w.match(/^file:\/\/[^/]*(\/.*)$/);if(!B)return null;try{const O=decodeURIComponent(B[1]);return O.includes("\0")?null:O}catch{return null}}function Ym(w){const O=w.replace(Wm,"").replace(Fm,"").replace(/\r/g,`
18
- `).split(`
19
- `).filter(X=>X.trim()),j=O[O.length-1];if(!j)return null;const ee=j.match(/(?:^|[:\s])(~|~\/[^\s:]*|\/[^\s:]*)\s*[#$%>]\s*$/);return ee?ee[1].replace(/\/+$/,"")||"/":null}function Vm(w){let B=null;for(const j of w.matchAll(Gm))B=j[1];if(B){const j=Km(B);if(j)return{path:j,source:"osc7"}}const O=Ym(w);return O?{path:O,source:"prompt"}:null}function $m(w){return!w||w==="~"||w==="~/"?{}:w.startsWith("/")?{absolute:w}:w.startsWith("~/")?{homeRelative:w.slice(2)}:{}}function sr(w,B){return B.startsWith("/")?B:w==="/"?`/${B}`:`${w.replace(/\/+$/,"")}/${B}`}function Xm(w){const B=w.replace(/\/+$/,""),O=B.lastIndexOf("/");return O<=0?"/":B.slice(0,O)}function Jd(w){return/^[A-Za-z]:/.test(w)||w.startsWith("\\\\")||w.includes("\\")}function Gr(w,B){const O=Jd(w)?"\\":"/";return`${w.replace(/[\\/]+$/,"")}${O}${B}`}function Zm(w){const B=Jd(w),O=w.replace(/[\\/]+$/,""),j=Math.max(O.lastIndexOf("/"),O.lastIndexOf("\\"));if(j<0)return w;if(!B)return j===0?"/":O.slice(0,j);const ee=O.slice(0,j);return/^[A-Za-z]:$/.test(ee)?`${ee}\\`:ee||"\\"}function Qm(w){const B=w.split(/[\\/]/).filter(Boolean);return B[B.length-1]??w}function Jm(w){if(w.kind==="directory")return"—";const B=["B","KB","MB","GB","TB"];let O=w.size,j=0;for(;O>=1024&&j<B.length-1;)O/=1024,j+=1;return`${j===0?O:O.toFixed(O<10?1:0)} ${B[j]}`}function ep(w){if(!w)return"";const B=w.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);if(!B)return w;const[,O,j,ee,se,X]=B;return`${O}-${j}-${ee} ${se}:${X}`}function e_(w){if(!w||w.kind!=="ssh")return null;const B=w.sshTarget||w.host;return B&&B!=="local"?B:null}function tp(w){return w?e_(w)?{available:!0,reason:`Transfer files with ${w.host}`}:{available:!1,reason:`${w.name} is a local session — SFTP needs an SSH connection`}:{available:!1,reason:"Open an SSH session to transfer files"}}function Od(w){return w.kind==="directory"||w.kind==="symlink"}function Bd(w,B,O=!1){return w.filter(j=>B.has(j.name)&&(O||j.kind!=="directory"))}function jd(w,B,O="file"){return B===0?w:`${w} ${B} ${B===1?O:`${O}s`}`}function Hd(w,B,O,j,ee){if(j&&ee){const X=ee.indexOf(j),u=ee.indexOf(B);if(X>=0&&u>=0){const f=O?new Set(w):new Set,d=Math.min(X,u),y=Math.max(X,u);for(const h of ee.slice(d,y+1))f.add(h);return f}}if(!O)return new Set([B]);const se=new Set(w);return se.has(B)?se.delete(B):se.add(B),se}function ip({session:w,target:B,api:O,onClose:j,backdrop:ee}){const[se,X]=_e.useState(null),[u,f]=_e.useState(null),[d,y]=_e.useState(null),[h,v]=_e.useState({local:!0,remote:!0}),[b,C]=_e.useState({local:new Set,remote:new Set}),[m,o]=_e.useState({local:"",remote:""}),[c,a]=_e.useState("Connecting…"),[l,_]=_e.useState({}),[x,E]=_e.useState(null),[D,g]=_e.useState(null),[T,U]=_e.useState(""),[P,W]=_e.useState(null),[N,Q]=_e.useState(null),[ae,q]=_e.useState(null),te=_e.useRef({local:null,remote:null}),V=_e.useRef(null),R=_e.useRef(void 0),z=_e.useRef(void 0);R.current=se?.path,z.current=u?.path;const A=_e.useRef(!0);_e.useEffect(()=>()=>{A.current=!1},[]);const k=_e.useCallback(fe=>{const ge=fe instanceof Error?fe.message:String(fe);return a(ge),ge},[]),K=_e.useCallback(async fe=>{v(ge=>({...ge,local:!0}));try{const ge=await O.listLocalDirectory(fe);if(!A.current)return;X(ge),o(Ce=>({...Ce,local:ge.path})),C(Ce=>({...Ce,local:new Set})),_(Ce=>({...Ce,local:void 0}))}catch(ge){if(!A.current)return;_(Ce=>({...Ce,local:k(ge)}))}finally{A.current&&v(ge=>({...ge,local:!1}))}},[O,k]),re=_e.useCallback(async fe=>{const ge=V.current;if(ge){v(Ce=>({...Ce,remote:!0}));try{const Ce=await O.sftpList(ge,fe);if(!A.current)return;f(Ce),o(Le=>({...Le,remote:Ce.path})),C(Le=>({...Le,remote:new Set})),_(Le=>({...Le,remote:void 0}))}catch(Ce){if(!A.current)return;_(Le=>({...Le,remote:k(Ce)}))}finally{A.current&&v(Ce=>({...Ce,remote:!1}))}}},[O,k]);_e.useEffect(()=>O.onSftpEvent?.(fe=>{if(!A.current)return;const ge=V.current;if(fe.type==="prompt"){if(ge&&fe.prompt.sessionId!==ge)return;V.current=fe.prompt.sessionId,g(fe.prompt),U("");return}ge&&fe.sessionId!==ge||(fe.type==="progress"&&E({name:fe.name,percent:fe.percent,detail:fe.detail}),fe.type==="status"&&a(fe.message),fe.type==="closed"&&(V.current=null,y(null),_(Ce=>({...Ce,remote:fe.message})),a(fe.message)))}),[O]),_e.useEffect(()=>{K();const fe=$m(w.cwd);let ge=!1;return(async()=>{try{const Ce=await O.sftpOpen(B,fe.absolute);if(ge||!A.current)return;V.current=Ce.id,y(Ce),g(null),a(`Connected to ${Ce.target}`),await re(fe.homeRelative?sr(Ce.cwd,fe.homeRelative):void 0)}catch(Ce){if(ge||!A.current)return;g(null),v(Le=>({...Le,remote:!1})),_(Le=>({...Le,remote:k(Ce)}))}})(),()=>{ge=!0}},[]);const me=_e.useCallback(fe=>fe==="local"?K(R.current):re(z.current),[K,re]),pe=(fe,ge)=>fe==="local"?K(ge):re(ge),F=_e.useMemo(()=>Bd(se?.entries??[],b.local),[se,b.local]),L=_e.useMemo(()=>Bd(u?.entries??[],b.remote,!0),[u,b.remote]),ne=x!==null,ve=async fe=>{const ge=V.current;if(!ge||!se||!u)return;const Ce=fe==="upload"?F:L;if(!Ce.length)return;E({name:Ce[0].name,percent:0,detail:"starting"});let Le=0;try{for(const Xe of Ce)a(`${fe==="upload"?"Uploading":"Downloading"} ${Xe.name}…`),fe==="upload"?await O.sftpUpload(ge,Gr(se.path,Xe.name),u.path):await O.sftpDownload(ge,sr(u.path,Xe.name),se.path,Xe.kind),Le+=1;a(`${fe==="upload"?"Uploaded":"Downloaded"} ${Le} ${Le===1?"file":"files"}.`)}catch(Xe){const je=k(Xe);a(`${je} (${Le} of ${Ce.length} transferred)`)}finally{A.current&&(E(null),await me(fe==="upload"?"remote":"local"))}},Se=async fe=>{if(fe.preventDefault(),!P)return;const ge=P.value.trim(),Ce=P.side;if(ge)try{Ce==="local"&&se?await O.createLocalDirectory(Gr(se.path,ge)):Ce==="remote"&&u&&V.current&&await O.sftpMkdir(V.current,sr(u.path,ge)),W(null),a(`Created ${ge}`),await me(Ce)}catch(Le){k(Le)}},be=async fe=>{if(fe.preventDefault(),!N)return;const ge=N.value.trim(),{side:Ce,entry:Le}=N;if(!ge||ge===Le.name){Q(null);return}try{Ce==="local"&&se?await O.renameLocalEntry(Gr(se.path,Le.name),Gr(se.path,ge)):Ce==="remote"&&u&&V.current&&await O.sftpRename(V.current,sr(u.path,Le.name),sr(u.path,ge)),Q(null),a(`Renamed to ${ge}`),await me(Ce)}catch(Xe){k(Xe)}},Me=async()=>{if(!ae)return;const{side:fe,entry:ge}=ae;try{fe==="local"&&se?await O.removeLocalEntry(Gr(se.path,ge.name),ge.kind):fe==="remote"&&u&&V.current&&await O.sftpRemove(V.current,sr(u.path,ge.name),ge.kind),q(null),a(`Deleted ${ge.name}`),await me(fe)}catch(Ce){k(Ce)}},Ue=async fe=>{fe.preventDefault();const ge=V.current;if(!ge||!D)return;const Ce=D.kind==="confirm"?"yes":T;g(null),U(""),a(D.kind==="confirm"?"Accepting host key…":"Authenticating…");try{await O.sftpAnswerPrompt(ge,Ce)}catch(Le){k(Le)}},He=async fe=>{const ge=V.current;if(g(null),U(""),a(fe==="confirm"?"Host key rejected.":"Cancelled. The transfer connection was closed."),!!ge)try{fe==="confirm"?await O.sftpAnswerPrompt(ge,"no"):await O.sftpClose(ge)}catch{}},at=(fe,ge)=>{if(!Od(ge))return;const Ce=fe==="local"?se?.path:u?.path;Ce&&pe(fe,fe==="local"?Gr(Ce,ge.name):sr(Ce,ge.name))},Ae=fe=>{const ge=fe==="local"?b.local:b.remote,Ce=(fe==="local"?se?.entries:u?.entries)??[];return ge.size!==1?null:Ce.find(Le=>ge.has(Le.name))??null},Mt=fe=>{const ge=fe==="local"?se:u,Ce=fe==="local"?b.local:b.remote,Le=fe==="local"?l.local:l.remote,Xe=fe==="local"?h.local:h.remote,je=Ae(fe),dt=fe==="remote"&&!d;return p.jsxs("section",{className:`sftp-pane sftp-pane-${fe}`,children:[p.jsxs("header",{className:"sftp-pane-head",children:[p.jsx("span",{className:"eyebrow",children:fe==="local"?"THIS COMPUTER":w.host.toUpperCase()}),p.jsxs("div",{className:"sftp-pane-tools",children:[p.jsx("button",{type:"button",title:"Parent folder","aria-label":`${fe} parent folder`,disabled:!ge||Xe,onClick:()=>ge&&void pe(fe,fe==="local"?Zm(ge.path):Xm(ge.path)),children:p.jsx($e,{name:"level-up"})}),p.jsx("button",{type:"button",title:"Refresh","aria-label":`Refresh ${fe}`,disabled:Xe||dt,onClick:()=>{me(fe)},children:p.jsx($e,{name:"refresh"})}),p.jsx("button",{type:"button",title:"New folder","aria-label":`New folder on ${fe}`,disabled:!ge||dt,onClick:()=>W({side:fe,value:""}),children:p.jsx($e,{name:"folder-plus"})}),p.jsx("button",{type:"button",title:je?`Rename ${je.name}`:"Select one item to rename","aria-label":`Rename on ${fe}`,disabled:!je||dt,onClick:()=>je&&Q({side:fe,entry:je,value:je.name}),children:p.jsx($e,{name:"pencil"})}),p.jsx("button",{type:"button",className:"sftp-danger",title:je?`Delete ${je.name}`:"Select one item to delete","aria-label":`Delete on ${fe}`,disabled:!je||dt,onClick:()=>je&&q({side:fe,entry:je}),children:p.jsx($e,{name:"trash"})})]})]}),p.jsx("form",{className:"sftp-path",onSubmit:Ge=>{Ge.preventDefault();const lt=(fe==="local"?m.local:m.remote).trim();lt&&pe(fe,lt)},children:p.jsx("input",{value:fe==="local"?m.local:m.remote,onChange:Ge=>{const lt=Ge.target.value;o(mt=>fe==="local"?{...mt,local:lt}:{...mt,remote:lt})},spellCheck:!1,"aria-label":`${fe} path`,placeholder:fe==="local"?"Local folder":"Remote folder",disabled:dt})}),p.jsx("div",{className:"sftp-list",role:"listbox","aria-label":`${fe} files`,"aria-busy":Xe,children:Le?p.jsxs("div",{className:"sftp-empty sftp-error",children:[p.jsx("b",{children:fe==="local"?"Cannot read this folder":"No remote listing"}),p.jsx("small",{children:Le})]}):Xe&&!ge?p.jsxs("div",{className:"sftp-empty",children:[p.jsx("b",{children:fe==="remote"&&!d?"Connecting…":"Loading…"}),p.jsx("small",{children:fe==="remote"?`Opening SFTP to ${w.host}`:"Reading the local folder"})]}):ge&&ge.entries.length?ge.entries.map(Ge=>p.jsxs("button",{type:"button",role:"option","aria-selected":Ce.has(Ge.name),className:`sftp-row ${Ce.has(Ge.name)?"selected":""} ${Ge.kind==="directory"?"is-directory":""}`,onClick:lt=>{const mt=lt.ctrlKey||lt.metaKey,fi=te.current[fe],Lt=lt.shiftKey&&fi?fi:void 0,di=ge?.entries.map(qe=>qe.name);C(qe=>fe==="local"?{...qe,local:Hd(qe.local,Ge.name,mt,Lt,di)}:{...qe,remote:Hd(qe.remote,Ge.name,mt,Lt,di)}),lt.shiftKey||(te.current[fe]=Ge.name)},onDoubleClick:()=>at(fe,Ge),onKeyDown:lt=>{lt.key!=="Enter"||!Od(Ge)||(lt.preventDefault(),at(fe,Ge))},title:Ge.linkTarget?`${Ge.name} → ${Ge.linkTarget}`:Ge.name,children:[p.jsx($e,{name:Ge.kind==="directory"?"folder":Ge.kind==="symlink"?"link":"file"}),p.jsx("span",{className:"sftp-name",children:Ge.name}),p.jsx("span",{className:"sftp-size",children:Jm(Ge)}),p.jsx("span",{className:"sftp-modified",children:ep(Ge.modified)})]},Ge.name)):p.jsxs("div",{className:"sftp-empty",children:[p.jsx("b",{children:"Empty folder"}),p.jsx("small",{children:"Nothing here to transfer."})]})}),p.jsxs("footer",{className:"sftp-pane-foot",children:[fe==="local"?p.jsxs("button",{type:"button",className:"primary-button",disabled:!F.length||!d||ne,onClick:()=>{ve("upload")},title:F.length?`Copy to ${w.host}`:"Select files to upload",children:[p.jsx($e,{name:"arrow-up"})," ",jd("Upload",F.length)]}):p.jsxs("button",{type:"button",className:"primary-button",disabled:!L.length||!d||ne,onClick:()=>{ve("download")},title:L.length?"Copy to this computer":"Select files to download",children:[p.jsx($e,{name:"arrow-down"})," ",jd("Download",L.length,"item")]}),p.jsx("span",{className:"sftp-count",children:ge?`${ge.entries.length} items`:""})]})]})};return p.jsx("div",{className:"sftp-layer",role:"presentation",...ee,children:p.jsxs("section",{className:"sftp-panel",role:"dialog","aria-label":"Transfer files",children:[p.jsxs("div",{className:"sftp-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"TRANSFER FILES"}),p.jsxs("h2",{children:[w.name," · ",w.host]})]}),p.jsx("button",{type:"button",className:"close-button",onClick:j,children:"Esc"})]}),p.jsxs("div",{className:"sftp-body",children:[Mt("local"),Mt("remote")]}),D&&p.jsxs("form",{className:"sftp-prompt",onSubmit:Ue,children:[p.jsx("span",{className:"eyebrow warning-text",children:D.kind==="confirm"?"HOST KEY":"AUTHENTICATION"}),p.jsx("pre",{children:D.text}),D.kind==="confirm"?p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>{He("confirm")},children:"Reject"}),p.jsx("button",{type:"submit",className:"primary-button",children:"Accept key"})]}):p.jsxs(p.Fragment,{children:[p.jsxs("label",{children:[D.kind==="passphrase"?"Key passphrase":"Password",p.jsx("input",{autoFocus:!0,type:"password",value:T,onChange:fe=>U(fe.target.value),autoComplete:"off"})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>{He(D.kind)},children:"Cancel"}),p.jsx("button",{type:"submit",className:"primary-button",children:"Send"})]})]})]}),P&&p.jsxs("form",{className:"sftp-inline-form",onSubmit:Se,children:[p.jsxs("label",{children:["New folder in ",P.side==="local"?se?.path:u?.path,p.jsx("input",{autoFocus:!0,value:P.value,onChange:fe=>W({...P,value:fe.target.value}),required:!0})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>W(null),children:"Cancel"}),p.jsx("button",{type:"submit",className:"primary-button",children:"Create"})]})]}),N&&p.jsxs("form",{className:"sftp-inline-form",onSubmit:be,children:[p.jsxs("label",{children:["Rename ",N.entry.name,p.jsx("input",{autoFocus:!0,value:N.value,onChange:fe=>Q({...N,value:fe.target.value}),required:!0})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>Q(null),children:"Cancel"}),p.jsx("button",{type:"submit",className:"primary-button",children:"Rename"})]})]}),ae&&p.jsxs("div",{className:"sftp-inline-form",children:[p.jsx("span",{className:"eyebrow warning-text",children:"CONFIRM DELETE"}),p.jsxs("p",{children:["Delete ",p.jsx("b",{children:ae.entry.name})," from ",ae.side==="local"?"this computer":w.host,"?",ae.entry.kind==="directory"?" Only an empty folder can be deleted here.":""]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",autoFocus:!0,onClick:()=>q(null),children:"Cancel"}),p.jsx("button",{type:"button",className:"primary-button sftp-danger-button",onClick:()=>{Me()},children:"Delete"})]})]}),p.jsxs("footer",{className:"sftp-foot",children:[x?p.jsxs("div",{className:"sftp-progress",role:"progressbar","aria-valuenow":x.percent,"aria-valuemin":0,"aria-valuemax":100,"aria-label":`Transferring ${x.name}`,children:[p.jsx("div",{className:"sftp-progress-fill",style:{width:`${x.percent}%`}}),p.jsxs("span",{children:[Qm(x.name)," · ",x.percent,"% · ",x.detail]})]}):p.jsx("span",{className:"sftp-notice",children:c}),p.jsx("span",{className:"sftp-hint",children:"Double-click a folder to open · Ctrl-click to select several · Esc closes"})]})]})})}const Nd={q4:96,q8:41,fp16:76,fp32:152},zd={q4:142,q8:77,fp16:146,fp32:291},Ud={q4:299,q8:249,fp16:485,fp32:968},Ic=[{id:"onnx-community/whisper-tiny.en",label:"Whisper tiny · English",family:"tiny",multilingual:!1,downloadMb:Nd},{id:"onnx-community/whisper-base.en",label:"Whisper base · English",family:"base",multilingual:!1,downloadMb:zd},{id:"onnx-community/whisper-small.en",label:"Whisper small · English",family:"small",multilingual:!1,downloadMb:Ud},{id:"onnx-community/whisper-tiny",label:"Whisper tiny · multilingual",family:"tiny",multilingual:!0,downloadMb:Nd},{id:"onnx-community/whisper-base",label:"Whisper base · multilingual",family:"base",multilingual:!0,downloadMb:zd},{id:"onnx-community/whisper-small",label:"Whisper small · multilingual",family:"small",multilingual:!0,downloadMb:Ud}],sp="onnx-community/whisper-tiny.en",qd=[{value:"q8",label:"q8 · quantized",detail:"Smallest download, fastest on CPU"},{value:"q4",label:"q4",detail:"Smaller weights, some accuracy loss"},{value:"fp16",label:"fp16",detail:"Half precision; needs WebGPU to pay off"},{value:"fp32",label:"fp32 · full",detail:"Most accurate, largest download"}],t_=[{value:"auto",label:"Detect automatically"},{value:"en",label:"English"},{value:"es",label:"Spanish"},{value:"fr",label:"French"},{value:"de",label:"German"},{value:"it",label:"Italian"},{value:"pt",label:"Portuguese"},{value:"nl",label:"Dutch"},{value:"pl",label:"Polish"},{value:"sv",label:"Swedish"},{value:"da",label:"Danish"},{value:"no",label:"Norwegian"},{value:"fi",label:"Finnish"},{value:"cs",label:"Czech"},{value:"el",label:"Greek"},{value:"tr",label:"Turkish"},{value:"ru",label:"Russian"},{value:"uk",label:"Ukrainian"},{value:"he",label:"Hebrew"},{value:"ar",label:"Arabic"},{value:"hi",label:"Hindi"},{value:"zh",label:"Chinese"},{value:"ja",label:"Japanese"},{value:"ko",label:"Korean"},{value:"id",label:"Indonesian"},{value:"th",label:"Thai"},{value:"vi",label:"Vietnamese"}];function bl(w){return Ic.find(B=>B.id===w)}function rp(w){return bl(w)?.multilingual??!1}function np(w,B){return bl(w)?.downloadMb[B]??null}function ap(w,B){const O=np(w,B);return O===null?"Download size unknown":`≈${O} MB download, cached after first use`}const lp={bash:"bash",zsh:"zsh",fish:"fish",sh:"sh",powershell:"Windows PowerShell",pwsh:"PowerShell 7",cmd:"Command Prompt",wsl:"WSL"};function op(w){return lp[w]??w}const i_="zerog-settings",s_="zerog-theme",Ye={appearance:{theme:"dark",font:"system",fontSize:13,lineHeight:1.2,letterSpacing:0},terminal:{scrollback:1e4,cursorStyle:"block",cursorBlink:!0,copyOnSelect:!0},sessions:{defaultBackend:"bash",defaultWslDistribution:"",defaultLayout:"stack",startSidebarCollapsed:!1,sidebarWidth:238,splitColumnRatio:.5,splitRowRatio:.5},ai:{requireApproval:!0,voiceInsert:"type",proceedPhrase:"OK, proceed"},speech:{engine:"builtin",model:sp,precision:"q8",device:"wasm",language:"auto",task:"transcribe",maxUtteranceSeconds:30,silenceThreshold:.004,serverUrl:"http://127.0.0.1:8080/v1/audio/transcriptions",serverModel:"Qwen3-ASR-0.6B"}},wt={fontSize:{min:8,max:32},lineHeight:{min:1,max:2},letterSpacing:{min:-2,max:4},scrollback:{min:200,max:2e5},maxUtteranceSeconds:{min:5,max:120},silenceThreshold:{min:5e-4,max:.05},sidebarWidth:{min:180,max:520},splitRatio:{min:.15,max:.85}},Id={system:'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace',jetbrains:'"JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace',cascadia:'"Cascadia Code", "Cascadia Mono", ui-monospace, Consolas, "Liberation Mono", monospace',consolas:'Consolas, "Liberation Mono", ui-monospace, monospace',fira:'"Fira Code", "Fira Mono", ui-monospace, Consolas, "Liberation Mono", monospace',menlo:'Menlo, Monaco, ui-monospace, Consolas, "Liberation Mono", monospace'},cp=[{value:"system",label:"System monospace"},{value:"jetbrains",label:"JetBrains Mono"},{value:"cascadia",label:"Cascadia Code"},{value:"consolas",label:"Consolas"},{value:"fira",label:"Fira Code"},{value:"menlo",label:"Menlo"}];function Uc(w){return Id[w]??Id.system}function Wr(w){return typeof w=="object"&&w!==null}function hi(w,B,O){return typeof w=="string"&&B.includes(w)?w:O}function hl(w,B){return typeof w=="boolean"?w:B}function ns(w,B,O){return typeof w!="number"||!Number.isFinite(w)?O:Math.min(B.max,Math.max(B.min,w))}function Oc(w,B,O=512){return typeof w!="string"?B:w.slice(0,O)}function up(w,B,O=200){return typeof w!="string"?B:Array.from(w.slice(0,O),j=>{const ee=j.codePointAt(0)??0;return ee<32||ee===127?" ":j}).join("")}function Pd(w){return w.proceedPhrase.trim()||Ye.ai.proceedPhrase}const Gd=["dark","light"],hp=["stack","split-v","split-h","grid"],r_=["bash","zsh","fish","sh","powershell","pwsh","cmd","wsl"],fp=["block","underline","bar"],dp=["system","jetbrains","cascadia","consolas","fira","menlo"],_p=["builtin","server"],vp=["wasm","webgpu"],mp=["q4","q8","fp16","fp32"],pp=["transcribe","translate"],gp=["type","review"];function nr(w,B){const O=Wr(w)?w:{},j=Wr(O.appearance)?O.appearance:{},ee=Wr(O.terminal)?O.terminal:{},se=Wr(O.sessions)?O.sessions:{},X=Wr(O.ai)?O.ai:{},u=Wr(O.speech)?O.speech:{},f=hi(B,Gd,Ye.appearance.theme),d=hi(u.engine,_p,Ye.speech.engine),y=hi(u.model,Ic.map(v=>v.id),Ye.speech.model),h=d==="server"||bl(y)?.multilingual?hi(u.language,t_.map(v=>v.value),Ye.speech.language):"auto";return{appearance:{theme:hi(j.theme,Gd,f),font:hi(j.font,dp,Ye.appearance.font),fontSize:Math.round(ns(j.fontSize,wt.fontSize,Ye.appearance.fontSize)),lineHeight:ns(j.lineHeight,wt.lineHeight,Ye.appearance.lineHeight),letterSpacing:ns(j.letterSpacing,wt.letterSpacing,Ye.appearance.letterSpacing)},terminal:{scrollback:Math.round(ns(ee.scrollback,wt.scrollback,Ye.terminal.scrollback)),cursorStyle:hi(ee.cursorStyle,fp,Ye.terminal.cursorStyle),cursorBlink:hl(ee.cursorBlink,Ye.terminal.cursorBlink),copyOnSelect:hl(ee.copyOnSelect,Ye.terminal.copyOnSelect)},sessions:{defaultBackend:hi(se.defaultBackend,r_,Ye.sessions.defaultBackend),defaultWslDistribution:Oc(se.defaultWslDistribution,Ye.sessions.defaultWslDistribution,64),defaultLayout:hi(se.defaultLayout,hp,Ye.sessions.defaultLayout),startSidebarCollapsed:hl(se.startSidebarCollapsed,Ye.sessions.startSidebarCollapsed),sidebarWidth:Math.round(ns(se.sidebarWidth,wt.sidebarWidth,Ye.sessions.sidebarWidth)),splitColumnRatio:ns(se.splitColumnRatio,wt.splitRatio,Ye.sessions.splitColumnRatio),splitRowRatio:ns(se.splitRowRatio,wt.splitRatio,Ye.sessions.splitRowRatio)},ai:{requireApproval:hl(X.requireApproval,Ye.ai.requireApproval),voiceInsert:hi(X.voiceInsert,gp,Ye.ai.voiceInsert),proceedPhrase:up(X.proceedPhrase,Ye.ai.proceedPhrase)},speech:{engine:d,model:y,precision:hi(u.precision,mp,Ye.speech.precision),device:hi(u.device,vp,Ye.speech.device),language:h,task:hi(u.task,pp,Ye.speech.task),maxUtteranceSeconds:Math.round(ns(u.maxUtteranceSeconds,wt.maxUtteranceSeconds,Ye.speech.maxUtteranceSeconds)),silenceThreshold:ns(u.silenceThreshold,wt.silenceThreshold,Ye.speech.silenceThreshold),serverUrl:Oc(u.serverUrl,Ye.speech.serverUrl,512),serverModel:Oc(u.serverModel,Ye.speech.serverModel,128)}}}function Sp(w){if(!w)return nr(void 0);let B=null,O=null;try{B=w.getItem(i_),O=w.getItem(s_)}catch{return nr(void 0)}if(!B)return nr(void 0,O);try{return nr(JSON.parse(B),O)}catch{return nr(void 0,O)}}function Wd(w,B){if(w)try{w.setItem(i_,JSON.stringify(B)),w.setItem(s_,B.appearance.theme)}catch{}}function Fd(w,B,O){return nr({...w,[B]:{...w[B],...O}})}function n_(w,B){if(B.some(j=>j.backend===w))return w;const O=B[0]?.backend;return O&&r_.includes(O)?O:w}function bp(w){const B=w.engine==="builtin",O=bl(w.model)?.multilingual??!1;return{model:B,precision:B,device:B,language:B?O:!0,task:B&&O,server:!B}}function yp(w,B){return nr({...w,[B]:Ye[B]})}const Bc=[{id:"appearance",label:"Appearance",hint:"Theme, font",blurb:"How the workspace and terminal text look."},{id:"terminal",label:"Terminal",hint:"Scrollback, cursor",blurb:"Behaviour of every terminal pane."},{id:"sessions",label:"Sessions",hint:"Defaults, layout",blurb:"What new terminals and new windows start as."},{id:"ai",label:"AI & voice",hint:"Approval, insert",blurb:"How AI suggestions and transcripts reach a terminal."},{id:"speech",label:"Speech recognition",hint:"Engine, model",blurb:"Which recogniser runs, and how it is tuned."}];function Kr({label:w,hint:B,children:O}){return p.jsxs("label",{className:"settings-field",children:[p.jsx("span",{className:"settings-field-label",children:w}),O,B?p.jsx("small",{children:B}):null]})}function Hi({label:w,hint:B,value:O,options:j,onChange:ee}){return p.jsx(Kr,{label:w,hint:B,children:p.jsx("select",{value:O,onChange:se=>ee(se.target.value),children:j.map(se=>p.jsx("option",{value:se.value,children:se.label},se.value))})})}function Fr({label:w,hint:B,value:O,min:j,max:ee,step:se,format:X,onChange:u}){return p.jsx(Kr,{label:w,hint:B,children:p.jsxs("span",{className:"settings-range",children:[p.jsx("input",{type:"range",min:j,max:ee,step:se,value:O,onChange:f=>u(Number(f.target.value)),"aria-label":w}),p.jsx("output",{children:X(O)})]})})}function fl({label:w,hint:B,checked:O,onChange:j}){return p.jsxs("label",{className:"settings-toggle",children:[p.jsx("input",{type:"checkbox",checked:O,onChange:ee=>j(ee.target.checked)}),p.jsxs("span",{children:[p.jsx("b",{children:w}),B?p.jsx("small",{children:B}):null]})]})}function Cp({value:w,onChange:B}){const O=[{id:"builtin",title:"Built-in",detail:"Whisper ONNX in this app, downloaded once and cached. No other software needed."},{id:"server",title:"Local server",detail:"Post audio to a transcription server on this machine — the way to use a GGUF model such as Qwen3-ASR through llama.cpp, LM Studio or Unsloth Studio."}];return p.jsx("div",{className:"settings-engines",role:"radiogroup","aria-label":"Speech engine",children:O.map(j=>p.jsxs("button",{type:"button",role:"radio","aria-checked":w===j.id,className:`settings-engine ${w===j.id?"active":""}`,onClick:()=>B(j.id),children:[p.jsx("b",{children:j.title}),p.jsx("small",{children:j.detail})]},j.id))})}function wp({state:w,onRun:B}){const O=w.status!=="idle",j=w.status==="recording"?"Stop and transcribe":w.status==="transcribing"?"Transcribing…":"Test recognition";return p.jsxs("div",{className:"settings-test",children:[p.jsxs("div",{className:"settings-test-head",children:[p.jsxs("div",{children:[p.jsx("b",{children:"Try it"}),p.jsx("small",{children:"Records a phrase and transcribes it here, without typing into a terminal."})]}),p.jsx("button",{type:"button",className:w.status==="recording"?"settings-test-button recording":"settings-test-button",onClick:B,disabled:w.status==="transcribing",children:j})]}),w.message?p.jsx("p",{className:"settings-test-status",children:w.message}):null,w.error?p.jsx("p",{className:"settings-test-error",children:w.error}):null,w.transcript!==null&&w.transcript!==void 0?p.jsx("output",{className:"settings-test-transcript",children:w.transcript||"(nothing transcribed)"}):null,!O&&(w.elapsedMs!=null||w.level!=null)?p.jsxs("p",{className:"settings-test-metrics",children:[w.elapsedMs!=null?`${(w.elapsedMs/1e3).toFixed(1)}s`:null,w.elapsedMs!=null&&w.level!=null?" · ":null,w.level!=null?`level ${w.level.toFixed(4)} RMS`:null]}):null]})}function Ep({settings:w,onChange:B,onReset:O,onClose:j,backdrop:ee,backends:se,wslDistributions:X,speechTest:u,onSpeechTest:f}){const[d,y]=_e.useState("appearance"),h=Bc.find(C=>C.id===d)??Bc[0],v=bp(w.speech),b=se.length?se.map(C=>({value:C.backend,label:C.label})):[{value:w.sessions.defaultBackend,label:w.sessions.defaultBackend}];return p.jsx("div",{className:"modal-layer settings-layer",role:"presentation",...ee,children:p.jsxs("section",{className:"settings-card",role:"dialog","aria-modal":"true","aria-label":"Settings",children:[p.jsxs("div",{className:"modal-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"SETTINGS"}),p.jsx("h2",{children:h.label})]}),p.jsx("button",{type:"button",className:"close-button",onClick:j,children:"Esc"})]}),p.jsxs("div",{className:"settings-body",children:[p.jsx("nav",{className:"settings-nav","aria-label":"Settings pages",children:Bc.map(C=>p.jsxs("button",{type:"button",className:`settings-nav-item ${C.id===d?"active":""}`,"aria-current":C.id===d,onClick:()=>y(C.id),children:[p.jsx("b",{children:C.label}),p.jsx("small",{children:C.hint})]},C.id))}),p.jsxs("div",{className:"settings-page",children:[p.jsx("p",{className:"settings-blurb",children:h.blurb}),d==="appearance"&&p.jsxs(p.Fragment,{children:[p.jsx(Hi,{label:"Theme",value:w.appearance.theme,options:[{value:"dark",label:"Dark"},{value:"light",label:"Light"}],onChange:C=>B("appearance",{theme:C})}),p.jsx(Hi,{label:"Terminal font",hint:"Falls back to another monospace face when the font is not installed.",value:w.appearance.font,options:cp,onChange:C=>B("appearance",{font:C})}),p.jsx(Fr,{label:"Font size",value:w.appearance.fontSize,min:wt.fontSize.min,max:wt.fontSize.max,step:1,format:C=>`${C} px`,onChange:C=>B("appearance",{fontSize:C})}),p.jsx(Fr,{label:"Line height",value:w.appearance.lineHeight,min:wt.lineHeight.min,max:wt.lineHeight.max,step:.05,format:C=>C.toFixed(2),onChange:C=>B("appearance",{lineHeight:C})}),p.jsx(Fr,{label:"Letter spacing",value:w.appearance.letterSpacing,min:wt.letterSpacing.min,max:wt.letterSpacing.max,step:.1,format:C=>`${C.toFixed(1)} px`,onChange:C=>B("appearance",{letterSpacing:C})}),p.jsxs("div",{className:"settings-preview",style:{fontFamily:Uc(w.appearance.font),fontSize:`${w.appearance.fontSize}px`,lineHeight:w.appearance.lineHeight,letterSpacing:`${w.appearance.letterSpacing}px`},children:[p.jsx("span",{children:"user@host:~$ git status --short"}),p.jsx("span",{children:" M src/renderer/settings.ts"})]})]}),d==="terminal"&&p.jsxs(p.Fragment,{children:[p.jsx(Fr,{label:"Scrollback",hint:"Lines kept per pane. Larger scrollback costs memory in every open pane.",value:w.terminal.scrollback,min:wt.scrollback.min,max:5e4,step:200,format:C=>`${C.toLocaleString()} lines`,onChange:C=>B("terminal",{scrollback:C})}),p.jsx(Hi,{label:"Cursor",value:w.terminal.cursorStyle,options:[{value:"block",label:"Block"},{value:"underline",label:"Underline"},{value:"bar",label:"Bar"}],onChange:C=>B("terminal",{cursorStyle:C})}),p.jsx(fl,{label:"Blink the cursor",checked:w.terminal.cursorBlink,onChange:C=>B("terminal",{cursorBlink:C})}),p.jsx(fl,{label:"Copy on selection",hint:"Selecting text with the mouse puts it on the clipboard. Ctrl+Shift+C copies regardless.",checked:w.terminal.copyOnSelect,onChange:C=>B("terminal",{copyOnSelect:C})})]}),d==="sessions"&&p.jsxs(p.Fragment,{children:[p.jsx(Hi,{label:"Default shell",hint:"Pre-selected when opening a new local terminal.",value:n_(w.sessions.defaultBackend,se),options:b,onChange:C=>B("sessions",{defaultBackend:C})}),p.jsxs(Kr,{label:"Default WSL distribution",hint:"Used when the default shell is WSL.",children:[p.jsx("input",{list:"settings-wsl-distributions",value:w.sessions.defaultWslDistribution,placeholder:"Ubuntu",onChange:C=>B("sessions",{defaultWslDistribution:C.target.value})}),p.jsx("datalist",{id:"settings-wsl-distributions",children:X.map(C=>p.jsx("option",{value:C},C))})]}),p.jsx(Hi,{label:"Layout at startup",value:w.sessions.defaultLayout,options:[{value:"stack",label:"Single pane"},{value:"split-v",label:"Split vertically"},{value:"split-h",label:"Split horizontally"},{value:"grid",label:"Grid of four"}],onChange:C=>B("sessions",{defaultLayout:C})}),p.jsx(fl,{label:"Start with the sidebar collapsed",checked:w.sessions.startSidebarCollapsed,onChange:C=>B("sessions",{startSidebarCollapsed:C})})]}),d==="ai"&&p.jsxs(p.Fragment,{children:[p.jsx(fl,{label:"Ask before running an AI suggestion",hint:"Off means a suggested command is sent to the terminal as soon as it arrives.",checked:w.ai.requireApproval,onChange:C=>B("ai",{requireApproval:C})}),p.jsx(Hi,{label:"Voice transcripts",hint:"Neither option presses Enter for you.",value:w.ai.voiceInsert,options:[{value:"type",label:"Type into the terminal"},{value:"review",label:"Show for review first"}],onChange:C=>B("ai",{voiceInsert:C})}),p.jsx(Kr,{label:"Proceed phrase",hint:"What a pane's tick button sends. Unlike the options above, this one does press Enter — it is for telling an agent already waiting in the pane to carry on.",children:p.jsx("input",{value:w.ai.proceedPhrase,placeholder:Ye.ai.proceedPhrase,onChange:C=>B("ai",{proceedPhrase:C.target.value})})})]}),d==="speech"&&p.jsxs(p.Fragment,{children:[p.jsx(Cp,{value:w.speech.engine,onChange:C=>B("speech",{engine:C})}),v.model?p.jsx(Hi,{label:"Model",hint:ap(w.speech.model,w.speech.precision),value:w.speech.model,options:Ic.map(C=>({value:C.id,label:C.label})),onChange:C=>B("speech",{model:C})}):null,v.precision?p.jsx(Hi,{label:"Precision",hint:qd.find(C=>C.value===w.speech.precision)?.detail,value:w.speech.precision,options:qd.map(C=>({value:C.value,label:C.label})),onChange:C=>B("speech",{precision:C})}):null,v.device?p.jsx(Hi,{label:"Compute",hint:"WebGPU is faster where it works; the app falls back to WASM when it does not.",value:w.speech.device,options:[{value:"wasm",label:"CPU (WASM)"},{value:"webgpu",label:"GPU (WebGPU)"}],onChange:C=>B("speech",{device:C})}):null,v.language?p.jsx(Hi,{label:"Language",value:w.speech.language,options:t_,onChange:C=>B("speech",{language:C})}):null,v.task?p.jsx(Hi,{label:"Task",hint:"Translate produces English text from another language.",value:w.speech.task,options:[{value:"transcribe",label:"Transcribe"},{value:"translate",label:"Translate to English"}],onChange:C=>B("speech",{task:C})}):null,v.server?p.jsxs(p.Fragment,{children:[p.jsx(Kr,{label:"Server URL",hint:"Must be on this machine. OpenAI-compatible: POST multipart audio to /v1/audio/transcriptions.",children:p.jsx("input",{value:w.speech.serverUrl,placeholder:"http://127.0.0.1:8080/v1/audio/transcriptions",onChange:C=>B("speech",{serverUrl:C.target.value})})}),p.jsx(Kr,{label:"Server model",hint:"The model name the server expects, e.g. Qwen3-ASR-0.6B.",children:p.jsx("input",{value:w.speech.serverModel,placeholder:"Qwen3-ASR-0.6B",onChange:C=>B("speech",{serverModel:C.target.value})})})]}):null,p.jsx(Fr,{label:"Maximum utterance",hint:"Recording stops itself at this length so a stuck microphone cannot queue forever.",value:w.speech.maxUtteranceSeconds,min:wt.maxUtteranceSeconds.min,max:wt.maxUtteranceSeconds.max,step:5,format:C=>`${C} s`,onChange:C=>B("speech",{maxUtteranceSeconds:C})}),p.jsx(Fr,{label:"Silence threshold",hint:"Recordings quieter than this are discarded without transcribing. Raise it for a noisy room, lower it for a quiet microphone.",value:w.speech.silenceThreshold,min:wt.silenceThreshold.min,max:wt.silenceThreshold.max,step:5e-4,format:C=>C.toFixed(4),onChange:C=>B("speech",{silenceThreshold:C})}),p.jsx(wp,{state:u,onRun:f})]}),p.jsxs("div",{className:"settings-foot",children:[p.jsx("span",{className:"settings-hint",children:"Changes apply immediately and are remembered."}),p.jsxs("button",{type:"button",onClick:()=>O(d),children:["Reset ",h.label.toLowerCase()]})]})]})]})]})})}const rr=[{kind:"local",label:"Local terminal",hint:"Shell on this machine"},{kind:"ssh",label:"SSH",hint:"Remote host"}];function Kd(w){return w==="local"||w==="ssh"}const xp={workspace:{eyebrow:"WORKSPACE",title:"New workspace",submit:"Create workspace"},local:{eyebrow:"NEW SESSION",title:"Start a session",submit:"Open terminal"},ssh:{eyebrow:"NEW SESSION",title:"Start a session",submit:"Connect"}};function jc(w){return xp[w]}function Ap(w,B){const O=rr.findIndex(ee=>ee.kind===w);if(O===-1)return null;const j=rr.length;switch(B){case"ArrowRight":case"ArrowDown":return rr[(O+1)%j].kind;case"ArrowLeft":case"ArrowUp":return rr[(O-1+j)%j].kind;case"Home":return rr[0].kind;case"End":return rr[j-1].kind;default:return null}}const Dp=new Set(["127.0.0.1","localhost"]),Tp=new Set(["::1","[::1]"]),Rp=12e4,Mp=300;function a_(w){try{const B=new URL(w);return B.protocol!=="http:"&&B.protocol!=="https:"?null:B.hostname.toLowerCase()}catch{return null}}function Lp(w){const B=a_(w);return B===null?!1:Dp.has(B)||B.endsWith(".localhost")}function kp(w){const B=a_(w);return B!==null&&Tp.has(B)}function dl(w,B,O){for(let j=0;j<O.length;j+=1)w.setUint8(B+j,O.charCodeAt(j))}function Op(w,B=pl){const j=w.length*2,ee=new ArrayBuffer(44+j),se=new DataView(ee);dl(se,0,"RIFF"),se.setUint32(4,36+j,!0),dl(se,8,"WAVE"),dl(se,12,"fmt "),se.setUint32(16,16,!0),se.setUint16(20,1,!0),se.setUint16(22,1,!0),se.setUint32(24,B,!0),se.setUint32(28,B*2,!0),se.setUint16(32,2,!0),se.setUint16(34,16,!0),dl(se,36,"data"),se.setUint32(40,j,!0);for(let X=0;X<w.length;X+=1){const u=Math.max(-1,Math.min(1,w[X]));se.setInt16(44+X*2,Math.round(u*32767),!0)}return ee}function Bp(w){if(typeof w=="string"){const j=w.trim();return j||null}if(typeof w!="object"||w===null)return null;const B=w;if(typeof B.text=="string"&&B.text.trim())return B.text.trim();const O=B.segments;if(Array.isArray(O)){const j=O.map(ee=>typeof ee=="object"&&ee!==null?ee.text:null).filter(ee=>typeof ee=="string").join(" ").trim();if(j)return j}if(typeof B.error=="string")throw new Error(B.error);return null}function jp(w){const B=Op(w.audio,w.sampleRate??pl),O=new FormData;return O.set("file",new Blob([B],{type:"audio/wav"}),"utterance.wav"),O.set("model",w.model),O.set("response_format","json"),w.language&&w.language!=="auto"&&O.set("language",w.language),O}function Hp(){return typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function"?AbortSignal.timeout(Rp):void 0}async function Np(w,B=fetch){if(!Lp(w.url))throw new Error(kp(w.url)?"Use http://localhost instead of an IPv6 literal — the renderer cannot allow [::1]":"Speech server URL must be on this machine (http://127.0.0.1 or http://localhost)");if(!w.model.trim())throw new Error("Speech server model name is required");const O=await B(w.url,{method:"POST",body:jp(w),signal:Hp()}),j=await O.text();if(!O.ok){const X=j.slice(0,Mp).trim();throw new Error(`Speech server returned ${O.status}${X?`: ${X}`:""}`)}let ee=j;try{ee=JSON.parse(j)}catch{}const se=Bp(ee);if(se===null)throw new Error("Speech server returned no transcript");return se}function Yd(w){return typeof w=="object"&&w!==null}class zp{constructor(B){this.options=B,this.worker=null,this.pending=new Map,this.nextId=1}async transcribe(B,O,j){if(O.engine==="server"){const se=this.options.now??(()=>Date.now()),X=se();return{text:await Np({url:O.serverUrl,model:O.serverModel,language:O.language,audio:B},this.options.fetchImpl),elapsedMs:se()-X,engine:"server"}}return{...await this.transcribeInWorker(B,O,j),engine:"builtin"}}transcribeInWorker(B,O,j){const ee=this.ensureWorker(),se=this.nextId++;return new Promise((X,u)=>{this.pending.set(se,{resolve:X,reject:u,onProgress:j}),ee.postMessage({type:"transcribe",id:se,audio:B,config:{model:O.model,precision:O.precision,device:O.device,language:O.language,task:O.task,multilingual:rp(O.model)}},[B.buffer])})}ensureWorker(){if(this.worker)return this.worker;const B=this.options.createWorker();return B.onmessage=O=>this.handleMessage(O.data),B.onerror=O=>{const j=Yd(O)&&typeof O.message=="string"?O.message:"Speech worker failed";this.failAll(new Error(j)),this.worker=null},this.worker=B,B}handleMessage(B){if(!Yd(B)||typeof B.id!="number")return;const O=this.pending.get(B.id);if(O){if(B.type==="loading"){O.onProgress?.({kind:"loading",progress:typeof B.progress=="number"?B.progress:null});return}if(B.type==="notice"){O.onProgress?.({kind:"notice",message:String(B.message)});return}if(B.type==="result"){this.pending.delete(B.id),O.resolve({text:typeof B.text=="string"?B.text:"",elapsedMs:typeof B.elapsedMs=="number"?B.elapsedMs:0});return}B.type==="error"&&(this.pending.delete(B.id),O.reject(new Error(typeof B.message=="string"?B.message:"Transcription failed")))}}failAll(B){for(const O of this.pending.values())O.reject(B);this.pending.clear()}dispose(){this.failAll(new Error("Speech client disposed")),this.worker?.terminate(),this.worker=null}}const Up=150,qp=3e3,ct=()=>window.zerog;function Hc(){try{return window.localStorage}catch{return null}}function _l({session:w,active:B=!1,ghosted:O=!1,onClick:j}){const ee=w.kind==="ssh"?`SSH · ${w.host}`:w.backend==="wsl"?`WSL${w.wslDistribution?` · ${w.wslDistribution}`:""} · ${w.cwd}`:w.backend&&w.backend!=="screen"?`${op(w.backend)} · ${w.cwd}`:w.persistence==="screen"?`screen · ${w.cwd}`:`local · process only · ${w.cwd}`;return p.jsxs("button",{type:"button",className:`session-row ${B?"active":""} ${O?"session-ghosted":""}`,onClick:j,children:[p.jsx("span",{className:`status-dot ${w.status}`}),p.jsxs("span",{className:"session-copy",children:[p.jsx("b",{children:w.name}),p.jsx("small",{children:ee})]}),p.jsx("span",{className:"session-state",children:O?"↗":w.status==="connected"?"●":"○"})]})}const Ip=120;function Pp({sessionId:w,focused:B,onStatus:O,appearance:j,terminalSettings:ee,registerFocus:se}){const X=_e.useRef(null),u=_e.useRef(null),f=_e.useRef(O);f.current=O;const d=_e.useRef(j);d.current=j;const y=_e.useRef(ee);y.current=ee;const h=_e.useRef(null);return _e.useEffect(()=>{if(!X.current)return;const v=X.current,b=new bm.Terminal({cursorBlink:y.current.cursorBlink,cursorStyle:y.current.cursorStyle,fontFamily:Uc(d.current.font),fontSize:d.current.fontSize,lineHeight:d.current.lineHeight,letterSpacing:d.current.letterSpacing,scrollback:y.current.scrollback,allowProposedApi:!0,theme:$d(d.current.theme),linkHandler:{activate:(ae,q)=>{const te=ct();te?.openExternal&&(f.current(`Opening ${q}`),te.openExternal(q).catch(V=>{f.current(V instanceof Error?V.message:String(V))}))},hover:(ae,q)=>f.current(`Link: ${q}`),leave:()=>f.current("Ready")}}),C=new Cm.FitAddon;b.loadAddon(C),b.open(v),u.current=b;const m=ct();let o=!1,c=0,a=0,l=0,_=!1,x=0;const E=()=>{if(o||!v.isConnected||v.clientWidth<20||v.clientHeight<20)return!1;try{C.fit()}catch{return!1}return b.cols>0&&b.rows>0},D=()=>{!_||!m||!w||b.cols===a&&b.rows===l||(window.clearTimeout(x),x=window.setTimeout(()=>{o||!w||b.cols===a&&b.rows===l||(a=b.cols,l=b.rows,m.resize(w,a,l))},Ip))},g=()=>{E()&&D()},T=()=>{cancelAnimationFrame(c),c=requestAnimationFrame(()=>{g(),c=requestAnimationFrame(g)})};if(h.current=T,!m)return T(),b.writeln("\x1B[90mZeroG Terminal\x1B[0m"),b.writeln("\x1B[31mPreload API unavailable. Rebuild the app.\x1B[0m"),f.current("Preload API unavailable"),()=>{o=!0,cancelAnimationFrame(c),u.current=null,b.dispose()};const U=m.onData((ae,q)=>{ae===w&&b.write(q)}),P=m.onStatus((ae,q)=>{ae===w&&(f.current(q),T())}),W=b.onData(ae=>{w&&m.write(w,ae)}),N=Im({terminal:b,clipboard:m,onError:ae=>f.current(ae),writeToPty:ae=>{w&&m.write(w,ae)},pasteEventTarget:v,isCopyOnSelectEnabled:()=>y.current.copyOnSelect}),Q=new ResizeObserver(()=>T());if(Q.observe(v),window.addEventListener("resize",T),document.fonts?.ready?.then(()=>{o||T()}).catch(()=>{}),T(),!w)b.writeln("\x1B[90mZeroG Terminal\x1B[0m"),b.writeln("\x1B[90mSelect a session or create a local/SSH connection.\x1B[0m");else{const ae=E()?{cols:b.cols,rows:b.rows}:void 0;ae&&(a=ae.cols,l=ae.rows),m.attachSession(w,ae).then(q=>{_=!0,q.persistence==="process"?f.current(`${q.host} · ${q.name} · process only (install screen for persistence)`):f.current(`${q.host} · ${q.name}`),T()}).catch(q=>{f.current(q instanceof Error?q.message:String(q))})}return()=>{o=!0,cancelAnimationFrame(c),window.clearTimeout(x),N(),W.dispose(),U(),P(),Q.disconnect(),window.removeEventListener("resize",T),h.current=null,u.current=null,b.dispose()}},[w]),_e.useEffect(()=>{const v=u.current;v&&(v.options.theme=$d(j.theme),v.options.fontFamily=Uc(j.font),v.options.fontSize=j.fontSize,v.options.lineHeight=j.lineHeight,v.options.letterSpacing=j.letterSpacing,v.options.scrollback=ee.scrollback,v.options.cursorStyle=ee.cursorStyle,v.options.cursorBlink=ee.cursorBlink,h.current?.())},[j,ee]),_e.useEffect(()=>{B&&u.current?.focus()},[B]),_e.useEffect(()=>{if(!(!w||!se))return se(w,()=>u.current?.focus()),()=>se(w,null)},[w,se]),p.jsx("div",{className:"terminal",ref:X,onMouseDownCapture:v=>v.preventDefault()})}function Nc({orientation:w,className:B,label:O,valuePercent:j,style:ee,onDrag:se,onCommit:X,onNudge:u,onReset:f}){const[d,y]=_e.useState(!1),h=w==="vertical"?"ArrowLeft":"ArrowUp",v=w==="vertical"?"ArrowRight":"ArrowDown";return p.jsx("div",{role:"separator","aria-orientation":w,"aria-label":O,"aria-valuenow":Math.round(j),"aria-valuemin":0,"aria-valuemax":100,tabIndex:0,className:`${B} ${d?"dragging":""}`.trim(),style:ee,title:`${O} — drag, arrow keys, or double-click to reset`,onPointerDown:b=>{b.button===0&&(b.preventDefault(),b.currentTarget.setPointerCapture(b.pointerId),y(!0))},onPointerMove:b=>{b.currentTarget.hasPointerCapture(b.pointerId)&&se(b)},onPointerUp:b=>{b.currentTarget.hasPointerCapture(b.pointerId)&&(b.currentTarget.releasePointerCapture(b.pointerId),y(!1),X())},onPointerCancel:()=>y(!1),onDoubleClick:f,onKeyDown:b=>{b.key===h?(b.preventDefault(),u(-1)):b.key===v?(b.preventDefault(),u(1)):(b.key==="Enter"||b.key==="Home")&&(b.preventDefault(),f())}})}function Gp({index:w,onCreate:B}){return p.jsxs("article",{className:"pane empty-pane",children:[p.jsxs("div",{className:"pane-title",children:[p.jsxs("span",{children:["PANE ",w]}),p.jsx("span",{className:"pane-dim",children:"EMPTY"})]}),p.jsxs("div",{className:"empty-pane-body",children:[p.jsx("span",{className:"empty-glyph",children:"+"}),p.jsx("strong",{children:"Split ready"}),p.jsx("small",{children:"Open another terminal here"}),p.jsx("button",{type:"button",onClick:B,children:"Choose session"})]})]})}function Vd(w,B=[]){return{id:`ws-${crypto.randomUUID()}`,name:w,sessionIds:B}}function Wp(){const[w,B]=_e.useState(()=>Sp(Hc())),O=w.appearance.theme,[j,ee]=_e.useState([]),[se,X]=_e.useState(()=>[Vd("Workspace")]),[u,f]=_e.useState(()=>se[0]?.id??""),[d,y]=_e.useState(null),[h,v]=_e.useState("Ready"),[b,C]=_e.useState(!1),[m,o]=_e.useState(w.sessions.startSidebarCollapsed),[c,a]=_e.useState("terminals"),[l,_]=_e.useState(!1),[x,E]=_e.useState(!0),[D,g]=_e.useState(null),[T,U]=_e.useState(null),[P,W]=_e.useState(!1),[N,Q]=_e.useState(w.sessions.defaultLayout),[ae,q]=_e.useState(),[te,V]=_e.useState(null),[R,z]=_e.useState("Workspace"),[A,k]=_e.useState("term"),[K,re]=_e.useState(""),[me,pe]=_e.useState(""),[F,L]=_e.useState(null),[ne,ve]=_e.useState({status:"idle",sessionId:null}),[Se,be]=_e.useState(null),Me=_e.useRef(null),Ue=_e.useRef(null),He=_e.useRef(null),at=_e.useRef(void 0),[Ae,Mt]=_e.useState(!1),[fe,ge]=_e.useState(!1),[Ce,Le]=_e.useState({status:"idle"}),Xe=_e.useRef(null),je=_e.useRef(void 0),[dt,Ge]=_e.useState([]),[lt,mt]=_e.useState(w.sessions.defaultBackend),[fi,Lt]=_e.useState(w.sessions.defaultWslDistribution),[di,qe]=_e.useState([]),[Ni,kt]=_e.useState([]),[Ft,It]=_e.useState([]),[Yn,Yr]=_e.useState([]),[Pc,Bs]=_e.useState(!1),as=_e.useRef(new Map),lr=_e.useCallback((H,J)=>{J?as.current.set(H,J):as.current.delete(H)},[]),Pt=_e.useCallback(H=>{H&&(q(H),requestAnimationFrame(()=>as.current.get(H)?.()))},[]),or=ir(()=>U(null)),js=ir(()=>L(null)),yl=ir(()=>W(!1)),Vn=ir(()=>_(!1)),Vr=ir(()=>Mt(!1)),Hs=ir(()=>mi()),Cl=ir(()=>ge(!1)),_i=_e.useCallback((H,J)=>{B(oe=>{const de=Fd(oe,H,J);return Wd(Hc(),de),de})},[]),$r=_e.useCallback((H,J)=>{B(oe=>Fd(oe,H,J))},[]),$n=_e.useCallback(H=>{B(J=>{const oe=yp(J,H);return Wd(Hc(),oe),oe})},[]);_e.useEffect(()=>{document.documentElement.dataset.theme=O},[O]);const Bt=_e.useMemo(()=>se.find(H=>H.id===u)??se[0]??null,[se,u]),Ze=_e.useMemo(()=>{if(!Bt)return j;const H=new Set(Bt.sessionIds),J=j.filter(oe=>H.has(oe.id));if(Bt.id===se[0]?.id){const oe=new Set(se.flatMap(xe=>xe.sessionIds)),de=j.filter(xe=>!oe.has(xe.id));return[...new Map([...J,...de].map(xe=>[xe.id,xe])).values()]}return J},[Bt,j,se]),Gi=_e.useCallback(async()=>{const H=ct();if(E(!0),g(null),!H){g("Preload API unavailable"),v("Preload API unavailable"),E(!1);return}try{const J=await H.listSessions();ee(J),v(J.length?`${J.length} session${J.length===1?"":"s"}`:"No sessions")}catch(J){const oe=J instanceof Error?J.message:String(J);g(oe),v(oe)}finally{E(!1)}},[]);_e.useEffect(()=>{Gi()},[Gi]),_e.useEffect(()=>{const H=ct();H&&H.listBackends?.().then(Ge).catch(()=>Ge([]))},[]),_e.useEffect(()=>{if(lt!=="wsl"){qe([]),Lt("");return}const H=ct();H&&H.listWslDistributions?.().then(qe).catch(()=>qe([]))},[lt]),_e.useEffect(()=>{if(!l){kt([]);return}const H=ct();H&&H.listHistory?.().then(kt).catch(()=>kt([]))},[l]),_e.useEffect(()=>{const H=ct(),J=ul((d?.kind==="ssh"?d.host:"")||(ae?j.find(de=>de.id===ae)?.host:"")||""),oe=J?Ft.filter(de=>ul(de.hostName??"")===J||de.alias===J):[];if(oe.length===0){Yr([]);return}H?.discoverRemoteScreens&&(Bs(!0),Promise.allSettled(oe.map(de=>H.discoverRemoteScreens(de))).then(de=>{const we=[];de.forEach((xe,Re)=>{xe.status==="fulfilled"&&Array.isArray(xe.value)&&xe.value.forEach(We=>{we.push({session:We,connection:oe[Re]})})}),Yr(we)}).catch(()=>Yr([])).finally(()=>Bs(!1)))},[Ft,d?.host,j,ae]),_e.useEffect(()=>{const H=ct();H&&H.listKnownConnections?.().then(It).catch(()=>It([]))},[]),_e.useEffect(()=>{!d&&Ze.length&&y(Ze[0])},[d,Ze]),_e.useEffect(()=>ct()?.onLinkRefused?.(J=>v(J)),[]);const Xr=_e.useRef(new Map);_e.useEffect(()=>{const H=ct();if(H)return H.onData((J,oe)=>{const de=((Xr.current.get(J)??"")+oe).slice(-2048);Xr.current.set(J,de);const we=Vm(de);we&&(ee(xe=>{const Re=xe.find(We=>We.id===J);return!Re||Re.cwd===we.path?xe:xe.map(We=>We.id===J?{...We,cwd:we.path}:We)}),y(xe=>xe&&xe.id===J&&xe.cwd!==we.path?{...xe,cwd:we.path}:xe))})},[]),_e.useEffect(()=>{if(ne.status!=="listening")return;const H=J=>{J.key==="Escape"&&(J.preventDefault(),J.stopPropagation(),fr(),v("Voice cancelled"))};return window.addEventListener("keydown",H,!0),()=>window.removeEventListener("keydown",H,!0)},[ne.status]),_e.useEffect(()=>{const H=J=>{if(J.key==="Escape"){if(fe){J.preventDefault(),ge(!1);return}if(Ae){J.preventDefault(),Mt(!1);return}if(Se){J.preventDefault(),mi();return}if(P){J.preventDefault(),W(!1);return}if(F){J.preventDefault(),L(null);return}if(T){J.preventDefault(),U(null);return}if(l){J.preventDefault(),_(!1);return}}if(!(J.ctrlKey||J.metaKey)||!J.shiftKey)return;const oe=J.key.toLowerCase();oe==="o"&&(J.preventDefault(),W(de=>!de)),oe==="n"&&(J.preventDefault(),z(zc(se)),U("workspace")),oe==="t"&&(J.preventDefault(),Vt("local")),oe==="l"&&(J.preventDefault(),V(null),Q(de=>de==="stack"?"split-v":"stack")),oe==="b"&&(J.preventDefault(),o(de=>!de)),J.code==="Comma"&&(J.preventDefault(),Mt(de=>!de))};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[P,F,T,l,Ae,fe,Se,ne.status,se,Bt,Ze]);const Ai=Pd(w.ai),pt=e_(d),jt=tp(d),Di=N==="stack"?1:N==="grid"?4:2,zi=Ze.slice(0,4),wl=Math.max(Di,zi.length),Et=zi.some(H=>H.id===te)?te:null,Xn=zi.find(H=>H.id===d?.id)?.id??zi[0]?.id,Ns=(H,J)=>N==="stack"?H.id===Xn:J<Di;_e.useEffect(()=>{fe&&!pt&&ge(!1)},[fe,pt]);const Gt=async H=>{y(H),q(H.id);const J=zi.findIndex(oe=>oe.id===H.id);Et?V(H.id):J>=Di&&N!=="stack"&&Q("grid"),v(H.persistence==="process"?`${H.host} · ${H.name} · process only (install screen for persistence)`:`${H.host} · ${H.name}`),W(!1)},Ht=(H,J=u)=>{X(oe=>oe.map(de=>de.id!==J?{...de,sessionIds:de.sessionIds.filter(we=>we!==H.id)}:de.sessionIds.includes(H.id)?de:{...de,sessionIds:[...de.sessionIds,H.id]}))},ls=async H=>{H.preventDefault();const J=R.trim()||zc(se),oe=Vd(J);X(de=>[...de,oe]),f(oe.id),y(null),U(null),v(`Workspace “${J}” ready`)},zs=async H=>{H.preventDefault();const J=ct();if(J){if(Ze.length>=4){v("This workspace supports up to 4 sessions."),U(null);return}C(!0);try{const oe=await J.createLocalSession({name:A,backend:lt,wslDistribution:lt==="wsl"?fi:void 0});ee(de=>[...de.filter(we=>we.id!==oe.id),oe]),Ht(oe),q(oe.id),V(null),Q(vl(Ze.length+1)),U(null),await Gt(oe)}catch(oe){v(oe instanceof Error?oe.message:String(oe))}finally{C(!1)}}},os=async H=>{H.preventDefault();const J=ct();if(J){if(Ze.length>=4){v("This workspace supports up to 4 sessions."),U(null);return}C(!0);try{const oe=await J.createSshSession({name:K||void 0,target:me});ee(de=>[...de.filter(we=>we.id!==oe.id),oe]),Ht(oe),q(oe.id),V(null),Q(vl(Ze.length+1)),U(null),await Gt(oe)}catch(oe){v(oe instanceof Error?oe.message:String(oe))}finally{C(!1)}}},bt=async(H,J)=>{try{const oe=ct();if(!oe)return;v(`Attaching to ${H.name} on ${J.alias}…`);const we=(await oe.buildRemoteScreenAttach?.(J,H.screenName??H.name))?.args,xe=Array.isArray(we)?we.indexOf("--"):-1,Re=xe>0?we[xe-1]:J.hostName??J.alias,We=await oe.createSshSession({target:Re,name:H.name}),Fe=H.screenName??H.name,Ve={...We,screenName:Fe,persistence:"screen",backend:"screen"};ee(_t=>_t.some(vt=>vt.id===Ve.id)?_t.map(vt=>vt.id===Ve.id?Ve:vt):[..._t,Ve]),Ht(Ve),await Gt(Ve),await oe.attachSession(Ve.id);const ii=we&&xe>0?we.slice(xe+1).join(" "):`screen -x ${Fe}`;await Zr(oe,Ve.id),oe.write(Ve.id,`${ii}\r`),await Gi(),v(`Connected to ${H.name} on ${J.alias}`)}catch(oe){v(oe instanceof Error?oe.message:String(oe))}},Zr=(H,J)=>new Promise(oe=>{let de=!1,we="",xe,Re;const We=()=>{de||(de=!0,clearTimeout(xe),clearTimeout(Fe),Re?.(),oe())},Fe=setTimeout(We,qp);Re=H.onData((Ve,ii)=>{if(Ve===J){if(we=(we+ii).slice(-512),Tm(we)){We();return}clearTimeout(xe),xe=setTimeout(We,Up)}})}),Qr=()=>{z(zc(se)),U("workspace")},Vt=(H,J)=>{k(Fp(Bt?.name??"term",Ze)),mt(n_(w.sessions.defaultBackend,dt)),Lt(w.sessions.defaultWslDistribution),J?.sshTarget!==void 0&&pe(J.sshTarget),U(H)},Ti=()=>Vt("local"),El=()=>{const H=ul((d?.kind==="ssh"?d.host:"")||(ae?j.find(Re=>Re.id===ae)?.host:"")||""),J=H?Yn.filter(Re=>ul(Re.connection.hostName??"")===H||Re.connection.alias===H).reduce((Re,We)=>{const Fe=We.connection.hostName||We.connection.alias;return(Re[Fe]=Re[Fe]||[]).push(We),Re},{}):{},oe=j.filter(Re=>Re.persistence==="screen"&&!Ze.some(We=>We.id===Re.id)),de=Object.keys(J).length>0,we=oe.length>0;if(!de&&!we)return p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"No screens"}),p.jsx("small",{children:H?"No remote screens found for this host.":"Open a remote session to discover screens, or start a local screen."})]});const xe=[];if(de)for(const[Re,We]of Object.entries(J)){const Fe=We,Ve=p.jsx("div",{className:"session-group-label",children:Re},`${Re}-label`),ii=Fe.map(({session:_t})=>{const Li=Fe.find(vt=>vt.session.id===_t.id)?.connection;return p.jsx(_l,{session:_t,ghosted:!0,onClick:async()=>{if(!Li)return;v(`Attaching ${_t.name}…`);const vt=ct();if(vt)try{const ki=(await vt.buildRemoteScreenAttach?.(Li,_t.screenName??_t.name))?.args,si=Array.isArray(ki)?ki.indexOf("--"):-1,rn=si>0?ki[si-1]:Li.hostName??Li.alias,pi={...await vt.createSshSession({target:rn,name:_t.name}),screenName:_t.screenName??_t.name,persistence:"screen",backend:"screen"};ee(hs=>hs.some(Us=>Us.id===pi.id)?hs.map(Us=>Us.id===pi.id?pi:Us):[...hs,pi]),Ht(pi),await Gt(pi),await vt.attachSession(pi.id);const dr=ki&&si>0?ki.slice(si+1).join(" "):`screen -x ${_t.screenName??_t.name}`;await Zr(vt,pi.id),vt.write(pi.id,`${dr}\r`),await Gi(),v(`Connected to ${_t.name}`)}catch(us){v(us instanceof Error?us.message:String(us))}}},_t.id)});xe.push(Ve,...ii)}return we&&!de&&(xe.push(p.jsx("div",{className:"session-group-label",children:"local"},"local-label")),oe.forEach(Re=>{xe.push(p.jsx(_l,{session:Re,ghosted:!0,onClick:()=>{Ht(Re),Gt(Re),v(`Reconnecting to ${Re.name}…`)}},Re.id))})),p.jsx(p.Fragment,{children:xe})},Zn=N==="split-v"?"pane-grid split-v":N==="split-h"?"pane-grid split-h":N==="grid"?"pane-grid grid":"pane-grid",Jr=!Et&&(N==="split-v"||N==="grid"),Qn=!Et&&(N==="split-h"||N==="grid"),Ri=w.sessions.splitColumnRatio,Mi=w.sessions.splitRowRatio,vi=_e.useRef(null),$t=Et?void 0:{...Jr?{gridTemplateColumns:`${Ri}fr ${1-Ri}fr`}:{},...Qn?{gridTemplateRows:`${Mi}fr ${1-Mi}fr`}:{}},en=(H,J)=>{const oe=vi.current?.getBoundingClientRect();if(!oe)return;const de=H==="column"?(J.clientX-oe.left)/oe.width:(J.clientY-oe.top)/oe.height;Number.isFinite(de)&&$r("sessions",H==="column"?{splitColumnRatio:de}:{splitRowRatio:de})},Jn=(H,J)=>{const de=(H==="column"?Ri:Mi)+J*.02;_i("sessions",H==="column"?{splitColumnRatio:de}:{splitRowRatio:de})},cr=H=>{_i("sessions",H==="column"?{splitColumnRatio:Ye.sessions.splitColumnRatio}:{splitRowRatio:Ye.sessions.splitRowRatio})},tn=_e.useRef(null),ur=H=>{const J=tn.current?.getBoundingClientRect();J&&$r("sessions",{sidebarWidth:Math.round(H.clientX-J.left)})},xl=H=>{q(H),V(J=>J===H?null:H)},Kt=H=>{if(!Et||Ze.length<2)return;const oe=(Ze.findIndex(we=>we.id===Et)+H+Ze.length)%Ze.length,de=Ze[oe];q(de.id),y(de),V(de.id)},hr=()=>(Ue.current??=new zp({createWorker:()=>new Worker(new URL(""+new URL("voice-worker-DoNT0zEM.js",import.meta.url).href,import.meta.url),{type:"module"})}),Ue.current),ea=H=>{if(H.kind==="notice"){v(H.message);return}H.progress!==null&&v(`Loading speech model… ${Math.round(H.progress)}%`)},fr=()=>{const H=He.current;window.clearTimeout(at.current),Me.current?.cancel(),Me.current=null,He.current=null,ve({status:"idle",sessionId:null}),Pt(H)},mi=()=>{const H=Se?.sessionId;be(null),Pt(H)},sn=async()=>{const H=Me.current,J=He.current;if(!H||!J)return;window.clearTimeout(at.current),Me.current=null,ve({status:"transcribing",sessionId:J}),v("Transcribing…");const oe=await H.stop();if(!oe||Md(oe,w.speech.silenceThreshold)){He.current=null,ve({status:"idle",sessionId:null}),v("Voice: no speech detected — lower the silence threshold in Settings if this is wrong"),Pt(J);return}try{const de=await hr().transcribe(oe,w.speech,ea);if(He.current=null,ve({status:"idle",sessionId:null}),!de.text){v("Voice: nothing transcribed"),Pt(J);return}if(w.ai.voiceInsert==="review"){be({sessionId:J,text:de.text}),v(`Voice: review "${de.text}"`);return}ct()?.write(J,de.text),v(`Voice: "${de.text}"`),Pt(J)}catch(de){He.current=null,ve({status:"idle",sessionId:null}),v(`Voice error: ${de instanceof Error?de.message:String(de)}`),Pt(J)}},ta=async H=>{if(ne.status==="listening"&&ne.sessionId===H.id){await sn();return}if(ne.status!=="idle")return;if(Ce.status!=="idle"){v("The speech test in Settings is using the microphone");return}const J=new Ld;try{await J.start()}catch(oe){v(`Microphone unavailable: ${oe instanceof Error?oe.message:String(oe)}`);return}Me.current=J,He.current=H.id,ve({status:"listening",sessionId:H.id}),Pt(H.id),window.clearTimeout(at.current),at.current=window.setTimeout(()=>{sn()},w.speech.maxUtteranceSeconds*1e3),v(`Listening on ${H.name}… click the mic again to transcribe, Esc to discard`)},cs=H=>{const J=ct();if(!J)return;const oe=Pd(w.ai);J.write(H.id,`${oe}\r`),v(`Sent "${oe}" to ${H.name}`),Pt(H.id)},ia=async()=>{const H=Xe.current;if(!H)return;window.clearTimeout(je.current),Xe.current=null,Le({status:"transcribing",message:"Transcribing…",transcript:null,error:null});const J=await H.stop();if(!J){Le({status:"idle",error:"Nothing was recorded."});return}const oe=Zd(J),de=Md(J,w.speech.silenceThreshold);try{const we=await hr().transcribe(J,w.speech,xe=>{Le(Re=>({...Re,message:xe.kind==="notice"?xe.message:xe.progress!==null?`Loading speech model… ${Math.round(xe.progress)}%`:"Loading speech model…"}))});Le({status:"idle",transcript:we.text,elapsedMs:we.elapsedMs,level:oe,message:de?"Below the silence threshold — a real recording at this level would have been discarded.":we.engine==="server"?"Transcribed by the local server.":"Transcribed by the built-in engine.",error:null})}catch(we){Le({status:"idle",level:oe,error:we instanceof Error?we.message:String(we)})}},sa=async()=>{if(Ce.status==="recording"){await ia();return}if(Ce.status==="transcribing")return;if(ne.status!=="idle"){Le({status:"idle",error:"A terminal pane is recording — stop that first."});return}const H=new Ld;try{await H.start()}catch(J){Le({status:"idle",error:`Microphone unavailable: ${J instanceof Error?J.message:String(J)}`});return}Xe.current=H,Le({status:"recording",message:"Listening… say a command, then stop.",transcript:null,error:null}),window.clearTimeout(je.current),je.current=window.setTimeout(()=>{ia()},w.speech.maxUtteranceSeconds*1e3)};_e.useEffect(()=>()=>{window.clearTimeout(at.current),window.clearTimeout(je.current),Me.current?.cancel(),Xe.current?.cancel(),Ue.current?.dispose()},[]);const ra=async H=>{ne.sessionId===H.id&&fr();const J=Ze.filter(de=>de.id!==H.id);X(de=>de.map(we=>({...we,sessionIds:we.sessionIds.filter(xe=>xe!==H.id)}))),d?.id===H.id&&y(J[0]??null),ae===H.id&&q(J[0]?.id),te===H.id&&V(null),Q(vl(J.length));const oe=ct();if(oe)try{await oe.closeSession(H.id)}catch(de){v(de instanceof Error?de.message:String(de));return}v(H.persistence==="screen"?`Closed ${H.name} · screen session survives`:H.kind==="ssh"?`Closed ${H.name} · SSH connection ended`:`Closed ${H.name} · process ended`),Gi()};return p.jsxs("main",{className:`app-shell ${m?"drawer-collapsed":""}`,children:[p.jsxs("header",{className:"window-bar",children:[p.jsxs("div",{className:"window-brand",children:[p.jsx("span",{className:"brand-mark",children:"ZG"}),p.jsx("span",{className:"brand-name",children:"ZeroG"})]}),p.jsx("div",{className:"workspace-tabs",children:se.map(H=>p.jsxs("button",{type:"button",className:`workspace-tab ${H.id===Bt?.id?"active":""}`,onClick:()=>{f(H.id);const J=j.find(oe=>H.sessionIds.includes(oe.id));y(J??null),q(J?.id)},children:[p.jsx("span",{className:"tab-dot"}),H.name,p.jsx("span",{className:"tab-meta",children:H.sessionIds.length||(H.id===se[0]?.id?Ze.length:0)})]},H.id))}),p.jsxs("div",{className:"window-actions",children:[p.jsxs("button",{type:"button",className:"bar-button",onClick:()=>W(H=>!H),title:"Session overview (Ctrl+Shift+O)",children:[p.jsx($e,{name:"grid"}),p.jsx("span",{children:"Overview"})]}),p.jsxs("button",{type:"button",className:"bar-button",onClick:Qr,title:"New workspace (Ctrl+Shift+N)",children:[p.jsx($e,{name:"plus"}),p.jsx("span",{children:"New"})]}),p.jsxs("button",{type:"button",className:"bar-button",onClick:async()=>{const H=ct();if(!H)return;const J=await H.requestAiCommand();if(w.ai.requireApproval){L(J);return}const oe=d?.id??ae;if(!oe){v("No terminal selected for the suggestion");return}H.write(oe,`${J.command}\r`),v(`Ran suggestion: ${J.command}`)},children:[p.jsx($e,{name:"spark"}),p.jsx("span",{children:"Suggest"})]}),p.jsx("button",{type:"button",className:"bar-button theme-button",onClick:()=>_i("appearance",{theme:O==="dark"?"light":"dark"}),title:`Switch to ${O==="dark"?"light":"dark"} theme`,"aria-label":`Switch to ${O==="dark"?"light":"dark"} theme`,"aria-pressed":O==="light",children:p.jsx($e,{name:O==="dark"?"sun":"moon"})}),p.jsx("button",{type:"button",className:"avatar",title:"Settings (Ctrl+Shift+,)","aria-label":"Settings","aria-expanded":Ae,onClick:()=>Mt(!0),children:"S"})]})]}),p.jsxs("div",{className:"body-shell",children:[p.jsxs("nav",{className:"rail","aria-label":"Workspace navigation",children:[p.jsx("button",{type:"button",className:"rail-button",title:m?"Show sessions sidebar (Ctrl+Shift+B)":"Hide sessions sidebar (Ctrl+Shift+B)",onClick:()=>o(H=>!H),children:p.jsx($e,{name:m?"panel-left-open":"panel-left"})}),p.jsx("button",{type:"button",className:`rail-button ${m?"":"active"}`,title:"Sessions",onClick:()=>o(!1),children:p.jsx($e,{name:"sessions"})}),p.jsx("button",{type:"button",className:"rail-button",onClick:()=>W(!0),title:"Overview",children:p.jsx($e,{name:"grid"})}),p.jsx("span",{className:"rail-spacer"}),p.jsx("button",{type:"button",className:"rail-button",onClick:()=>Vt("ssh"),title:"Connect SSH",children:p.jsx($e,{name:"ssh"})}),p.jsx("button",{type:"button",className:`rail-button ${Ae?"active":""}`,title:"Settings (Ctrl+Shift+,)","aria-label":"Settings","aria-expanded":Ae,onClick:()=>Mt(H=>!H),children:p.jsx($e,{name:"settings"})})]}),!m&&p.jsxs("aside",{className:"session-drawer",ref:tn,style:{width:w.sessions.sidebarWidth},children:[p.jsxs("div",{className:"drawer-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"WORKSPACE"}),p.jsx("h1",{children:Bt?.name??"Sessions"})]}),p.jsxs("div",{className:"drawer-head-actions",children:[p.jsx("button",{type:"button",className:"square-button",onClick:()=>o(!0),title:"Hide sessions sidebar",children:p.jsx($e,{name:"panel-left"})}),p.jsx("button",{type:"button",className:"square-button history-button",onClick:()=>_(H=>!H),title:"Session history","aria-label":"Open session history","aria-expanded":l,children:p.jsx($e,{name:"history"})}),p.jsx("button",{type:"button",className:"square-button",onClick:Ti,title:"New local terminal","aria-label":"New local terminal",children:p.jsx($e,{name:"plus"})})]})]}),p.jsx("div",{className:"drawer-tools",role:"tablist","aria-label":"Session inventory",children:["terminals","screens","connections"].map(H=>{const J={terminals:"Terminals",screens:"Screens",connections:"Connections"},oe=H==="terminals"?Ze.length:H==="screens"?j.filter(de=>(de.persistence==="screen"||de.screenName)&&!Ze.some(we=>we.id===de.id)).length+Yn.length:j.filter(de=>de.kind==="ssh").length;return p.jsxs("button",{type:"button",role:"tab","aria-selected":c===H,className:`drawer-tool ${c===H?"active":""}`,onClick:()=>a(H),children:[J[H]," ",p.jsx("span",{children:oe})]},H)})}),p.jsx("div",{className:"session-list",role:"tabpanel",children:x?p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"Loading sessions…"}),p.jsx("small",{children:"Checking available terminals and durable sessions."})]}):D?p.jsxs("div",{className:"session-empty session-error",children:[p.jsx("b",{children:"Session inventory unavailable"}),p.jsx("small",{children:D}),p.jsx("button",{type:"button",onClick:()=>{Gi()},children:"Retry"})]}):c==="terminals"?Ze.length?Ze.map(H=>p.jsx(_l,{session:H,active:d?.id===H.id,onClick:()=>{Gt(H)}},H.id)):p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"No terminals yet"}),p.jsx("small",{children:"Add a local terminal or SSH connection to this workspace."})]}):c==="screens"?El():c==="connections"?Ft.length?Ft.map(H=>p.jsxs("button",{type:"button",className:"session-row",onClick:()=>Vt("ssh",{sshTarget:H.hostName??H.alias}),children:[p.jsx("span",{className:"status-dot"}),p.jsxs("span",{className:"session-copy",children:[p.jsx("b",{children:H.alias}),p.jsx("small",{children:H.hostName?`${H.user??""}${H.user?"@":""}${H.hostName}${H.port?`:${H.port}`:""}`:"Saved SSH connection"})]}),p.jsx("span",{className:"session-state",children:"→"})]},H.alias)):p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"No saved connections"}),p.jsx("small",{children:"Add Host entries to ~/.ssh/config to populate connections."})]}):j.filter(H=>H.kind==="ssh"&&H.scope==="remote"&&H.source==="discovered").length?j.filter(H=>H.kind==="ssh"&&H.scope==="remote"&&H.source==="discovered").map(H=>p.jsx(_l,{session:H,ghosted:!0,onClick:async()=>{Ht(H),v(`Attaching remote screen ${H.name}…`);const J=ct();if(J)try{const de=(await J.buildRemoteScreenAttach?.({alias:H.host,hostName:H.host},H.screenName??H.name))?.args?.find(xe=>xe.includes("@")||!xe.startsWith("-"))??H.host,we=await J.createSshSession({target:de,name:H.name});ee(xe=>xe.map(Re=>Re.id===H.id?we:Re)),await Gt(we)}catch(oe){v(oe instanceof Error?oe.message:String(oe))}}},H.id)):p.jsxs("div",{className:"session-empty",children:[p.jsx("b",{children:"No remote screens"}),p.jsx("small",{children:"Remote screen sessions will appear here after discovery."})]})}),p.jsxs("div",{className:"drawer-bottom",children:[p.jsxs("button",{type:"button",className:"drawer-action",onClick:Ti,children:[p.jsx($e,{name:"plus"})," Local terminal ",p.jsx("kbd",{children:"⌘⇧T"})]}),p.jsxs("button",{type:"button",className:"drawer-action",onClick:()=>Vt("ssh"),children:[p.jsx($e,{name:"ssh"})," Connect SSH"]}),p.jsxs("div",{className:"drawer-status",children:[p.jsx("span",{className:"status-dot connected"}),h]})]})]}),!m&&p.jsx(Nc,{orientation:"vertical",className:"sidebar-resizer",label:"Sidebar width",valuePercent:w.sessions.sidebarWidth/wt.sidebarWidth.max*100,onDrag:ur,onCommit:()=>_i("sessions",{sidebarWidth:w.sessions.sidebarWidth}),onNudge:H=>_i("sessions",{sidebarWidth:w.sessions.sidebarWidth+H*16}),onReset:()=>_i("sessions",{sidebarWidth:Ye.sessions.sidebarWidth})}),p.jsxs("section",{className:"workspace",children:[p.jsxs("div",{className:"workspace-head",children:[p.jsxs("div",{className:"location",children:[m&&p.jsx("button",{type:"button",className:"inline-restore",onClick:()=>o(!1),title:"Show sessions sidebar",children:p.jsx($e,{name:"panel-left-open"})}),p.jsx("span",{className:"connection-dot"}),p.jsx("span",{children:d?.host??"local"}),p.jsx("span",{className:"slash",children:"/"}),p.jsx("span",{children:d?.cwd??"~"}),p.jsx("span",{className:"slash",children:"/"}),p.jsx("span",{className:"muted-text",children:d?.name??Bt?.name??"no session"})]}),p.jsxs("div",{className:"head-controls",children:[p.jsxs("div",{className:"layout-controls",children:[p.jsx("span",{className:"control-label",children:"SFTP"}),p.jsx("button",{type:"button",className:fe?"layout-button active":"layout-button",onClick:()=>ge(H=>!H),disabled:!jt.available||!ct()?.sftpOpen,title:jt.reason,"aria-label":"Transfer files over SFTP",children:p.jsx($e,{name:"transfer"})})]}),p.jsxs("div",{className:"layout-controls",children:[p.jsx("span",{className:"control-label",children:"LAYOUT"}),p.jsx("button",{type:"button",className:N==="stack"||Et?"layout-button active":"layout-button",onClick:()=>{if(Et)V(null);else if(Ze.length>1){const H=ae??d?.id??Ze[0]?.id;H&&V(H)}else Q("stack")},title:Et?"Restore panes":Ze.length>1?"Maximize focused pane":"Single pane",children:p.jsx($e,{name:"stack"})}),p.jsx("button",{type:"button",className:N==="split-v"&&!Et?"layout-button active":"layout-button",onClick:()=>{V(null),Q("split-v")},title:"Vertical split",children:p.jsx($e,{name:"split-v"})}),p.jsx("button",{type:"button",className:N==="split-h"&&!Et?"layout-button active":"layout-button",onClick:()=>{V(null),Q("split-h")},title:"Horizontal split",children:p.jsx($e,{name:"split-h"})}),p.jsx("button",{type:"button",className:N==="grid"&&!Et?"layout-button active":"layout-button",onClick:()=>{V(null),Q("grid")},title:"Four-pane grid",children:p.jsx($e,{name:"grid"})})]})]})]}),p.jsxs("div",{className:`${Zn} ${Et?"maximized-pane-grid":""}`,ref:vi,style:$t,children:[Jr&&p.jsx(Nc,{orientation:"vertical",className:"pane-resizer pane-resizer-column",label:"Pane column split",valuePercent:Ri*100,style:{left:`calc((100% - 1px) * ${Ri} + 0.5px)`},onDrag:H=>en("column",H),onCommit:()=>_i("sessions",{splitColumnRatio:Ri}),onNudge:H=>Jn("column",H),onReset:()=>cr("column")}),Qn&&p.jsx(Nc,{orientation:"horizontal",className:"pane-resizer pane-resizer-row",label:"Pane row split",valuePercent:Mi*100,style:{top:`calc((100% - 1px) * ${Mi} + 0.5px)`},onDrag:H=>en("row",H),onCommit:()=>_i("sessions",{splitRowRatio:Mi}),onNudge:H=>Jn("row",H),onReset:()=>cr("row")}),Array.from({length:wl},(H,J)=>{const oe=zi[J];if(!oe)return p.jsx(Gp,{index:J+1,onCreate:Ti},J);const de=ne.sessionId===oe.id&&ne.status!=="idle"?ne.status:null;return p.jsxs("article",{className:`pane terminal-pane ${ae===oe.id?"focused":""} ${Et===oe.id?"maximized-pane":""} ${Ns(oe,J)?"":"overflow-pane"}`,onMouseDown:()=>q(oe.id),children:[p.jsxs("div",{className:"pane-title",children:[p.jsxs("span",{children:[p.jsx("span",{className:"pane-live"})," ",oe.name]}),p.jsxs("span",{className:"pane-actions",children:[Et&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"pane-nav",onClick:()=>Kt(-1),title:"Previous session",children:p.jsx($e,{name:"chevron-left"})}),p.jsx("button",{type:"button",className:"pane-nav",onClick:()=>Kt(1),title:"Next session",children:p.jsx($e,{name:"chevron-right"})})]}),b?"connecting…":de?`${de}…`:oe.kind==="ssh"?"ssh":"bash",p.jsx("button",{type:"button",className:"pane-proceed",onClick:()=>cs(oe),title:`Send "${Ai}" and press Enter`,"aria-label":`Send "${Ai}" to ${oe.name}`,children:p.jsx($e,{name:"check"})}),p.jsx("button",{type:"button",className:de?`pane-mic ${de}`:"pane-mic",onClick:()=>{ta(oe)},disabled:ne.status!=="idle"&&!de,title:de==="listening"?"Stop and transcribe":de==="transcribing"?"Transcribing…":"Voice input","aria-label":de==="listening"?`Stop recording ${oe.name}`:`Voice input for ${oe.name}`,children:p.jsx($e,{name:"mic"})}),p.jsx("button",{type:"button",className:"pane-maximize",onClick:()=>xl(oe.id),title:Et?"Restore pane":"Maximize pane",children:p.jsx($e,{name:Et?"restore":"maximize"})}),p.jsx("button",{type:"button",className:"pane-close",onClick:()=>{ra(oe)},title:"Close pane","aria-label":`Close ${oe.name}`,children:p.jsx($e,{name:"x"})})]})]}),p.jsx(Pp,{sessionId:oe.id,focused:ae===oe.id,onStatus:v,appearance:w.appearance,terminalSettings:w.terminal,registerFocus:lr})]},oe.id)})]}),p.jsxs("footer",{className:"status-bar",children:[p.jsx("span",{children:"ZeroG"}),p.jsx("span",{className:"status-separator"}),p.jsx("span",{children:Bt?.name??"Workspace"}),p.jsx("span",{className:"status-separator"}),p.jsx("span",{children:Et?"maximized pane":N==="stack"?"1 pane":`${Di} panes`}),p.jsx("span",{className:"status-separator"}),p.jsx("span",{children:"Esc closes overlays · ⌘⇧B sidebar"}),p.jsx("span",{className:"status-spacer"}),p.jsx("span",{children:d?`${d.kind==="ssh"?"SSH":d.persistence==="process"?"PROCESS":"SCREEN"} · ${d.persistence==="process"?"non-persistent":"persistent"}`:"no connection"})]})]})]}),P&&p.jsx("div",{className:"overview-layer",role:"presentation",...yl,children:p.jsxs("section",{className:"overview",children:[p.jsxs("div",{className:"overview-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"WORKSPACE OVERVIEW"}),p.jsx("h2",{children:Bt?.name??"Choose a session"})]}),p.jsx("button",{type:"button",className:"close-button",onClick:()=>W(!1),children:"Esc"})]}),p.jsx("div",{className:"thumbnail-grid",children:Ze.length?Ze.map(H=>p.jsxs("button",{type:"button",className:`thumbnail ${d?.id===H.id?"active":""}`,onClick:()=>{Gt(H)},children:[p.jsxs("div",{className:"thumbnail-preview",children:[p.jsx("span",{className:"thumbnail-line cyan"}),p.jsx("span",{className:"thumbnail-line short"}),p.jsx("span",{className:"thumbnail-line green"}),p.jsx("span",{className:"thumbnail-cursor"})]}),p.jsxs("div",{className:"thumbnail-label",children:[p.jsx("b",{children:H.name}),p.jsxs("small",{children:[H.kind==="ssh"?H.host:"local screen"," · ",H.status]})]})]},H.id)):p.jsxs("div",{className:"overview-empty",children:[p.jsx("span",{children:"▦"}),p.jsx("b",{children:"No terminals in this workspace"}),p.jsx("small",{children:"Create a local terminal or connect over SSH."})]})}),p.jsxs("div",{className:"overview-foot",children:[p.jsx("button",{type:"button",onClick:()=>{W(!1),Ti()},children:"+ Local terminal"}),p.jsx("button",{type:"button",onClick:()=>{W(!1),Vt("ssh")},children:"Connect SSH"}),p.jsx("button",{type:"button",onClick:()=>{W(!1),Qr()},children:"+ Workspace"}),p.jsx("span",{className:"overview-hint",children:"Press Esc to close"})]})]})}),l&&p.jsx("div",{className:"history-layer",role:"presentation",...Vn,children:p.jsxs("div",{className:"history-popover",role:"dialog","aria-label":"Session history",children:[p.jsxs("div",{className:"history-head",children:[p.jsx("b",{children:"History"}),p.jsx("button",{type:"button",onClick:()=>_(!1),"aria-label":"Close history",children:"×"})]}),Ni.length?Ni.slice().sort((H,J)=>J.timestamp.localeCompare(H.timestamp)).map(H=>p.jsxs("button",{type:"button",className:"history-item",onClick:async()=>{_(!1);const J=!!H.session.screenName,oe=H.session.kind==="ssh"&&!J;if(J||H.session.backend==="screen"){a("screens");const de=H.session.screenName||H.session.name,we=j.find(Fe=>Fe.kind==="ssh"&&Fe.screenName===de),xe=j.find(Fe=>Fe.screenName===de&&Fe.kind==="local");if(we){Ht(we),await Gt(we),v(`Reconnecting to ${we.name}…`);return}if(xe){Ht(xe),await Gt(xe),v(`Reconnecting to ${xe.name}…`);return}const Re=ct();if(!Re)return;const We=Ft.find(Fe=>(H.session.host||"").includes(Fe.hostName||Fe.alias)||(Fe.hostName||Fe.alias).includes(H.session.host||""));if(We){await bt({...H.session,screenName:de,host:We.hostName||We.alias},We);return}if(H.session.host){const Fe=H.session.host,Ve=await Re.createSshSession({target:Fe,name:H.session.name});ee(_t=>[..._t,Ve]),Ht(Ve),q(Ve.id),V(null),Q(vl(Ze.length+1)),await Gt(Ve);const ii=H.session.screenName||H.session.name;Re.write(Ve.id,`screen -x ${ii}\r`),v(`Connected to ${Ve.name}`)}return}if(oe){const de=H.session.host||H.session.sshTarget||"",we=de.replace(/[^a-zA-Z0-9_.-]+/g,"-").slice(0,40);pe(de),re(H.session.name&&H.session.name!==we?H.session.name:"");const xe=ct();if(!xe)return;const Re=Ft.find(Ve=>de.includes(Ve.hostName||Ve.alias)||(Ve.hostName||Ve.alias).includes(de)),We=H.session.name||we,Fe=await xe.createSshSession({target:de,name:We});if(ee(Ve=>[...Ve,Fe]),Ht(Fe),await Gt(Fe),v(`Connected to ${Fe.name}`),xe.discoverRemoteScreens&&Re)try{const Ve=await xe.discoverRemoteScreens(Re);if(Ve.length){const ii=Ve.find(_t=>_t.status==="detached")??Ve[0];await bt(ii,Re);return}}catch{}return}a("terminals")},children:[p.jsxs("span",{className:"history-main",children:[p.jsx("span",{className:"history-kind",children:H.event.toUpperCase()}),p.jsxs("span",{className:"history-text",children:[p.jsx("b",{children:H.session.name}),p.jsxs("small",{children:[H.session.host," · ",H.available?"available":"unavailable"]})]})]}),p.jsx("button",{type:"button",className:"history-remove","aria-label":"Remove history entry",onClick:J=>{J.stopPropagation(),ct()?.removeHistory(H.id).then(()=>kt(oe=>oe.filter(de=>de.id!==H.id))).catch(()=>{})},children:"×"})]},H.id)):p.jsx("p",{className:"history-empty",children:"No history entries yet."}),p.jsx("small",{className:"history-note",children:"Persisted session lifecycle from the main process."})]})}),T&&p.jsx("div",{className:"modal-layer",role:"presentation",...or,children:p.jsxs("form",{className:"modal-card",onSubmit:T==="workspace"?ls:T==="local"?zs:os,children:[p.jsxs("div",{className:"modal-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:jc(T).eyebrow}),p.jsx("h2",{children:jc(T).title})]}),p.jsx("button",{type:"button",className:"close-button",onClick:()=>U(null),children:"Esc"})]}),Kd(T)&&p.jsx("div",{className:"dialog-tabs",role:"tablist","aria-label":"Session type",children:rr.map(H=>p.jsxs("button",{type:"button",id:`session-tab-${H.kind}`,role:"tab","aria-selected":T===H.kind,"aria-controls":"session-dialog-panel",tabIndex:T===H.kind?0:-1,disabled:b,className:`dialog-tab ${T===H.kind?"active":""}`,onClick:()=>U(H.kind),onKeyDown:J=>{const oe=Ap(H.kind,J.key);oe&&(J.preventDefault(),U(oe),document.getElementById(`session-tab-${oe}`)?.focus())},children:[p.jsx("b",{children:H.label}),p.jsx("small",{children:H.hint})]},H.kind))}),T==="workspace"&&p.jsxs(p.Fragment,{children:[p.jsx("p",{children:"Create a separate workspace for a project or host group. Terminals stay scoped to the active workspace."}),p.jsxs("label",{children:["Workspace name",p.jsx("input",{autoFocus:!0,value:R,onChange:H=>z(H.target.value),pattern:"[A-Za-z0-9](?:[A-Za-z0-9_.]|-| ){0,48}",required:!0})]})]}),Kd(T)&&p.jsxs("div",{id:"session-dialog-panel",role:"tabpanel","aria-labelledby":`session-tab-${T}`,children:[T==="local"&&p.jsxs(p.Fragment,{children:[p.jsxs("p",{children:["Start a local session inside “",Bt?.name??"this workspace","”."]}),p.jsxs("label",{children:["Terminal name",p.jsx("input",{autoFocus:!0,value:A,onChange:H=>k(H.target.value),pattern:"[A-Za-z0-9](?:[A-Za-z0-9_.]|-){0,48}",required:!0})]}),p.jsxs("label",{children:["Shell backend",p.jsx("select",{value:lt,onChange:H=>{const J=H.target.value;mt(J)},children:dt.length?dt.map(H=>p.jsx("option",{value:H.backend,children:H.label},H.backend)):p.jsx("option",{value:"bash",children:"bash"})})]}),lt==="wsl"&&p.jsxs("label",{children:["WSL distribution",p.jsx("input",{value:fi,onChange:H=>Lt(H.target.value),placeholder:"Ubuntu"})]})]}),T==="ssh"&&p.jsxs(p.Fragment,{children:[p.jsxs("p",{children:["Connect a remote host into “",Bt?.name??"this workspace","”."]}),p.jsxs("label",{children:["SSH target",p.jsx("input",{autoFocus:!0,value:me,onChange:H=>pe(H.target.value),placeholder:"user@server:22",required:!0})]}),p.jsxs("label",{children:["Session label ",p.jsx("span",{className:"muted-text",children:"optional"}),p.jsx("input",{value:K,onChange:H=>re(H.target.value),placeholder:"server"})]})]})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>U(null),children:"Cancel"}),p.jsx("button",{className:"primary-button",disabled:b,type:"submit",children:b?"Working…":jc(T).submit})]})]})}),fe&&d&&pt&&ct()&&p.jsx(ip,{session:d,target:pt,api:ct(),onClose:()=>ge(!1),backdrop:Cl},d.id),Ae&&p.jsx(Ep,{settings:w,onChange:_i,onReset:$n,onClose:()=>Mt(!1),backdrop:Vr,backends:dt,wslDistributions:di,speechTest:Ce,onSpeechTest:()=>{sa()}}),Se&&p.jsx("div",{className:"modal-layer",role:"presentation",...Hs,children:p.jsxs("div",{className:"modal-card approval-card",children:[p.jsxs("div",{className:"modal-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:"VOICE"}),p.jsx("h2",{children:"Insert transcript?"})]}),p.jsx("button",{type:"button",className:"close-button",onClick:()=>mi(),children:"Esc"})]}),p.jsx("p",{children:"Review mode is on, so nothing has been typed yet. Inserting does not press Enter."}),p.jsx("code",{children:Se.text}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>mi(),children:"Discard"}),p.jsx("button",{type:"button",className:"primary-button",onClick:()=>{ct()?.write(Se.sessionId,Se.text),v(`Voice: "${Se.text}"`),mi()},children:"Insert"})]})]})}),F&&p.jsx("div",{className:"modal-layer",role:"presentation",...js,children:p.jsxs("div",{className:"modal-card approval-card",children:[p.jsxs("div",{className:"modal-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow warning-text",children:"APPROVAL REQUIRED"}),p.jsx("h2",{children:"Run suggestion?"})]}),p.jsx("button",{type:"button",className:"close-button",onClick:()=>L(null),children:"Esc"})]}),p.jsx("p",{children:F.explanation}),p.jsx("code",{children:F.command}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>L(null),children:"Cancel"}),p.jsx("button",{type:"button",className:"primary-button",onClick:()=>{d&&ct()?.write(d.id,`${F.command}\r`),L(null)},children:"Approve & run"})]})]})})]})}function $d(w){return w==="light"?{background:"#f7f9fc",foreground:"#253044",cursor:"#16803c",selectionBackground:"#cbdcf5",green:"#16803c",yellow:"#a15c00",red:"#c53030",blue:"#2459a6",cyan:"#087f8c"}:{background:"#0a0c10",foreground:"#d8dee9",cursor:"#9ece6a",selectionBackground:"#334155",green:"#9ece6a",yellow:"#e0af68",red:"#f7768e",blue:"#7aa2f7",cyan:"#7dcfff"}}function zc(w){let B=w.length+1;const O=new Set(w.map(j=>j.name.toLowerCase()));for(;O.has(`workspace ${B}`);)B+=1;return`Workspace ${B}`}function Fp(w,B){const O=w.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,24)||"term",j=new Set(B.map(se=>se.name.toLowerCase()));if(!j.has(O))return O;let ee=2;for(;j.has(`${O}-${ee}`);)ee+=1;return`${O}-${ee}`}function vl(w){return w<=1?"stack":w===2?"split-v":"grid"}gm.createRoot(document.getElementById("root")).render(p.jsx(Wp,{}));