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.
- package/LICENSE +21 -21
- package/README.md +8 -6
- package/bin/zerogterm.cjs +23 -23
- package/dist/renderer/assets/index-BjXtNztF.css +1 -0
- package/dist/renderer/assets/index-Ogyjvi0e.js +19 -0
- package/dist/renderer/index.html +4 -4
- package/package.json +1 -1
- package/dist/renderer/assets/index-D5eoFnzh.css +0 -1
- package/dist/renderer/assets/index-EEjSxqRY.js +0 -19
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
(function(){const L=document.createElement("link").relList;if(L&&L.supports&&L.supports("modulepreload"))return;for(const J of document.querySelectorAll('link[rel="modulepreload"]'))j(J);new MutationObserver(J=>{for(const se of J)if(se.type==="childList")for(const Z of se.addedNodes)Z.tagName==="LINK"&&Z.rel==="modulepreload"&&j(Z)}).observe(document,{childList:!0,subtree:!0});function O(J){const se={};return J.integrity&&(se.integrity=J.integrity),J.referrerPolicy&&(se.referrerPolicy=J.referrerPolicy),J.crossOrigin==="use-credentials"?se.credentials="include":J.crossOrigin==="anonymous"?se.credentials="omit":se.credentials="same-origin",se}function j(J){if(J.ep)return;J.ep=!0;const se=O(J);fetch(J.href,se)}})();var Ac={exports:{}},Fn={};var gd;function dm(){if(gd)return Fn;gd=1;var C=Symbol.for("react.transitional.element"),L=Symbol.for("react.fragment");function O(j,J,se){var Z=null;if(se!==void 0&&(Z=""+se),J.key!==void 0&&(Z=""+J.key),"key"in J){se={};for(var u in J)u!=="key"&&(se[u]=J[u])}else se=J;return J=se.ref,{$$typeof:C,type:j,key:Z,ref:J!==void 0?J:null,props:se}}return Fn.Fragment=L,Fn.jsx=O,Fn.jsxs=O,Fn}var Sd;function _m(){return Sd||(Sd=1,Ac.exports=dm()),Ac.exports}var p=_m(),Dc={exports:{}},Me={};var bd;function vm(){if(bd)return Me;bd=1;var C=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),Z=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 w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,o={};function c(A,B,K){this.props=A,this.context=B,this.refs=o,this.updater=K||w}c.prototype.isReactComponent={},c.prototype.setState=function(A,B){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,B,"setState")},c.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function a(){}a.prototype=c.prototype;function l(A,B,K){this.props=A,this.context=B,this.refs=o,this.updater=K||w}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,B,K){var re=K.ref;return{$$typeof:C,type:A,key:B,ref:re!==void 0?re:null,props:K}}function U(A,B){return T(A.type,B,A.props)}function P(A){return typeof A=="object"&&A!==null&&A.$$typeof===C}function W(A){var B={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(K){return B[K]})}var N=/\/+/g;function ee(A,B){return typeof A=="object"&&A!==null&&A.key!=null?W(""+A.key):B.toString(36)}function oe(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(B){A.status==="pending"&&(A.status="fulfilled",A.value=B)},function(B){A.status==="pending"&&(A.status="rejected",A.reason=B)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function q(A,B,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 C:case L:F=!0;break;case y:return F=A._init,q(F(A._payload),B,K,re,me)}}if(F)return me=me(A),F=re===""?"."+ee(A,0):re,x(me)?(K="",F!=null&&(K=F.replace(N,"$&/")+"/"),q(me,B,K,"",function(fe){return fe})):me!=null&&(P(me)&&(me=U(me,K+(me.key==null||A&&A.key===me.key?"":(""+me.key).replace(N,"$&/")+"/")+F)),B.push(me)),1;F=0;var k=re===""?".":re+":";if(x(A))for(var ae=0;ae<A.length;ae++)re=A[ae],pe=k+ee(re,ae),F+=q(re,B,K,pe,me);else if(ae=b(A),typeof ae=="function")for(A=ae.call(A),ae=0;!(re=A.next()).done;)re=re.value,pe=k+ee(re,ae++),F+=q(re,B,K,pe,me);else if(pe==="object"){if(typeof A.then=="function")return q(oe(A),B,K,re,me);throw B=String(A),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return F}function $(A,B,K){if(A==null)return A;var re=[],me=0;return q(A,re,"","",function(pe){return B.call(K,pe,me++)}),re}function ie(A){if(A._status===-1){var B=A._result;B=B(),B.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=B)}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 B=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(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},z={map:$,forEach:function(A,B,K){$(A,function(){B.apply(this,arguments)},K)},count:function(A){var B=0;return $(A,function(){B++}),B},toArray:function(A){return $(A,function(B){return B})||[]},only:function(A){if(!P(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Me.Activity=h,Me.Children=z,Me.Component=c,Me.Fragment=O,Me.Profiler=J,Me.PureComponent=l,Me.StrictMode=j,Me.Suspense=f,Me.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Me.__COMPILER_RUNTIME={__proto__:null,c:function(A){return D.H.useMemoCache(A)}},Me.cache=function(A){return function(){return A.apply(null,arguments)}},Me.cacheSignal=function(){return null},Me.cloneElement=function(A,B,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(B!=null)for(pe in B.key!==void 0&&(me=""+B.key),B)!g.call(B,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&B.ref===void 0||(re[pe]=B[pe]);var pe=arguments.length-2;if(pe===1)re.children=K;else if(1<pe){for(var F=Array(pe),k=0;k<pe;k++)F[k]=arguments[k+2];re.children=F}return T(A.type,me,re)},Me.createContext=function(A){return A={$$typeof:Z,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:se,_context:A},A},Me.createElement=function(A,B,K){var re,me={},pe=null;if(B!=null)for(re in B.key!==void 0&&(pe=""+B.key),B)g.call(B,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(me[re]=B[re]);var F=arguments.length-2;if(F===1)me.children=K;else if(1<F){for(var k=Array(F),ae=0;ae<F;ae++)k[ae]=arguments[ae+2];me.children=k}if(A&&A.defaultProps)for(re in F=A.defaultProps,F)me[re]===void 0&&(me[re]=F[re]);return T(A,pe,me)},Me.createRef=function(){return{current:null}},Me.forwardRef=function(A){return{$$typeof:u,render:A}},Me.isValidElement=P,Me.lazy=function(A){return{$$typeof:y,_payload:{_status:-1,_result:A},_init:ie}},Me.memo=function(A,B){return{$$typeof:d,type:A,compare:B===void 0?null:B}},Me.startTransition=function(A){var B=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{B!==null&&K.types!==null&&(B.types=K.types),D.T=B}},Me.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Me.use=function(A){return D.H.use(A)},Me.useActionState=function(A,B,K){return D.H.useActionState(A,B,K)},Me.useCallback=function(A,B){return D.H.useCallback(A,B)},Me.useContext=function(A){return D.H.useContext(A)},Me.useDebugValue=function(){},Me.useDeferredValue=function(A,B){return D.H.useDeferredValue(A,B)},Me.useEffect=function(A,B){return D.H.useEffect(A,B)},Me.useEffectEvent=function(A){return D.H.useEffectEvent(A)},Me.useId=function(){return D.H.useId()},Me.useImperativeHandle=function(A,B,K){return D.H.useImperativeHandle(A,B,K)},Me.useInsertionEffect=function(A,B){return D.H.useInsertionEffect(A,B)},Me.useLayoutEffect=function(A,B){return D.H.useLayoutEffect(A,B)},Me.useMemo=function(A,B){return D.H.useMemo(A,B)},Me.useOptimistic=function(A,B){return D.H.useOptimistic(A,B)},Me.useReducer=function(A,B,K){return D.H.useReducer(A,B,K)},Me.useRef=function(A){return D.H.useRef(A)},Me.useState=function(A){return D.H.useState(A)},Me.useSyncExternalStore=function(A,B,K){return D.H.useSyncExternalStore(A,B,K)},Me.useTransition=function(){return D.H.useTransition()},Me.version="19.2.8",Me}var yd;function Ic(){return yd||(yd=1,Dc.exports=vm()),Dc.exports}var _e=Ic(),Tc={exports:{}},Kn={},Rc={exports:{}},Mc={};var Cd;function mm(){return Cd||(Cd=1,(function(C){function L(q,$){var ie=q.length;q.push($);e:for(;0<ie;){var R=ie-1>>>1,z=q[R];if(0<J(z,$))q[R]=$,q[ie]=z,ie=R;else break e}}function O(q){return q.length===0?null:q[0]}function j(q){if(q.length===0)return null;var $=q[0],ie=q.pop();if(ie!==$){q[0]=ie;e:for(var R=0,z=q.length,A=z>>>1;R<A;){var B=2*(R+1)-1,K=q[B],re=B+1,me=q[re];if(0>J(K,ie))re<z&&0>J(me,K)?(q[R]=me,q[re]=ie,R=re):(q[R]=K,q[B]=ie,R=B);else if(re<z&&0>J(me,ie))q[R]=me,q[re]=ie,R=re;else break e}}return $}function J(q,$){var ie=q.sortIndex-$.sortIndex;return ie!==0?ie:q.id-$.id}if(C.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var se=performance;C.unstable_now=function(){return se.now()}}else{var Z=Date,u=Z.now();C.unstable_now=function(){return Z.now()-u}}var f=[],d=[],y=1,h=null,v=3,b=!1,w=!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 $=O(d);$!==null;){if($.callback===null)j(d);else if($.startTime<=q)j(d),$.sortIndex=$.expirationTime,L(f,$);else break;$=O(d)}}function x(q){if(m=!1,_(q),!w)if(O(f)!==null)w=!0,E||(E=!0,W());else{var $=O(d);$!==null&&oe(x,$.startTime-q)}}var E=!1,D=-1,g=5,T=-1;function U(){return o?!0:!(C.unstable_now()-T<g)}function P(){if(o=!1,E){var q=C.unstable_now();T=q;var $=!0;try{e:{w=!1,m&&(m=!1,a(D),D=-1),b=!0;var ie=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=C.unstable_now(),typeof z=="function"){h.callback=z,_(q),$=!0;break t}h===O(f)&&j(f),_(q)}else j(f);h=O(f)}if(h!==null)$=!0;else{var A=O(d);A!==null&&oe(x,A.startTime-q),$=!1}}break e}finally{h=null,v=ie,b=!1}$=void 0}}finally{$?W():E=!1}}}var W;if(typeof l=="function")W=function(){l(P)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,ee=N.port2;N.port1.onmessage=P,W=function(){ee.postMessage(null)}}else W=function(){c(P,0)};function oe(q,$){D=c(function(){q(C.unstable_now())},$)}C.unstable_IdlePriority=5,C.unstable_ImmediatePriority=1,C.unstable_LowPriority=4,C.unstable_NormalPriority=3,C.unstable_Profiling=null,C.unstable_UserBlockingPriority=2,C.unstable_cancelCallback=function(q){q.callback=null},C.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},C.unstable_getCurrentPriorityLevel=function(){return v},C.unstable_next=function(q){switch(v){case 1:case 2:case 3:var $=3;break;default:$=v}var ie=v;v=$;try{return q()}finally{v=ie}},C.unstable_requestPaint=function(){o=!0},C.unstable_runWithPriority=function(q,$){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var ie=v;v=q;try{return $()}finally{v=ie}},C.unstable_scheduleCallback=function(q,$,ie){var R=C.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?R+ie:R):ie=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=ie+z,q={id:y++,callback:$,priorityLevel:q,startTime:ie,expirationTime:z,sortIndex:-1},ie>R?(q.sortIndex=ie,L(d,q),O(f)===null&&q===O(d)&&(m?(a(D),D=-1):m=!0,oe(x,ie-R))):(q.sortIndex=z,L(f,q),w||b||(w=!0,E||(E=!0,W()))),q},C.unstable_shouldYield=U,C.unstable_wrapCallback=function(q){var $=v;return function(){var ie=v;v=$;try{return q.apply(this,arguments)}finally{v=ie}}}})(Mc)),Mc}var wd;function pm(){return wd||(wd=1,Rc.exports=mm()),Rc.exports}var Lc={exports:{}},Kt={};var Ed;function gm(){if(Ed)return Kt;Ed=1;var C=Ic();function L(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(L(522))},D:O,C:O,L:O,m:O,X:O,S:O,M:O},p:0,findDOMNode:null},J=Symbol.for("react.portal");function se(f,d,y){var h=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:J,key:h==null?null:""+h,children:f,containerInfo:d,implementation:y}}var Z=C.__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 Kt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,Kt.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(L(299));return se(f,d,null,y)},Kt.flushSync=function(f){var d=Z.T,y=j.p;try{if(Z.T=null,j.p=2,f)return f()}finally{Z.T=d,j.p=y,j.d.f()}},Kt.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))},Kt.prefetchDNS=function(f){typeof f=="string"&&j.d.D(f)},Kt.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})}},Kt.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)},Kt.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})}},Kt.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)},Kt.requestFormReset=function(f){j.d.r(f)},Kt.unstable_batchedUpdates=function(f,d){return f(d)},Kt.useFormState=function(f,d,y){return Z.H.useFormState(f,d,y)},Kt.useFormStatus=function(){return Z.H.useHostTransitionStatus()},Kt.version="19.2.8",Kt}var xd;function Sm(){if(xd)return Lc.exports;xd=1;function C(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(C)}catch(L){console.error(L)}}return C(),Lc.exports=gm(),Lc.exports}var Ad;function bm(){if(Ad)return Kn;Ad=1;var C=pm(),L=Ic(),O=Sm();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 J(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 Z(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function 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"),w=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 ee(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 w: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:ee(e.type)||"Memo";case g:t=e._payload,e=e._init;try{return ee(e(t))}catch{}}return null}var oe=Array.isArray,q=L.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=O.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},R=[],z=-1;function A(e){return{current:e}}function B(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 k(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}}B(re),K(re,e)}function ae(){B(re),B(me),B(pe)}function fe(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 be(e){me.current===e&&(B(re),B(me)),F.current===e&&(B(F),In._currentValue=ie)}var Se,Le;function je(e){if(Se===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);Se=t&&t[1]||"",Le=-1<i.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+Se+e+Le}var Ye=!1;function tt(e,t){if(!e||Ye)return"";Ye=!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(ne){var te=ne}Reflect.construct(e,[],he)}else{try{he.call()}catch(ne){te=ne}e.call(he.prototype)}}else{try{throw Error()}catch(ne){te=ne}(he=e())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(ne){if(ne&&te&&typeof ne.stack=="string")return[ne.stack,te.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
|
+
`),Q=M.split(`
|
|
5
|
+
`);for(r=s=0;s<I.length&&!I[s].includes("DetermineComponentFrameRoot");)s++;for(;r<Q.length&&!Q[r].includes("DetermineComponentFrameRoot");)r++;if(s===I.length||r===Q.length)for(s=I.length-1,r=Q.length-1;1<=s&&0<=r&&I[s]!==Q[r];)r--;for(;1<=s&&0<=r;s--,r--)if(I[s]!==Q[r]){if(s!==1||r!==1)do if(s--,r--,0>r||I[s]!==Q[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{Ye=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?je(i):""}function De(e,t){switch(e.tag){case 26:case 27:case 5:return je(e.type);case 16:return je("Lazy");case 13:return e.child!==t&&t!==null?je("Suspense Fallback"):je("Suspense");case 19:return je("SuspenseList");case 0:case 15:return tt(e.type,!1);case 11:return tt(e.type.render,!1);case 1:return tt(e.type,!0);case 31:return je("Activity");default:return""}}function jt(e){try{var t="",i=null;do t+=De(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
|
|
7
|
+
Error generating stack: `+s.message+`
|
|
8
|
+
`+s.stack}}var de=Object.prototype.hasOwnProperty,ge=C.unstable_scheduleCallback,ye=C.unstable_cancelCallback,Oe=C.unstable_shouldYield,ze=C.unstable_requestPaint,Ne=C.unstable_now,_t=C.unstable_getCurrentPriorityLevel,Ue=C.unstable_ImmediatePriority,vt=C.unstable_UserBlockingPriority,ct=C.unstable_NormalPriority,_i=C.unstable_LowPriority,Ht=C.unstable_IdlePriority,$t=C.log,Ke=C.unstable_setDisableYieldValue,Ai=null,Wt=null;function ii(e){if(typeof $t=="function"&&Ke(e),Wt&&typeof Wt.setStrictMode=="function")try{Wt.setStrictMode(Ai,e)}catch{}}var Ct=Math.clz32?Math.clz32:Kr,Yn=Math.log,Vn=Math.LN2;function Kr(e){return e>>>=0,e===0?32:31-(Yn(e)/Vn|0)|0}var Yr=256,js=262144,os=4194304;function qi(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 si(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=qi(s):(S&=M,S!==0?r=qi(S):i||(i=M&~e,i!==0&&(r=qi(i))))):(M=s&~n,M!==0?r=qi(M):S!==0?r=qi(S):i||(i=s&~e,i!==0&&(r=qi(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 Hs(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Cl(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 $n(){var e=os;return os<<=1,(os&62914560)===0&&(os=4194304),e}function Vr(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function Ns(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wl(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,Q=e.hiddenUpdates;for(i=S&~i;0<i;){var ce=31-Ct(i),he=1<<ce;M[ce]=0,I[ce]=-1;var te=Q[ce];if(te!==null)for(Q[ce]=null,ce=0;ce<te.length;ce++){var ne=te[ce];ne!==null&&(ne.lane&=-536870913)}i&=~he}s!==0&&Xn(e,s,0),n!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=n&~(S&~t))}function Xn(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-Ct(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function ri(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-Ct(i),r=1<<s;r&t|e[s]&t&&(e[s]|=t),i&=~r}}function $r(e,t){var i=t&-t;return i=(i&42)!==0?1:Xr(i),(i&(e.suspendedLanes|t))!==0?0:i}function Xr(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 Nt(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function et(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:hd(e.type))}function Ii(e,t){var i=$.p;try{return $.p=e,t()}finally{$.p=i}}var Di=Math.random().toString(36).slice(2),wt="__reactFiber$"+Di,Rt="__reactProps$"+Di,Pi="__reactContainer$"+Di,cs="__reactEvents$"+Di,us="__reactListeners$"+Di,El="__reactHandles$"+Di,Ot="__reactResources$"+Di,zs="__reactMarker$"+Di;function Zr(e){delete e[wt],delete e[Rt],delete e[cs],delete e[us],delete e[El]}function Mt(e){var t=e[wt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Pi]||i[wt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=$f(e);e!==null;){if(i=e[wt])return i;e=$f(e)}return t}e=i,i=e.parentNode}return null}function zt(e){if(e=e[wt]||e[Pi]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Us(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(j(33))}function hs(e){var t=e[Ot];return t||(t=e[Ot]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Et(e){e[zs]=!0}var Qr=new Set,Jr={};function Bi(e,t){ni(e,t),ni(e+"Capture",t)}function ni(e,t){for(Jr[e]=t,e=0;e<t.length;e++)Qr.add(t[e])}var qs=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={},Qn={};function Jn(e){return de.call(Qn,e)?!0:de.call(Zn,e)?!1:qs.test(e)?Qn[e]=!0:(Zn[e]=!0,!1)}function Is(e,t,i){if(Jn(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 vi(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 Ut(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 Yt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ea(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ta(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=ea(e)?"checked":"value";e._valueTracker=ta(e,t,""+e[t])}}function en(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=ea(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Gi(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 ia=/[\n"\\]/g;function Xt(e){return e.replace(ia,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function tn(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=""+Yt(t)):e.value!==""+Yt(t)&&(e.value=""+Yt(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?ur(e,S,Yt(t)):i!=null?ur(e,S,Yt(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=""+Yt(M):e.removeAttribute("name")}function sn(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?""+Yt(i):"",t=t!=null?""+Yt(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 ur(e,t,i){t==="number"&&Gi(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function Wi(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=""+Yt(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 sa(e,t,i){if(t!=null&&(t=""+Yt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+Yt(i):""}function rn(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(j(92));if(oe(s)){if(1<s.length)throw Error(j(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=Yt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),cr(e)}function mi(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var ra=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 na(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||ra.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function aa(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&&na(e,r,s)}else for(var n in t)t.hasOwnProperty(n)&&na(e,n,t[n])}function hr(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 xl=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"]]),Al=/^[\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 H(e){return Al.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function V(){}var le=null;function ve(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ee=null,we=null;function Re(e){var t=zt(e);if(t&&(e=t.stateNode)){var i=e[Rt]||null;e:switch(e=t.stateNode,t.type){case"input":if(tn(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="'+Xt(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var r=s[Rt]||null;if(!r)throw Error(j(90));tn(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&&en(s)}break e;case"textarea":sa(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&Wi(e,!!i.multiple,t,!1)}}}var $e=!1;function Qe(e,t,i){if($e)return e(t,i);$e=!0;try{var s=e(t);return s}finally{if($e=!1,(Ee!==null||we!==null)&&(Ga(),Ee&&(t=Ee,e=we,we=Ee=null,Re(t),e)))for(t=0;t<e.length;t++)Re(e[t])}}function qe(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Rt]||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 Lt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ft=!1;if(Lt)try{var Ti={};Object.defineProperty(Ti,"passive",{get:function(){ft=!0}}),window.addEventListener("test",Ti,Ti),window.removeEventListener("test",Ti,Ti)}catch{ft=!1}var mt=null,fs=null,ji=null;function Ps(){if(ji)return ji;var e,t=fs,i=t.length,s,r="value"in mt?mt.value:mt.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 ji=r.slice(e,1<s?1-s:void 0)}function fr(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 nn(){return!0}function pi(){return!1}function Ft(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)?nn:pi,this.isPropagationStopped=pi,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=nn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=nn)},persist:function(){},isPersistent:nn}),t}var Ri={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fi=Ft(Ri),an=h({},Ri,{view:0,detail:0}),h_=Ft(an),Dl,Tl,ln,la=h({},an,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ml,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"?(Dl=e.screenX-ln.screenX,Tl=e.screenY-ln.screenY):Tl=Dl=0,ln=e),Dl)},movementY:function(e){return"movementY"in e?e.movementY:Tl}}),Gc=Ft(la),f_=h({},la,{dataTransfer:0}),d_=Ft(f_),__=h({},an,{relatedTarget:0}),Rl=Ft(__),v_=h({},Ri,{animationName:0,elapsedTime:0,pseudoElement:0}),m_=Ft(v_),p_=h({},Ri,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),g_=Ft(p_),S_=h({},Ri,{data:0}),Wc=Ft(S_),b_={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},y_={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"},C_={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function w_(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=C_[e])?!!t[e]:!1}function Ml(){return w_}var E_=h({},an,{key:function(e){if(e.key){var t=b_[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=fr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?y_[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ml,charCode:function(e){return e.type==="keypress"?fr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),x_=Ft(E_),A_=h({},la,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Fc=Ft(A_),D_=h({},an,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ml}),T_=Ft(D_),R_=h({},Ri,{propertyName:0,elapsedTime:0,pseudoElement:0}),M_=Ft(R_),L_=h({},la,{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}),k_=Ft(L_),O_=h({},Ri,{newState:0,oldState:0}),B_=Ft(O_),j_=[9,13,27,32],Ll=Lt&&"CompositionEvent"in window,on=null;Lt&&"documentMode"in document&&(on=document.documentMode);var H_=Lt&&"TextEvent"in window&&!on,Kc=Lt&&(!Ll||on&&8<on&&11>=on),Yc=" ",Vc=!1;function $c(e,t){switch(e){case"keyup":return j_.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 dr=!1;function N_(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 z_(e,t){if(dr)return e==="compositionend"||!Ll&&$c(e,t)?(e=Ps(),ji=fs=mt=null,dr=!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 U_={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"?!!U_[e.type]:t==="textarea"}function Qc(e,t,i,s){Ee?we?we.push(s):we=[s]:Ee=s,t=Xa(t,"onChange"),0<t.length&&(i=new Fi("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var cn=null,un=null;function q_(e){jf(e,0)}function oa(e){var t=Us(e);if(en(t))return e}function Jc(e,t){if(e==="change")return t}var eu=!1;if(Lt){var kl;if(Lt){var Ol="oninput"in document;if(!Ol){var tu=document.createElement("div");tu.setAttribute("oninput","return;"),Ol=typeof tu.oninput=="function"}kl=Ol}else kl=!1;eu=kl&&(!document.documentMode||9<document.documentMode)}function iu(){cn&&(cn.detachEvent("onpropertychange",su),un=cn=null)}function su(e){if(e.propertyName==="value"&&oa(un)){var t=[];Qc(t,un,e,ve(e)),Qe(q_,t)}}function I_(e,t,i){e==="focusin"?(iu(),cn=t,un=i,cn.attachEvent("onpropertychange",su)):e==="focusout"&&iu()}function P_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return oa(un)}function G_(e,t){if(e==="click")return oa(t)}function W_(e,t){if(e==="input"||e==="change")return oa(t)}function F_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ai=typeof Object.is=="function"?Object.is:F_;function hn(e,t){if(ai(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(!de.call(t,r)||!ai(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=Gi(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=Gi(e.document)}return t}function Bl(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 K_=Lt&&"documentMode"in document&&11>=document.documentMode,_r=null,jl=null,fn=null,Hl=!1;function ou(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;Hl||_r==null||_r!==Gi(s)||(s=_r,"selectionStart"in s&&Bl(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=Xa(jl,"onSelect"),0<s.length&&(t=new Fi("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=_r)))}function Gs(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var vr={animationend:Gs("Animation","AnimationEnd"),animationiteration:Gs("Animation","AnimationIteration"),animationstart:Gs("Animation","AnimationStart"),transitionrun:Gs("Transition","TransitionRun"),transitionstart:Gs("Transition","TransitionStart"),transitioncancel:Gs("Transition","TransitionCancel"),transitionend:Gs("Transition","TransitionEnd")},Nl={},cu={};Lt&&(cu=document.createElement("div").style,"AnimationEvent"in window||(delete vr.animationend.animation,delete vr.animationiteration.animation,delete vr.animationstart.animation),"TransitionEvent"in window||delete vr.transitionend.transition);function Ws(e){if(Nl[e])return Nl[e];if(!vr[e])return e;var t=vr[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in cu)return Nl[e]=t[i];return e}var uu=Ws("animationend"),hu=Ws("animationiteration"),fu=Ws("animationstart"),Y_=Ws("transitionrun"),V_=Ws("transitionstart"),$_=Ws("transitioncancel"),du=Ws("transitionend"),_u=new Map,zl="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(" ");zl.push("scrollEnd");function Mi(e,t){_u.set(e,t),Bi(t,[e])}var ca=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=[],mr=0,Ul=0;function ua(){for(var e=mr,t=Ul=mr=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 ha(e,t,i,s){gi[mr++]=e,gi[mr++]=t,gi[mr++]=i,gi[mr++]=s,Ul|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function ql(e,t,i,s){return ha(e,t,i,s),fa(e)}function Fs(e,t){return ha(e,null,null,t),fa(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-Ct(i),e=n.hiddenUpdates,s=e[r],s===null?e[r]=[t]:s.push(t),t.lane=i|536870912),n):null}function fa(e){if(50<Bn)throw Bn=0,Xo=null,Error(j(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var pr={};function X_(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 li(e,t,i,s){return new X_(e,t,i,s)}function Il(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ki(e,t){var i=e.alternate;return i===null?(i=li(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 da(e,t,i,s,r,n){var S=0;if(s=e,typeof e=="function")Il(e)&&(S=1);else if(typeof e=="string")S=tm(e,i,re.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case T:return e=li(31,i,t,r),e.elementType=T,e.lanes=n,e;case m:return Ks(i.children,r,n,t);case o:S=8,r|=24;break;case c:return e=li(12,i,t,r|2),e.elementType=c,e.lanes=n,e;case x:return e=li(13,i,t,r),e.elementType=x,e.lanes=n,e;case E:return e=li(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=li(S,i,t,r),t.elementType=e,t.type=s,t.lanes=n,t}function Ks(e,t,i,s){return e=li(7,e,s,t),e.lanes=i,e}function Pl(e,t,i){return e=li(6,e,null,t),e.lanes=i,e}function pu(e){var t=li(18,null,null,0);return t.stateNode=e,t}function Gl(e,t,i){return t=li(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:jt(t)},gu.set(e,t),t)}return{value:e,source:t,stack:jt(t)}}var gr=[],Sr=0,_a=null,dn=0,bi=[],yi=0,ds=null,Hi=1,Ni="";function Yi(e,t){gr[Sr++]=dn,gr[Sr++]=_a,_a=e,dn=t}function Su(e,t,i){bi[yi++]=Hi,bi[yi++]=Ni,bi[yi++]=ds,ds=e;var s=Hi;e=Ni;var r=32-Ct(s)-1;s&=~(1<<r),i+=1;var n=32-Ct(t)+r;if(30<n){var S=r-r%5;n=(s&(1<<S)-1).toString(32),s>>=S,r-=S,Hi=1<<32-Ct(t)+r|i<<r|s,Ni=n+e}else Hi=1<<n|i<<r|s,Ni=e}function Wl(e){e.return!==null&&(Yi(e,1),Su(e,1,0))}function Fl(e){for(;e===_a;)_a=gr[--Sr],gr[Sr]=null,dn=gr[--Sr],gr[Sr]=null;for(;e===ds;)ds=bi[--yi],bi[yi]=null,Ni=bi[--yi],bi[yi]=null,Hi=bi[--yi],bi[yi]=null}function bu(e,t){bi[yi++]=Hi,bi[yi++]=Ni,bi[yi++]=ds,Hi=t.id,Ni=t.overflow,ds=e}var qt=null,ut=null,Fe=!1,_s=null,Ci=!1,Kl=Error(j(519));function vs(e){var t=Error(j(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _n(Si(t,e)),Kl}function yu(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[wt]=e,t[Rt]=s,i){case"dialog":Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":case"embed":Pe("load",t);break;case"video":case"audio":for(i=0;i<Hn.length;i++)Pe(Hn[i],t);break;case"source":Pe("error",t);break;case"img":case"image":case"link":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"input":Pe("invalid",t),sn(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Pe("invalid",t);break;case"textarea":Pe("invalid",t),rn(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&&(Pe("beforetoggle",t),Pe("toggle",t)),s.onScroll!=null&&Pe("scroll",t),s.onScrollEnd!=null&&Pe("scrollend",t),s.onClick!=null&&(t.onclick=V),t=!0):t=!1,t||vs(e,!0)}function Cu(e){for(qt=e.return;qt;)switch(qt.tag){case 5:case 31:case 13:Ci=!1;return;case 27:case 3:Ci=!0;return;default:qt=qt.return}}function br(e){if(e!==qt)return!1;if(!Fe)return Cu(e),Fe=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||hc(e.type,e.memoizedProps)),i=!i),i&&ut&&vs(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,Rs(e.type)?(e=mc,mc=null,ut=e):ut=t):ut=qt?Ei(e.stateNode.nextSibling):null;return!0}function Ys(){ut=qt=null,Fe=!1}function Yl(){var e=_s;return e!==null&&(ei===null?ei=e:ei.push.apply(ei,e),_s=null),e}function _n(e){_s===null?_s=[e]:_s.push(e)}var Vl=A(null),Vs=null,Vi=null;function ms(e,t,i){K(Vl,t._currentValue),t._currentValue=i}function $i(e){e._currentValue=Vl.current,B(Vl)}function $l(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 Xl(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),$l(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),$l(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 yr(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;ai(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&&Xl(t,e,i,s),t.flags|=262144}function va(e){for(e=e.firstContext;e!==null;){if(!ai(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $s(e){Vs=e,Vi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function It(e){return wu(Vs,e)}function ma(e,t){return Vs===null&&$s(e),wu(e,t)}function wu(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},Vi===null){if(e===null)throw Error(j(308));Vi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Vi=Vi.next=t;return i}var Z_=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()})}},Q_=C.unstable_scheduleCallback,J_=C.unstable_NormalPriority,xt={$$typeof:l,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Zl(){return{controller:new Z_,data:new Map,refCount:0}}function vn(e){e.refCount--,e.refCount===0&&Q_(J_,function(){e.controller.abort()})}var mn=null,Ql=0,Cr=0,wr=null;function ev(e,t){if(mn===null){var i=mn=[];Ql=0,Cr=ic(),wr={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Ql++,t.then(Eu,Eu),t}function Eu(){if(--Ql===0&&mn!==null){wr!==null&&(wr.status="fulfilled");var e=mn;mn=null,Cr=0,wr=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function tv(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(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=Ne(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&ev(e,t),xu!==null&&xu(e,t)};var Xs=A(null);function Jl(){var e=Xs.current;return e!==null?e:lt.pooledCache}function pa(e,t){t===null?K(Xs,Xs.current):K(Xs,t.pool)}function Au(){var e=Jl();return e===null?null:{parent:xt._currentValue,pool:e}}var Er=Error(j(460)),eo=Error(j(474)),ga=Error(j(542)),Sa={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(V,V),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(V,V);else{if(e=lt,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 Qs=t,Er}}function Zs(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(Qs=i,Er):i}}var Qs=null;function Ru(){if(Qs===null)throw Error(j(459));var e=Qs;return Qs=null,e}function Mu(e){if(e===Er||e===ga)throw Error(j(483))}var xr=null,pn=0;function ba(e){var t=pn;return pn+=1,xr===null&&(xr=[]),Tu(xr,e,t)}function gn(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ya(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 X=Y.deletions;X===null?(Y.deletions=[G],Y.flags|=16):X.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=Ki(Y,G),Y.index=0,Y.sibling=null,Y}function n(Y,G,X){return Y.index=X,e?(X=Y.alternate,X!==null?(X=X.index,X<G?(Y.flags|=67108866,G):X):(Y.flags|=67108866,G)):(Y.flags|=1048576,G)}function S(Y){return e&&Y.alternate===null&&(Y.flags|=67108866),Y}function M(Y,G,X,ue){return G===null||G.tag!==6?(G=Pl(X,Y.mode,ue),G.return=Y,G):(G=r(G,X),G.return=Y,G)}function I(Y,G,X,ue){var Ae=X.type;return Ae===m?ce(Y,G,X.props.children,ue,X.key):G!==null&&(G.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===g&&Zs(Ae)===G.type)?(G=r(G,X.props),gn(G,X),G.return=Y,G):(G=da(X.type,X.key,X.props,null,Y.mode,ue),gn(G,X),G.return=Y,G)}function Q(Y,G,X,ue){return G===null||G.tag!==4||G.stateNode.containerInfo!==X.containerInfo||G.stateNode.implementation!==X.implementation?(G=Gl(X,Y.mode,ue),G.return=Y,G):(G=r(G,X.children||[]),G.return=Y,G)}function ce(Y,G,X,ue,Ae){return G===null||G.tag!==7?(G=Ks(X,Y.mode,ue,Ae),G.return=Y,G):(G=r(G,X),G.return=Y,G)}function he(Y,G,X){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Pl(""+G,Y.mode,X),G.return=Y,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return X=da(G.type,G.key,G.props,null,Y.mode,X),gn(X,G),X.return=Y,X;case w:return G=Gl(G,Y.mode,X),G.return=Y,G;case g:return G=Zs(G),he(Y,G,X)}if(oe(G)||W(G))return G=Ks(G,Y.mode,X,null),G.return=Y,G;if(typeof G.then=="function")return he(Y,ba(G),X);if(G.$$typeof===l)return he(Y,ma(Y,G),X);ya(Y,G)}return null}function te(Y,G,X,ue){var Ae=G!==null?G.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return Ae!==null?null:M(Y,G,""+X,ue);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case b:return X.key===Ae?I(Y,G,X,ue):null;case w:return X.key===Ae?Q(Y,G,X,ue):null;case g:return X=Zs(X),te(Y,G,X,ue)}if(oe(X)||W(X))return Ae!==null?null:ce(Y,G,X,ue,null);if(typeof X.then=="function")return te(Y,G,ba(X),ue);if(X.$$typeof===l)return te(Y,G,ma(Y,X),ue);ya(Y,X)}return null}function ne(Y,G,X,ue,Ae){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return Y=Y.get(X)||null,M(G,Y,""+ue,Ae);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case b:return Y=Y.get(ue.key===null?X:ue.key)||null,I(G,Y,ue,Ae);case w:return Y=Y.get(ue.key===null?X:ue.key)||null,Q(G,Y,ue,Ae);case g:return ue=Zs(ue),ne(Y,G,X,ue,Ae)}if(oe(ue)||W(ue))return Y=Y.get(X)||null,ce(G,Y,ue,Ae,null);if(typeof ue.then=="function")return ne(Y,G,X,ba(ue),Ae);if(ue.$$typeof===l)return ne(Y,G,X,ma(G,ue),Ae);ya(G,ue)}return null}function Ce(Y,G,X,ue){for(var Ae=null,Xe=null,xe=G,Be=G=0,We=null;xe!==null&&Be<X.length;Be++){xe.index>Be?(We=xe,xe=null):We=xe.sibling;var Ze=te(Y,xe,X[Be],ue);if(Ze===null){xe===null&&(xe=We);break}e&&xe&&Ze.alternate===null&&t(Y,xe),G=n(Ze,G,Be),Xe===null?Ae=Ze:Xe.sibling=Ze,Xe=Ze,xe=We}if(Be===X.length)return i(Y,xe),Fe&&Yi(Y,Be),Ae;if(xe===null){for(;Be<X.length;Be++)xe=he(Y,X[Be],ue),xe!==null&&(G=n(xe,G,Be),Xe===null?Ae=xe:Xe.sibling=xe,Xe=xe);return Fe&&Yi(Y,Be),Ae}for(xe=s(xe);Be<X.length;Be++)We=ne(xe,Y,Be,X[Be],ue),We!==null&&(e&&We.alternate!==null&&xe.delete(We.key===null?Be:We.key),G=n(We,G,Be),Xe===null?Ae=We:Xe.sibling=We,Xe=We);return e&&xe.forEach(function(Bs){return t(Y,Bs)}),Fe&&Yi(Y,Be),Ae}function Te(Y,G,X,ue){if(X==null)throw Error(j(151));for(var Ae=null,Xe=null,xe=G,Be=G=0,We=null,Ze=X.next();xe!==null&&!Ze.done;Be++,Ze=X.next()){xe.index>Be?(We=xe,xe=null):We=xe.sibling;var Bs=te(Y,xe,Ze.value,ue);if(Bs===null){xe===null&&(xe=We);break}e&&xe&&Bs.alternate===null&&t(Y,xe),G=n(Bs,G,Be),Xe===null?Ae=Bs:Xe.sibling=Bs,Xe=Bs,xe=We}if(Ze.done)return i(Y,xe),Fe&&Yi(Y,Be),Ae;if(xe===null){for(;!Ze.done;Be++,Ze=X.next())Ze=he(Y,Ze.value,ue),Ze!==null&&(G=n(Ze,G,Be),Xe===null?Ae=Ze:Xe.sibling=Ze,Xe=Ze);return Fe&&Yi(Y,Be),Ae}for(xe=s(xe);!Ze.done;Be++,Ze=X.next())Ze=ne(xe,Y,Be,Ze.value,ue),Ze!==null&&(e&&Ze.alternate!==null&&xe.delete(Ze.key===null?Be:Ze.key),G=n(Ze,G,Be),Xe===null?Ae=Ze:Xe.sibling=Ze,Xe=Ze);return e&&xe.forEach(function(fm){return t(Y,fm)}),Fe&&Yi(Y,Be),Ae}function at(Y,G,X,ue){if(typeof X=="object"&&X!==null&&X.type===m&&X.key===null&&(X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case b:e:{for(var Ae=X.key;G!==null;){if(G.key===Ae){if(Ae=X.type,Ae===m){if(G.tag===7){i(Y,G.sibling),ue=r(G,X.props.children),ue.return=Y,Y=ue;break e}}else if(G.elementType===Ae||typeof Ae=="object"&&Ae!==null&&Ae.$$typeof===g&&Zs(Ae)===G.type){i(Y,G.sibling),ue=r(G,X.props),gn(ue,X),ue.return=Y,Y=ue;break e}i(Y,G);break}else t(Y,G);G=G.sibling}X.type===m?(ue=Ks(X.props.children,Y.mode,ue,X.key),ue.return=Y,Y=ue):(ue=da(X.type,X.key,X.props,null,Y.mode,ue),gn(ue,X),ue.return=Y,Y=ue)}return S(Y);case w:e:{for(Ae=X.key;G!==null;){if(G.key===Ae)if(G.tag===4&&G.stateNode.containerInfo===X.containerInfo&&G.stateNode.implementation===X.implementation){i(Y,G.sibling),ue=r(G,X.children||[]),ue.return=Y,Y=ue;break e}else{i(Y,G);break}else t(Y,G);G=G.sibling}ue=Gl(X,Y.mode,ue),ue.return=Y,Y=ue}return S(Y);case g:return X=Zs(X),at(Y,G,X,ue)}if(oe(X))return Ce(Y,G,X,ue);if(W(X)){if(Ae=W(X),typeof Ae!="function")throw Error(j(150));return X=Ae.call(X),Te(Y,G,X,ue)}if(typeof X.then=="function")return at(Y,G,ba(X),ue);if(X.$$typeof===l)return at(Y,G,ma(Y,X),ue);ya(Y,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(X=""+X,G!==null&&G.tag===6?(i(Y,G.sibling),ue=r(G,X),ue.return=Y,Y=ue):(i(Y,G),ue=Pl(X,Y.mode,ue),ue.return=Y,Y=ue),S(Y)):i(Y,G)}return function(Y,G,X,ue){try{pn=0;var Ae=at(Y,G,X,ue);return xr=null,Ae}catch(xe){if(xe===Er||xe===ga)throw xe;var Xe=li(29,xe,null,Y.mode);return Xe.lanes=ue,Xe.return=Y,Xe}}}var Js=Lu(!0),ku=Lu(!1),ps=!1;function to(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function io(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 gs(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ss(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Je&2)!==0){var r=s.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),s.pending=t,t=fa(e),vu(e,null,i),t}return ha(e,s,t,i),fa(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,ri(e,i)}}function so(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 ro=!1;function bn(){if(ro){var e=wr;if(e!==null)throw e}}function yn(e,t,i,s){ro=!1;var r=e.updateQueue;ps=!1;var n=r.firstBaseUpdate,S=r.lastBaseUpdate,M=r.shared.pending;if(M!==null){r.shared.pending=null;var I=M,Q=I.next;I.next=null,S===null?n=Q:S.next=Q,S=I;var ce=e.alternate;ce!==null&&(ce=ce.updateQueue,M=ce.lastBaseUpdate,M!==S&&(M===null?ce.firstBaseUpdate=Q:M.next=Q,ce.lastBaseUpdate=I))}if(n!==null){var he=r.baseState;S=0,ce=Q=I=null,M=n;do{var te=M.lane&-536870913,ne=te!==M.lane;if(ne?(Ge&te)===te:(s&te)===te){te!==0&&te===Cr&&(ro=!0),ce!==null&&(ce=ce.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var Ce=e,Te=M;te=t;var at=i;switch(Te.tag){case 1:if(Ce=Te.payload,typeof Ce=="function"){he=Ce.call(at,he,te);break e}he=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Te.payload,te=typeof Ce=="function"?Ce.call(at,he,te):Ce,te==null)break e;he=h({},he,te);break e;case 2:ps=!0}}te=M.callback,te!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=r.callbacks,ne===null?r.callbacks=[te]:ne.push(te))}else ne={lane:te,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ce===null?(Q=ce=ne,I=he):ce=ce.next=ne,S|=te;if(M=M.next,M===null){if(M=r.shared.pending,M===null)break;ne=M,M=ne.next,ne.next=null,r.lastBaseUpdate=ne,r.shared.pending=null}}while(!0);ce===null&&(I=he),r.baseState=I,r.firstBaseUpdate=Q,r.lastBaseUpdate=ce,n===null&&(r.shared.lanes=0),Es|=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 Ar=A(null),Ca=A(0);function ju(e,t){e=rs,K(Ca,e),K(Ar,t),rs=e|t.baseLanes}function no(){K(Ca,rs),K(Ar,Ar.current)}function ao(){rs=Ca.current,B(Ar),B(Ca)}var oi=A(null),wi=null;function bs(e){var t=e.alternate;K(St,St.current&1),K(oi,e),wi===null&&(t===null||Ar.current!==null||t.memoizedState!==null)&&(wi=e)}function lo(e){K(St,St.current),K(oi,e),wi===null&&(wi=e)}function Hu(e){e.tag===22?(K(St,St.current),K(oi,e),wi===null&&(wi=e)):ys()}function ys(){K(St,St.current),K(oi,oi.current)}function ci(e){B(oi),wi===e&&(wi=null),B(St)}var St=A(0);function wa(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||_c(i)||vc(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 Xi=0,ke=null,rt=null,At=null,Ea=!1,Dr=!1,er=!1,xa=0,Cn=0,Tr=null,iv=0;function pt(){throw Error(j(321))}function oo(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!ai(e[i],t[i]))return!1;return!0}function co(e,t,i,s,r,n){return Xi=n,ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?Sh:xo,er=!1,n=i(s,r),er=!1,Dr&&(n=zu(t,i,s,r)),Nu(e),n}function Nu(e){q.H=xn;var t=rt!==null&&rt.next!==null;if(Xi=0,At=rt=ke=null,Ea=!1,Cn=0,Tr=null,t)throw Error(j(300));e===null||Dt||(e=e.dependencies,e!==null&&va(e)&&(Dt=!0))}function zu(e,t,i,s){ke=e;var r=0;do{if(Dr&&(Tr=null),Cn=0,Dr=!1,25<=r)throw Error(j(301));if(r+=1,At=rt=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(Dr);return n}function sv(){var e=q.H,t=e.useState()[0];return t=typeof t.then=="function"?wn(t):t,e=e.useState()[0],(rt!==null?rt.memoizedState:null)!==e&&(ke.flags|=1024),t}function uo(){var e=xa!==0;return xa=0,e}function ho(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function fo(e){if(Ea){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ea=!1}Xi=0,At=rt=ke=null,Dr=!1,Cn=xa=0,Tr=null}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return At===null?ke.memoizedState=At=e:At=At.next=e,At}function bt(){if(rt===null){var e=ke.alternate;e=e!==null?e.memoizedState:null}else e=rt.next;var t=At===null?ke.memoizedState:At.next;if(t!==null)At=t,rt=e;else{if(e===null)throw ke.alternate===null?Error(j(467)):Error(j(310));rt=e,e={memoizedState:rt.memoizedState,baseState:rt.baseState,baseQueue:rt.baseQueue,queue:rt.queue,next:null},At===null?ke.memoizedState=At=e:At=At.next=e}return At}function Aa(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wn(e){var t=Cn;return Cn+=1,Tr===null&&(Tr=[]),e=Tu(Tr,e,t),t=ke,(At===null?t.memoizedState:At.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?Sh:xo),e}function Da(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return wn(e);if(e.$$typeof===l)return It(e)}throw Error(j(438,String(e)))}function _o(e){var t=null,i=ke.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=ke.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=Aa(),ke.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 Zi(e,t){return typeof t=="function"?t(e):t}function Ta(e){var t=bt();return vo(t,rt,e)}function vo(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,Q=t,ce=!1;do{var he=Q.lane&-536870913;if(he!==Q.lane?(Ge&he)===he:(Xi&he)===he){var te=Q.revertLane;if(te===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),he===Cr&&(ce=!0);else if((Xi&te)===te){Q=Q.next,te===Cr&&(ce=!0);continue}else he={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},I===null?(M=I=he,S=n):I=I.next=he,ke.lanes|=te,Es|=te;he=Q.action,er&&i(n,he),n=Q.hasEagerState?Q.eagerState:i(n,he)}else te={lane:he,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},I===null?(M=I=te,S=n):I=I.next=te,ke.lanes|=he,Es|=he;Q=Q.next}while(Q!==null&&Q!==t);if(I===null?S=n:I.next=M,!ai(n,e.memoizedState)&&(Dt=!0,ce&&(i=wr,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 mo(e){var t=bt(),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);ai(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=ke,r=bt(),n=Fe;if(n){if(i===void 0)throw Error(j(407));i=i()}else i=t();var S=!ai((rt||r).memoizedState,i);if(S&&(r.memoizedState=i,Dt=!0),r=r.queue,So(Pu.bind(null,s,r,e),[e]),r.getSnapshot!==t||S||At!==null&&At.memoizedState.tag&1){if(s.flags|=2048,Rr(9,{destroy:void 0},Iu.bind(null,s,r,i,t),null),lt===null)throw Error(j(349));n||(Xi&127)!==0||qu(s,t,i)}return i}function qu(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=ke.updateQueue,t===null?(t=Aa(),ke.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!ai(e,i)}catch{return!0}}function Wu(e){var t=Fs(e,2);t!==null&&ti(t,e,2)}function po(e){var t=Vt();if(typeof e=="function"){var i=e;if(e=i(),er){ii(!0);try{i()}finally{ii(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zi,lastRenderedState:e},t}function Fu(e,t,i,s){return e.baseState=i,vo(e,rt,typeof s=="function"?s:Zi)}function rv(e,t,i,s,r){if(La(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(Q){go(e,t,Q)}finally{n!==null&&S.types!==null&&(n.types=S.types),q.T=n}}else try{n=i(r,s),Yu(e,t,n)}catch(Q){go(e,t,Q)}}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 go(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 go(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(Fe){var i=lt.formState;if(i!==null){e:{var s=ke;if(Fe){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}}vs(s)}s=!1}s&&(t=i[0])}}return i=Vt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xu,lastRenderedState:t},i.queue=s,i=mh.bind(null,ke,s),s.dispatch=i,s=po(!1),n=Eo.bind(null,ke,!1,s.queue),s=Vt(),r={state:t,dispatch:null,action:e,pending:null},s.queue=r,i=rv.bind(null,ke,r,n,i),r.dispatch=i,s.memoizedState=e,[t,i,!1]}function Qu(e){var t=bt();return Ju(t,rt,e)}function Ju(e,t,i){if(t=vo(e,t,Xu)[0],e=Ta(Zi)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=wn(t)}catch(S){throw S===Er?ga:S}else s=t;t=bt();var r=t.queue,n=r.dispatch;return i!==t.memoizedState&&(ke.flags|=2048,Rr(9,{destroy:void 0},nv.bind(null,r,i),null)),[s,n,e]}function nv(e,t){e.action=t}function eh(e){var t=bt(),i=rt;if(i!==null)return Ju(t,i,e);bt(),t=t.memoizedState,i=bt();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Rr(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=ke.updateQueue,t===null&&(t=Aa(),ke.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 bt().memoizedState}function Ra(e,t,i,s){var r=Vt();ke.flags|=e,r.memoizedState=Rr(1|t,{destroy:void 0},i,s===void 0?null:s)}function Ma(e,t,i,s){var r=bt();s=s===void 0?null:s;var n=r.memoizedState.inst;rt!==null&&s!==null&&oo(s,rt.memoizedState.deps)?r.memoizedState=Rr(t,n,i,s):(ke.flags|=e,r.memoizedState=Rr(1|t,n,i,s))}function ih(e,t){Ra(8390656,8,e,t)}function So(e,t){Ma(2048,8,e,t)}function av(e){ke.flags|=4;var t=ke.updateQueue;if(t===null)t=Aa(),ke.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function sh(e){var t=bt().memoizedState;return av({ref:t,nextImpl:e}),function(){if((Je&2)!==0)throw Error(j(440));return t.impl.apply(void 0,arguments)}}function rh(e,t){return Ma(4,2,e,t)}function nh(e,t){return Ma(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,Ma(4,4,ah.bind(null,t,e),i)}function bo(){}function oh(e,t){var i=bt();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&oo(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function ch(e,t){var i=bt();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&oo(t,s[1]))return s[0];if(s=e(),er){ii(!0);try{e()}finally{ii(!1)}}return i.memoizedState=[s,t],s}function yo(e,t,i){return i===void 0||(Xi&1073741824)!==0&&(Ge&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=hf(),ke.lanes|=e,Es|=e,i)}function uh(e,t,i,s){return ai(i,t)?i:Ar.current!==null?(e=yo(e,i,s),ai(e,t)||(Dt=!0),e):(Xi&42)===0||(Xi&1073741824)!==0&&(Ge&261930)===0?(Dt=!0,e.memoizedState=i):(e=hf(),ke.lanes|=e,Es|=e,t)}function hh(e,t,i,s,r){var n=$.p;$.p=n!==0&&8>n?n:8;var S=q.T,M={};q.T=M,Eo(e,!1,t,i);try{var I=r(),Q=q.S;if(Q!==null&&Q(M,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ce=tv(I,s);En(e,t,ce,fi(e))}else En(e,t,s,fi(e))}catch(he){En(e,t,{then:function(){},status:"rejected",reason:he},fi())}finally{$.p=n,S!==null&&M.types!==null&&(S.types=M.types),q.T=S}}function lv(){}function Co(e,t,i,s){if(e.tag!==5)throw Error(j(476));var r=fh(e).queue;hh(e,r,t,ie,i===null?lv:function(){return dh(e),i(s)})}function fh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zi,lastRenderedState:ie},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zi,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,{},fi())}function wo(){return It(In)}function _h(){return bt().memoizedState}function vh(){return bt().memoizedState}function ov(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=fi();e=gs(i);var s=Ss(t,e,i);s!==null&&(ti(s,t,i),Sn(s,t,i)),t={cache:Zl()},e.payload=t;return}t=t.return}}function cv(e,t,i){var s=fi();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},La(e)?ph(t,i):(i=ql(e,t,i,s),i!==null&&(ti(i,e,s),gh(i,t,s)))}function mh(e,t,i){var s=fi();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(La(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,ai(M,S))return ha(e,t,r,0),lt===null&&ua(),!1}catch{}if(i=ql(e,t,r,s),i!==null)return ti(i,e,s),gh(i,t,s),!0}return!1}function Eo(e,t,i,s){if(s={lane:2,revertLane:ic(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},La(e)){if(t)throw Error(j(479))}else t=ql(e,i,s,2),t!==null&&ti(t,e,2)}function La(e){var t=e.alternate;return e===ke||t!==null&&t===ke}function ph(e,t){Dr=Ea=!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,ri(e,i)}}var xn={readContext:It,use:Da,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useLayoutEffect:pt,useInsertionEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useSyncExternalStore:pt,useId:pt,useHostTransitionStatus:pt,useFormState:pt,useActionState:pt,useOptimistic:pt,useMemoCache:pt,useCacheRefresh:pt};xn.useEffectEvent=pt;var Sh={readContext:It,use:Da,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:It,useEffect:ih,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,Ra(4194308,4,ah.bind(null,t,e),i)},useLayoutEffect:function(e,t){return Ra(4194308,4,e,t)},useInsertionEffect:function(e,t){Ra(4,2,e,t)},useMemo:function(e,t){var i=Vt();t=t===void 0?null:t;var s=e();if(er){ii(!0);try{e()}finally{ii(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Vt();if(i!==void 0){var r=i(t);if(er){ii(!0);try{i(t)}finally{ii(!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=cv.bind(null,ke,e),[s.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:function(e){e=po(e);var t=e.queue,i=mh.bind(null,ke,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:bo,useDeferredValue:function(e,t){var i=Vt();return yo(i,e,t)},useTransition:function(){var e=po(!1);return e=hh.bind(null,ke,e.queue,!0,!1),Vt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=ke,r=Vt();if(Fe){if(i===void 0)throw Error(j(407));i=i()}else{if(i=t(),lt===null)throw Error(j(349));(Ge&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,Rr(9,{destroy:void 0},Iu.bind(null,s,n,i,t),null),i},useId:function(){var e=Vt(),t=lt.identifierPrefix;if(Fe){var i=Ni,s=Hi;i=(s&~(1<<32-Ct(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=xa++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=iv++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:wo,useFormState:Zu,useActionState:Zu,useOptimistic:function(e){var t=Vt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Eo.bind(null,ke,!0,i),i.dispatch=t,[e,t]},useMemoCache:_o,useCacheRefresh:function(){return Vt().memoizedState=ov.bind(null,ke)},useEffectEvent:function(e){var t=Vt(),i={impl:e};return t.memoizedState=i,function(){if((Je&2)!==0)throw Error(j(440));return i.impl.apply(void 0,arguments)}}},xo={readContext:It,use:Da,useCallback:oh,useContext:It,useEffect:So,useImperativeHandle:lh,useInsertionEffect:rh,useLayoutEffect:nh,useMemo:ch,useReducer:Ta,useRef:th,useState:function(){return Ta(Zi)},useDebugValue:bo,useDeferredValue:function(e,t){var i=bt();return uh(i,rt.memoizedState,e,t)},useTransition:function(){var e=Ta(Zi)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:wn(e),t]},useSyncExternalStore:Uu,useId:_h,useHostTransitionStatus:wo,useFormState:Qu,useActionState:Qu,useOptimistic:function(e,t){var i=bt();return Fu(i,rt,e,t)},useMemoCache:_o,useCacheRefresh:vh};xo.useEffectEvent=sh;var bh={readContext:It,use:Da,useCallback:oh,useContext:It,useEffect:So,useImperativeHandle:lh,useInsertionEffect:rh,useLayoutEffect:nh,useMemo:ch,useReducer:mo,useRef:th,useState:function(){return mo(Zi)},useDebugValue:bo,useDeferredValue:function(e,t){var i=bt();return rt===null?yo(i,e,t):uh(i,rt.memoizedState,e,t)},useTransition:function(){var e=mo(Zi)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:wn(e),t]},useSyncExternalStore:Uu,useId:_h,useHostTransitionStatus:wo,useFormState:eh,useActionState:eh,useOptimistic:function(e,t){var i=bt();return rt!==null?Fu(i,rt,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:_o,useCacheRefresh:vh};bh.useEffectEvent=sh;function Ao(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 Do={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=fi(),r=gs(s);r.payload=t,i!=null&&(r.callback=i),t=Ss(e,r,s),t!==null&&(ti(t,e,s),Sn(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=fi(),r=gs(s);r.tag=1,r.payload=t,i!=null&&(r.callback=i),t=Ss(e,r,s),t!==null&&(ti(t,e,s),Sn(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=fi(),s=gs(i);s.tag=2,t!=null&&(s.callback=t),t=Ss(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&&Do.enqueueReplaceState(t,t.state,null)}function tr(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){ca(e)}function Eh(e){console.error(e)}function xh(e){ca(e)}function ka(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 To(e,t,i){return i=gs(i),i.tag=3,i.payload={element:null},i.callback=function(){ka(e,t)},i}function Dh(e){return e=gs(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"&&(xs===null?xs=new Set([this]):xs.add(this));var M=s.stack;this.componentDidCatch(s.value,{componentStack:M!==null?M:""})})}function uv(e,t,i,s,r){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&yr(t,i,r,!0),i=oi.current,i!==null){switch(i.tag){case 31:case 13:return wi===null?Wa():i.alternate===null&>===0&&(gt=3),i.flags&=-257,i.flags|=65536,i.lanes=r,s===Sa?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),Jo(e,s,r)),!1;case 22:return i.flags|=65536,s===Sa?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)),Jo(e,s,r)),!1}throw Error(j(435,i.tag))}return Jo(e,s,r),Wa(),!1}if(Fe)return t=oi.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=r,s!==Kl&&(e=Error(j(422),{cause:s}),_n(Si(e,i)))):(s!==Kl&&(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=To(e.stateNode,s,r),so(e,r),gt!==4&&(gt=2)),!1;var n=Error(j(520),{cause:s});if(n=Si(n,i),On===null?On=[n]:On.push(n),gt!==4&&(gt=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=To(i.stateNode,s,e),so(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"&&(xs===null||!xs.has(n))))return i.flags|=65536,r&=-r,i.lanes|=r,r=Dh(r),Th(r,e,i,s),so(i,r),!1}i=i.return}while(i!==null);return!1}var Ro=Error(j(461)),Dt=!1;function Pt(e,t,i,s){t.child=e===null?ku(t,null,i,s):Js(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 $s(t),s=co(e,t,i,S,n,r),M=uo(),e!==null&&!Dt?(ho(e,t,r),Qi(e,t,r)):(Fe&&M&&Wl(t),t.flags|=1,Pt(e,t,s,r),t.child)}function Mh(e,t,i,s,r){if(e===null){var n=i.type;return typeof n=="function"&&!Il(n)&&n.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=n,Lh(e,t,n,s,r)):(e=da(i.type,null,s,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(n=e.child,!No(e,r)){var S=n.memoizedProps;if(i=i.compare,i=i!==null?i:hn,i(S,s)&&e.ref===t.ref)return Qi(e,t,r)}return t.flags|=1,e=Ki(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,No(e,r))(e.flags&131072)!==0&&(Dt=!0);else return t.lanes=e.lanes,Qi(e,t,r)}return Mo(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&&pa(t,n!==null?n.cachePool:null),n!==null?ju(t,n):no(),Hu(t);else return s=t.lanes=536870912,Oh(e,t,n!==null?n.baseLanes|i:i,i,s)}else n!==null?(pa(t,n.cachePool),ju(t,n),ys(),t.memoizedState=null):(e!==null&&pa(t,null),no(),ys());return Pt(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=Jl();return n=n===null?null:{parent:xt._currentValue,pool:n},t.memoizedState={baseLanes:i,cachePool:n},e!==null&&pa(t,null),no(),Hu(t),e!==null&&yr(e,t,s,!0),t.childLanes=r,null}function Oa(e,t){return t=ja({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 Js(t,e.child,null,i),e=Oa(t,t.pendingProps),e.flags|=2,ci(t),t.memoizedState=null,e}function hv(e,t,i){var s=t.pendingProps,r=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Fe){if(s.mode==="hidden")return e=Oa(t,s),t.lanes=536870912,An(null,e);if(lo(t),(e=ut)?(e=Yf(e,Ci),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ds!==null?{id:Hi,overflow:Ni}:null,retryLane:536870912,hydrationErrors:null},i=pu(e),i.return=t,t.child=i,qt=t,ut=null)):e=null,e===null)throw vs(t);return t.lanes=536870912,null}return Oa(t,s)}var n=e.memoizedState;if(n!==null){var S=n.dehydrated;if(lo(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||yr(e,t,i,!1),r=(i&e.childLanes)!==0,Dt||r){if(s=lt,s!==null&&(S=$r(s,i),S!==0&&S!==n.retryLane))throw n.retryLane=S,Fs(e,S),ti(s,e,S),Ro;Wa(),t=Bh(e,t,i)}else e=n.treeContext,ut=Ei(S.nextSibling),qt=t,Fe=!0,_s=null,Ci=!1,e!==null&&bu(t,e),t=Oa(t,s),t.flags|=4096;return t}return e=Ki(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ba(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 Mo(e,t,i,s,r){return $s(t),i=co(e,t,i,s,void 0,r),s=uo(),e!==null&&!Dt?(ho(e,t,r),Qi(e,t,r)):(Fe&&s&&Wl(t),t.flags|=1,Pt(e,t,i,r),t.child)}function jh(e,t,i,s,r,n){return $s(t),t.updateQueue=null,i=zu(t,s,i,r),Nu(e),s=uo(),e!==null&&!Dt?(ho(e,t,n),Qi(e,t,n)):(Fe&&s&&Wl(t),t.flags|=1,Pt(e,t,i,n),t.child)}function Hh(e,t,i,s,r){if($s(t),t.stateNode===null){var n=pr,S=i.contextType;typeof S=="object"&&S!==null&&(n=It(S)),n=new i(s,n),t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,n.updater=Do,t.stateNode=n,n._reactInternals=t,n=t.stateNode,n.props=s,n.state=t.memoizedState,n.refs={},to(t),S=i.contextType,n.context=typeof S=="object"&&S!==null?It(S):pr,n.state=t.memoizedState,S=i.getDerivedStateFromProps,typeof S=="function"&&(Ao(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&&Do.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=tr(i,M);n.props=I;var Q=n.context,ce=i.contextType;S=pr,typeof ce=="object"&&ce!==null&&(S=It(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||Q!==S)&&Ch(t,n,s,S),ps=!1;var te=t.memoizedState;n.state=te,yn(t,s,n,r),bn(),Q=t.memoizedState,M||te!==Q||ps?(typeof he=="function"&&(Ao(t,i,he,s),Q=t.memoizedState),(I=ps||yh(t,i,I,s,te,Q,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=Q),n.props=s,n.state=Q,n.context=S,s=I):(typeof n.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{n=t.stateNode,io(e,t),S=t.memoizedProps,ce=tr(i,S),n.props=ce,he=t.pendingProps,te=n.context,Q=i.contextType,I=pr,typeof Q=="object"&&Q!==null&&(I=It(Q)),M=i.getDerivedStateFromProps,(Q=typeof M=="function"||typeof n.getSnapshotBeforeUpdate=="function")||typeof n.UNSAFE_componentWillReceiveProps!="function"&&typeof n.componentWillReceiveProps!="function"||(S!==he||te!==I)&&Ch(t,n,s,I),ps=!1,te=t.memoizedState,n.state=te,yn(t,s,n,r),bn();var ne=t.memoizedState;S!==he||te!==ne||ps||e!==null&&e.dependencies!==null&&va(e.dependencies)?(typeof M=="function"&&(Ao(t,i,M,s),ne=t.memoizedState),(ce=ps||yh(t,i,ce,s,te,ne,I)||e!==null&&e.dependencies!==null&&va(e.dependencies))?(Q||typeof n.UNSAFE_componentWillUpdate!="function"&&typeof n.componentWillUpdate!="function"||(typeof n.componentWillUpdate=="function"&&n.componentWillUpdate(s,ne,I),typeof n.UNSAFE_componentWillUpdate=="function"&&n.UNSAFE_componentWillUpdate(s,ne,I)),typeof n.componentDidUpdate=="function"&&(t.flags|=4),typeof n.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof n.componentDidUpdate!="function"||S===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ne),n.props=s,n.state=ne,n.context=I,s=ce):(typeof n.componentDidUpdate!="function"||S===e.memoizedProps&&te===e.memoizedState||(t.flags|=4),typeof n.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&te===e.memoizedState||(t.flags|=1024),s=!1)}return n=s,Ba(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=Js(t,e.child,null,r),t.child=Js(t,null,i,r)):Pt(e,t,i,r),t.memoizedState=n.state,e=t.child):e=Qi(e,t,r),e}function Nh(e,t,i,s){return Ys(),t.flags|=256,Pt(e,t,i,s),t.child}var Lo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ko(e){return{baseLanes:e,cachePool:Au()}}function Oo(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=hi),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:(St.current&2)!==0),S&&(r=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(Fe){if(r?bs(t):ys(),(e=ut)?(e=Yf(e,Ci),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ds!==null?{id:Hi,overflow:Ni}:null,retryLane:536870912,hydrationErrors:null},i=pu(e),i.return=t,t.child=i,qt=t,ut=null)):e=null,e===null)throw vs(t);return vc(e)?t.lanes=32:t.lanes=536870912,null}var M=s.children;return s=s.fallback,r?(ys(),r=t.mode,M=ja({mode:"hidden",children:M},r),s=Ks(s,r,i,null),M.return=t,s.return=t,M.sibling=s,t.child=M,s=t.child,s.memoizedState=ko(i),s.childLanes=Oo(e,S,i),t.memoizedState=Lo,An(null,s)):(bs(t),Bo(t,M))}var I=e.memoizedState;if(I!==null&&(M=I.dehydrated,M!==null)){if(n)t.flags&256?(bs(t),t.flags&=-257,t=jo(e,t,i)):t.memoizedState!==null?(ys(),t.child=e.child,t.flags|=128,t=null):(ys(),M=s.fallback,r=t.mode,s=ja({mode:"visible",children:s.children},r),M=Ks(M,r,i,null),M.flags|=2,s.return=t,M.return=t,s.sibling=M,t.child=s,Js(t,e.child,null,i),s=t.child,s.memoizedState=ko(i),s.childLanes=Oo(e,S,i),t.memoizedState=Lo,t=An(null,s));else if(bs(t),vc(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var Q=S.dgst;S=Q,s=Error(j(419)),s.stack="",s.digest=S,_n({value:s,source:null,stack:null}),t=jo(e,t,i)}else if(Dt||yr(e,t,i,!1),S=(i&e.childLanes)!==0,Dt||S){if(S=lt,S!==null&&(s=$r(S,i),s!==0&&s!==I.retryLane))throw I.retryLane=s,Fs(e,s),ti(S,e,s),Ro;_c(M)||Wa(),t=jo(e,t,i)}else _c(M)?(t.flags|=192,t.child=e.child,t=null):(e=I.treeContext,ut=Ei(M.nextSibling),qt=t,Fe=!0,_s=null,Ci=!1,e!==null&&bu(t,e),t=Bo(t,s.children),t.flags|=4096);return t}return r?(ys(),M=s.fallback,r=t.mode,I=e.child,Q=I.sibling,s=Ki(I,{mode:"hidden",children:s.children}),s.subtreeFlags=I.subtreeFlags&65011712,Q!==null?M=Ki(Q,M):(M=Ks(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=ko(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=Oo(e,S,i),t.memoizedState=Lo,An(e.child,s)):(bs(t),i=e.child,e=i.sibling,i=Ki(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 Bo(e,t){return t=ja({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ja(e,t){return e=li(22,e,null,t),e.lanes=0,e}function jo(e,t,i){return Js(t,e.child,null,i),e=Bo(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),$l(e.return,t,i)}function Ho(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=St.current,M=(S&2)!==0;if(M?(S=S&1|2,t.flags|=128):S&=1,K(St,S),Pt(e,t,s,i),s=Fe?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&&wa(e)===null&&(r=i),i=i.sibling;i=r,i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),Ho(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&&wa(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}Ho(t,!0,i,null,n,s);break;case"together":Ho(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Qi(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Es|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(yr(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=Ki(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Ki(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function No(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&va(e)))}function fv(e,t,i){switch(t.tag){case 3:k(t,t.stateNode.containerInfo),ms(t,xt,e.memoizedState.cache),Ys();break;case 27:case 5:fe(t);break;case 4:k(t,t.stateNode.containerInfo);break;case 10:ms(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lo(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(bs(t),t.flags|=128,null):(i&t.child.childLanes)!==0?zh(e,t,i):(bs(t),e=Qi(e,t,i),e!==null?e.sibling:null);bs(t);break;case 19:var r=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(yr(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(St,St.current),s)break;return null;case 22:return t.lanes=0,kh(e,t,i,t.pendingProps);case 24:ms(t,xt,e.memoizedState.cache)}return Qi(e,t,i)}function Ih(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)Dt=!0;else{if(!No(e,i)&&(t.flags&128)===0)return Dt=!1,fv(e,t,i);Dt=(e.flags&131072)!==0}else Dt=!1,Fe&&(t.flags&1048576)!==0&&Su(t,dn,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=Zs(t.elementType),t.type=e,typeof e=="function")Il(e)?(s=tr(e,s),t.tag=1,t=Hh(null,t,e,s,i)):(t.tag=0,t=Mo(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=ee(e)||e,Error(j(306,t,""))}}return t;case 0:return Mo(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,r=tr(s,t.pendingProps),Hh(e,t,s,r,i);case 3:e:{if(k(t,t.stateNode.containerInfo),e===null)throw Error(j(387));s=t.pendingProps;var n=t.memoizedState;r=n.element,io(e,t),yn(t,s,null,i);var S=t.memoizedState;if(s=S.cache,ms(t,xt,s),s!==n.cache&&Xl(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),qt=t,Fe=!0,_s=null,Ci=!0,i=ku(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ys(),s===r){t=Qi(e,t,i);break e}Pt(e,t,s,i)}t=t.child}return t;case 26:return Ba(e,t),e===null?(i=Jf(t.type,null,t.pendingProps,null))?t.memoizedState=i:Fe||(i=t.type,e=t.pendingProps,s=Za(pe.current).createElement(i),s[wt]=t,s[Rt]=e,Gt(s,i,e),Et(s),t.stateNode=s):t.memoizedState=Jf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return fe(t),e===null&&Fe&&(s=t.stateNode=Xf(t.type,t.pendingProps,pe.current),qt=t,Ci=!0,r=ut,Rs(t.type)?(mc=r,ut=Ei(s.firstChild)):ut=r),Pt(e,t,t.pendingProps.children,i),Ba(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Fe&&((r=s=ut)&&(s=Pv(s,t.type,t.pendingProps,Ci),s!==null?(t.stateNode=s,qt=t,ut=Ei(s.firstChild),Ci=!1,r=!0):r=!1),r||vs(t)),fe(t),r=t.type,n=t.pendingProps,S=e!==null?e.memoizedProps:null,s=n.children,hc(r,n)?s=null:S!==null&&hc(r,S)&&(t.flags|=32),t.memoizedState!==null&&(r=co(e,t,sv,null,null,i),In._currentValue=r),Ba(e,t),Pt(e,t,s,i),t.child;case 6:return e===null&&Fe&&((e=i=ut)&&(i=Gv(i,t.pendingProps,Ci),i!==null?(t.stateNode=i,qt=t,ut=null,e=!0):e=!1),e||vs(t)),null;case 13:return zh(e,t,i);case 4:return k(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=Js(t,null,s,i):Pt(e,t,s,i),t.child;case 11:return Rh(e,t,t.type,t.pendingProps,i);case 7:return Pt(e,t,t.pendingProps,i),t.child;case 8:return Pt(e,t,t.pendingProps.children,i),t.child;case 12:return Pt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,ms(t,t.type,s.value),Pt(e,t,s.children,i),t.child;case 9:return r=t.type._context,s=t.pendingProps.children,$s(t),r=It(r),s=s(r),t.flags|=1,Pt(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 hv(e,t,i);case 22:return kh(e,t,i,t.pendingProps);case 24:return $s(t),s=It(xt),e===null?(r=Jl(),r===null&&(r=lt,n=Zl(),r.pooledCache=n,n.refCount++,n!==null&&(r.pooledCacheLanes|=i),r=n),t.memoizedState={parent:s,cache:r},to(t),ms(t,xt,r)):((e.lanes&i)!==0&&(io(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),ms(t,xt,s)):(s=n.cache,ms(t,xt,s),s!==r.cache&&Xl(t,[xt],i,!0))),Pt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(j(156,t.tag))}function Ji(e){e.flags|=4}function zo(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 Qs=Sa,eo}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 Qs=Sa,eo}function Ha(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?$n():536870912,e.lanes|=t,Or|=t)}function Dn(e,t){if(!Fe)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 dv(e,t,i){var s=t.pendingProps;switch(Fl(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),$i(xt),ae(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(br(t)?Ji(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Yl())),ht(t),null;case 26:var r=t.type,n=t.memoizedState;return e===null?(Ji(t),n!==null?(ht(t),Ph(t,n)):(ht(t),zo(t,r,null,s,i))):n?n!==e.memoizedState?(Ji(t),ht(t),Ph(t,n)):(ht(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&Ji(t),ht(t),zo(t,r,e,s,i)),null;case 27:if(be(t),i=pe.current,r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ji(t);else{if(!s){if(t.stateNode===null)throw Error(j(166));return ht(t),null}e=re.current,br(t)?yu(t):(e=Xf(r,s,i),t.stateNode=e,Ji(t))}return ht(t),null;case 5:if(be(t),r=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&Ji(t);else{if(!s){if(t.stateNode===null)throw Error(j(166));return ht(t),null}if(n=re.current,br(t))yu(t);else{var S=Za(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[wt]=t,n[Rt]=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(Gt(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&&Ji(t)}}return ht(t),zo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&Ji(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(j(166));if(e=pe.current,br(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,r=qt,r!==null)switch(r.tag){case 27:case 5:s=r.memoizedProps}e[wt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||Uf(e.nodeValue,i)),e||vs(t,!0)}else e=Za(e).createTextNode(s),e[wt]=t,t.stateNode=e}return ht(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=br(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[wt]=t}else Ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),e=!1}else i=Yl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(ci(t),t):(ci(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=br(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[wt]=t}else Ys(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ht(t),r=!1}else r=Yl(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),r=!0;if(!r)return t.flags&256?(ci(t),t):(ci(t),null)}return ci(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),Ha(t,t.updateQueue),ht(t),null);case 4:return ae(),e===null&&ac(t.stateNode.containerInfo),ht(t),null;case 10:return $i(t.type),ht(t),null;case 19:if(B(St),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(gt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(n=wa(e),n!==null){for(t.flags|=128,Dn(s,!1),e=n.updateQueue,t.updateQueue=e,Ha(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)mu(i,e),i=i.sibling;return K(St,St.current&1|2),Fe&&Yi(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&Ne()>Ia&&(t.flags|=128,r=!0,Dn(s,!1),t.lanes=4194304)}else{if(!r)if(e=wa(n),e!==null){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,Ha(t,e),Dn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!n.alternate&&!Fe)return ht(t),null}else 2*Ne()-s.renderingStartTime>Ia&&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=Ne(),e.sibling=null,i=St.current,K(St,r?i&1|2:i&1),Fe&&Yi(t,s.treeForkCount),e):(ht(t),null);case 22:case 23:return ci(t),ao(),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&&Ha(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&&B(Xs),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),$i(xt),ht(t),null;case 25:return null;case 30:return null}throw Error(j(156,t.tag))}function _v(e,t){switch(Fl(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $i(xt),ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(ci(t),t.alternate===null)throw Error(j(340));Ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ci(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(j(340));Ys()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(St),null;case 4:return ae(),null;case 10:return $i(t.type),null;case 22:case 23:return ci(t),ao(),e!==null&&B(Xs),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return $i(xt),null;case 25:return null;default:return null}}function Gh(e,t){switch(Fl(t),t.tag){case 3:$i(xt),ae();break;case 26:case 27:case 5:be(t);break;case 4:ae();break;case 31:t.memoizedState!==null&&ci(t);break;case 13:ci(t);break;case 19:B(St);break;case 10:$i(t.type);break;case 22:case 23:ci(t),ao(),e!==null&&B(Xs);break;case 24:$i(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){st(t,t.return,M)}}function Cs(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,Q=M;try{Q()}catch(ce){st(r,I,ce)}}}s=s.next}while(s!==n)}}catch(ce){st(t,t.return,ce)}}function Wh(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Bu(t,i)}catch(s){st(e,e.return,s)}}}function Fh(e,t,i){i.props=tr(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){st(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){st(e,t,r)}}function zi(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(r){st(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){st(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){st(e,e.return,r)}}function Uo(e,t,i){try{var s=e.stateNode;Hv(s,e.type,i,t),s[Rt]=t}catch(r){st(e,e.return,r)}}function Yh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Rs(e.type)||e.tag===4}function qo(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&&Rs(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 Io(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=V));else if(s!==4&&(s===27&&Rs(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(Io(e,t,i),e=e.sibling;e!==null;)Io(e,t,i),e=e.sibling}function Na(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&&Rs(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Na(e,t,i),e=e.sibling;e!==null;)Na(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]);Gt(t,s,i),t[wt]=e,t[Rt]=i}catch(n){st(e,e.return,n)}}var es=!1,Tt=!1,Po=!1,$h=typeof WeakSet=="function"?WeakSet:Set,Bt=null;function vv(e,t){if(e=e.containerInfo,cc=rl,e=lu(e),Bl(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,Q=0,ce=0,he=e,te=null;t:for(;;){for(var ne;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),(ne=he.firstChild)!==null;)te=he,he=ne;for(;;){if(he===e)break t;if(te===i&&++Q===r&&(M=S),te===n&&++ce===s&&(I=S),(ne=he.nextSibling)!==null)break;he=te,te=he.parentNode}he=ne}i=M===-1||I===-1?null:{start:M,end:I}}else i=null}i=i||{start:0,end:0}}else i=null;for(uc={focusedElem:e,selectionRange:i},rl=!1,Bt=t;Bt!==null;)if(t=Bt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Bt=e;else for(;Bt!==null;){switch(t=Bt,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 Ce=tr(i.type,r);e=s.getSnapshotBeforeUpdate(Ce,n),s.__reactInternalSnapshotBeforeUpdate=e}catch(Te){st(i,i.return,Te)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)dc(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":dc(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,Bt=e;break}Bt=t.return}}function Xh(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:is(e,i),s&4&&Tn(5,i);break;case 1:if(is(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(S){st(i,i.return,S)}else{var r=tr(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){st(i,i.return,S)}}s&64&&Wh(i),s&512&&Rn(i,i.return);break;case 3:if(is(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){st(i,i.return,S)}}break;case 27:t===null&&s&4&&Vh(i);case 26:case 5:is(e,i),t===null&&s&4&&Kh(i),s&512&&Rn(i,i.return);break;case 12:is(e,i);break;case 31:is(e,i),s&4&&Jh(e,i);break;case 13:is(e,i),s&4&&ef(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=Ev.bind(null,i),Wv(e,i))));break;case 22:if(s=i.memoizedState!==null||es,!s){t=t!==null&&t.memoizedState!==null||Tt,r=es;var n=Tt;es=s,(Tt=t)&&!n?ss(e,i,(i.subtreeFlags&8772)!==0):is(e,i),es=r,Tt=n}break;case 30:break;default:is(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&&Zr(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 dt=null,Zt=!1;function ts(e,t,i){for(i=i.child;i!==null;)Qh(e,t,i),i=i.sibling}function Qh(e,t,i){if(Wt&&typeof Wt.onCommitFiberUnmount=="function")try{Wt.onCommitFiberUnmount(Ai,i)}catch{}switch(i.tag){case 26:Tt||zi(i,t),ts(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:Tt||zi(i,t);var s=dt,r=Zt;Rs(i.type)&&(dt=i.stateNode,Zt=!1),ts(e,t,i),zn(i.stateNode),dt=s,Zt=r;break;case 5:Tt||zi(i,t);case 6:if(s=dt,r=Zt,dt=null,ts(e,t,i),dt=s,Zt=r,dt!==null)if(Zt)try{(dt.nodeType===9?dt.body:dt.nodeName==="HTML"?dt.ownerDocument.body:dt).removeChild(i.stateNode)}catch(n){st(i,t,n)}else try{dt.removeChild(i.stateNode)}catch(n){st(i,t,n)}break;case 18:dt!==null&&(Zt?(e=dt,Ff(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Ir(e)):Ff(dt,i.stateNode));break;case 4:s=dt,r=Zt,dt=i.stateNode.containerInfo,Zt=!0,ts(e,t,i),dt=s,Zt=r;break;case 0:case 11:case 14:case 15:Cs(2,i,t),Tt||Cs(4,i,t),ts(e,t,i);break;case 1:Tt||(zi(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&Fh(i,t,s)),ts(e,t,i);break;case 21:ts(e,t,i);break;case 22:Tt=(s=Tt)||i.memoizedState!==null,ts(e,t,i),Tt=s;break;default:ts(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{Ir(e)}catch(i){st(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{Ir(e)}catch(i){st(t,t.return,i)}}function mv(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 za(e,t){var i=mv(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var r=xv.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(Rs(M.type)){dt=M.stateNode,Zt=!1;break e}break;case 5:dt=M.stateNode,Zt=!1;break e;case 3:case 4:dt=M.stateNode.containerInfo,Zt=!0;break e}M=M.return}if(dt===null)throw Error(j(160));Qh(n,S,r),dt=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 Li=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&&(Cs(3,e,e.return),Tn(3,e),Cs(5,e,e.return));break;case 1:Qt(t,e),Jt(e),s&512&&(Tt||i===null||zi(i,i.return)),s&64&&es&&(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=Li;if(Qt(t,e),Jt(e),s&512&&(Tt||i===null||zi(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[zs]||n[wt]||n.namespaceURI==="http://www.w3.org/2000/svg"||n.hasAttribute("itemprop"))&&(n=r.createElement(s),r.head.insertBefore(n,r.querySelector("head > title"))),Gt(n,s,i),n[wt]=e,Et(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),Gt(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),Gt(n,s,i),r.head.appendChild(n);break;default:throw Error(j(468,s))}n[wt]=e,Et(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&&Uo(e,e.memoizedProps,i.memoizedProps)}break;case 27:Qt(t,e),Jt(e),s&512&&(Tt||i===null||zi(i,i.return)),i!==null&&s&4&&Uo(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Qt(t,e),Jt(e),s&512&&(Tt||i===null||zi(i,i.return)),e.flags&32){r=e.stateNode;try{mi(r,"")}catch(Ce){st(e,e.return,Ce)}}s&4&&e.stateNode!=null&&(r=e.memoizedProps,Uo(e,r,i!==null?i.memoizedProps:r)),s&1024&&(Po=!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(Ce){st(e,e.return,Ce)}}break;case 3:if(el=null,r=Li,Li=Qa(t.containerInfo),Qt(t,e),Li=r,Jt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Ir(t.containerInfo)}catch(Ce){st(e,e.return,Ce)}Po&&(Po=!1,sf(e));break;case 4:s=Li,Li=Qa(e.stateNode.containerInfo),Qt(t,e),Jt(e),Li=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,za(e,s)));break;case 13:Qt(t,e),Jt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(qa=Ne()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,za(e,s)));break;case 22:r=e.memoizedState!==null;var I=i!==null&&i.memoizedState!==null,Q=es,ce=Tt;if(es=Q||r,Tt=ce||I,Qt(t,e),Tt=ce,es=Q,Jt(e),s&8192)e:for(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,r&&(i===null||I||es||Tt||ir(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,te=he!=null&&he.hasOwnProperty("display")?he.display:null;M.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(Ce){st(I,I.return,Ce)}}}else if(t.tag===6){if(i===null){I=t;try{I.stateNode.nodeValue=r?"":I.memoizedProps}catch(Ce){st(I,I.return,Ce)}}}else if(t.tag===18){if(i===null){I=t;try{var ne=I.stateNode;r?Kf(ne,!0):Kf(I.stateNode,!1)}catch(Ce){st(I,I.return,Ce)}}}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,za(e,i))));break;case 19:Qt(t,e),Jt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,za(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=qo(e);Na(e,n,r);break;case 5:var S=i.stateNode;i.flags&32&&(mi(S,""),i.flags&=-33);var M=qo(e);Na(e,M,S);break;case 3:case 4:var I=i.stateNode.containerInfo,Q=qo(e);Io(e,Q,I);break;default:throw Error(j(161))}}catch(ce){st(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 is(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Xh(e,t.alternate,t),t=t.sibling}function ir(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Cs(4,t,t.return),ir(t);break;case 1:zi(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&Fh(t,t.return,i),ir(t);break;case 27:zn(t.stateNode);case 26:case 5:zi(t,t.return),ir(t);break;case 22:t.memoizedState===null&&ir(t);break;case 30:ir(t);break;default:ir(t)}e=e.sibling}}function ss(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:ss(r,n,i),Tn(4,n);break;case 1:if(ss(r,n,i),s=n,r=s.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(Q){st(s,s.return,Q)}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(Q){st(s,s.return,Q)}}i&&S&64&&Wh(n),Rn(n,n.return);break;case 27:Vh(n);case 26:case 5:ss(r,n,i),i&&s===null&&S&4&&Kh(n),Rn(n,n.return);break;case 12:ss(r,n,i);break;case 31:ss(r,n,i),i&&S&4&&Jh(r,n);break;case 13:ss(r,n,i),i&&S&4&&ef(r,n);break;case 22:n.memoizedState===null&&ss(r,n,i),Rn(n,n.return);break;case 30:break;default:ss(r,n,i)}t=t.sibling}}function Go(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 Wo(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 ki(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:ki(e,t,i,s),r&2048&&Tn(9,t);break;case 1:ki(e,t,i,s);break;case 3:ki(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){ki(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){st(t,t.return,I)}}else ki(e,t,i,s);break;case 31:ki(e,t,i,s);break;case 13:ki(e,t,i,s);break;case 23:break;case 22:n=t.stateNode,S=t.alternate,t.memoizedState!==null?n._visibility&2?ki(e,t,i,s):Mn(e,t):n._visibility&2?ki(e,t,i,s):(n._visibility|=2,Mr(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),r&2048&&Go(S,t);break;case 24:ki(e,t,i,s),r&2048&&Wo(t.alternate,t);break;default:ki(e,t,i,s)}}function Mr(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,Q=S.flags;switch(S.tag){case 0:case 11:case 15:Mr(n,S,M,I,r),Tn(8,S);break;case 23:break;case 22:var ce=S.stateNode;S.memoizedState!==null?ce._visibility&2?Mr(n,S,M,I,r):Mn(n,S):(ce._visibility|=2,Mr(n,S,M,I,r)),r&&Q&2048&&Go(S.alternate,S);break;case 24:Mr(n,S,M,I,r),r&&Q&2048&&Wo(S.alternate,S);break;default:Mr(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&&Go(s.alternate,s);break;case 24:Mn(i,s),r&2048&&Wo(s.alternate,s);break;default:Mn(i,s)}t=t.sibling}}var Ln=8192;function Lr(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:Lr(e,t,i),e.flags&Ln&&e.memoizedState!==null&&im(i,Li,e.memoizedState,e.memoizedProps);break;case 5:Lr(e,t,i);break;case 3:case 4:var s=Li;Li=Qa(e.stateNode.containerInfo),Lr(e,t,i),Li=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Ln,Ln=16777216,Lr(e,t,i),Ln=s):Lr(e,t,i));break;default:Lr(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];Bt=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&&Cs(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,Ua(e)):kn(e);break;default:kn(e)}}function Ua(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];Bt=s,of(s,e)}af(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Cs(8,t,t.return),Ua(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Ua(t));break;default:Ua(t)}e=e.sibling}}function of(e,t){for(;Bt!==null;){var i=Bt;switch(i.tag){case 0:case 11:case 15:Cs(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,Bt=s;else e:for(i=e;Bt!==null;){s=Bt;var r=s.sibling,n=s.return;if(Zh(s),s===i){Bt=null;break e}if(r!==null){r.return=n,Bt=r;break e}Bt=n}}}var pv={getCacheForType:function(e){var t=It(xt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return It(xt).controller.signal}},gv=typeof WeakMap=="function"?WeakMap:Map,Je=0,lt=null,Ie=null,Ge=0,it=0,ui=null,ws=!1,kr=!1,Fo=!1,rs=0,gt=0,Es=0,sr=0,Ko=0,hi=0,Or=0,On=null,ei=null,Yo=!1,qa=0,cf=0,Ia=1/0,Pa=null,xs=null,kt=0,As=null,Br=null,ns=0,Vo=0,$o=null,uf=null,Bn=0,Xo=null;function fi(){return(Je&2)!==0&&Ge!==0?Ge&-Ge:q.T!==null?ic():et()}function hf(){if(hi===0)if((Ge&536870912)===0||Fe){var e=js;js<<=1,(js&3932160)===0&&(js=262144),hi=e}else hi=536870912;return e=oi.current,e!==null&&(e.flags|=32),hi}function ti(e,t,i){(e===lt&&(it===2||it===9)||e.cancelPendingCommit!==null)&&(jr(e,0),Ds(e,Ge,hi,!1)),Ns(e,i),((Je&2)===0||e!==lt)&&(e===lt&&((Je&2)===0&&(sr|=i),gt===4&&Ds(e,Ge,hi,!1)),Ui(e))}function ff(e,t,i){if((Je&6)!==0)throw Error(j(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||Hs(e,t),r=s?yv(e,t):Qo(e,t,!0),n=s;do{if(r===0){kr&&!s&&Ds(e,t,0,!1);break}else{if(i=e.current.alternate,n&&!Sv(i)){r=Qo(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&&(jr(M,S).flags|=256),S=Qo(M,S,!1),S!==2){if(Fo&&!I){M.errorRecoveryDisabledLanes|=n,sr|=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){jr(e,0),Ds(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:Ds(s,t,hi,!ws);break e;case 2:ei=null;break;case 3:case 5:break;default:throw Error(j(329))}if((t&62914560)===t&&(r=qa+300-Ne(),10<r)){if(Ds(s,t,hi,!ws),si(s,0,!0)!==0)break e;ns=t,s.timeoutHandle=Gf(df.bind(null,s,i,ei,Pa,Yo,t,hi,sr,Or,ws,n,"Throttled",-0,0),r);break e}df(s,i,ei,Pa,Yo,t,hi,sr,Or,ws,n,null,-0,0)}}break}while(!0);Ui(e)}function df(e,t,i,s,r,n,S,M,I,Q,ce,he,te,ne){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:V},nf(t,n,he);var Ce=(n&62914560)===n?qa-Ne():(n&4194048)===n?cf-Ne():0;if(Ce=sm(he,Ce),Ce!==null){ns=n,e.cancelPendingCommit=Ce(yf.bind(null,e,t,n,i,s,r,S,M,I,ce,he,null,te,ne)),Ds(e,n,S,!Q);return}}yf(e,t,n,i,s,r,S,M,I)}function Sv(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(!ai(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 Ds(e,t,i,s){t&=~Ko,t&=~sr,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var r=t;0<r;){var n=31-Ct(r),S=1<<n;s[n]=-1,r&=~S}i!==0&&Xn(e,i,t)}function Ga(){return(Je&6)===0?(jn(0),!1):!0}function Zo(){if(Ie!==null){if(it===0)var e=Ie.return;else e=Ie,Vi=Vs=null,fo(e),xr=null,pn=0,e=Ie;for(;e!==null;)Gh(e.alternate,e),e=e.return;Ie=null}}function jr(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,Uv(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ns=0,Zo(),lt=e,Ie=i=Ki(e.current,null),Ge=t,it=0,ui=null,ws=!1,kr=Hs(e,t),Fo=!1,Or=hi=Ko=sr=Es=gt=0,ei=On=null,Yo=!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-Ct(s),n=1<<r;t|=e[r],s&=~n}return rs=t,ua(),i}function _f(e,t){ke=null,q.H=xn,t===Er||t===ga?(t=Ru(),it=3):t===eo?(t=Ru(),it=4):it=t===Ro?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,ui=t,Ie===null&&(gt=1,ka(e,Si(t,e.current)))}function vf(){var e=oi.current;return e===null?!0:(Ge&4194048)===Ge?wi===null:(Ge&62914560)===Ge||(Ge&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=pv,e}function Wa(){gt=4,ws||(Ge&4194048)!==Ge&&oi.current!==null||(kr=!0),(Es&134217727)===0&&(sr&134217727)===0||lt===null||Ds(lt,Ge,hi,!1)}function Qo(e,t,i){var s=Je;Je|=2;var r=mf(),n=pf();(lt!==e||Ge!==t)&&(Pa=null,jr(e,t)),t=!1;var S=gt;e:do try{if(it!==0&&Ie!==null){var M=Ie,I=ui;switch(it){case 8:Zo(),S=6;break e;case 3:case 2:case 9:case 6:oi.current===null&&(t=!0);var Q=it;if(it=0,ui=null,Hr(e,M,I,Q),i&&kr){S=0;break e}break;default:Q=it,it=0,ui=null,Hr(e,M,I,Q)}}bv(),S=gt;break}catch(ce){_f(e,ce)}while(!0);return t&&e.shellSuspendCounter++,Vi=Vs=null,Je=s,q.H=r,q.A=n,Ie===null&&(lt=null,Ge=0,ua()),S}function bv(){for(;Ie!==null;)gf(Ie)}function yv(e,t){var i=Je;Je|=2;var s=mf(),r=pf();lt!==e||Ge!==t?(Pa=null,Ia=Ne()+500,jr(e,t)):kr=Hs(e,t);e:do try{if(it!==0&&Ie!==null){t=Ie;var n=ui;t:switch(it){case 1:it=0,ui=null,Hr(e,t,n,1);break;case 2:case 9:if(Du(n)){it=0,ui=null,Sf(t);break}t=function(){it!==2&&it!==9||lt!==e||(it=7),Ui(e)},n.then(t,t);break e;case 3:it=7;break e;case 4:it=5;break e;case 7:Du(n)?(it=0,ui=null,Sf(t)):(it=0,ui=null,Hr(e,t,n,7));break;case 5:var S=null;switch(Ie.tag){case 26:S=Ie.memoizedState;case 5:case 27:var M=Ie;if(S?rd(S):M.stateNode.complete){it=0,ui=null;var I=M.sibling;if(I!==null)Ie=I;else{var Q=M.return;Q!==null?(Ie=Q,Fa(Q)):Ie=null}break t}}it=0,ui=null,Hr(e,t,n,5);break;case 6:it=0,ui=null,Hr(e,t,n,6);break;case 8:Zo(),gt=6;break e;default:throw Error(j(462))}}Cv();break}catch(ce){_f(e,ce)}while(!0);return Vi=Vs=null,q.H=s,q.A=r,Je=i,Ie!==null?0:(lt=null,Ge=0,ua(),gt)}function Cv(){for(;Ie!==null&&!Oe();)gf(Ie)}function gf(e){var t=Ih(e.alternate,e,rs);e.memoizedProps=e.pendingProps,t===null?Fa(e):Ie=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,Ge);break;case 11:t=jh(i,t,t.pendingProps,t.type.render,t.ref,Ge);break;case 5:fo(t);default:Gh(i,t),t=Ie=mu(t,rs),t=Ih(i,t,rs)}e.memoizedProps=e.pendingProps,t===null?Fa(e):Ie=t}function Hr(e,t,i,s){Vi=Vs=null,fo(t),xr=null,pn=0;var r=t.return;try{if(uv(e,r,t,i,Ge)){gt=1,ka(e,Si(i,e.current)),Ie=null;return}}catch(n){if(r!==null)throw Ie=r,n;gt=1,ka(e,Si(i,e.current)),Ie=null;return}t.flags&32768?(Fe||s===1?e=!0:kr||(Ge&536870912)!==0?e=!1:(ws=e=!0,(s===2||s===9||s===3||s===6)&&(s=oi.current,s!==null&&s.tag===13&&(s.flags|=16384))),bf(t,e)):Fa(t)}function Fa(e){var t=e;do{if((t.flags&32768)!==0){bf(t,ws);return}e=t.return;var i=dv(t.alternate,t,rs);if(i!==null){Ie=i;return}if(t=t.sibling,t!==null){Ie=t;return}Ie=t=e}while(t!==null);gt===0&&(gt=5)}function bf(e,t){do{var i=_v(e.alternate,e);if(i!==null){i.flags&=32767,Ie=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Ie=e;return}Ie=e=i}while(e!==null);gt=6,Ie=null}function yf(e,t,i,s,r,n,S,M,I){e.cancelPendingCommit=null;do Ka();while(kt!==0);if((Je&6)!==0)throw Error(j(327));if(t!==null){if(t===e.current)throw Error(j(177));if(n=t.lanes|t.childLanes,n|=Ul,wl(e,i,n,S,M,I),e===lt&&(Ie=lt=null,Ge=0),Br=t,As=e,ns=i,Vo=n,$o=r,uf=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Av(ct,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=$.p,$.p=2,S=Je,Je|=4;try{vv(e,t,i)}finally{Je=S,$.p=r,q.T=s}}kt=1,Cf(),wf(),Ef()}}function Cf(){if(kt===1){kt=0;var e=As,t=Br,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=q.T,q.T=null;var s=$.p;$.p=2;var r=Je;Je|=4;try{tf(t,e);var n=uc,S=lu(e.containerInfo),M=n.focusedElem,I=n.selectionRange;if(S!==M&&M&&M.ownerDocument&&au(M.ownerDocument.documentElement,M)){if(I!==null&&Bl(M)){var Q=I.start,ce=I.end;if(ce===void 0&&(ce=Q),"selectionStart"in M)M.selectionStart=Q,M.selectionEnd=Math.min(ce,M.value.length);else{var he=M.ownerDocument||document,te=he&&he.defaultView||window;if(te.getSelection){var ne=te.getSelection(),Ce=M.textContent.length,Te=Math.min(I.start,Ce),at=I.end===void 0?Te:Math.min(I.end,Ce);!ne.extend&&Te>at&&(S=at,at=Te,Te=S);var Y=nu(M,Te),G=nu(M,at);if(Y&&G&&(ne.rangeCount!==1||ne.anchorNode!==Y.node||ne.anchorOffset!==Y.offset||ne.focusNode!==G.node||ne.focusOffset!==G.offset)){var X=he.createRange();X.setStart(Y.node,Y.offset),ne.removeAllRanges(),Te>at?(ne.addRange(X),ne.extend(G.node,G.offset)):(X.setEnd(G.node,G.offset),ne.addRange(X))}}}}for(he=[],ne=M;ne=ne.parentNode;)ne.nodeType===1&&he.push({element:ne,left:ne.scrollLeft,top:ne.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}}rl=!!cc,uc=cc=null}finally{Je=r,$.p=s,q.T=i}}e.current=t,kt=2}}function wf(){if(kt===2){kt=0;var e=As,t=Br,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=q.T,q.T=null;var s=$.p;$.p=2;var r=Je;Je|=4;try{Xh(e,t.alternate,t)}finally{Je=r,$.p=s,q.T=i}}kt=3}}function Ef(){if(kt===4||kt===3){kt=0,ze();var e=As,t=Br,i=ns,s=uf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?kt=5:(kt=0,Br=As=null,xf(e,e.pendingLanes));var r=e.pendingLanes;if(r===0&&(xs=null),Nt(i),t=t.stateNode,Wt&&typeof Wt.onCommitFiberRoot=="function")try{Wt.onCommitFiberRoot(Ai,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=q.T,r=$.p,$.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,$.p=r}}(ns&3)!==0&&Ka(),Ui(e),r=e.pendingLanes,(i&261930)!==0&&(r&42)!==0?e===Xo?Bn++:(Bn=0,Xo=e):Bn=0,jn(0)}}function xf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,vn(t)))}function Ka(){return Cf(),wf(),Ef(),Af()}function Af(){if(kt!==5)return!1;var e=As,t=Vo;Vo=0;var i=Nt(ns),s=q.T,r=$.p;try{$.p=32>i?32:i,q.T=null,i=$o,$o=null;var n=As,S=ns;if(kt=0,Br=As=null,ns=0,(Je&6)!==0)throw Error(j(331));var M=Je;if(Je|=4,lf(n.current),rf(n,n.current,S,i),Je=M,jn(0,!1),Wt&&typeof Wt.onPostCommitFiberRoot=="function")try{Wt.onPostCommitFiberRoot(Ai,n)}catch{}return!0}finally{$.p=r,q.T=s,xf(e,t)}}function Df(e,t,i){t=Si(i,t),t=To(e.stateNode,t,2),e=Ss(e,t,2),e!==null&&(Ns(e,2),Ui(e))}function st(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"&&(xs===null||!xs.has(s))){e=Si(i,e),i=Dh(2),s=Ss(t,i,2),s!==null&&(Th(i,s,t,e),Ns(s,2),Ui(s));break}}t=t.return}}function Jo(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new gv;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)||(Fo=!0,r.add(i),e=wv.bind(null,e,t,i),t.then(e,e))}function wv(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,lt===e&&(Ge&i)===i&&(gt===4||gt===3&&(Ge&62914560)===Ge&&300>Ne()-qa?(Je&2)===0&&jr(e,0):Ko|=i,Or===Ge&&(Or=0)),Ui(e)}function Tf(e,t){t===0&&(t=$n()),e=Fs(e,t),e!==null&&(Ns(e,t),Ui(e))}function Ev(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Tf(e,i)}function xv(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 Av(e,t){return ge(e,t)}var Ya=null,Nr=null,ec=!1,Va=!1,tc=!1,Ts=0;function Ui(e){e!==Nr&&e.next===null&&(Nr===null?Ya=Nr=e:Nr=Nr.next=e),Va=!0,ec||(ec=!0,Tv())}function jn(e,t){if(!tc&&Va){tc=!0;do for(var i=!1,s=Ya;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-Ct(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=Ge,n=si(s,s===lt?n:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(n&3)===0||Hs(s,n)||(i=!0,kf(s,n));s=s.next}while(i);tc=!1}}function Dv(){Rf()}function Rf(){Va=ec=!1;var e=0;Ts!==0&&zv()&&(e=Ts);for(var t=Ne(),i=null,s=Ya;s!==null;){var r=s.next,n=Mf(s,t);n===0?(s.next=null,i===null?Ya=r:i.next=r,r===null&&(Nr=i)):(i=s,(e!==0||(n&3)!==0)&&(Va=!0)),s=r}kt!==0&&kt!==5||jn(e),Ts!==0&&(Ts=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-Ct(n),M=1<<S,I=r[S];I===-1?((M&i)===0||(M&s)!==0)&&(r[S]=Cl(M,t)):I<=t&&(e.expiredLanes|=M),n&=~M}if(t=lt,i=Ge,i=si(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(it===2||it===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&ye(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||Hs(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&ye(s),Nt(i)){case 2:case 8:i=vt;break;case 32:i=ct;break;case 268435456:i=Ht;break;default:i=ct}return s=Lf.bind(null,e),i=ge(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&ye(s),e.callbackPriority=2,e.callbackNode=null,2}function Lf(e,t){if(kt!==0&&kt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Ka()&&e.callbackNode!==i)return null;var s=Ge;return s=si(e,e===lt?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(ff(e,s,t),Mf(e,Ne()),e.callbackNode!=null&&e.callbackNode===i?Lf.bind(null,e):null)}function kf(e,t){if(Ka())return null;ff(e,t,!0)}function Tv(){qv(function(){(Je&6)!==0?ge(Ue,Dv):Rf()})}function ic(){if(Ts===0){var e=Cr;e===0&&(e=Yr,Yr<<=1,(Yr&261888)===0&&(Yr=256)),Ts=e}return Ts}function Of(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:H(""+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 Rv(e,t,i,s,r){if(t==="submit"&&i&&i.stateNode===r){var n=Of((r[Rt]||null).action),S=s.submitter;S&&(t=(t=S[Rt]||null)?Of(t.formAction):S.getAttribute("formAction"),t!==null&&(n=t,S=null));var M=new Fi("action","action",null,s,r);e.push({event:M,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ts!==0){var I=S?Bf(r,S):new FormData(r);Co(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),Co(i,{pending:!0,data:I,method:r.method,action:n},n,I))},currentTarget:r}]})}}for(var sc=0;sc<zl.length;sc++){var rc=zl[sc],Mv=rc.toLowerCase(),Lv=rc[0].toUpperCase()+rc.slice(1);Mi(Mv,"on"+Lv)}Mi(uu,"onAnimationEnd"),Mi(hu,"onAnimationIteration"),Mi(fu,"onAnimationStart"),Mi("dblclick","onDoubleClick"),Mi("focusin","onFocus"),Mi("focusout","onBlur"),Mi(Y_,"onTransitionRun"),Mi(V_,"onTransitionStart"),Mi($_,"onTransitionCancel"),Mi(du,"onTransitionEnd"),ni("onMouseEnter",["mouseout","mouseover"]),ni("onMouseLeave",["mouseout","mouseover"]),ni("onPointerEnter",["pointerout","pointerover"]),ni("onPointerLeave",["pointerout","pointerover"]),Bi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Bi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Bi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Bi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Bi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Bi("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(" "),kv=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,Q=M.currentTarget;if(M=M.listener,I!==n&&r.isPropagationStopped())break e;n=M,r.currentTarget=Q;try{n(r)}catch(ce){ca(ce)}r.currentTarget=null,n=I}else for(S=0;S<s.length;S++){if(M=s[S],I=M.instance,Q=M.currentTarget,M=M.listener,I!==n&&r.isPropagationStopped())break e;n=M,r.currentTarget=Q;try{n(r)}catch(ce){ca(ce)}r.currentTarget=null,n=I}}}}function Pe(e,t){var i=t[cs];i===void 0&&(i=t[cs]=new Set);var s=e+"__bubble";i.has(s)||(Hf(t,e,2,!1),i.add(s))}function nc(e,t,i){var s=0;t&&(s|=4),Hf(i,e,s,t)}var $a="_reactListening"+Math.random().toString(36).slice(2);function ac(e){if(!e[$a]){e[$a]=!0,Qr.forEach(function(i){i!=="selectionchange"&&(kv.has(i)||nc(i,!1,e),nc(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[$a]||(t[$a]=!0,nc("selectionchange",!1,t))}}function Hf(e,t,i,s){switch(hd(t)){case 2:var r=am;break;case 8:r=lm;break;default:r=yc}i=r.bind(null,t,i,e),r=void 0,!ft||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 lc(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=Mt(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}Qe(function(){var Q=n,ce=ve(i),he=[];e:{var te=_u.get(e);if(te!==void 0){var ne=Fi,Ce=e;switch(e){case"keypress":if(fr(i)===0)break e;case"keydown":case"keyup":ne=x_;break;case"focusin":Ce="focus",ne=Rl;break;case"focusout":Ce="blur",ne=Rl;break;case"beforeblur":case"afterblur":ne=Rl;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":ne=Gc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=d_;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=T_;break;case uu:case hu:case fu:ne=m_;break;case du:ne=M_;break;case"scroll":case"scrollend":ne=h_;break;case"wheel":ne=k_;break;case"copy":case"cut":case"paste":ne=g_;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=Fc;break;case"toggle":case"beforetoggle":ne=B_}var Te=(t&4)!==0,at=!Te&&(e==="scroll"||e==="scrollend"),Y=Te?te!==null?te+"Capture":null:te;Te=[];for(var G=Q,X;G!==null;){var ue=G;if(X=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||X===null||Y===null||(ue=qe(G,Y),ue!=null&&Te.push(Nn(G,ue,X))),at)break;G=G.return}0<Te.length&&(te=new ne(te,Ce,null,i,ce),he.push({event:te,listeners:Te}))}}if((t&7)===0){e:{if(te=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",te&&i!==le&&(Ce=i.relatedTarget||i.fromElement)&&(Mt(Ce)||Ce[Pi]))break e;if((ne||te)&&(te=ce.window===ce?ce:(te=ce.ownerDocument)?te.defaultView||te.parentWindow:window,ne?(Ce=i.relatedTarget||i.toElement,ne=Q,Ce=Ce?Mt(Ce):null,Ce!==null&&(at=se(Ce),Te=Ce.tag,Ce!==at||Te!==5&&Te!==27&&Te!==6)&&(Ce=null)):(ne=null,Ce=Q),ne!==Ce)){if(Te=Gc,ue="onMouseLeave",Y="onMouseEnter",G="mouse",(e==="pointerout"||e==="pointerover")&&(Te=Fc,ue="onPointerLeave",Y="onPointerEnter",G="pointer"),at=ne==null?te:Us(ne),X=Ce==null?te:Us(Ce),te=new Te(ue,G+"leave",ne,i,ce),te.target=at,te.relatedTarget=X,ue=null,Mt(ce)===Q&&(Te=new Te(Y,G+"enter",Ce,i,ce),Te.target=X,Te.relatedTarget=at,ue=Te),at=ue,ne&&Ce)t:{for(Te=Ov,Y=ne,G=Ce,X=0,ue=Y;ue;ue=Te(ue))X++;ue=0;for(var Ae=G;Ae;Ae=Te(Ae))ue++;for(;0<X-ue;)Y=Te(Y),X--;for(;0<ue-X;)G=Te(G),ue--;for(;X--;){if(Y===G||G!==null&&Y===G.alternate){Te=Y;break t}Y=Te(Y),G=Te(G)}Te=null}else Te=null;ne!==null&&Nf(he,te,ne,Te,!1),Ce!==null&&at!==null&&Nf(he,at,Ce,Te,!0)}}e:{if(te=Q?Us(Q):window,ne=te.nodeName&&te.nodeName.toLowerCase(),ne==="select"||ne==="input"&&te.type==="file")var Xe=Jc;else if(Zc(te))if(eu)Xe=W_;else{Xe=P_;var xe=I_}else ne=te.nodeName,!ne||ne.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?Q&&hr(Q.elementType)&&(Xe=Jc):Xe=G_;if(Xe&&(Xe=Xe(e,Q))){Qc(he,Xe,i,ce);break e}xe&&xe(e,te,Q),e==="focusout"&&Q&&te.type==="number"&&Q.memoizedProps.value!=null&&ur(te,"number",te.value)}switch(xe=Q?Us(Q):window,e){case"focusin":(Zc(xe)||xe.contentEditable==="true")&&(_r=xe,jl=Q,fn=null);break;case"focusout":fn=jl=_r=null;break;case"mousedown":Hl=!0;break;case"contextmenu":case"mouseup":case"dragend":Hl=!1,ou(he,i,ce);break;case"selectionchange":if(K_)break;case"keydown":case"keyup":ou(he,i,ce)}var Be;if(Ll)e:{switch(e){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else dr?$c(e,i)&&(We="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(We="onCompositionStart");We&&(Kc&&i.locale!=="ko"&&(dr||We!=="onCompositionStart"?We==="onCompositionEnd"&&dr&&(Be=Ps()):(mt=ce,fs="value"in mt?mt.value:mt.textContent,dr=!0)),xe=Xa(Q,We),0<xe.length&&(We=new Wc(We,e,null,i,ce),he.push({event:We,listeners:xe}),Be?We.data=Be:(Be=Xc(i),Be!==null&&(We.data=Be)))),(Be=H_?N_(e,i):z_(e,i))&&(We=Xa(Q,"onBeforeInput"),0<We.length&&(xe=new Wc("onBeforeInput","beforeinput",null,i,ce),he.push({event:xe,listeners:We}),xe.data=Be)),Rv(he,e,Q,i,ce)}jf(he,t)})}function Nn(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Xa(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=qe(e,i),r!=null&&s.unshift(Nn(e,r,n)),r=qe(e,t),r!=null&&s.push(Nn(e,r,n))),e.tag===3)return s;e=e.return}return[]}function Ov(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,Q=M.stateNode;if(M=M.tag,I!==null&&I===s)break;M!==5&&M!==26&&M!==27||Q===null||(I=Q,r?(Q=qe(i,n),Q!=null&&S.unshift(Nn(i,Q,I))):r||(Q=qe(i,n),Q!=null&&S.push(Nn(i,Q,I)))),i=i.return}S.length!==0&&e.push({event:t,listeners:S})}var Bv=/\r\n?/g,jv=/\u0000|\uFFFD/g;function zf(e){return(typeof e=="string"?e:""+e).replace(Bv,`
|
|
9
|
+
`).replace(jv,"")}function Uf(e,t){return t=zf(t),zf(e)===t}function nt(e,t,i,s,r,n){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||mi(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&mi(e,""+s);break;case"className":vi(e,"class",s);break;case"tabIndex":vi(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":vi(e,i,s);break;case"style":aa(e,s,n);break;case"data":if(t!=="object"){vi(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=H(""+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"&&nt(e,t,"name",r.name,r,null),nt(e,t,"formEncType",r.formEncType,r,null),nt(e,t,"formMethod",r.formMethod,r,null),nt(e,t,"formTarget",r.formTarget,r,null)):(nt(e,t,"encType",r.encType,r,null),nt(e,t,"method",r.method,r,null),nt(e,t,"target",r.target,r,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=H(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=V);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("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=H(""+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":Pe("beforetoggle",e),Pe("toggle",e),Is(e,"popover",s);break;case"xlinkActuate":Ut(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Ut(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Ut(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Ut(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Ut(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Ut(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Ut(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Ut(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Ut(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Is(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=xl.get(i)||i,Is(e,i,s))}}function oc(e,t,i,s,r,n){switch(i){case"style":aa(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"?mi(e,s):(typeof s=="number"||typeof s=="bigint")&&mi(e,""+s);break;case"onScroll":s!=null&&Pe("scroll",e);break;case"onScrollEnd":s!=null&&Pe("scrollend",e);break;case"onClick":s!=null&&(e.onclick=V);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jr.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[Rt]||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,""):Is(e,i,s)}}}function Gt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",e),Pe("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:nt(e,t,n,S,i,null)}}r&&nt(e,t,"srcSet",i.srcSet,i,null),s&&nt(e,t,"src",i.src,i,null);return;case"input":Pe("invalid",e);var M=n=S=r=null,I=null,Q=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":Q=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:nt(e,t,s,ce,i,null)}}sn(e,n,M,I,Q,S,r,!1);return;case"select":Pe("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:nt(e,t,r,M,i,null)}t=n,i=S,e.multiple=!!s,t!=null?Wi(e,!!s,t,!1):i!=null&&Wi(e,!!s,i,!0);return;case"textarea":Pe("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:nt(e,t,S,M,i,null)}rn(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":nt(e,t,I,s,i,null));return;case"dialog":Pe("beforetoggle",e),Pe("toggle",e),Pe("cancel",e),Pe("close",e);break;case"iframe":case"object":Pe("load",e);break;case"video":case"audio":for(s=0;s<Hn.length;s++)Pe(Hn[s],e);break;case"image":Pe("error",e),Pe("load",e);break;case"details":Pe("toggle",e);break;case"embed":case"source":case"link":Pe("error",e),Pe("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(Q in i)if(i.hasOwnProperty(Q)&&(s=i[Q],s!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(j(137,t));default:nt(e,t,Q,s,i,null)}return;default:if(hr(t)){for(ce in i)i.hasOwnProperty(ce)&&(s=i[ce],s!==void 0&&oc(e,t,ce,s,i,void 0));return}}for(M in i)i.hasOwnProperty(M)&&(s=i[M],s!=null&&nt(e,t,M,s,i,null))}function Hv(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,Q=null,ce=null;for(ne in i){var he=i[ne];if(i.hasOwnProperty(ne)&&he!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":I=he;default:s.hasOwnProperty(ne)||nt(e,t,ne,null,s,he)}}for(var te in s){var ne=s[te];if(he=i[te],s.hasOwnProperty(te)&&(ne!=null||he!=null))switch(te){case"type":n=ne;break;case"name":r=ne;break;case"checked":Q=ne;break;case"defaultChecked":ce=ne;break;case"value":S=ne;break;case"defaultValue":M=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(j(137,t));break;default:ne!==he&&nt(e,t,te,ne,s,he)}}tn(e,S,M,I,Q,ce,n,r);return;case"select":ne=S=M=te=null;for(n in i)if(I=i[n],i.hasOwnProperty(n)&&I!=null)switch(n){case"value":break;case"multiple":ne=I;default:s.hasOwnProperty(n)||nt(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":te=n;break;case"defaultValue":M=n;break;case"multiple":S=n;default:n!==I&&nt(e,t,r,n,s,I)}t=M,i=S,s=ne,te!=null?Wi(e,!!i,te,!1):!!s!=!!i&&(t!=null?Wi(e,!!i,t,!0):Wi(e,!!i,i?[]:"",!1));return;case"textarea":ne=te=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:nt(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":te=r;break;case"defaultValue":ne=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(j(91));break;default:r!==n&&nt(e,t,S,r,s,n)}sa(e,te,ne);return;case"option":for(var Ce in i)te=i[Ce],i.hasOwnProperty(Ce)&&te!=null&&!s.hasOwnProperty(Ce)&&(Ce==="selected"?e.selected=!1:nt(e,t,Ce,null,s,te));for(I in s)te=s[I],ne=i[I],s.hasOwnProperty(I)&&te!==ne&&(te!=null||ne!=null)&&(I==="selected"?e.selected=te&&typeof te!="function"&&typeof te!="symbol":nt(e,t,I,te,s,ne));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Te in i)te=i[Te],i.hasOwnProperty(Te)&&te!=null&&!s.hasOwnProperty(Te)&&nt(e,t,Te,null,s,te);for(Q in s)if(te=s[Q],ne=i[Q],s.hasOwnProperty(Q)&&te!==ne&&(te!=null||ne!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(j(137,t));break;default:nt(e,t,Q,te,s,ne)}return;default:if(hr(t)){for(var at in i)te=i[at],i.hasOwnProperty(at)&&te!==void 0&&!s.hasOwnProperty(at)&&oc(e,t,at,void 0,s,te);for(ce in s)te=s[ce],ne=i[ce],!s.hasOwnProperty(ce)||te===ne||te===void 0&&ne===void 0||oc(e,t,ce,te,s,ne);return}}for(var Y in i)te=i[Y],i.hasOwnProperty(Y)&&te!=null&&!s.hasOwnProperty(Y)&&nt(e,t,Y,null,s,te);for(he in s)te=s[he],ne=i[he],!s.hasOwnProperty(he)||te===ne||te==null&&ne==null||nt(e,t,he,te,s,ne)}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 Nv(){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],Q=I.startTime;if(Q>M)break;var ce=I.transferSize,he=I.initiatorType;ce&&qf(he)&&(I=I.responseEnd,S+=ce*(I<M?1:(M-Q)/(I-Q)))}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 cc=null,uc=null;function Za(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 hc(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 fc=null;function zv(){var e=window.event;return e&&e.type==="popstate"?e===fc?!1:(fc=e,!0):(fc=null,!1)}var Gf=typeof setTimeout=="function"?setTimeout:void 0,Uv=typeof clearTimeout=="function"?clearTimeout:void 0,Wf=typeof Promise=="function"?Promise:void 0,qv=typeof queueMicrotask=="function"?queueMicrotask:typeof Wf<"u"?function(e){return Wf.resolve(null).then(e).catch(Iv)}:Gf;function Iv(e){setTimeout(function(){throw e})}function Rs(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),Ir(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[zs]||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);Ir(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 dc(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":dc(i),Zr(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function Pv(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[zs])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 Gv(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 _c(e){return e.data==="$?"||e.data==="$~"}function vc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Wv(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 mc=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=Za(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]);Zr(e)}var xi=new Map,Zf=new Set;function Qa(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var as=$.d;$.d={f:Fv,r:Kv,D:Yv,C:Vv,L:$v,m:Xv,X:Qv,S:Zv,M:Jv};function Fv(){var e=as.f(),t=Ga();return e||t}function Kv(e){var t=zt(e);t!==null&&t.tag===5&&t.type==="form"?dh(t):as.r(e)}var zr=typeof document>"u"?null:document;function Qf(e,t,i){var s=zr;if(s&&typeof t=="string"&&t){var r=Xt(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"),Gt(t,"link",e),Et(t),s.head.appendChild(t)))}}function Yv(e){as.D(e),Qf("dns-prefetch",e,null)}function Vv(e,t){as.C(e,t),Qf("preconnect",e,t)}function $v(e,t,i){as.L(e,t,i);var s=zr;if(s&&e&&t){var r='link[rel="preload"][as="'+Xt(t)+'"]';t==="image"&&i&&i.imageSrcSet?(r+='[imagesrcset="'+Xt(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(r+='[imagesizes="'+Xt(i.imageSizes)+'"]')):r+='[href="'+Xt(e)+'"]';var n=r;switch(t){case"style":n=Ur(e);break;case"script":n=qr(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"),Gt(t,"link",e),Et(t),s.head.appendChild(t)))}}function Xv(e,t){as.m(e,t);var i=zr;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Xt(s)+'"][href="'+Xt(e)+'"]',n=r;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":n=qr(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"),Gt(s,"link",e),Et(s),i.head.appendChild(s)}}}function Zv(e,t,i){as.S(e,t,i);var s=zr;if(s&&e){var r=hs(s).hoistableStyles,n=Ur(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))&&pc(e,i);var I=S=s.createElement("link");Et(I),Gt(I,"link",e),I._p=new Promise(function(Q,ce){I.onload=Q,I.onerror=ce}),I.addEventListener("load",function(){M.loading|=1}),I.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Ja(S,t,s)}S={type:"stylesheet",instance:S,count:1,state:M},r.set(n,S)}}}function Qv(e,t){as.X(e,t);var i=zr;if(i&&e){var s=hs(i).hoistableScripts,r=qr(e),n=s.get(r);n||(n=i.querySelector(qn(r)),n||(e=h({src:e,async:!0},t),(t=xi.get(r))&&gc(e,t),n=i.createElement("script"),Et(n),Gt(n,"link",e),i.head.appendChild(n)),n={type:"script",instance:n,count:1,state:null},s.set(r,n))}}function Jv(e,t){as.M(e,t);var i=zr;if(i&&e){var s=hs(i).hoistableScripts,r=qr(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))&&gc(e,t),n=i.createElement("script"),Et(n),Gt(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)?Qa(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=Ur(i.href),i=hs(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=Ur(i.href);var n=hs(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||em(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=qr(i),i=hs(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 Ur(e){return'href="'+Xt(e)+'"'}function Un(e){return'link[rel="stylesheet"]['+e+"]"}function ed(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function em(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}),Gt(t,"link",i),Et(t),e.head.appendChild(t))}function qr(e){return'[src="'+Xt(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~="'+Xt(i.href)+'"]');if(s)return t.instance=s,Et(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"),Et(s),Gt(s,"style",r),Ja(s,i.precedence,e),t.instance=s;case"stylesheet":r=Ur(i.href);var n=e.querySelector(Un(r));if(n)return t.state.loading|=4,t.instance=n,Et(n),n;s=ed(i),(r=xi.get(r))&&pc(s,r),n=(e.ownerDocument||e).createElement("link"),Et(n);var S=n;return S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Gt(n,"link",s),t.state.loading|=4,Ja(n,i.precedence,e),t.instance=n;case"script":return n=qr(i.src),(r=e.querySelector(qn(n)))?(t.instance=r,Et(r),r):(s=i,(r=xi.get(n))&&(s=h({},i),gc(s,r)),e=e.ownerDocument||e,r=e.createElement("script"),Et(r),Gt(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,Ja(s,i.precedence,e));return t.instance}function Ja(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 pc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function gc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var el=null;function id(e,t,i){if(el===null){var s=new Map,r=el=new Map;r.set(i,s)}else r=el,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[zs]||n[wt]||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 tm(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 im(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=Ur(s.href),n=t.querySelector(Un(r));if(n){t=n._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=tl.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=n,Et(n);return}n=t.ownerDocument||t,s=ed(s),(r=xi.get(r))&&pc(s,r),n=n.createElement("link"),Et(n);var S=n;S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Gt(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=tl.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Sc=0;function sm(e,t){return e.stylesheets&&e.count===0&&sl(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&sl(e,e.stylesheets),e.unsuspend){var n=e.unsuspend;e.unsuspend=null,n()}},6e4+t);0<e.imgBytes&&Sc===0&&(Sc=62500*Nv());var r=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&sl(e,e.stylesheets),e.unsuspend)){var n=e.unsuspend;e.unsuspend=null,n()}},(e.imgBytes>Sc?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(r)}}:null}function tl(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)sl(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var il=null;function sl(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,il=new Map,t.forEach(rm,e),il=null,tl.call(e))}function rm(e,t){if(!(t.state.loading&4)){var i=il.get(e);if(i)var s=i.get(null);else{i=new Map,il.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=tl.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:ie,_currentValue2:ie,_threadCount:0};function nm(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,Q,ce,he){return e=new nm(e,t,i,S,I,Q,ce,he,M),t=1,n===!0&&(t|=24),n=li(3,null,null,t),e.current=n,n.stateNode=e,t=Zl(),t.refCount++,e.pooledCache=t,t.refCount++,n.memoizedState={element:s,isDehydrated:i,cache:t},to(n),e}function ad(e){return e?(e=pr,e):pr}function ld(e,t,i,s,r,n){r=ad(r),s.context===null?s.context=r:s.pendingContext=r,s=gs(t),s.payload={element:i},n=n===void 0?null:n,n!==null&&(s.callback=n),i=Ss(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 bc(e,t){od(e,t),(e=e.alternate)&&od(e,t)}function cd(e){if(e.tag===13||e.tag===31){var t=Fs(e,67108864);t!==null&&ti(t,e,67108864),bc(e,67108864)}}function ud(e){if(e.tag===13||e.tag===31){var t=fi();t=Xr(t);var i=Fs(e,t);i!==null&&ti(i,e,t),bc(e,t)}}var rl=!0;function am(e,t,i,s){var r=q.T;q.T=null;var n=$.p;try{$.p=2,yc(e,t,i,s)}finally{$.p=n,q.T=r}}function lm(e,t,i,s){var r=q.T;q.T=null;var n=$.p;try{$.p=8,yc(e,t,i,s)}finally{$.p=n,q.T=r}}function yc(e,t,i,s){if(rl){var r=Cc(s);if(r===null)lc(e,t,s,nl,i),fd(e,s);else if(cm(r,e,t,i,s))s.stopPropagation();else if(fd(e,s),t&4&&-1<om.indexOf(e)){for(;r!==null;){var n=zt(r);if(n!==null)switch(n.tag){case 3:if(n=n.stateNode,n.current.memoizedState.isDehydrated){var S=qi(n.pendingLanes);if(S!==0){var M=n;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var I=1<<31-Ct(S);M.entanglements[1]|=I,S&=~I}Ui(n),(Je&6)===0&&(Ia=Ne()+500,jn(0))}}break;case 31:case 13:M=Fs(n,2),M!==null&&ti(M,n,2),Ga(),bc(n,2)}if(n=Cc(s),n===null&&lc(e,t,s,nl,i),n===r)break;r=n}r!==null&&s.stopPropagation()}else lc(e,t,s,null,i)}}function Cc(e){return e=ve(e),wc(e)}var nl=null;function wc(e){if(nl=null,e=Mt(e),e!==null){var t=se(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=Z(t),e!==null)return e;e=null}else if(i===31){if(e=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 nl=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(_t()){case Ue:return 2;case vt:return 8;case ct:case _i:return 32;case Ht:return 268435456;default:return 32}default:return 32}}var Ec=!1,Ms=null,Ls=null,ks=null,Pn=new Map,Gn=new Map,Os=[],om="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":Ms=null;break;case"dragenter":case"dragleave":Ls=null;break;case"mouseover":case"mouseout":ks=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=zt(t),t!==null&&cd(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function cm(e,t,i,s,r){switch(t){case"focusin":return Ms=Wn(Ms,e,t,i,s,r),!0;case"dragenter":return Ls=Wn(Ls,e,t,i,s,r),!0;case"mouseover":return ks=Wn(ks,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=Mt(e.target);if(t!==null){var i=se(t);if(i!==null){if(t=i.tag,t===13){if(t=Z(i),t!==null){e.blockedOn=t,Ii(e.priority,function(){ud(i)});return}}else if(t===31){if(t=u(i),t!==null){e.blockedOn=t,Ii(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 al(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Cc(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);le=s,i.target.dispatchEvent(s),le=null}else return t=zt(i),t!==null&&cd(t),e.blockedOn=i,!1;t.shift()}return!0}function _d(e,t,i){al(e)&&i.delete(t)}function um(){Ec=!1,Ms!==null&&al(Ms)&&(Ms=null),Ls!==null&&al(Ls)&&(Ls=null),ks!==null&&al(ks)&&(ks=null),Pn.forEach(_d),Gn.forEach(_d)}function ll(e,t){e.blockedOn===t&&(e.blockedOn=null,Ec||(Ec=!0,C.unstable_scheduleCallback(C.unstable_NormalPriority,um)))}var ol=null;function vd(e){ol!==e&&(ol=e,C.unstable_scheduleCallback(C.unstable_NormalPriority,function(){ol===e&&(ol=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(wc(s||i)===null)continue;break}var n=zt(i);n!==null&&(e.splice(t,3),t-=3,Co(n,{pending:!0,data:r,method:i.method,action:s},s,r))}}))}function Ir(e){function t(I){return ll(I,e)}Ms!==null&&ll(Ms,e),Ls!==null&&ll(Ls,e),ks!==null&&ll(ks,e),Pn.forEach(t),Gn.forEach(t);for(var i=0;i<Os.length;i++){var s=Os[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Os.length&&(i=Os[0],i.blockedOn===null);)dd(i),i.blockedOn===null&&Os.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[Rt]||null;if(typeof n=="function")S||vd(i);else if(S){var M=null;if(n&&n.hasAttribute("formAction")){if(r=n,S=n[Rt]||null)M=S.formAction;else if(wc(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 xc(e){this._internalRoot=e}cl.prototype.render=xc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(j(409));var i=t.current,s=fi();ld(i,s,e,t,null,null)},cl.prototype.unmount=xc.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),Ga(),t[Pi]=null}};function cl(e){this._internalRoot=e}cl.prototype.unstable_scheduleHydration=function(e){if(e){var t=et();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Os.length&&t!==0&&t<Os[i].priority;i++);Os.splice(i,0,e),i===0&&dd(e)}};var pd=L.version;if(pd!=="19.2.8")throw Error(j(527,pd,"19.2.8"));$.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 hm={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ul=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ul.isDisabled&&ul.supportsFiber)try{Ai=ul.inject(hm),Wt=ul}catch{}}return Kn.createRoot=function(e,t){if(!J(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[Pi]=t.current,ac(e),new xc(t)},Kn.hydrateRoot=function(e,t,i){if(!J(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=fi(),s=Xr(s),r=gs(s),r.callback=null,Ss(i,r,s),i=s,t.current.lanes=i,Ns(t,i),Ui(t),e[Pi]=t.current,ac(e),new cl(t)},Kn.version="19.2.8",Kn}var Dd;function ym(){if(Dd)return Tc.exports;Dd=1;function C(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(C)}catch(L){console.error(L)}}return C(),Tc.exports=bm(),Tc.exports}var Cm=ym(),kc={exports:{}},Td;function wm(){return Td||(Td=1,(function(C,L){(function(O,j){C.exports=j()})(globalThis,(()=>(()=>{var O={4567:function(Z,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),w=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 ee=U<N.length?N[U]:N.slice(-1)[0]+1;return ee>=this._terminal.cols&&(++W,ee=0),{row:W,column:ee}},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,w.ICoreBrowserService),y(3,w.IRenderService)],c)},3614:(Z,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,w,m){v=d(v=f(v),w.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(v,!0),b.value=""}function h(v,b,w){const m=w.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,w,m){v.stopPropagation(),v.clipboardData&&y(v.clipboardData.getData("text/plain"),b,w,m)},u.paste=y,u.moveTextAreaUnderMouseCursor=h,u.rightClickHandler=function(v,b,w,m,o){h(v,b,w),o&&m.rightClickSelect(v),b.value=m.selectionText,b.select()}},7239:(Z,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:(Z,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(Z,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),w=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,w.IBufferService),y(4,m.ILinkProviderService)],o)},9042:(Z,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(Z,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,ee)=>l?l.activate(N,ee,P):w(0,ee),hover:(N,ee)=>l?.hover?.(N,ee,P),leave:(N,ee)=>l?.leave?.(N,ee,P)})}g=!1,_.hasExtendedAttrs()&&_.extended.urlId?(D=T,E=_.extended.urlId):(D=-1,E=-1)}}o(a)}};function w(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:(Z,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:(Z,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),w=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),ee=f(844),oe=f(6114),q=f(8437),$=f(2584),ie=f(7399),R=f(5941),z=f(9074),A=f(2585),B=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=oe,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new ee.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(((k,ae)=>this.refresh(k,ae)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((k=>this._reportWindowsOptions(k)))),this.register(this._inputHandler.onColor((k=>this._handleColorEvent(k)))),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((k=>this._afterResize(k.cols,k.rows)))),this.register((0,ee.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(F){if(this._themeService)for(const k of F){let ae,fe="";switch(k.index){case 256:ae="foreground",fe="10";break;case 257:ae="background",fe="11";break;case 258:ae="cursor",fe="12";break;default:ae="ansi",fe="4;"+k.index}switch(k.type){case 0:const be=P.color.toColorRGB(ae==="ansi"?this._themeService.colors.ansi[k.index]:this._themeService.colors[ae]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${fe};${(0,R.toRgbString)(be)}${$.C1_ESCAPED.ST}`);break;case 1:if(ae==="ansi")this._themeService.modifyColors((Se=>Se.ansi[k.index]=P.channels.toColor(...k.color)));else{const Se=ae;this._themeService.modifyColors((Le=>Le[Se]=P.channels.toColor(...k.color)))}break;case 2:this._themeService.restoreColor(k.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($.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($.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,k=this.buffer.lines.get(F);if(!k)return;const ae=Math.min(this.buffer.x,this.cols-1),fe=this._renderService.dimensions.css.cell.height,be=k.getWidth(ae),Se=this._renderService.dimensions.css.cell.width*be,Le=this.buffer.y*this._renderService.dimensions.css.cell.height,je=ae*this._renderService.dimensions.css.cell.width;this.textarea.style.left=je+"px",this.textarea.style.top=Le+"px",this.textarea.style.width=Se+"px",this.textarea.style.height=fe+"px",this.textarea.style.lineHeight=fe+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",(k=>{this.hasSelection()&&(0,d.copyHandler)(k,this._selectionService)})));const F=k=>(0,d.handlePasteEvent)(k,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",F)),this.register((0,y.addDisposableDomListener)(this.element,"paste",F)),oe.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",(k=>{k.button===2&&(0,d.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",(k=>{(0,d.rightClickHandler)(k,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),oe.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",(k=>{k.button===1&&(0,d.moveTextAreaUnderMouseCursor)(k,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 k=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),k.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",(ae=>this.updateCursorStyle(ae)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),k.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),oe.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",(ae=>this._handleTextAreaFocus(ae)))),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((ae=>this._onRender.fire(ae)))),this.onResize((ae=>this._renderService.resize(ae.cols,ae.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(k);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((ae=>this.scrollLines(ae.amount,ae.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((ae=>this.scrollLines(ae.amount,ae.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((ae=>this._renderService.handleSelectionChanged(ae.start,ae.end,ae.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((ae=>{this.textarea.value=ae,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((ae=>{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",(ae=>this._selectionService.handleMouseDown(ae)))),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",(ae=>this._handleScreenReaderModeOptionChange(ae)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(o.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(ae=>{!this._overviewRulerRenderer&&ae&&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,k=this.element;function ae(Se){const Le=F._mouseService.getMouseReportCoords(Se,F.screenElement);if(!Le)return!1;let je,Ye;switch(Se.overrideType||Se.type){case"mousemove":Ye=32,Se.buttons===void 0?(je=3,Se.button!==void 0&&(je=Se.button<3?Se.button:3)):je=1&Se.buttons?0:4&Se.buttons?1:2&Se.buttons?2:3;break;case"mouseup":Ye=0,je=Se.button<3?Se.button:3;break;case"mousedown":Ye=1,je=Se.button<3?Se.button:3;break;case"wheel":if(F._customWheelEventHandler&&F._customWheelEventHandler(Se)===!1||F.viewport.getLinesScrolled(Se)===0)return!1;Ye=Se.deltaY<0?0:1,je=4;break;default:return!1}return!(Ye===void 0||je===void 0||je>4)&&F.coreMouseService.triggerMouseEvent({col:Le.col,row:Le.row,x:Le.x,y:Le.y,button:je,action:Ye,ctrl:Se.ctrlKey,alt:Se.altKey,shift:Se.shiftKey})}const fe={mouseup:null,wheel:null,mousedrag:null,mousemove:null},be={mouseup:Se=>(ae(Se),Se.buttons||(this._document.removeEventListener("mouseup",fe.mouseup),fe.mousedrag&&this._document.removeEventListener("mousemove",fe.mousedrag)),this.cancel(Se)),wheel:Se=>(ae(Se),this.cancel(Se,!0)),mousedrag:Se=>{Se.buttons&&ae(Se)},mousemove:Se=>{Se.buttons||ae(Se)}};this.register(this.coreMouseService.onProtocolChange((Se=>{Se?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Se)),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&Se?fe.mousemove||(k.addEventListener("mousemove",be.mousemove),fe.mousemove=be.mousemove):(k.removeEventListener("mousemove",fe.mousemove),fe.mousemove=null),16&Se?fe.wheel||(k.addEventListener("wheel",be.wheel,{passive:!1}),fe.wheel=be.wheel):(k.removeEventListener("wheel",fe.wheel),fe.wheel=null),2&Se?fe.mouseup||(fe.mouseup=be.mouseup):(this._document.removeEventListener("mouseup",fe.mouseup),fe.mouseup=null),4&Se?fe.mousedrag||(fe.mousedrag=be.mousedrag):(this._document.removeEventListener("mousemove",fe.mousedrag),fe.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(k,"mousedown",(Se=>{if(Se.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Se))return ae(Se),fe.mouseup&&this._document.addEventListener("mouseup",fe.mouseup),fe.mousedrag&&this._document.addEventListener("mousemove",fe.mousedrag),this.cancel(Se)}))),this.register((0,y.addDisposableDomListener)(k,"wheel",(Se=>{if(!fe.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(Se)===!1)return!1;if(!this.buffer.hasScrollback){const Le=this.viewport.getLinesScrolled(Se);if(Le===0)return;const je=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Se.deltaY<0?"A":"B");let Ye="";for(let tt=0;tt<Math.abs(Le);tt++)Ye+=je;return this.coreService.triggerDataEvent(Ye,!0),this.cancel(Se,!0)}return this.viewport.handleWheel(Se)?this.cancel(Se):void 0}}),{passive:!1})),this.register((0,y.addDisposableDomListener)(k,"touchstart",(Se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Se),this.cancel(Se)}),{passive:!0})),this.register((0,y.addDisposableDomListener)(k,"touchmove",(Se=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Se)?void 0:this.cancel(Se)}),{passive:!1}))}refresh(F,k){this._renderService?.refreshRows(F,k)}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,k,ae=0){ae===1?(super.scrollLines(F,k,ae),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 k=this._characterJoinerService.register(F);return this.refresh(0,this.rows-1),k}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,k,ae){this._selectionService.setSelection(F,k,ae)}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,k){this._selectionService?.selectLines(F,k)}_keyDown(F){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1)return!1;const k=this.browser.isMac&&this.options.macOptionIsMeta&&F.altKey;if(!k&&!this._compositionHelper.keydown(F))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;k||F.key!=="Dead"&&F.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ae=(0,ie.evaluateKeyboardEvent)(F,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(F),ae.type===3||ae.type===2){const fe=this.rows-1;return this.scrollLines(ae.type===2?-fe:fe),this.cancel(F,!0)}return ae.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,F)||(ae.cancel&&this.cancel(F,!0),!ae.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):(ae.key!==$.C0.ETX&&ae.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ae.key,domEvent:F}),this._showCursor(),this.coreService.triggerDataEvent(ae.key,!0),!this.optionsService.rawOptions.screenReaderMode||F.altKey||F.ctrlKey?this.cancel(F,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(F,k){const ae=F.isMac&&!this.options.macOptionIsMeta&&k.altKey&&!k.ctrlKey&&!k.metaKey||F.isWindows&&k.altKey&&k.ctrlKey&&!k.metaKey||F.isWindows&&k.getModifierState("AltGraph");return k.type==="keypress"?ae:ae&&(!k.keyCode||k.keyCode>47)}_keyUp(F){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1||((function(k){return k.keyCode===16||k.keyCode===17||k.keyCode===18})(F)||this.focus(),this.updateCursorStyle(F),this._keyPressHandled=!1)}_keyPress(F){let k;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(F)===!1)return!1;if(this.cancel(F),F.charCode)k=F.charCode;else if(F.which===null||F.which===void 0)k=F.keyCode;else{if(F.which===0||F.charCode===0)return!1;k=F.which}return!(!k||(F.altKey||F.ctrlKey||F.metaKey)&&!this._isThirdLevelShift(this.browser,F)||(k=String.fromCharCode(k),this._onKey.fire({key:k,domEvent:F}),this._showCursor(),this.coreService.triggerDataEvent(k,!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 k=F.data;return this.coreService.triggerDataEvent(k,!0),this.cancel(F),!0}return!1}resize(F,k){F!==this.cols||k!==this.rows?super.resize(F,k):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(F,k){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($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(F){if(this._renderService)switch(F){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const k=this._renderService.dimensions.css.canvas.width.toFixed(0),ae=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${ae};${k}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const fe=this._renderService.dimensions.css.cell.width.toFixed(0),be=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${be};${fe}t`)}}cancel(F,k){if(this.options.cancelEvents||k)return F.preventDefault(),F.stopPropagation(),!1}}u.Terminal=me},9924:(Z,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(Z,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),w=f(844),m=f(2585);let o=u.Viewport=class extends w.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(Z,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 w=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=w=d([y(1,b.IBufferService),y(2,h.ICoreBrowserService),y(3,b.IDecorationService),y(4,h.IRenderService)],w)},5871:(Z,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(Z,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),w=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,w.IBufferService),y(3,w.IDecorationService),y(4,v.IRenderService),y(5,w.IOptionsService),y(6,v.ICoreBrowserService)],a)},2950:function(Z,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 w=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=w=d([y(2,v.IBufferService),y(3,v.IOptionsService),y(4,v.ICoreService),y(5,h.IRenderService)],w)},9806:(Z,u)=>{function f(d,y,h){const v=h.getBoundingClientRect(),b=d.getComputedStyle(h),w=parseInt(b.getPropertyValue("padding-left")),m=parseInt(b.getPropertyValue("padding-top"));return[y.clientX-v.left-w,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,w,m,o,c){if(!w)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:(Z,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 ee=v(D,g)==="A"?-1:1;T.buffer.lines.get(P+ee*N)?.isWrapped&&U++}return U})(o,c,a);return m(E,w(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 w(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,w("D",N))})(_,x,0,c,a,l)+y(x,c,a,l)+(function(g,T,U,P,W,N){let ee;ee=y(T,P,W,N).length>0?P-h(P,W):T;const oe=P,q=(function($,ie,R,z,A,B){let K;return K=y(R,z,A,B).length>0?z-h(z,A):ie,$<R&&K<=z||$>=R&&K<z?"C":"D"})(g,T,U,P,W,N);return m(b(g,ee,U,oe,q==="C",W).length,w(q,N))})(_,x,o,c,a,l);let E;if(x===c)return E=_>o?"D":"C",m(Math.abs(_-o),w(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),w(E,l))}},1296:function(Z,u,f){var d=this&&this.__decorate||function(N,ee,oe,q){var $,ie=arguments.length,R=ie<3?ee:q===null?q=Object.getOwnPropertyDescriptor(ee,oe):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(N,ee,oe,q);else for(var z=N.length-1;z>=0;z--)($=N[z])&&(R=(ie<3?$(R):ie>3?$(ee,oe,R):$(ee,oe))||R);return ie>3&&R&&Object.defineProperty(ee,oe,R),R},y=this&&this.__param||function(N,ee){return function(oe,q){ee(oe,q,N)}};Object.defineProperty(u,"__esModule",{value:!0}),u.DomRenderer=void 0;const h=f(3787),v=f(2550),b=f(2223),w=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,ee,oe,q,$,ie,R,z,A,B,K,re,me){super(),this._terminal=N,this._document=ee,this._element=oe,this._screenElement=q,this._viewportElement=$,this._helperContainer=ie,this._linkifier2=R,this._charSizeService=A,this._optionsService=B,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,w.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 oe of this._rowElements)oe.style.width=`${this.dimensions.css.canvas.width}px`,oe.style.height=`${this.dimensions.css.cell.height}px`,oe.style.lineHeight=`${this.dimensions.css.cell.height}px`,oe.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const ee=`${this._terminalSelector} .${E} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=ee,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 ee=`${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}`;ee+=`${this._terminalSelector} .${E} .xterm-dim { color: ${c.color.multiplyOpacity(N.foreground,.5).css};}`,ee+=`${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 oe=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,$=`blink_block_${this._terminalClass}`;ee+=`@keyframes ${oe} { 50% { border-bottom-style: hidden; }}`,ee+=`@keyframes ${q} { 50% { box-shadow: none; }}`,ee+=`@keyframes ${$} { 0% { background-color: ${N.cursor.css}; color: ${N.cursorAccent.css}; } 50% { background-color: inherit; color: ${N.cursor.css}; }}`,ee+=`${this._terminalSelector} .${E}.${T} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${oe} 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: ${$} 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);}`,ee+=`${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[ie,R]of N.ansi.entries())ee+=`${this._terminalSelector} .${D}${ie} { color: ${R.css}; }${this._terminalSelector} .${D}${ie}.xterm-dim { color: ${c.color.multiplyOpacity(R,.5).css}; }${this._terminalSelector} .${g}${ie} { background-color: ${R.css}; }`;ee+=`${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=ee}_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,ee){for(let oe=this._rowElements.length;oe<=ee;oe++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>ee;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(N,ee){this._refreshRowElements(N,ee),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,ee,oe){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(N,ee,oe),this.renderRows(0,this._bufferService.rows-1),!N||!ee)return;this._selectionRenderModel.update(this._terminal,N,ee,oe);const q=this._selectionRenderModel.viewportStartRow,$=this._selectionRenderModel.viewportEndRow,ie=this._selectionRenderModel.viewportCappedStartRow,R=this._selectionRenderModel.viewportCappedEndRow;if(ie>=this._bufferService.rows||R<0)return;const z=this._document.createDocumentFragment();if(oe){const A=N[0]>ee[0];z.appendChild(this._createSelectionElement(ie,A?ee[0]:N[0],A?N[0]:ee[0],R-ie+1))}else{const A=q===ie?N[0]:0,B=ie===$?ee[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(ie,A,B));const K=R-ie-1;if(z.appendChild(this._createSelectionElement(ie+1,0,this._bufferService.cols,K)),ie!==R){const re=$===R?ee[0]:this._bufferService.cols;z.appendChild(this._createSelectionElement(R,0,re))}}this._selectionContainer.appendChild(z)}_createSelectionElement(N,ee,oe,q=1){const $=this._document.createElement("div"),ie=ee*this.dimensions.css.cell.width;let R=this.dimensions.css.cell.width*(oe-ee);return ie+R>this.dimensions.css.canvas.width&&(R=this.dimensions.css.canvas.width-ie),$.style.height=q*this.dimensions.css.cell.height+"px",$.style.top=N*this.dimensions.css.cell.height+"px",$.style.left=`${ie}px`,$.style.width=`${R}px`,$}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,ee){const oe=this._bufferService.buffer,q=oe.ybase+oe.y,$=Math.min(oe.x,this._bufferService.cols-1),ie=this._optionsService.rawOptions.cursorBlink,R=this._optionsService.rawOptions.cursorStyle,z=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=N;A<=ee;A++){const B=A+oe.ydisp,K=this._rowElements[A],re=oe.lines.get(B);if(!K||!re)break;K.replaceChildren(...this._rowFactory.createRow(re,B,B===q,R,z,$,ie,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,ee,oe,q,$,ie){oe<0&&(N=0),q<0&&(ee=0);const R=this._bufferService.rows-1;oe=Math.max(Math.min(oe,R),0),q=Math.max(Math.min(q,R),0),$=Math.min($,this._bufferService.cols);const z=this._bufferService.buffer,A=z.ybase+z.y,B=Math.min(z.x,$-1),K=this._optionsService.rawOptions.cursorBlink,re=this._optionsService.rawOptions.cursorStyle,me=this._optionsService.rawOptions.cursorInactiveStyle;for(let pe=oe;pe<=q;++pe){const F=pe+z.ydisp,k=this._rowElements[pe],ae=z.lines.get(F);if(!k||!ae)break;k.replaceChildren(...this._rowFactory.createRow(ae,F,F===A,re,me,B,K,this.dimensions.css.cell.width,this._widthCache,ie?pe===oe?N:0:-1,ie?(pe===q?ee:$)-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(Z,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),w=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,ee,oe,q){const $=[],ie=this._characterJoinerService.getJoinedCharacters(D),R=this._themeService.colors;let z,A=E.getNoBgTrimmedLength();g&&A<P+1&&(A=P+1);let B=0,K="",re=0,me=0,pe=0,F=!1,k=0,ae=!1,fe=0;const be=[],Se=oe!==-1&&q!==-1;for(let Le=0;Le<A;Le++){E.loadCell(Le,this._workCell);let je=this._workCell.getWidth();if(je===0)continue;let Ye=!1,tt=Le,De=this._workCell;if(ie.length>0&&Le===ie[0][0]){Ye=!0;const Ke=ie.shift();De=new c.JoinedCellData(this._workCell,E.translateToString(!0,Ke[0],Ke[1]),Ke[1]-Ke[0]),tt=Ke[1]-1,je=De.getWidth()}const jt=this._isCellInSelection(Le,D),de=g&&Le===P,ge=Se&&Le>=oe&&Le<=q;let ye=!1;this._decorationService.forEachDecorationAtCell(Le,D,void 0,(Ke=>{ye=!0}));let Oe=De.getChars()||v.WHITESPACE_CELL_CHAR;if(Oe===" "&&(De.isUnderline()||De.isOverline())&&(Oe=" "),fe=je*N-ee.get(Oe,De.isBold(),De.isItalic()),z){if(B&&(jt&&ae||!jt&&!ae&&De.bg===re)&&(jt&&ae&&R.selectionForeground||De.fg===me)&&De.extended.ext===pe&&ge===F&&fe===k&&!de&&!Ye&&!ye){De.isInvisible()?K+=v.WHITESPACE_CELL_CHAR:K+=Oe,B++;continue}B&&(z.textContent=K),z=this._document.createElement("span"),B=0,K=""}else z=this._document.createElement("span");if(re=De.bg,me=De.fg,pe=De.extended.ext,F=ge,k=fe,ae=jt,Ye&&P>=Le&&P<=tt&&(P=Le),!this._coreService.isCursorHidden&&de&&this._coreService.isCursorInitialized){if(be.push("xterm-cursor"),this._coreBrowserService.isFocused)W&&be.push("xterm-cursor-blink"),be.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(U)switch(U){case"outline":be.push("xterm-cursor-outline");break;case"block":be.push("xterm-cursor-block");break;case"bar":be.push("xterm-cursor-bar");break;case"underline":be.push("xterm-cursor-underline")}}if(De.isBold()&&be.push("xterm-bold"),De.isItalic()&&be.push("xterm-italic"),De.isDim()&&be.push("xterm-dim"),K=De.isInvisible()?v.WHITESPACE_CELL_CHAR:De.getChars()||v.WHITESPACE_CELL_CHAR,De.isUnderline()&&(be.push(`xterm-underline-${De.extended.underlineStyle}`),K===" "&&(K=" "),!De.isUnderlineColorDefault()))if(De.isUnderlineColorRGB())z.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(De.getUnderlineColor()).join(",")})`;else{let Ke=De.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&De.isBold()&&Ke<8&&(Ke+=8),z.style.textDecorationColor=R.ansi[Ke].css}De.isOverline()&&(be.push("xterm-overline"),K===" "&&(K=" ")),De.isStrikethrough()&&be.push("xterm-strikethrough"),ge&&(z.style.textDecoration="underline");let ze=De.getFgColor(),Ne=De.getFgColorMode(),_t=De.getBgColor(),Ue=De.getBgColorMode();const vt=!!De.isInverse();if(vt){const Ke=ze;ze=_t,_t=Ke;const Ai=Ne;Ne=Ue,Ue=Ai}let ct,_i,Ht,$t=!1;switch(this._decorationService.forEachDecorationAtCell(Le,D,void 0,(Ke=>{Ke.options.layer!=="top"&&$t||(Ke.backgroundColorRGB&&(Ue=50331648,_t=Ke.backgroundColorRGB.rgba>>8&16777215,ct=Ke.backgroundColorRGB),Ke.foregroundColorRGB&&(Ne=50331648,ze=Ke.foregroundColorRGB.rgba>>8&16777215,_i=Ke.foregroundColorRGB),$t=Ke.options.layer==="top")})),!$t&&jt&&(ct=this._coreBrowserService.isFocused?R.selectionBackgroundOpaque:R.selectionInactiveBackgroundOpaque,_t=ct.rgba>>8&16777215,Ue=50331648,$t=!0,R.selectionForeground&&(Ne=50331648,ze=R.selectionForeground.rgba>>8&16777215,_i=R.selectionForeground)),$t&&be.push("xterm-decoration-top"),Ue){case 16777216:case 33554432:Ht=R.ansi[_t],be.push(`xterm-bg-${_t}`);break;case 50331648:Ht=m.channels.toColor(_t>>16,_t>>8&255,255&_t),this._addStyle(z,`background-color:#${x((_t>>>0).toString(16),"0",6)}`);break;default:vt?(Ht=R.foreground,be.push(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):Ht=R.background}switch(ct||De.isDim()&&(ct=m.color.multiplyOpacity(Ht,.5)),Ne){case 16777216:case 33554432:De.isBold()&&ze<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ze+=8),this._applyMinimumContrast(z,Ht,R.ansi[ze],De,ct,void 0)||be.push(`xterm-fg-${ze}`);break;case 50331648:const Ke=m.channels.toColor(ze>>16&255,ze>>8&255,255&ze);this._applyMinimumContrast(z,Ht,Ke,De,ct,_i)||this._addStyle(z,`color:#${x(ze.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(z,Ht,R.foreground,De,ct,_i)||vt&&be.push(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}be.length&&(z.className=be.join(" "),be.length=0),de||Ye||ye?z.textContent=K:B++,fe!==this.defaultSpacing&&(z.style.letterSpacing=`${fe}px`),$.push(z),Le=tt}return z&&B&&(z.textContent=K),$}_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 ee=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);N=m.color.ensureContrastRatio(U||D,P||g,ee),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,w.IOptionsService),y(3,o.ICoreBrowserService),y(4,w.ICoreService),y(5,w.IDecorationService),y(6,o.IThemeService)],_)},2550:(Z,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 w=this._measure(f,0);return w>0&&(this._flat[h]=w),w}let v=f;d&&(v+="B"),y&&(v+="I");let b=this._holey.get(v);if(b===void 0){let w=0;d&&(w|=1),y&&(w|=2),b=this._measure(f,w),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:(Z,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:(Z,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(w){return 57344<=w&&w<=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:(Z,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 w=y.buffers.active.ydisp,m=h[1]-w,o=v[1]-w,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:(Z,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(Z,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 w=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=w=d([y(2,h.IOptionsService)],w);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(Z,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),w=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,w.IBufferService)],o)},5114:(Z,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:(Z,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(Z,u,f){var d=this&&this.__decorate||function(w,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(w,m,o,c);else for(var x=w.length-1;x>=0;x--)(a=w[x])&&(_=(l<3?a(_):l>3?a(m,o,_):a(m,o))||_);return l>3&&_&&Object.defineProperty(m,o,_),_},y=this&&this.__param||function(w,m){return function(o,c){m(o,c,w)}};Object.defineProperty(u,"__esModule",{value:!0}),u.MouseService=void 0;const h=f(4725),v=f(9806);let b=u.MouseService=class{constructor(w,m){this._renderService=w,this._charSizeService=m}getCoords(w,m,o,c,a){return(0,v.getCoords)(window,w,m,o,c,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,a)}getMouseReportCoords(w,m){const o=(0,v.getCoordsRelativeToElement)(window,w,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(Z,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),w=f(844),m=f(7226),o=f(2585);let c=u.RenderService=class extends w.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 w.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new w.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new 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,w.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(Z,u,f){var d=this&&this.__decorate||function(g,T,U,P){var W,N=arguments.length,ee=N<3?T:P===null?P=Object.getOwnPropertyDescriptor(T,U):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ee=Reflect.decorate(g,T,U,P);else for(var oe=g.length-1;oe>=0;oe--)(W=g[oe])&&(ee=(N<3?W(ee):N>3?W(T,U,ee):W(T,U))||ee);return N>3&&ee&&Object.defineProperty(T,U,ee),ee},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),w=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,ee,oe,q){super(),this._element=g,this._screenElement=T,this._linkifier=U,this._bufferService=P,this._coreService=W,this._mouseService=N,this._optionsService=ee,this._renderService=oe,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=$=>this._handleMouseMove($),this._mouseUpListener=$=>this._handleMouseUp($),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim(($=>this._handleTrim($))),this.register(this._bufferService.buffers.onBufferActivate(($=>this._handleBufferActivate($)))),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 ee=g[1];ee<=T[1];ee++){const oe=U.translateBufferLineToString(ee,!0,W,N);P.push(oe)}}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 ee=U.lines.get(N),oe=U.translateBufferLineToString(N,!0);ee?.isWrapped?P[P.length-1]+=oe:P.push(oe)}if(g[1]!==T[1]){const N=U.lines.get(T[1]),ee=U.translateBufferLineToString(T[1],!0,0,T[0]);N&&N.isWrapped?P[P.length-1]+=ee:P.push(ee)}}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 ee=W.translateBufferLineToString(g[1],!1);let oe=this._convertViewportColToCharacterIndex(N,g[0]),q=oe;const $=g[0]-oe;let ie=0,R=0,z=0,A=0;if(ee.charAt(oe)===" "){for(;oe>0&&ee.charAt(oe-1)===" ";)oe--;for(;q<ee.length&&ee.charAt(q+1)===" ";)q++}else{let re=g[0],me=g[0];N.getWidth(re)===0&&(ie++,re--),N.getWidth(me)===2&&(R++,me++);const pe=N.getString(me).length;for(pe>1&&(A+=pe-1,q+=pe-1);re>0&&oe>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?(ie++,re--):F>1&&(z+=F-1,oe-=F-1),oe--,re--}for(;me<N.length&&q+1<ee.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 B=oe+$-ie+z,K=Math.min(this._bufferService.cols,q-oe+ie+R-z-A);if(T||ee.slice(oe,q).trim()!==""){if(U&&B===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;B-=pe,K+=pe}}}if(P&&B+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:B,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,w.IMouseService),y(6,_.IOptionsService),y(7,w.IRenderService),y(8,w.ICoreBrowserService)],D)},4725:(Z,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(Z,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 ee=D.length-1;ee>=0;ee--)(P=D[ee])&&(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),w=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 w.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:(Z,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 w=new Array(b);for(let m=0;m<Math.min(b,this.length);m++)w[m]=this._array[this._getCyclicIndex(m)];this._array=w,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let w=this._length;w<b;w++)this._array[w]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,w){this._array[this._getCyclicIndex(b)]=w}push(b){this._array[this._getCyclicIndex(this._length)]=b,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(b,w,...m){if(w){for(let o=b;o<this._length-w;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+w)];this._length-=w,this.onDeleteEmitter.fire({index:b,amount:w})}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,w,m){if(!(w<=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=w-1;c>=0;c--)this.set(b+c+m,this.get(b+c));const o=b+w+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<w;o++)this.set(b+o+m,this.get(b+o))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}u.CircularList=h},1439:(Z,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:(Z,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,w,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}}})(w||(u.css=w={})),(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,ee=D>>8&255,oe=a(m.relativeLuminance2(W,N,ee),m.relativeLuminance2(T,U,P));for(;oe<g&&(W>0||N>0||ee>0);)W-=Math.max(0,Math.ceil(.1*W)),N-=Math.max(0,Math.ceil(.1*N)),ee-=Math.max(0,Math.ceil(.1*ee)),oe=a(m.relativeLuminance2(W,N,ee),m.relativeLuminance2(T,U,P));return(W<<24|N<<16|ee<<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,ee=D>>8&255,oe=a(m.relativeLuminance2(W,N,ee),m.relativeLuminance2(T,U,P));for(;oe<g&&(W<255||N<255||ee<255);)W=Math.min(255,W+Math.ceil(.1*(255-W))),N=Math.min(255,N+Math.ceil(.1*(255-N))),ee=Math.min(255,ee+Math.ceil(.1*(255-ee))),oe=a(m.relativeLuminance2(W,N,ee),m.relativeLuminance2(T,U,P));return(W<<24|N<<16|ee<<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),ee=a(T,m.relativeLuminance(N>>8));if(ee<g){const oe=x(E,D,g);return ee>a(T,m.relativeLuminance(oe>>8))?N:oe}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:(Z,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),w=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 w.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:(Z,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(Z,u,f){var d=this&&this.__decorate||function(ie,R,z,A){var B,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(ie,R,z,A);else for(var me=ie.length-1;me>=0;me--)(B=ie[me])&&(re=(K<3?B(re):K>3?B(R,z,re):B(R,z))||re);return K>3&&re&&Object.defineProperty(R,z,re),re},y=this&&this.__param||function(ie,R){return function(z,A){R(z,A,ie)}};Object.defineProperty(u,"__esModule",{value:!0}),u.InputHandler=u.WindowsOptionsReportType=void 0;const h=f(2584),v=f(7116),b=f(2015),w=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(ie,R){if(ie>24)return R.setWinLines||!1;switch(ie){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(ie){ie[ie.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",ie[ie.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(N||(u.WindowsOptionsReportType=N={}));let ee=0;class oe extends w.Disposable{getAttrData(){return this._curAttrData}constructor(R,z,A,B,K,re,me,pe,F=new b.EscapeSequenceParser){super(),this._bufferService=R,this._charsetService=z,this._coreService=A,this._logService=B,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((k=>this._activeBuffer=k.activeBuffer))),this._parser.setCsiHandlerFallback(((k,ae)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(k),params:ae.toArray()})})),this._parser.setEscHandlerFallback((k=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(k)})})),this._parser.setExecuteHandlerFallback((k=>{this._logService.debug("Unknown EXECUTE code: ",{code:k})})),this._parser.setOscHandlerFallback(((k,ae,fe)=>{this._logService.debug("Unknown OSC code: ",{identifier:k,action:ae,data:fe})})),this._parser.setDcsHandlerFallback(((k,ae,fe)=>{ae==="HOOK"&&(fe=fe.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(k),action:ae,payload:fe})})),this._parser.setPrintHandler(((k,ae,fe)=>this.print(k,ae,fe))),this._parser.registerCsiHandler({final:"@"},(k=>this.insertChars(k))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(k=>this.scrollLeft(k))),this._parser.registerCsiHandler({final:"A"},(k=>this.cursorUp(k))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(k=>this.scrollRight(k))),this._parser.registerCsiHandler({final:"B"},(k=>this.cursorDown(k))),this._parser.registerCsiHandler({final:"C"},(k=>this.cursorForward(k))),this._parser.registerCsiHandler({final:"D"},(k=>this.cursorBackward(k))),this._parser.registerCsiHandler({final:"E"},(k=>this.cursorNextLine(k))),this._parser.registerCsiHandler({final:"F"},(k=>this.cursorPrecedingLine(k))),this._parser.registerCsiHandler({final:"G"},(k=>this.cursorCharAbsolute(k))),this._parser.registerCsiHandler({final:"H"},(k=>this.cursorPosition(k))),this._parser.registerCsiHandler({final:"I"},(k=>this.cursorForwardTab(k))),this._parser.registerCsiHandler({final:"J"},(k=>this.eraseInDisplay(k,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(k=>this.eraseInDisplay(k,!0))),this._parser.registerCsiHandler({final:"K"},(k=>this.eraseInLine(k,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(k=>this.eraseInLine(k,!0))),this._parser.registerCsiHandler({final:"L"},(k=>this.insertLines(k))),this._parser.registerCsiHandler({final:"M"},(k=>this.deleteLines(k))),this._parser.registerCsiHandler({final:"P"},(k=>this.deleteChars(k))),this._parser.registerCsiHandler({final:"S"},(k=>this.scrollUp(k))),this._parser.registerCsiHandler({final:"T"},(k=>this.scrollDown(k))),this._parser.registerCsiHandler({final:"X"},(k=>this.eraseChars(k))),this._parser.registerCsiHandler({final:"Z"},(k=>this.cursorBackwardTab(k))),this._parser.registerCsiHandler({final:"`"},(k=>this.charPosAbsolute(k))),this._parser.registerCsiHandler({final:"a"},(k=>this.hPositionRelative(k))),this._parser.registerCsiHandler({final:"b"},(k=>this.repeatPrecedingCharacter(k))),this._parser.registerCsiHandler({final:"c"},(k=>this.sendDeviceAttributesPrimary(k))),this._parser.registerCsiHandler({prefix:">",final:"c"},(k=>this.sendDeviceAttributesSecondary(k))),this._parser.registerCsiHandler({final:"d"},(k=>this.linePosAbsolute(k))),this._parser.registerCsiHandler({final:"e"},(k=>this.vPositionRelative(k))),this._parser.registerCsiHandler({final:"f"},(k=>this.hVPosition(k))),this._parser.registerCsiHandler({final:"g"},(k=>this.tabClear(k))),this._parser.registerCsiHandler({final:"h"},(k=>this.setMode(k))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(k=>this.setModePrivate(k))),this._parser.registerCsiHandler({final:"l"},(k=>this.resetMode(k))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(k=>this.resetModePrivate(k))),this._parser.registerCsiHandler({final:"m"},(k=>this.charAttributes(k))),this._parser.registerCsiHandler({final:"n"},(k=>this.deviceStatus(k))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(k=>this.deviceStatusPrivate(k))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(k=>this.softReset(k))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(k=>this.setCursorStyle(k))),this._parser.registerCsiHandler({final:"r"},(k=>this.setScrollRegion(k))),this._parser.registerCsiHandler({final:"s"},(k=>this.saveCursor(k))),this._parser.registerCsiHandler({final:"t"},(k=>this.windowOptions(k))),this._parser.registerCsiHandler({final:"u"},(k=>this.restoreCursor(k))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(k=>this.insertColumns(k))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(k=>this.deleteColumns(k))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(k=>this.selectProtected(k))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(k=>this.requestMode(k,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(k=>this.requestMode(k,!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((k=>(this.setTitle(k),this.setIconName(k),!0)))),this._parser.registerOscHandler(1,new D.OscHandler((k=>this.setIconName(k)))),this._parser.registerOscHandler(2,new D.OscHandler((k=>this.setTitle(k)))),this._parser.registerOscHandler(4,new D.OscHandler((k=>this.setOrReportIndexedColor(k)))),this._parser.registerOscHandler(8,new D.OscHandler((k=>this.setHyperlink(k)))),this._parser.registerOscHandler(10,new D.OscHandler((k=>this.setOrReportFgColor(k)))),this._parser.registerOscHandler(11,new D.OscHandler((k=>this.setOrReportBgColor(k)))),this._parser.registerOscHandler(12,new D.OscHandler((k=>this.setOrReportCursorColor(k)))),this._parser.registerOscHandler(104,new D.OscHandler((k=>this.restoreIndexedColor(k)))),this._parser.registerOscHandler(110,new D.OscHandler((k=>this.restoreFgColor(k)))),this._parser.registerOscHandler(111,new D.OscHandler((k=>this.restoreBgColor(k)))),this._parser.registerOscHandler(112,new D.OscHandler((k=>this.restoreCursorColor(k)))),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 k in v.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:k},(()=>this.selectCharset("("+k))),this._parser.registerEscHandler({intermediates:")",final:k},(()=>this.selectCharset(")"+k))),this._parser.registerEscHandler({intermediates:"*",final:k},(()=>this.selectCharset("*"+k))),this._parser.registerEscHandler({intermediates:"+",final:k},(()=>this.selectCharset("+"+k))),this._parser.registerEscHandler({intermediates:"-",final:k},(()=>this.selectCharset("-"+k))),this._parser.registerEscHandler({intermediates:".",final:k},(()=>this.selectCharset("."+k))),this._parser.registerEscHandler({intermediates:"/",final:k},(()=>this.selectCharset("/"+k)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((k=>(this._logService.error("Parsing error: ",k),k))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new g.DcsHandler(((k,ae)=>this.requestStatusString(k,ae))))}_preserveStack(R,z,A,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=R,this._parseStack.cursorStartY=z,this._parseStack.decodedLength=A,this._parseStack.position=B}_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,B=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;B=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,(k=>String.fromCharCode(k))).join("")}"`),typeof R=="string"?R.split("").map((k=>k.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 k=re;k<R.length;k+=P){const ae=k+P<R.length?k+P:R.length,fe=typeof R=="string"?this._stringDecoder.decode(R.substring(k,ae),this._parseBuffer):this._utf8Decoder.decode(R.subarray(k,ae),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,fe))return this._preserveStack(B,K,fe,k),this._logSlowResolvingAsync(A),A}else if(!me){const k=typeof R=="string"?this._stringDecoder.decode(R,this._parseBuffer):this._utf8Decoder.decode(R,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,k))return this._preserveStack(B,K,k,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===B&&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 B,K;const re=this._charsetService.charset,me=this._optionsService.rawOptions.screenReaderMode,pe=this._bufferService.cols,F=this._coreService.decPrivateModes.wraparound,k=this._coreService.modes.insertMode,ae=this._curAttrData;let fe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-z>0&&fe.getWidth(this._activeBuffer.x-1)===2&&fe.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ae);let be=this._parser.precedingJoinState;for(let Se=z;Se<A;++Se){if(B=R[Se],B<127&&re){const tt=re[String.fromCharCode(B)];tt&&(B=tt.charCodeAt(0))}const Le=this._unicodeService.charProperties(B,be);K=E.UnicodeService.extractWidth(Le);const je=E.UnicodeService.extractShouldJoin(Le),Ye=je?E.UnicodeService.extractWidth(be):0;if(be=Le,me&&this._onA11yChar.fire((0,m.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+K-Ye>pe){if(F){const tt=fe;let De=this._activeBuffer.x-Ye;for(this._activeBuffer.x=Ye,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),fe=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ye>0&&fe instanceof o.BufferLine&&fe.copyCellsFrom(tt,De,0,Ye,!1);De<pe;)tt.setCellFromCodepoint(De++,0,1,ae)}else if(this._activeBuffer.x=pe-1,K===2)continue}if(je&&this._activeBuffer.x){const tt=fe.getWidth(this._activeBuffer.x-1)?1:2;fe.addCodepointToCell(this._activeBuffer.x-tt,B,K);for(let De=K-Ye;--De>=0;)fe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}else if(k&&(fe.insertCells(this._activeBuffer.x,K-Ye,this._activeBuffer.getNullCell(ae)),fe.getWidth(pe-1)===2&&fe.setCellFromCodepoint(pe-1,a.NULL_CELL_CODE,a.NULL_CELL_WIDTH,ae)),fe.setCellFromCodepoint(this._activeBuffer.x++,B,K,ae),K>0)for(;--K;)fe.setCellFromCodepoint(this._activeBuffer.x++,0,0,ae)}this._parser.precedingJoinState=be,this._activeBuffer.x<pe&&A-z>0&&fe.getWidth(this._activeBuffer.x)===0&&!fe.hasContent(this._activeBuffer.x)&&fe.setCellFromCodepoint(this._activeBuffer.x,0,1,ae),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,B=!1,K=!1){const re=this._activeBuffer.lines.get(this._activeBuffer.ybase+R);re.replaceCells(z,A,this._activeBuffer.getNullCell(this._eraseAttrData()),K),B&&(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 B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,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,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,K=this._bufferService.rows-1+this._activeBuffer.ybase-B+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 B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;z--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(B,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 B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.deleteCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),B.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 B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.insertCells(0,z,this._activeBuffer.getNullCell(this._eraseAttrData())),B.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 B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.insertCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),B.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 B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.deleteCells(this._activeBuffer.x,z,this._activeBuffer.getNullCell(this._eraseAttrData())),B.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,B=E.UnicodeService.extractWidth(z),K=this._activeBuffer.x-B,re=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(K),me=new Uint32Array(re.length*A);let pe=0;for(let k=0;k<re.length;){const ae=re.codePointAt(k)||0;me[pe++]=ae,k+=ae>65535?2:1}let F=pe;for(let k=1;k<A;++k)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:B,activeEncoding:K}=this._coreMouseService,re=this._coreService,{buffers:me,cols:pe}=this._bufferService,{active:F,alt:k}=me,ae=this._optionsService.rawOptions,fe=je=>je?1:2,be=R.params[0];return Se=be,Le=z?be===2?4:be===4?fe(re.modes.insertMode):be===12?3:be===20?fe(ae.convertEol):0:be===1?fe(A.applicationCursorKeys):be===3?ae.windowOptions.setWinLines?pe===80?2:pe===132?1:0:0:be===6?fe(A.origin):be===7?fe(A.wraparound):be===8?3:be===9?fe(B==="X10"):be===12?fe(ae.cursorBlink):be===25?fe(!re.isCursorHidden):be===45?fe(A.reverseWraparound):be===66?fe(A.applicationKeypad):be===67?4:be===1e3?fe(B==="VT200"):be===1002?fe(B==="DRAG"):be===1003?fe(B==="ANY"):be===1004?fe(A.sendFocus):be===1005?4:be===1006?fe(K==="SGR"):be===1015?4:be===1016?fe(K==="SGR_PIXELS"):be===1048?1:be===47||be===1047||be===1049?fe(F===k):be===2004?fe(A.bracketedPasteMode):0,re.triggerDataEvent(`${h.C0.ESC}[${z?"":"?"}${Se};${Le}$y`),!0;var Se,Le}_updateAttrColor(R,z,A,B,K){return z===2?(R|=50331648,R&=-16777216,R|=_.AttributeData.fromColorRGB([A,B,K])):z===5&&(R&=-50331904,R|=33554432|255&A),R}_extractColor(R,z,A){const B=[0,0,-1,0,0,0];let K=0,re=0;do{if(B[re+K]=R.params[z+re],R.hasSubParams(z+re)){const me=R.getSubParams(z+re);let pe=0;do B[1]===5&&(K=1),B[re+pe+1+K]=me[pe];while(++pe<me.length&&pe+re+1+K<B.length);break}if(B[1]===5&&re+K>=2||B[1]===2&&re+K>=5)break;B[1]&&(K=1)}while(++re+z<R.length&&re+K<B.length);for(let me=2;me<B.length;++me)B[me]===-1&&(B[me]=0);switch(B[0]){case 38:A.fg=this._updateAttrColor(A.fg,B[1],B[3],B[4],B[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,B[1],B[3],B[4],B[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,B[1],B[3],B[4],B[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 B=this._curAttrData;for(let K=0;K<z;K++)A=R.params[K],A>=30&&A<=37?(B.fg&=-50331904,B.fg|=16777216|A-30):A>=40&&A<=47?(B.bg&=-50331904,B.bg|=16777216|A-40):A>=90&&A<=97?(B.fg&=-50331904,B.fg|=16777224|A-90):A>=100&&A<=107?(B.bg&=-50331904,B.bg|=16777224|A-100):A===0?this._processSGR0(B):A===1?B.fg|=134217728:A===3?B.bg|=67108864:A===4?(B.fg|=268435456,this._processUnderline(R.hasSubParams(K)?R.getSubParams(K)[0]:1,B)):A===5?B.fg|=536870912:A===7?B.fg|=67108864:A===8?B.fg|=1073741824:A===9?B.fg|=2147483648:A===2?B.bg|=134217728:A===21?this._processUnderline(2,B):A===22?(B.fg&=-134217729,B.bg&=-134217729):A===23?B.bg&=-67108865:A===24?(B.fg&=-268435457,this._processUnderline(0,B)):A===25?B.fg&=-536870913:A===27?B.fg&=-67108865:A===28?B.fg&=-1073741825:A===29?B.fg&=2147483647:A===39?(B.fg&=-67108864,B.fg|=16777215&o.DEFAULT_ATTR_DATA.fg):A===49?(B.bg&=-67108864,B.bg|=16777215&o.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?K+=this._extractColor(R,K,B):A===53?B.bg|=1073741824:A===55?B.bg&=-1073741825:A===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):A===100?(B.fg&=-67108864,B.fg|=16777215&o.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.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 B=A.shift(),K=A.shift();if(/^\d+$/.exec(B)){const re=parseInt(B);if($(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 B;const K=A.findIndex((re=>re.startsWith("id=")));return K!==-1&&(B=A[K].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,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 B=0;B<A.length&&!(z>=this._specialColors.length);++B,++z)if(A[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[z]}]);else{const K=(0,T.parseColor)(A[B]);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 B=0;B<A.length;++B)if(/^\d+$/.exec(A[B])){const K=parseInt(A[B]);$(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,B=this._activeBuffer.lines.get(A);B&&(B.fill(R),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(R,z){const A=this._bufferService.buffer,B=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}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(R,z){this._dirtyRowTracker.markRangeDirty(R,z)}}u.InputHandler=oe;let q=class{constructor(ie){this._bufferService=ie,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(ie){ie<this.start?this.start=ie:ie>this.end&&(this.end=ie)}markRangeDirty(ie,R){ie>R&&(ee=ie,ie=R,R=ee),ie<this.start&&(this.start=ie),R>this.end&&(this.end=R)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function $(ie){return 0<=ie&&ie<256}q=d([y(0,x.IBufferService)],q)},844:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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 w=0,m=0,o=b.timeRemaining(),c=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),m=Math.max(w,m),c=b.timeRemaining(),1.5*m>c)return o-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(o-w))}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 w=Date.now()+b;return{timeRemaining:()=>Math.max(0,w-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:(Z,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:(Z,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:(Z,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),w=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=w.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=w.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 ee;ee=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 oe=[];for(let A=0;A<N;A++){const B=this.getBlankLine(v.DEFAULT_ATTR_DATA,!0);oe.push(B)}oe.length>0&&(x.push({start:D+T.length+E,newLines:oe}),E+=oe.length),T.push(...oe);let q=W.length-1,$=W[q];$===0&&(q--,$=W[q]);let ie=T.length-N-1,R=P;for(;ie>=0;){const A=Math.min(R,$);if(T[q]===void 0)break;if(T[q].copyCellsFrom(T[ie],R-A,$-A,A,!0),$-=A,$===0&&(q--,$=W[q]),R-=A,R===0){ie--;const B=Math.max(ie,0);R=(0,b.getWrappedLineTrimmedLength)(T,B,this._cols)}}for(let A=0;A<T.length;A++)W[A]<a&&T[A].setCell(W[A],_);let z=N-ee;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 $=W.newLines.length-1;$>=0;$--)this.lines.set(q--,W.newLines[$]);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 ee=0;for(let q=D.length-1;q>=0;q--)D[q].index+=ee,this.lines.onInsertEmitter.fire(D[q]),ee+=D[q].amount;const oe=Math.max(0,T+E-this.lines.maxLength);oe>0&&this.lines.onTrimEmitter.fire(oe)}}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:(Z,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 w{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 w(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=w},4841:(Z,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:(Z,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 w=[];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&&(w.push(m+a.length-D),w.push(D)),m+=a.length-1}return w},u.reflowLargerCreateNewLayout=function(d,y){const h=[];let v=0,b=y[v],w=0;for(let m=0;m<d.length;m++)if(b===m){const o=y[++v];d.onDeleteEmitter.fire({index:m-w,amount:o}),m+=o-1,w+=o,b=y[++v]}else h.push(m);return{layout:h,countRemoved:w}},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 w=0,m=0,o=0;for(;o<b;){if(b-o<h){v.push(b-o);break}w+=h;const c=f(d,m,y);w>c&&(w-=c,m++);const a=d[m].getWidth(w-1)===2;a&&w--;const l=a?h-1:h;v.push(l),o+=l}return v},u.getWrappedLineTrimmedLength=f},5295:(Z,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(w,m){super(),this._optionsService=w,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(w){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(w),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(w,m){this._normal.resize(w,m),this._alt.resize(w,m),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}u.BufferSet=v},511:(Z,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(w){const m=new v;return m.setFromCharData(w),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(w){this.fg=w[y.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(w[y.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(w[y.CHAR_DATA_CHAR_INDEX].length===2){const o=w[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=o&&o<=56319){const c=w[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&c<=57343?this.content=1024*(o-55296)+c-56320+65536|w[y.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=w[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[y.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=w[y.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[y.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}u.CellData=v},643:(Z,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:(Z,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:(Z,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:(Z,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:(Z,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,w){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&&!w||!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:(Z,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 w=f.charCodeAt(b);if(55296<=w&&w<=56319){if(++b>=y)return this._interim=w,h;const m=f.charCodeAt(b);56320<=m&&m<=57343?d[h++]=1024*(w-55296)+m-56320+65536:(d[h++]=w,d[h++]=m)}else w!==65279&&(d[h++]=w)}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,w,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&(w=f[l+3]));)d[m++]=h,d[m++]=v,d[m++]=b,d[m++]=w,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(w=f[l++],(192&w)!=128){l--;continue}if(o=(7&h)<<18|(63&v)<<12|(63&b)<<6|63&w,o<65536||o>1114111)continue;d[m++]=o}}return m}}},225:(Z,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(w,m){let o,c=0,a=m.length-1;if(w<m[0][0]||w>m[a][1])return!1;for(;a>=c;)if(o=c+a>>1,w>m[o][1])c=o+1;else{if(!(w<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,w){let m=this.wcwidth(b),o=m===0&&w!==0;if(o){const c=d.UnicodeService.extractWidth(w);c===0?o=!1:c>m&&(m=c)}return d.UnicodeService.createPropertyValue(0,m,o)}}},5981:(Z,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,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let 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,w){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(w),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(w)}_innerWrite(b=0,w=!0){const m=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const o=this._writeBuffer[this._bufferOffset],c=this._action(o,w);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:(Z,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),w=b.length<2?"0"+b:b;switch(v){case 4:return b[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}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 w=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/w*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/w*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/w*255)]}}else if(v.indexOf("#")===0&&(v=v.slice(1),d.exec(v)&&[3,6,9,12].includes(v.length))){const b=v.length/3,w=[0,0,0];for(let m=0;m<3;++m){const o=parseInt(v.slice(b*m,b*m+b),16);w[m]=b===1?o<<4:b===2?o:b===3?o>>4:o>>8}return w}},u.toRgbString=function(h,v=16){const[b,w,m]=h;return`rgb:${y(b,v)}/${y(w,v)}/${y(m,v)}`}},5770:(Z,u)=>{Object.defineProperty(u,"__esModule",{value:!0}),u.PAYLOAD_LIMIT=void 0,u.PAYLOAD_LIMIT=1e7},6351:(Z,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(w,m){this._handlers[w]===void 0&&(this._handlers[w]=[]);const o=this._handlers[w];return o.push(m),{dispose:()=>{const c=o.indexOf(m);c!==-1&&o.splice(c,1)}}}clearHandler(w){this._handlers[w]&&delete this._handlers[w]}setHandlerFallback(w){this._handlerFb=w}reset(){if(this._active.length)for(let w=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;w>=0;--w)this._active[w].unhook(!1);this._stack.paused=!1,this._active=v,this._ident=0}hook(w,m){if(this.reset(),this._ident=w,this._active=this._handlers[w]||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(w,m,o){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(w,m,o);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(w,m,o))}unhook(w,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(w),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",w);this._active=v,this._ident=0}};const b=new y.Params;b.addParam(0),u.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=b,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():b,this._data="",this._hitLimit=!1}put(w,m,o){this._hitLimit||(this._data+=(0,d.utf32ToString)(w,m,o),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let m=!1;if(this._hitLimit)m=!1;else if(w&&(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:(Z,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 w=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(w,0,2,0),o.add(w,8,5,8),o.add(w,6,0,6),o.add(w,11,0,11),o.add(w,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:w)],E>>4){case 2:for(let N=g+1;;++N){if(N>=a||(x=c[N])<32||x>126&&x<w){this._printHandler(c,g,N),g=N-1;break}if(++N>=a||(x=c[N])<32||x>126&&x<w){this._printHandler(c,g,N),g=N-1;break}if(++N>=a||(x=c[N])<32||x>126&&x<w){this._printHandler(c,g,N),g=N-1;break}if(++N>=a||(x=c[N])<32||x>126&&x<w){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<w){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<w){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:(Z,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 w=this._handlers[v];return w.push(b),{dispose:()=>{const m=w.indexOf(b);m!==-1&&w.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,w){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(v,b,w);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(v,b,w))}start(){this.reset(),this._state=1}put(v,b,w){if(this._state!==3){if(this._state===1)for(;b<w;){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&&w-b>0&&this._put(v,b,w)}}end(v,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,m=this._active.length-1,o=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,w=b,o=this._stack.fallThrough,this._stack.paused=!1),!o&&w===!1){for(;m>=0&&(w=this._active[m].end(v),w!==!0);m--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,w;m--}for(;m>=0;m--)if(w=this._active[m].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,w}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,w){this._hitLimit||(this._data+=(0,y.utf32ToString)(v,b,w),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((w=>(this._data="",this._hitLimit=!1,w)));return this._data="",this._hitLimit=!1,b}}},8742:(Z,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 w=h[b];if(Array.isArray(w))for(let m=0;m<w.length;++m)v.addSubParam(w[m]);else v.addParam(w)}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,w=255&this._subParamsIdx[v];w-b>0&&h.push(Array.prototype.slice.call(this._subParams,b,w))}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,w=255&this._subParamsIdx[v];w-b>0&&(h[v]=this._subParams.slice(b,w))}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,w=b[v-1];b[v-1]=~w?Math.min(10*w+h,f):h}}u.Params=d},5741:(Z,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:(Z,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:(Z,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:(Z,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(w){super(),this._core=w,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:(Z,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:(Z,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(Z,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),w=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,w.IOptionsService)],m)},7994:(Z,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(Z,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),w={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(w))this.addProtocol(x,w[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(Z,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),w=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,w.IBufferService),y(1,w.ILogService),y(2,w.IOptionsService)],c)},9074:(Z,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,w=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,w=b+(E.options.width??1),a>=b&&a<w&&(!_||(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:(Z,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[w,m]of b)this.set(w,m)}set(b,w){const m=this._entries.get(b);return this._entries.set(b,w),m}forEach(b){for(const[w,m]of this._entries.entries())b(w,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 w=(0,y.getServiceDependencies)(v).sort(((c,a)=>c.index-a.index)),m=[];for(const c of w){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=w.length>0?w[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(Z,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 w,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()))),w=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){w=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(w.logLevel!==v.LogLevelEnum.TRACE)return l.apply(this,_);w.trace(`GlyphRenderer#${l.name}(${_.map((E=>JSON.stringify(E))).join(", ")})`);const x=l.apply(this,_);return w.trace(`GlyphRenderer#${l.name} return`,x),x}}},7302:(Z,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(Z,u,f){var d=this&&this.__decorate||function(b,w,m,o){var c,a=arguments.length,l=a<3?w:o===null?o=Object.getOwnPropertyDescriptor(w,m):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(b,w,m,o);else for(var _=b.length-1;_>=0;_--)(c=b[_])&&(l=(a<3?c(l):a>3?c(w,m,l):c(w,m))||l);return a>3&&l&&Object.defineProperty(w,m,l),l},y=this&&this.__param||function(b,w){return function(m,o){w(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 w=this._bufferService.buffer;if(b.id===void 0){const _=w.addMarker(w.ybase+w.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,w.ybase+w.y),c.id;const a=w.addMarker(w.ybase+w.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,w){const m=this._dataByLinkId.get(b);if(m&&m.lines.every((o=>o.line!==w))){const o=this._bufferService.buffer.addMarker(w);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,w){const m=b.lines.indexOf(w);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:(Z,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,w){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,w)};return h.toString=()=>y,u.serviceRegistry.set(y,h),h}},2585:(Z,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:(Z,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,w,m=!1){return(16777215&b)<<3|(3&w)<<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 w=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 w+this.wcwidth(a);const x=b.charCodeAt(c);56320<=x&&x<=57343?a=1024*(a-55296)+x-56320+65536:w+=this.wcwidth(x)}const l=this.charProperties(a,m);let _=h.extractWidth(l);h.extractShouldJoin(l)&&(_-=h.extractWidth(m)),w+=_,m=l}return w}charProperties(b,w){return this._activeProvider.charProperties(b,w)}}u.UnicodeService=h}},j={};function J(Z){var u=j[Z];if(u!==void 0)return u.exports;var f=j[Z]={exports:{}};return O[Z].call(f.exports,f,f.exports,J),f.exports}var se={};return(()=>{var Z=se;Object.defineProperty(Z,"__esModule",{value:!0}),Z.Terminal=void 0;const u=J(9042),f=J(3236),d=J(844),y=J(5741),h=J(8285),v=J(7975),b=J(7090),w=["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(w.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")}}Z.Terminal=m})(),se})()))})(kc)),kc.exports}var Em=wm(),Oc={exports:{}},Rd;function xm(){return Rd||(Rd=1,(function(C,L){(function(O,j){C.exports=j()})(self,(()=>(()=>{var O={};return(()=>{var j=O;Object.defineProperty(j,"__esModule",{value:!0}),j.FitAddon=void 0,j.FitAddon=class{activate(J){this._terminal=J}dispose(){}fit(){const J=this.proposeDimensions();if(!J||!this._terminal||isNaN(J.cols)||isNaN(J.rows))return;const se=this._terminal._core;this._terminal.rows===J.rows&&this._terminal.cols===J.cols||(se._renderService.clear(),this._terminal.resize(J.cols,J.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const J=this._terminal._core,se=J._renderService.dimensions;if(se.css.cell.width===0||se.css.cell.height===0)return;const Z=this._terminal.options.scrollback===0?0:J.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")))-Z;return{cols:Math.max(2,Math.floor(v/se.css.cell.width)),rows:Math.max(1,Math.floor(h/se.css.cell.height))}}}})(),O})()))})(Oc)),Oc.exports}var Am=xm();const gl=16e3,Dm=.004,Tm=["audio/webm;codecs=opus","audio/webm","audio/mp4"];function Zd(C){if(!C.length)return 0;let L=0;for(const O of C)L+=O*O;return Math.sqrt(L/C.length)}function Md(C,L=Dm){return Zd(C)<L}async function Rm(C){const L=new AudioContext;try{const O=await L.decodeAudioData(await C.arrayBuffer()),j=Math.max(1,Math.ceil(O.duration*gl)),J=new OfflineAudioContext(1,j,gl),se=J.createBufferSource();return se.buffer=O,se.connect(J.destination),se.start(),(await J.startRendering()).getChannelData(0)}finally{L.close()}}class Ld{constructor(){this.stream=null,this.recorder=null,this.chunks=[]}async start(){this.stream=await navigator.mediaDevices.getUserMedia({audio:!0});const L=Tm.find(O=>MediaRecorder.isTypeSupported(O));this.recorder=new MediaRecorder(this.stream,L?{mimeType:L}:void 0),this.chunks=[],this.recorder.ondataavailable=O=>{O.data.size&&this.chunks.push(O.data)},this.recorder.start()}stop(){return new Promise(L=>{const O=this.recorder;if(!O||O.state==="inactive"){this.dispose(),L(null);return}O.onstop=()=>{const j=new Blob(this.chunks,{type:O.mimeType||"audio/webm"});if(this.dispose(),!j.size){L(null);return}Rm(j).then(L,()=>L(null))},O.stop()})}cancel(){const L=this.recorder;L&&L.state!=="inactive"&&(L.onstop=null,L.stop()),this.dispose()}dispose(){this.stream?.getTracks().forEach(L=>L.stop()),this.stream=null,this.recorder=null,this.chunks=[]}}function hl(C){const L=C.replace(/^.*@/,""),O=L.replace(/:\d+$/,"");return O.includes(":")?L:O}const pl="\x1B",kd="\x07",Mm=new RegExp(pl+"\\][^"+kd+pl+"]*(?:"+kd+"|"+pl+"\\\\)","g"),Lm=new RegExp(pl+"\\[[0-9;?]*[A-Za-z]","g");function km(C){return/[#$%>]\s*$/.test(C.replace(Mm,"").replace(Lm,""))}const Om=60,Bm=200;function jm(C){if(C.type!=="keydown"||!(C.ctrlKey||C.metaKey)||!C.shiftKey)return null;const L=C.key.toLowerCase();return L==="c"?"copy":L==="v"?"paste":null}function Sl(C){return C instanceof Error?C.message:String(C)}function Hm(C,L,O){if(L.mark(),typeof C.terminal.paste=="function"){C.terminal.paste(O);return}C.writeToPty?.(O)}function Qd(C=()=>Date.now()){let L=Number.NEGATIVE_INFINITY;return{mark(){L=C()},isDuplicate(){return C()-L<Bm}}}function Nm(C,L){const O=j=>{L.isDuplicate()&&(j.preventDefault(),j.stopPropagation(),j.stopImmediatePropagation?.())};return C.addEventListener("paste",O,!0),()=>C.removeEventListener("paste",O,!0)}function zm(C,L=Qd()){return O=>{const j=jm(O);if(!j)return!0;if(O.preventDefault(),O.stopPropagation(),j==="copy"){const J=C.terminal.getSelection();return J&&C.clipboard.copyText(J).catch(se=>{C.onError(Sl(se))}),!1}return C.clipboard.readText().then(J=>{J&&Hm(C,L,J)}).catch(J=>{C.onError(Sl(J))}),!1}}const Um=new Set(["c","p","s"]);function qm(C){return C?[...C].some(L=>Um.has(L)):!0}function Im(C){const L=C.replace(/\s+/g,"");if(!/^[A-Za-z0-9+/]*={0,2}$/.test(L))return null;try{const O=atob(L),j=Uint8Array.from(O,J=>J.charCodeAt(0));return new TextDecoder().decode(j)}catch{return null}}function Pm(C){const L=C.indexOf(";");if(L===-1||!qm(C.slice(0,L)))return null;const O=C.slice(L+1);return O==="?"||!O?null:Im(O)}function Gm(C){const L=C.terminal.parser;if(!L)return()=>{};const O=L.registerOscHandler(52,j=>{const J=Pm(j);return J!==null&&C.clipboard.copyText(J).catch(se=>{C.onError(Sl(se))}),!0});return()=>{O&&typeof O.dispose=="function"&&O.dispose()}}function Wm(C){const{terminal:L}=C;if(typeof L.onSelectionChange!="function")return()=>{};let O,j=null;const J=L.onSelectionChange(()=>{O&&clearTimeout(O),O=setTimeout(()=>{if(O=void 0,C.isCopyOnSelectEnabled&&!C.isCopyOnSelectEnabled())return;const se=L.getSelection();!se||se===j||(j=se,C.clipboard.copyText(se).catch(Z=>{j=null,C.onError(Sl(Z))}))},Om)});return()=>{O&&clearTimeout(O),J&&typeof J.dispose=="function"&&J.dispose()}}function Fm(C){const L=Qd();C.terminal.attachCustomKeyEventHandler(zm(C,L));const O=[Gm(C),Wm(C),C.pasteEventTarget?Nm(C.pasteEventTarget,L):()=>{}];return()=>{for(const j of O.reverse())j()}}function Km(C){let L=!1;return{onMouseDown(O){L=O.target===O.currentTarget},onClick(O){const j=L&&O.target===O.currentTarget;L=!1,j&&C()}}}function rr(C){const L=_e.useRef(C);L.current=C;const O=_e.useRef(null);return O.current||(O.current=Km(()=>L.current())),O.current}function Ve({name:C,className:L=""}){const O={viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round",className:`icon-svg ${L}`.trim(),"aria-hidden":!0};switch(C){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"terminal":return p.jsxs("svg",{...O,children:[p.jsx("rect",{x:"3",y:"4",width:"18",height:"16",rx:"2"}),p.jsx("path",{d:"M7 9l3 3-3 3M13 15h4"})]});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 or="\x1B",bl="\x07",Ym=new RegExp(or+"\\]7;([^"+bl+or+"]*)(?:"+bl+"|"+or+"\\\\)","g"),Vm=new RegExp(or+"\\][^"+bl+or+"]*(?:"+bl+"|"+or+"\\\\)","g"),$m=new RegExp(or+"\\[[0-9;?]*[ -/]*[@-~]","g");function Xm(C){const L=C.match(/^file:\/\/[^/]*(\/.*)$/);if(!L)return null;try{const O=decodeURIComponent(L[1]);return O.includes("\0")?null:O}catch{return null}}function Zm(C){const O=C.replace(Vm,"").replace($m,"").replace(/\r/g,`
|
|
18
|
+
`).split(`
|
|
19
|
+
`).filter(Z=>Z.trim()),j=O[O.length-1];if(!j)return null;const J=j.match(/(?:^|[:\s])(~|~\/[^\s:]*|\/[^\s:]*)\s*[#$%>]\s*$/);return J?J[1].replace(/\/+$/,"")||"/":null}function Qm(C){let L=null;for(const j of C.matchAll(Ym))L=j[1];if(L){const j=Xm(L);if(j)return{path:j,source:"osc7"}}const O=Zm(C);return O?{path:O,source:"prompt"}:null}function Jm(C){return!C||C==="~"||C==="~/"?{}:C.startsWith("/")?{absolute:C}:C.startsWith("~/")?{homeRelative:C.slice(2)}:{}}function nr(C,L){return L.startsWith("/")?L:C==="/"?`/${L}`:`${C.replace(/\/+$/,"")}/${L}`}function ep(C){const L=C.replace(/\/+$/,""),O=L.lastIndexOf("/");return O<=0?"/":L.slice(0,O)}function Jd(C){return/^[A-Za-z]:/.test(C)||C.startsWith("\\\\")||C.includes("\\")}function Pr(C,L){const O=Jd(C)?"\\":"/";return`${C.replace(/[\\/]+$/,"")}${O}${L}`}function tp(C){const L=Jd(C),O=C.replace(/[\\/]+$/,""),j=Math.max(O.lastIndexOf("/"),O.lastIndexOf("\\"));if(j<0)return C;if(!L)return j===0?"/":O.slice(0,j);const J=O.slice(0,j);return/^[A-Za-z]:$/.test(J)?`${J}\\`:J||"\\"}function ip(C){const L=C.split(/[\\/]/).filter(Boolean);return L[L.length-1]??C}function sp(C){if(C.kind==="directory")return"—";const L=["B","KB","MB","GB","TB"];let O=C.size,j=0;for(;O>=1024&&j<L.length-1;)O/=1024,j+=1;return`${j===0?O:O.toFixed(O<10?1:0)} ${L[j]}`}function rp(C){if(!C)return"";const L=C.match(/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/);if(!L)return C;const[,O,j,J,se,Z]=L;return`${O}-${j}-${J} ${se}:${Z}`}function e_(C){if(!C||C.kind!=="ssh")return null;const L=C.sshTarget||C.host;return L&&L!=="local"?L:null}function np(C){return C?e_(C)?{available:!0,reason:`Transfer files with ${C.host}`}:{available:!1,reason:`${C.name} is a local session — SFTP needs an SSH connection`}:{available:!1,reason:"Open an SSH session to transfer files"}}function Od(C){return C.kind==="directory"||C.kind==="symlink"}function Bd(C,L,O=!1){return C.filter(j=>L.has(j.name)&&(O||j.kind!=="directory"))}function jd(C,L,O="file"){return L===0?C:`${C} ${L} ${L===1?O:`${O}s`}`}function Hd(C,L,O,j,J){if(j&&J){const Z=J.indexOf(j),u=J.indexOf(L);if(Z>=0&&u>=0){const f=O?new Set(C):new Set,d=Math.min(Z,u),y=Math.max(Z,u);for(const h of J.slice(d,y+1))f.add(h);return f}}if(!O)return new Set([L]);const se=new Set(C);return se.has(L)?se.delete(L):se.add(L),se}function ap({session:C,target:L,api:O,onClose:j,backdrop:J}){const[se,Z]=_e.useState(null),[u,f]=_e.useState(null),[d,y]=_e.useState(null),[h,v]=_e.useState({local:!0,remote:!0}),[b,w]=_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,ee]=_e.useState(null),[oe,q]=_e.useState(null),$=_e.useRef({local:null,remote:null}),ie=_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 B=_e.useCallback(de=>{const ge=de instanceof Error?de.message:String(de);return a(ge),ge},[]),K=_e.useCallback(async de=>{v(ge=>({...ge,local:!0}));try{const ge=await O.listLocalDirectory(de);if(!A.current)return;Z(ge),o(ye=>({...ye,local:ge.path})),w(ye=>({...ye,local:new Set})),_(ye=>({...ye,local:void 0}))}catch(ge){if(!A.current)return;_(ye=>({...ye,local:B(ge)}))}finally{A.current&&v(ge=>({...ge,local:!1}))}},[O,B]),re=_e.useCallback(async de=>{const ge=ie.current;if(ge){v(ye=>({...ye,remote:!0}));try{const ye=await O.sftpList(ge,de);if(!A.current)return;f(ye),o(Oe=>({...Oe,remote:ye.path})),w(Oe=>({...Oe,remote:new Set})),_(Oe=>({...Oe,remote:void 0}))}catch(ye){if(!A.current)return;_(Oe=>({...Oe,remote:B(ye)}))}finally{A.current&&v(ye=>({...ye,remote:!1}))}}},[O,B]);_e.useEffect(()=>O.onSftpEvent?.(de=>{if(!A.current)return;const ge=ie.current;if(de.type==="prompt"){if(ge&&de.prompt.sessionId!==ge)return;ie.current=de.prompt.sessionId,g(de.prompt),U("");return}ge&&de.sessionId!==ge||(de.type==="progress"&&E({name:de.name,percent:de.percent,detail:de.detail}),de.type==="status"&&a(de.message),de.type==="closed"&&(ie.current=null,y(null),_(ye=>({...ye,remote:de.message})),a(de.message)))}),[O]),_e.useEffect(()=>{K();const de=Jm(C.cwd);let ge=!1;return(async()=>{try{const ye=await O.sftpOpen(L,de.absolute);if(ge||!A.current)return;ie.current=ye.id,y(ye),g(null),a(`Connected to ${ye.target}`),await re(de.homeRelative?nr(ye.cwd,de.homeRelative):void 0)}catch(ye){if(ge||!A.current)return;g(null),v(Oe=>({...Oe,remote:!1})),_(Oe=>({...Oe,remote:B(ye)}))}})(),()=>{ge=!0}},[]);const me=_e.useCallback(de=>de==="local"?K(R.current):re(z.current),[K,re]),pe=(de,ge)=>de==="local"?K(ge):re(ge),F=_e.useMemo(()=>Bd(se?.entries??[],b.local),[se,b.local]),k=_e.useMemo(()=>Bd(u?.entries??[],b.remote,!0),[u,b.remote]),ae=x!==null,fe=async de=>{const ge=ie.current;if(!ge||!se||!u)return;const ye=de==="upload"?F:k;if(!ye.length)return;E({name:ye[0].name,percent:0,detail:"starting"});let Oe=0;try{for(const ze of ye)a(`${de==="upload"?"Uploading":"Downloading"} ${ze.name}…`),de==="upload"?await O.sftpUpload(ge,Pr(se.path,ze.name),u.path):await O.sftpDownload(ge,nr(u.path,ze.name),se.path,ze.kind),Oe+=1;a(`${de==="upload"?"Uploaded":"Downloaded"} ${Oe} ${Oe===1?"file":"files"}.`)}catch(ze){const Ne=B(ze);a(`${Ne} (${Oe} of ${ye.length} transferred)`)}finally{A.current&&(E(null),await me(de==="upload"?"remote":"local"))}},be=async de=>{if(de.preventDefault(),!P)return;const ge=P.value.trim(),ye=P.side;if(ge)try{ye==="local"&&se?await O.createLocalDirectory(Pr(se.path,ge)):ye==="remote"&&u&&ie.current&&await O.sftpMkdir(ie.current,nr(u.path,ge)),W(null),a(`Created ${ge}`),await me(ye)}catch(Oe){B(Oe)}},Se=async de=>{if(de.preventDefault(),!N)return;const ge=N.value.trim(),{side:ye,entry:Oe}=N;if(!ge||ge===Oe.name){ee(null);return}try{ye==="local"&&se?await O.renameLocalEntry(Pr(se.path,Oe.name),Pr(se.path,ge)):ye==="remote"&&u&&ie.current&&await O.sftpRename(ie.current,nr(u.path,Oe.name),nr(u.path,ge)),ee(null),a(`Renamed to ${ge}`),await me(ye)}catch(ze){B(ze)}},Le=async()=>{if(!oe)return;const{side:de,entry:ge}=oe;try{de==="local"&&se?await O.removeLocalEntry(Pr(se.path,ge.name),ge.kind):de==="remote"&&u&&ie.current&&await O.sftpRemove(ie.current,nr(u.path,ge.name),ge.kind),q(null),a(`Deleted ${ge.name}`),await me(de)}catch(ye){B(ye)}},je=async de=>{de.preventDefault();const ge=ie.current;if(!ge||!D)return;const ye=D.kind==="confirm"?"yes":T;g(null),U(""),a(D.kind==="confirm"?"Accepting host key…":"Authenticating…");try{await O.sftpAnswerPrompt(ge,ye)}catch(Oe){B(Oe)}},Ye=async de=>{const ge=ie.current;if(g(null),U(""),a(de==="confirm"?"Host key rejected.":"Cancelled. The transfer connection was closed."),!!ge)try{de==="confirm"?await O.sftpAnswerPrompt(ge,"no"):await O.sftpClose(ge)}catch{}},tt=(de,ge)=>{if(!Od(ge))return;const ye=de==="local"?se?.path:u?.path;ye&&pe(de,de==="local"?Pr(ye,ge.name):nr(ye,ge.name))},De=de=>{const ge=de==="local"?b.local:b.remote,ye=(de==="local"?se?.entries:u?.entries)??[];return ge.size!==1?null:ye.find(Oe=>ge.has(Oe.name))??null},jt=de=>{const ge=de==="local"?se:u,ye=de==="local"?b.local:b.remote,Oe=de==="local"?l.local:l.remote,ze=de==="local"?h.local:h.remote,Ne=De(de),_t=de==="remote"&&!d;return p.jsxs("section",{className:`sftp-pane sftp-pane-${de}`,children:[p.jsxs("header",{className:"sftp-pane-head",children:[p.jsx("span",{className:"eyebrow",children:de==="local"?"THIS COMPUTER":C.host.toUpperCase()}),p.jsxs("div",{className:"sftp-pane-tools",children:[p.jsx("button",{type:"button",title:"Parent folder","aria-label":`${de} parent folder`,disabled:!ge||ze,onClick:()=>ge&&void pe(de,de==="local"?tp(ge.path):ep(ge.path)),children:p.jsx(Ve,{name:"level-up"})}),p.jsx("button",{type:"button",title:"Refresh","aria-label":`Refresh ${de}`,disabled:ze||_t,onClick:()=>{me(de)},children:p.jsx(Ve,{name:"refresh"})}),p.jsx("button",{type:"button",title:"New folder","aria-label":`New folder on ${de}`,disabled:!ge||_t,onClick:()=>W({side:de,value:""}),children:p.jsx(Ve,{name:"folder-plus"})}),p.jsx("button",{type:"button",title:Ne?`Rename ${Ne.name}`:"Select one item to rename","aria-label":`Rename on ${de}`,disabled:!Ne||_t,onClick:()=>Ne&&ee({side:de,entry:Ne,value:Ne.name}),children:p.jsx(Ve,{name:"pencil"})}),p.jsx("button",{type:"button",className:"sftp-danger",title:Ne?`Delete ${Ne.name}`:"Select one item to delete","aria-label":`Delete on ${de}`,disabled:!Ne||_t,onClick:()=>Ne&&q({side:de,entry:Ne}),children:p.jsx(Ve,{name:"trash"})})]})]}),p.jsx("form",{className:"sftp-path",onSubmit:Ue=>{Ue.preventDefault();const vt=(de==="local"?m.local:m.remote).trim();vt&&pe(de,vt)},children:p.jsx("input",{value:de==="local"?m.local:m.remote,onChange:Ue=>{const vt=Ue.target.value;o(ct=>de==="local"?{...ct,local:vt}:{...ct,remote:vt})},spellCheck:!1,"aria-label":`${de} path`,placeholder:de==="local"?"Local folder":"Remote folder",disabled:_t})}),p.jsx("div",{className:"sftp-list",role:"listbox","aria-label":`${de} files`,"aria-busy":ze,children:Oe?p.jsxs("div",{className:"sftp-empty sftp-error",children:[p.jsx("b",{children:de==="local"?"Cannot read this folder":"No remote listing"}),p.jsx("small",{children:Oe})]}):ze&&!ge?p.jsxs("div",{className:"sftp-empty",children:[p.jsx("b",{children:de==="remote"&&!d?"Connecting…":"Loading…"}),p.jsx("small",{children:de==="remote"?`Opening SFTP to ${C.host}`:"Reading the local folder"})]}):ge&&ge.entries.length?ge.entries.map(Ue=>p.jsxs("button",{type:"button",role:"option","aria-selected":ye.has(Ue.name),className:`sftp-row ${ye.has(Ue.name)?"selected":""} ${Ue.kind==="directory"?"is-directory":""}`,onClick:vt=>{const ct=vt.ctrlKey||vt.metaKey,_i=$.current[de],Ht=vt.shiftKey&&_i?_i:void 0,$t=ge?.entries.map(Ke=>Ke.name);w(Ke=>de==="local"?{...Ke,local:Hd(Ke.local,Ue.name,ct,Ht,$t)}:{...Ke,remote:Hd(Ke.remote,Ue.name,ct,Ht,$t)}),vt.shiftKey||($.current[de]=Ue.name)},onDoubleClick:()=>tt(de,Ue),onKeyDown:vt=>{vt.key!=="Enter"||!Od(Ue)||(vt.preventDefault(),tt(de,Ue))},title:Ue.linkTarget?`${Ue.name} → ${Ue.linkTarget}`:Ue.name,children:[p.jsx(Ve,{name:Ue.kind==="directory"?"folder":Ue.kind==="symlink"?"link":"file"}),p.jsx("span",{className:"sftp-name",children:Ue.name}),p.jsx("span",{className:"sftp-size",children:sp(Ue)}),p.jsx("span",{className:"sftp-modified",children:rp(Ue.modified)})]},Ue.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:[de==="local"?p.jsxs("button",{type:"button",className:"primary-button",disabled:!F.length||!d||ae,onClick:()=>{fe("upload")},title:F.length?`Copy to ${C.host}`:"Select files to upload",children:[p.jsx(Ve,{name:"arrow-up"})," ",jd("Upload",F.length)]}):p.jsxs("button",{type:"button",className:"primary-button",disabled:!k.length||!d||ae,onClick:()=>{fe("download")},title:k.length?"Copy to this computer":"Select files to download",children:[p.jsx(Ve,{name:"arrow-down"})," ",jd("Download",k.length,"item")]}),p.jsx("span",{className:"sftp-count",children:ge?`${ge.entries.length} items`:""})]})]})};return p.jsx("div",{className:"sftp-layer",role:"presentation",...J,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:[C.name," · ",C.host]})]}),p.jsx("button",{type:"button",className:"close-button",onClick:j,children:"Esc"})]}),p.jsxs("div",{className:"sftp-body",children:[jt("local"),jt("remote")]}),D&&p.jsxs("form",{className:"sftp-prompt",onSubmit:je,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:()=>{Ye("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:de=>U(de.target.value),autoComplete:"off"})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>{Ye(D.kind)},children:"Cancel"}),p.jsx("button",{type:"submit",className:"primary-button",children:"Send"})]})]})]}),P&&p.jsxs("form",{className:"sftp-inline-form",onSubmit:be,children:[p.jsxs("label",{children:["New folder in ",P.side==="local"?se?.path:u?.path,p.jsx("input",{autoFocus:!0,value:P.value,onChange:de=>W({...P,value:de.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:Se,children:[p.jsxs("label",{children:["Rename ",N.entry.name,p.jsx("input",{autoFocus:!0,value:N.value,onChange:de=>ee({...N,value:de.target.value}),required:!0})]}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>ee(null),children:"Cancel"}),p.jsx("button",{type:"submit",className:"primary-button",children:"Rename"})]})]}),oe&&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:oe.entry.name})," from ",oe.side==="local"?"this computer":C.host,"?",oe.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:()=>{Le()},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:[ip(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},Pc=[{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}],lp="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 yl(C){return Pc.find(L=>L.id===C)}function op(C){return yl(C)?.multilingual??!1}function cp(C,L){return yl(C)?.downloadMb[L]??null}function up(C,L){const O=cp(C,L);return O===null?"Download size unknown":`≈${O} MB download, cached after first use`}const hp={bash:"bash",zsh:"zsh",fish:"fish",sh:"sh",powershell:"Windows PowerShell",pwsh:"PowerShell 7",cmd:"Command Prompt",wsl:"WSL"};function fp(C){return hp[C]??C}const i_="zerog-settings",s_="zerog-theme",He={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:lp,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"}},yt={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'},dp=[{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 qc(C){return Id[C]??Id.system}function Gr(C){return typeof C=="object"&&C!==null}function di(C,L,O){return typeof C=="string"&&L.includes(C)?C:O}function fl(C,L){return typeof C=="boolean"?C:L}function ls(C,L,O){return typeof C!="number"||!Number.isFinite(C)?O:Math.min(L.max,Math.max(L.min,C))}function Bc(C,L,O=512){return typeof C!="string"?L:C.slice(0,O)}function _p(C,L,O=200){return typeof C!="string"?L:Array.from(C.slice(0,O),j=>{const J=j.codePointAt(0)??0;return J<32||J===127?" ":j}).join("")}function Pd(C){return C.proceedPhrase.trim()||He.ai.proceedPhrase}const Gd=["dark","light"],vp=["stack","split-v","split-h","grid"],r_=["bash","zsh","fish","sh","powershell","pwsh","cmd","wsl"],mp=["block","underline","bar"],pp=["system","jetbrains","cascadia","consolas","fira","menlo"],gp=["builtin","server"],Sp=["wasm","webgpu"],bp=["q4","q8","fp16","fp32"],yp=["transcribe","translate"],Cp=["type","review"];function lr(C,L){const O=Gr(C)?C:{},j=Gr(O.appearance)?O.appearance:{},J=Gr(O.terminal)?O.terminal:{},se=Gr(O.sessions)?O.sessions:{},Z=Gr(O.ai)?O.ai:{},u=Gr(O.speech)?O.speech:{},f=di(L,Gd,He.appearance.theme),d=di(u.engine,gp,He.speech.engine),y=di(u.model,Pc.map(v=>v.id),He.speech.model),h=d==="server"||yl(y)?.multilingual?di(u.language,t_.map(v=>v.value),He.speech.language):"auto";return{appearance:{theme:di(j.theme,Gd,f),font:di(j.font,pp,He.appearance.font),fontSize:Math.round(ls(j.fontSize,yt.fontSize,He.appearance.fontSize)),lineHeight:ls(j.lineHeight,yt.lineHeight,He.appearance.lineHeight),letterSpacing:ls(j.letterSpacing,yt.letterSpacing,He.appearance.letterSpacing)},terminal:{scrollback:Math.round(ls(J.scrollback,yt.scrollback,He.terminal.scrollback)),cursorStyle:di(J.cursorStyle,mp,He.terminal.cursorStyle),cursorBlink:fl(J.cursorBlink,He.terminal.cursorBlink),copyOnSelect:fl(J.copyOnSelect,He.terminal.copyOnSelect)},sessions:{defaultBackend:di(se.defaultBackend,r_,He.sessions.defaultBackend),defaultWslDistribution:Bc(se.defaultWslDistribution,He.sessions.defaultWslDistribution,64),defaultLayout:di(se.defaultLayout,vp,He.sessions.defaultLayout),startSidebarCollapsed:fl(se.startSidebarCollapsed,He.sessions.startSidebarCollapsed),sidebarWidth:Math.round(ls(se.sidebarWidth,yt.sidebarWidth,He.sessions.sidebarWidth)),splitColumnRatio:ls(se.splitColumnRatio,yt.splitRatio,He.sessions.splitColumnRatio),splitRowRatio:ls(se.splitRowRatio,yt.splitRatio,He.sessions.splitRowRatio)},ai:{requireApproval:fl(Z.requireApproval,He.ai.requireApproval),voiceInsert:di(Z.voiceInsert,Cp,He.ai.voiceInsert),proceedPhrase:_p(Z.proceedPhrase,He.ai.proceedPhrase)},speech:{engine:d,model:y,precision:di(u.precision,bp,He.speech.precision),device:di(u.device,Sp,He.speech.device),language:h,task:di(u.task,yp,He.speech.task),maxUtteranceSeconds:Math.round(ls(u.maxUtteranceSeconds,yt.maxUtteranceSeconds,He.speech.maxUtteranceSeconds)),silenceThreshold:ls(u.silenceThreshold,yt.silenceThreshold,He.speech.silenceThreshold),serverUrl:Bc(u.serverUrl,He.speech.serverUrl,512),serverModel:Bc(u.serverModel,He.speech.serverModel,128)}}}function wp(C){if(!C)return lr(void 0);let L=null,O=null;try{L=C.getItem(i_),O=C.getItem(s_)}catch{return lr(void 0)}if(!L)return lr(void 0,O);try{return lr(JSON.parse(L),O)}catch{return lr(void 0,O)}}function Wd(C,L){if(C)try{C.setItem(i_,JSON.stringify(L)),C.setItem(s_,L.appearance.theme)}catch{}}function Fd(C,L,O){return lr({...C,[L]:{...C[L],...O}})}function n_(C,L){if(L.some(j=>j.backend===C))return C;const O=L[0]?.backend;return O&&r_.includes(O)?O:C}function Ep(C){const L=C.engine==="builtin",O=yl(C.model)?.multilingual??!1;return{model:L,precision:L,device:L,language:L?O:!0,task:L&&O,server:!L}}function xp(C,L){return lr({...C,[L]:He[L]})}const jc=[{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 Fr({label:C,hint:L,children:O}){return p.jsxs("label",{className:"settings-field",children:[p.jsx("span",{className:"settings-field-label",children:C}),O,L?p.jsx("small",{children:L}):null]})}function Oi({label:C,hint:L,value:O,options:j,onChange:J}){return p.jsx(Fr,{label:C,hint:L,children:p.jsx("select",{value:O,onChange:se=>J(se.target.value),children:j.map(se=>p.jsx("option",{value:se.value,children:se.label},se.value))})})}function Wr({label:C,hint:L,value:O,min:j,max:J,step:se,format:Z,onChange:u}){return p.jsx(Fr,{label:C,hint:L,children:p.jsxs("span",{className:"settings-range",children:[p.jsx("input",{type:"range",min:j,max:J,step:se,value:O,onChange:f=>u(Number(f.target.value)),"aria-label":C}),p.jsx("output",{children:Z(O)})]})})}function dl({label:C,hint:L,checked:O,onChange:j}){return p.jsxs("label",{className:"settings-toggle",children:[p.jsx("input",{type:"checkbox",checked:O,onChange:J=>j(J.target.checked)}),p.jsxs("span",{children:[p.jsx("b",{children:C}),L?p.jsx("small",{children:L}):null]})]})}function Ap({value:C,onChange:L}){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":C===j.id,className:`settings-engine ${C===j.id?"active":""}`,onClick:()=>L(j.id),children:[p.jsx("b",{children:j.title}),p.jsx("small",{children:j.detail})]},j.id))})}function Dp({state:C,onRun:L}){const O=C.status!=="idle",j=C.status==="recording"?"Stop and transcribe":C.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:C.status==="recording"?"settings-test-button recording":"settings-test-button",onClick:L,disabled:C.status==="transcribing",children:j})]}),C.message?p.jsx("p",{className:"settings-test-status",children:C.message}):null,C.error?p.jsx("p",{className:"settings-test-error",children:C.error}):null,C.transcript!==null&&C.transcript!==void 0?p.jsx("output",{className:"settings-test-transcript",children:C.transcript||"(nothing transcribed)"}):null,!O&&(C.elapsedMs!=null||C.level!=null)?p.jsxs("p",{className:"settings-test-metrics",children:[C.elapsedMs!=null?`${(C.elapsedMs/1e3).toFixed(1)}s`:null,C.elapsedMs!=null&&C.level!=null?" · ":null,C.level!=null?`level ${C.level.toFixed(4)} RMS`:null]}):null]})}function Tp({settings:C,onChange:L,onReset:O,onClose:j,backdrop:J,backends:se,wslDistributions:Z,speechTest:u,onSpeechTest:f}){const[d,y]=_e.useState("appearance"),h=jc.find(w=>w.id===d)??jc[0],v=Ep(C.speech),b=se.length?se.map(w=>({value:w.backend,label:w.label})):[{value:C.sessions.defaultBackend,label:C.sessions.defaultBackend}];return p.jsx("div",{className:"modal-layer settings-layer",role:"presentation",...J,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:jc.map(w=>p.jsxs("button",{type:"button",className:`settings-nav-item ${w.id===d?"active":""}`,"aria-current":w.id===d,onClick:()=>y(w.id),children:[p.jsx("b",{children:w.label}),p.jsx("small",{children:w.hint})]},w.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(Oi,{label:"Theme",value:C.appearance.theme,options:[{value:"dark",label:"Dark"},{value:"light",label:"Light"}],onChange:w=>L("appearance",{theme:w})}),p.jsx(Oi,{label:"Terminal font",hint:"Falls back to another monospace face when the font is not installed.",value:C.appearance.font,options:dp,onChange:w=>L("appearance",{font:w})}),p.jsx(Wr,{label:"Font size",value:C.appearance.fontSize,min:yt.fontSize.min,max:yt.fontSize.max,step:1,format:w=>`${w} px`,onChange:w=>L("appearance",{fontSize:w})}),p.jsx(Wr,{label:"Line height",value:C.appearance.lineHeight,min:yt.lineHeight.min,max:yt.lineHeight.max,step:.05,format:w=>w.toFixed(2),onChange:w=>L("appearance",{lineHeight:w})}),p.jsx(Wr,{label:"Letter spacing",value:C.appearance.letterSpacing,min:yt.letterSpacing.min,max:yt.letterSpacing.max,step:.1,format:w=>`${w.toFixed(1)} px`,onChange:w=>L("appearance",{letterSpacing:w})}),p.jsxs("div",{className:"settings-preview",style:{fontFamily:qc(C.appearance.font),fontSize:`${C.appearance.fontSize}px`,lineHeight:C.appearance.lineHeight,letterSpacing:`${C.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(Wr,{label:"Scrollback",hint:"Lines kept per pane. Larger scrollback costs memory in every open pane.",value:C.terminal.scrollback,min:yt.scrollback.min,max:5e4,step:200,format:w=>`${w.toLocaleString()} lines`,onChange:w=>L("terminal",{scrollback:w})}),p.jsx(Oi,{label:"Cursor",value:C.terminal.cursorStyle,options:[{value:"block",label:"Block"},{value:"underline",label:"Underline"},{value:"bar",label:"Bar"}],onChange:w=>L("terminal",{cursorStyle:w})}),p.jsx(dl,{label:"Blink the cursor",checked:C.terminal.cursorBlink,onChange:w=>L("terminal",{cursorBlink:w})}),p.jsx(dl,{label:"Copy on selection",hint:"Selecting text with the mouse puts it on the clipboard. Ctrl+Shift+C copies regardless.",checked:C.terminal.copyOnSelect,onChange:w=>L("terminal",{copyOnSelect:w})})]}),d==="sessions"&&p.jsxs(p.Fragment,{children:[p.jsx(Oi,{label:"Default shell",hint:"Pre-selected when opening a new local terminal.",value:n_(C.sessions.defaultBackend,se),options:b,onChange:w=>L("sessions",{defaultBackend:w})}),p.jsxs(Fr,{label:"Default WSL distribution",hint:"Used when the default shell is WSL.",children:[p.jsx("input",{list:"settings-wsl-distributions",value:C.sessions.defaultWslDistribution,placeholder:"Ubuntu",onChange:w=>L("sessions",{defaultWslDistribution:w.target.value})}),p.jsx("datalist",{id:"settings-wsl-distributions",children:Z.map(w=>p.jsx("option",{value:w},w))})]}),p.jsx(Oi,{label:"Layout at startup",value:C.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:w=>L("sessions",{defaultLayout:w})}),p.jsx(dl,{label:"Start with the sidebar collapsed",checked:C.sessions.startSidebarCollapsed,onChange:w=>L("sessions",{startSidebarCollapsed:w})})]}),d==="ai"&&p.jsxs(p.Fragment,{children:[p.jsx(dl,{label:"Ask before running an AI suggestion",hint:"Off means a suggested command is sent to the terminal as soon as it arrives.",checked:C.ai.requireApproval,onChange:w=>L("ai",{requireApproval:w})}),p.jsx(Oi,{label:"Voice transcripts",hint:"Neither option presses Enter for you.",value:C.ai.voiceInsert,options:[{value:"type",label:"Type into the terminal"},{value:"review",label:"Show for review first"}],onChange:w=>L("ai",{voiceInsert:w})}),p.jsx(Fr,{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:C.ai.proceedPhrase,placeholder:He.ai.proceedPhrase,onChange:w=>L("ai",{proceedPhrase:w.target.value})})})]}),d==="speech"&&p.jsxs(p.Fragment,{children:[p.jsx(Ap,{value:C.speech.engine,onChange:w=>L("speech",{engine:w})}),v.model?p.jsx(Oi,{label:"Model",hint:up(C.speech.model,C.speech.precision),value:C.speech.model,options:Pc.map(w=>({value:w.id,label:w.label})),onChange:w=>L("speech",{model:w})}):null,v.precision?p.jsx(Oi,{label:"Precision",hint:qd.find(w=>w.value===C.speech.precision)?.detail,value:C.speech.precision,options:qd.map(w=>({value:w.value,label:w.label})),onChange:w=>L("speech",{precision:w})}):null,v.device?p.jsx(Oi,{label:"Compute",hint:"WebGPU is faster where it works; the app falls back to WASM when it does not.",value:C.speech.device,options:[{value:"wasm",label:"CPU (WASM)"},{value:"webgpu",label:"GPU (WebGPU)"}],onChange:w=>L("speech",{device:w})}):null,v.language?p.jsx(Oi,{label:"Language",value:C.speech.language,options:t_,onChange:w=>L("speech",{language:w})}):null,v.task?p.jsx(Oi,{label:"Task",hint:"Translate produces English text from another language.",value:C.speech.task,options:[{value:"transcribe",label:"Transcribe"},{value:"translate",label:"Translate to English"}],onChange:w=>L("speech",{task:w})}):null,v.server?p.jsxs(p.Fragment,{children:[p.jsx(Fr,{label:"Server URL",hint:"Must be on this machine. OpenAI-compatible: POST multipart audio to /v1/audio/transcriptions.",children:p.jsx("input",{value:C.speech.serverUrl,placeholder:"http://127.0.0.1:8080/v1/audio/transcriptions",onChange:w=>L("speech",{serverUrl:w.target.value})})}),p.jsx(Fr,{label:"Server model",hint:"The model name the server expects, e.g. Qwen3-ASR-0.6B.",children:p.jsx("input",{value:C.speech.serverModel,placeholder:"Qwen3-ASR-0.6B",onChange:w=>L("speech",{serverModel:w.target.value})})})]}):null,p.jsx(Wr,{label:"Maximum utterance",hint:"Recording stops itself at this length so a stuck microphone cannot queue forever.",value:C.speech.maxUtteranceSeconds,min:yt.maxUtteranceSeconds.min,max:yt.maxUtteranceSeconds.max,step:5,format:w=>`${w} s`,onChange:w=>L("speech",{maxUtteranceSeconds:w})}),p.jsx(Wr,{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:C.speech.silenceThreshold,min:yt.silenceThreshold.min,max:yt.silenceThreshold.max,step:5e-4,format:w=>w.toFixed(4),onChange:w=>L("speech",{silenceThreshold:w})}),p.jsx(Dp,{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 ar=[{kind:"local",label:"Local terminal",hint:"Shell on this machine"},{kind:"ssh",label:"SSH",hint:"Remote host"}];function Kd(C){return C==="local"||C==="ssh"}const Rp={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 Hc(C){return Rp[C]}function Mp(C,L){const O=ar.findIndex(J=>J.kind===C);if(O===-1)return null;const j=ar.length;switch(L){case"ArrowRight":case"ArrowDown":return ar[(O+1)%j].kind;case"ArrowLeft":case"ArrowUp":return ar[(O-1+j)%j].kind;case"Home":return ar[0].kind;case"End":return ar[j-1].kind;default:return null}}const a_={"split-v":"Vertical split","split-h":"Horizontal split",grid:"Four-pane grid"},Lp=[{layout:"split-v",icon:"split-v"},{layout:"split-h",icon:"split-h"},{layout:"grid",icon:"grid"}];function l_(C){return C==="split-v"?["column"]:C==="split-h"?["row"]:C==="grid"?["column","row"]:[]}function o_(C,L){return l_(C).some(O=>{const j=O==="column"?L.columnRatio:L.rowRatio,J=O==="column"?He.sessions.splitColumnRatio:He.sessions.splitRowRatio;return Math.abs(j-J)>.005})}function kp(C){const L=l_(C);return{...L.includes("column")?{splitColumnRatio:He.sessions.splitColumnRatio}:{},...L.includes("row")?{splitRowRatio:He.sessions.splitRowRatio}:{}}}function c_(C){return C.maximized?{kind:"restore"}:C.layout==="stack"?{kind:"show",layout:C.lastSplit}:C.sessionCount>1?{kind:"maximize"}:{kind:"show",layout:"stack"}}function Op(C,L){return L.layout!==C||L.maximized?{kind:"show",layout:C}:o_(C,L)?{kind:"reset-splits",ratios:kp(C)}:c_(L)}function Bp(C,L){return L.layout!==C||L.maximized?a_[C]:o_(C,L)?"Reset pane sizes":L.sessionCount>1?"Maximize focused pane":"Single pane"}function jp(C){return C.maximized||C.layout==="stack"?`Back to ${a_[C.lastSplit].toLowerCase()}`:C.sessionCount>1?"Maximize focused pane":"Single pane"}const Hp=new Set(["127.0.0.1","localhost"]),Np=new Set(["::1","[::1]"]),zp=12e4,Up=300;function u_(C){try{const L=new URL(C);return L.protocol!=="http:"&&L.protocol!=="https:"?null:L.hostname.toLowerCase()}catch{return null}}function qp(C){const L=u_(C);return L===null?!1:Hp.has(L)||L.endsWith(".localhost")}function Ip(C){const L=u_(C);return L!==null&&Np.has(L)}function _l(C,L,O){for(let j=0;j<O.length;j+=1)C.setUint8(L+j,O.charCodeAt(j))}function Pp(C,L=gl){const j=C.length*2,J=new ArrayBuffer(44+j),se=new DataView(J);_l(se,0,"RIFF"),se.setUint32(4,36+j,!0),_l(se,8,"WAVE"),_l(se,12,"fmt "),se.setUint32(16,16,!0),se.setUint16(20,1,!0),se.setUint16(22,1,!0),se.setUint32(24,L,!0),se.setUint32(28,L*2,!0),se.setUint16(32,2,!0),se.setUint16(34,16,!0),_l(se,36,"data"),se.setUint32(40,j,!0);for(let Z=0;Z<C.length;Z+=1){const u=Math.max(-1,Math.min(1,C[Z]));se.setInt16(44+Z*2,Math.round(u*32767),!0)}return J}function Gp(C){if(typeof C=="string"){const j=C.trim();return j||null}if(typeof C!="object"||C===null)return null;const L=C;if(typeof L.text=="string"&&L.text.trim())return L.text.trim();const O=L.segments;if(Array.isArray(O)){const j=O.map(J=>typeof J=="object"&&J!==null?J.text:null).filter(J=>typeof J=="string").join(" ").trim();if(j)return j}if(typeof L.error=="string")throw new Error(L.error);return null}function Wp(C){const L=Pp(C.audio,C.sampleRate??gl),O=new FormData;return O.set("file",new Blob([L],{type:"audio/wav"}),"utterance.wav"),O.set("model",C.model),O.set("response_format","json"),C.language&&C.language!=="auto"&&O.set("language",C.language),O}function Fp(){return typeof AbortSignal<"u"&&typeof AbortSignal.timeout=="function"?AbortSignal.timeout(zp):void 0}async function Kp(C,L=fetch){if(!qp(C.url))throw new Error(Ip(C.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(!C.model.trim())throw new Error("Speech server model name is required");const O=await L(C.url,{method:"POST",body:Wp(C),signal:Fp()}),j=await O.text();if(!O.ok){const Z=j.slice(0,Up).trim();throw new Error(`Speech server returned ${O.status}${Z?`: ${Z}`:""}`)}let J=j;try{J=JSON.parse(j)}catch{}const se=Gp(J);if(se===null)throw new Error("Speech server returned no transcript");return se}function Yd(C){return typeof C=="object"&&C!==null}class Yp{constructor(L){this.options=L,this.worker=null,this.pending=new Map,this.nextId=1}async transcribe(L,O,j){if(O.engine==="server"){const se=this.options.now??(()=>Date.now()),Z=se();return{text:await Kp({url:O.serverUrl,model:O.serverModel,language:O.language,audio:L},this.options.fetchImpl),elapsedMs:se()-Z,engine:"server"}}return{...await this.transcribeInWorker(L,O,j),engine:"builtin"}}transcribeInWorker(L,O,j){const J=this.ensureWorker(),se=this.nextId++;return new Promise((Z,u)=>{this.pending.set(se,{resolve:Z,reject:u,onProgress:j}),J.postMessage({type:"transcribe",id:se,audio:L,config:{model:O.model,precision:O.precision,device:O.device,language:O.language,task:O.task,multilingual:op(O.model)}},[L.buffer])})}ensureWorker(){if(this.worker)return this.worker;const L=this.options.createWorker();return L.onmessage=O=>this.handleMessage(O.data),L.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=L,L}handleMessage(L){if(!Yd(L)||typeof L.id!="number")return;const O=this.pending.get(L.id);if(O){if(L.type==="loading"){O.onProgress?.({kind:"loading",progress:typeof L.progress=="number"?L.progress:null});return}if(L.type==="notice"){O.onProgress?.({kind:"notice",message:String(L.message)});return}if(L.type==="result"){this.pending.delete(L.id),O.resolve({text:typeof L.text=="string"?L.text:"",elapsedMs:typeof L.elapsedMs=="number"?L.elapsedMs:0});return}L.type==="error"&&(this.pending.delete(L.id),O.reject(new Error(typeof L.message=="string"?L.message:"Transcription failed")))}}failAll(L){for(const O of this.pending.values())O.reject(L);this.pending.clear()}dispose(){this.failAll(new Error("Speech client disposed")),this.worker?.terminate(),this.worker=null}}const Vp=150,$p=3e3,ot=()=>window.zerog;function Nc(){try{return window.localStorage}catch{return null}}function vl({session:C,active:L=!1,ghosted:O=!1,onClick:j}){const J=C.kind==="ssh"?`SSH · ${C.host}`:C.backend==="wsl"?`WSL${C.wslDistribution?` · ${C.wslDistribution}`:""} · ${C.cwd}`:C.backend&&C.backend!=="screen"?`${fp(C.backend)} · ${C.cwd}`:C.persistence==="screen"?`screen · ${C.cwd}`:`local · process only · ${C.cwd}`;return p.jsxs("button",{type:"button",className:`session-row ${L?"active":""} ${O?"session-ghosted":""}`,onClick:j,children:[p.jsx("span",{className:`status-dot ${C.status}`}),p.jsxs("span",{className:"session-copy",children:[p.jsx("b",{children:C.name}),p.jsx("small",{children:J})]}),p.jsx("span",{className:"session-state",children:O?"↗":C.status==="connected"?"●":"○"})]})}const Xp=120;function Zp({sessionId:C,focused:L,onStatus:O,appearance:j,terminalSettings:J,registerFocus:se}){const Z=_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(J);y.current=J;const h=_e.useRef(null);return _e.useEffect(()=>{if(!Z.current)return;const v=Z.current,b=new Em.Terminal({cursorBlink:y.current.cursorBlink,cursorStyle:y.current.cursorStyle,fontFamily:qc(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:(oe,q)=>{const $=ot();$?.openExternal&&(f.current(`Opening ${q}`),$.openExternal(q).catch(ie=>{f.current(ie instanceof Error?ie.message:String(ie))}))},hover:(oe,q)=>f.current(`Link: ${q}`),leave:()=>f.current("Ready")}}),w=new Am.FitAddon;b.loadAddon(w),b.open(v),u.current=b;const m=ot();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{w.fit()}catch{return!1}return b.cols>0&&b.rows>0},D=()=>{!_||!m||!C||b.cols===a&&b.rows===l||(window.clearTimeout(x),x=window.setTimeout(()=>{o||!C||b.cols===a&&b.rows===l||(a=b.cols,l=b.rows,m.resize(C,a,l))},Xp))},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((oe,q)=>{oe===C&&b.write(q)}),P=m.onStatus((oe,q)=>{oe===C&&(f.current(q),T())}),W=b.onData(oe=>{C&&m.write(C,oe)}),N=Fm({terminal:b,clipboard:m,onError:oe=>f.current(oe),writeToPty:oe=>{C&&m.write(C,oe)},pasteEventTarget:v,isCopyOnSelectEnabled:()=>y.current.copyOnSelect}),ee=new ResizeObserver(()=>T());if(ee.observe(v),window.addEventListener("resize",T),document.fonts?.ready?.then(()=>{o||T()}).catch(()=>{}),T(),!C)b.writeln("\x1B[90mZeroG Terminal\x1B[0m"),b.writeln("\x1B[90mSelect a session or create a local/SSH connection.\x1B[0m");else{const oe=E()?{cols:b.cols,rows:b.rows}:void 0;oe&&(a=oe.cols,l=oe.rows),m.attachSession(C,oe).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(),ee.disconnect(),window.removeEventListener("resize",T),h.current=null,u.current=null,b.dispose()}},[C]),_e.useEffect(()=>{const v=u.current;v&&(v.options.theme=$d(j.theme),v.options.fontFamily=qc(j.font),v.options.fontSize=j.fontSize,v.options.lineHeight=j.lineHeight,v.options.letterSpacing=j.letterSpacing,v.options.scrollback=J.scrollback,v.options.cursorStyle=J.cursorStyle,v.options.cursorBlink=J.cursorBlink,h.current?.())},[j,J]),_e.useEffect(()=>{L&&u.current?.focus()},[L]),_e.useEffect(()=>{if(!(!C||!se))return se(C,()=>u.current?.focus()),()=>se(C,null)},[C,se]),p.jsx("div",{className:"terminal",ref:Z,onMouseDownCapture:v=>v.preventDefault()})}function zc({orientation:C,className:L,label:O,valuePercent:j,style:J,onDrag:se,onCommit:Z,onNudge:u,onReset:f}){const[d,y]=_e.useState(!1),h=C==="vertical"?"ArrowLeft":"ArrowUp",v=C==="vertical"?"ArrowRight":"ArrowDown";return p.jsx("div",{role:"separator","aria-orientation":C,"aria-label":O,"aria-valuenow":Math.round(j),"aria-valuemin":0,"aria-valuemax":100,tabIndex:0,className:`${L} ${d?"dragging":""}`.trim(),style:J,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),Z())},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 Qp({index:C,onCreate:L}){return p.jsxs("article",{className:"pane empty-pane",children:[p.jsxs("div",{className:"pane-title",children:[p.jsxs("span",{children:["PANE ",C]}),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:L,children:"Choose session"})]})]})}function Vd(C,L=[]){return{id:`ws-${crypto.randomUUID()}`,name:C,sessionIds:L}}function Jp(){const[C,L]=_e.useState(()=>wp(Nc())),O=C.appearance.theme,[j,J]=_e.useState([]),[se,Z]=_e.useState(()=>[Vd("Workspace")]),[u,f]=_e.useState(()=>se[0]?.id??""),[d,y]=_e.useState(null),[h,v]=_e.useState("Ready"),[b,w]=_e.useState(!1),[m,o]=_e.useState(C.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,ee]=_e.useState(C.sessions.defaultLayout),oe=_e.useRef(C.sessions.defaultLayout==="stack"?"split-v":C.sessions.defaultLayout),[q,$]=_e.useState(),[ie,R]=_e.useState(null),[z,A]=_e.useState("Workspace"),[B,K]=_e.useState("term"),[re,me]=_e.useState(""),[pe,F]=_e.useState(""),[k,ae]=_e.useState(null),[fe,be]=_e.useState({status:"idle",sessionId:null}),[Se,Le]=_e.useState(null),je=_e.useRef(null),Ye=_e.useRef(null),tt=_e.useRef(null),De=_e.useRef(void 0),[jt,de]=_e.useState(!1),[ge,ye]=_e.useState(!1),[Oe,ze]=_e.useState({status:"idle"}),Ne=_e.useRef(null),_t=_e.useRef(void 0),[Ue,vt]=_e.useState([]),[ct,_i]=_e.useState(C.sessions.defaultBackend),[Ht,$t]=_e.useState(C.sessions.defaultWslDistribution),[Ke,Ai]=_e.useState([]),[Wt,ii]=_e.useState([]),[Ct,Yn]=_e.useState([]),[Vn,Kr]=_e.useState([]),[Yr,js]=_e.useState(!1),os=_e.useRef(new Map),qi=_e.useCallback((H,V)=>{V?os.current.set(H,V):os.current.delete(H)},[]),si=_e.useCallback(H=>{H&&($(H),requestAnimationFrame(()=>os.current.get(H)?.()))},[]),Hs=rr(()=>U(null)),Cl=rr(()=>ae(null)),$n=rr(()=>W(!1)),Vr=rr(()=>_(!1)),Ns=rr(()=>de(!1)),wl=rr(()=>mi()),Xn=rr(()=>ye(!1)),ri=_e.useCallback((H,V)=>{L(le=>{const ve=Fd(le,H,V);return Wd(Nc(),ve),ve})},[]),$r=_e.useCallback((H,V)=>{L(le=>Fd(le,H,V))},[]),Xr=_e.useCallback(H=>{L(V=>{const le=xp(V,H);return Wd(Nc(),le),le})},[]);_e.useEffect(()=>{document.documentElement.dataset.theme=O},[O]);const Nt=_e.useMemo(()=>se.find(H=>H.id===u)??se[0]??null,[se,u]),et=_e.useMemo(()=>{if(!Nt)return j;const H=new Set(Nt.sessionIds),V=j.filter(le=>H.has(le.id));if(Nt.id===se[0]?.id){const le=new Set(se.flatMap(we=>we.sessionIds)),ve=j.filter(we=>!le.has(we.id));return[...new Map([...V,...ve].map(we=>[we.id,we])).values()]}return V},[Nt,j,se]),Ii=_e.useCallback(async()=>{const H=ot();if(E(!0),g(null),!H){g("Preload API unavailable"),v("Preload API unavailable"),E(!1);return}try{const V=await H.listSessions();J(V),v(V.length?`${V.length} session${V.length===1?"":"s"}`:"No sessions")}catch(V){const le=V instanceof Error?V.message:String(V);g(le),v(le)}finally{E(!1)}},[]);_e.useEffect(()=>{Ii()},[Ii]),_e.useEffect(()=>{const H=ot();H&&H.listBackends?.().then(vt).catch(()=>vt([]))},[]),_e.useEffect(()=>{if(ct!=="wsl"){Ai([]),$t("");return}const H=ot();H&&H.listWslDistributions?.().then(Ai).catch(()=>Ai([]))},[ct]),_e.useEffect(()=>{if(!l){ii([]);return}const H=ot();H&&H.listHistory?.().then(ii).catch(()=>ii([]))},[l]),_e.useEffect(()=>{const H=ot(),V=hl((d?.kind==="ssh"?d.host:"")||(q?j.find(ve=>ve.id===q)?.host:"")||""),le=V?Ct.filter(ve=>hl(ve.hostName??"")===V||ve.alias===V):[];if(le.length===0){Kr([]);return}H?.discoverRemoteScreens&&(js(!0),Promise.allSettled(le.map(ve=>H.discoverRemoteScreens(ve))).then(ve=>{const Ee=[];ve.forEach((we,Re)=>{we.status==="fulfilled"&&Array.isArray(we.value)&&we.value.forEach($e=>{Ee.push({session:$e,connection:le[Re]})})}),Kr(Ee)}).catch(()=>Kr([])).finally(()=>js(!1)))},[Ct,d?.host,j,q]),_e.useEffect(()=>{const H=ot();H&&H.listKnownConnections?.().then(Yn).catch(()=>Yn([]))},[]),_e.useEffect(()=>{!d&&et.length&&y(et[0])},[d,et]),_e.useEffect(()=>ot()?.onLinkRefused?.(V=>v(V)),[]);const Di=_e.useRef(new Map);_e.useEffect(()=>{const H=ot();if(H)return H.onData((V,le)=>{const ve=((Di.current.get(V)??"")+le).slice(-2048);Di.current.set(V,ve);const Ee=Qm(ve);Ee&&(J(we=>{const Re=we.find($e=>$e.id===V);return!Re||Re.cwd===Ee.path?we:we.map($e=>$e.id===V?{...$e,cwd:Ee.path}:$e)}),y(we=>we&&we.id===V&&we.cwd!==Ee.path?{...we,cwd:Ee.path}:we))})},[]),_e.useEffect(()=>{if(fe.status!=="listening")return;const H=V=>{V.key==="Escape"&&(V.preventDefault(),V.stopPropagation(),rn(),v("Voice cancelled"))};return window.addEventListener("keydown",H,!0),()=>window.removeEventListener("keydown",H,!0)},[fe.status]),_e.useEffect(()=>{const H=V=>{if(V.key==="Escape"){if(ge){V.preventDefault(),ye(!1);return}if(jt){V.preventDefault(),de(!1);return}if(Se){V.preventDefault(),mi();return}if(P){V.preventDefault(),W(!1);return}if(k){V.preventDefault(),ae(null);return}if(T){V.preventDefault(),U(null);return}if(l){V.preventDefault(),_(!1);return}}if(!(V.ctrlKey||V.metaKey)||!V.shiftKey)return;const le=V.key.toLowerCase();le==="o"&&(V.preventDefault(),W(ve=>!ve)),le==="n"&&(V.preventDefault(),A(Uc(se)),U("workspace")),le==="t"&&(V.preventDefault(),ni("local")),le==="l"&&(V.preventDefault(),R(null),ee(ve=>ve==="stack"?oe.current:"stack")),le==="b"&&(V.preventDefault(),o(ve=>!ve)),V.code==="Comma"&&(V.preventDefault(),de(ve=>!ve))};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[P,k,T,l,jt,ge,Se,fe.status,se,Nt,et]);const wt=Pd(C.ai),Rt=e_(d),Pi=np(d),cs=N==="stack"?1:N==="grid"?4:2,us=et.slice(0,4),El=Math.max(cs,us.length),Ot=us.some(H=>H.id===ie)?ie:null,zs=us.find(H=>H.id===d?.id)?.id??us[0]?.id,Zr=(H,V)=>N==="stack"?H.id===zs:V<cs;_e.useEffect(()=>{ge&&!Rt&&ye(!1)},[ge,Rt]),_e.useEffect(()=>{N!=="stack"&&(oe.current=N)},[N]);const Mt=async H=>{y(H),$(H.id);const V=us.findIndex(le=>le.id===H.id);Ot?R(H.id):V>=cs&&N!=="stack"&&ee("grid"),v(H.persistence==="process"?`${H.host} · ${H.name} · process only (install screen for persistence)`:`${H.host} · ${H.name}`),W(!1)},zt=(H,V=u)=>{Z(le=>le.map(ve=>ve.id!==V?{...ve,sessionIds:ve.sessionIds.filter(Ee=>Ee!==H.id)}:ve.sessionIds.includes(H.id)?ve:{...ve,sessionIds:[...ve.sessionIds,H.id]}))},Us=async H=>{H.preventDefault();const V=z.trim()||Uc(se),le=Vd(V);Z(ve=>[...ve,le]),f(le.id),y(null),U(null),v(`Workspace “${V}” ready`)},hs=async H=>{H.preventDefault();const V=ot();if(V){if(et.length>=4){v("This workspace supports up to 4 sessions."),U(null);return}w(!0);try{const le=await V.createLocalSession({name:B,backend:ct,wslDistribution:ct==="wsl"?Ht:void 0});J(ve=>[...ve.filter(Ee=>Ee.id!==le.id),le]),zt(le),$(le.id),R(null),ee(ml(et.length+1)),U(null),await Mt(le)}catch(le){v(le instanceof Error?le.message:String(le))}finally{w(!1)}}},Et=async H=>{H.preventDefault();const V=ot();if(V){if(et.length>=4){v("This workspace supports up to 4 sessions."),U(null);return}w(!0);try{const le=await V.createSshSession({name:re||void 0,target:pe});J(ve=>[...ve.filter(Ee=>Ee.id!==le.id),le]),zt(le),$(le.id),R(null),ee(ml(et.length+1)),U(null),await Mt(le)}catch(le){v(le instanceof Error?le.message:String(le))}finally{w(!1)}}},Qr=async(H,V)=>{try{const le=ot();if(!le)return;v(`Attaching to ${H.name} on ${V.alias}…`);const Ee=(await le.buildRemoteScreenAttach?.(V,H.screenName??H.name))?.args,we=Array.isArray(Ee)?Ee.indexOf("--"):-1,Re=we>0?Ee[we-1]:V.hostName??V.alias,$e=await le.createSshSession({target:Re,name:H.name}),Qe=H.screenName??H.name,qe={...$e,screenName:Qe,persistence:"screen",backend:"screen"};J(ft=>ft.some(mt=>mt.id===qe.id)?ft.map(mt=>mt.id===qe.id?qe:mt):[...ft,qe]),zt(qe),await Mt(qe),await le.attachSession(qe.id);const Lt=Ee&&we>0?Ee.slice(we+1).join(" "):`screen -x ${Qe}`;await Jr(le,qe.id),le.write(qe.id,`${Lt}\r`),await Ii(),v(`Connected to ${H.name} on ${V.alias}`)}catch(le){v(le instanceof Error?le.message:String(le))}},Jr=(H,V)=>new Promise(le=>{let ve=!1,Ee="",we,Re;const $e=()=>{ve||(ve=!0,clearTimeout(we),clearTimeout(Qe),Re?.(),le())},Qe=setTimeout($e,$p);Re=H.onData((qe,Lt)=>{if(qe===V){if(Ee=(Ee+Lt).slice(-512),km(Ee)){$e();return}clearTimeout(we),we=setTimeout($e,Vp)}})}),Bi=()=>{A(Uc(se)),U("workspace")},ni=(H,V)=>{K(eg(Nt?.name??"term",et)),_i(n_(C.sessions.defaultBackend,Ue)),$t(C.sessions.defaultWslDistribution),V?.sshTarget!==void 0&&F(V.sshTarget),U(H)},qs=()=>ni("local"),Zn=()=>{const H=hl((d?.kind==="ssh"?d.host:"")||(q?j.find(Re=>Re.id===q)?.host:"")||""),V=H?Vn.filter(Re=>hl(Re.connection.hostName??"")===H||Re.connection.alias===H).reduce((Re,$e)=>{const Qe=$e.connection.hostName||$e.connection.alias;return(Re[Qe]=Re[Qe]||[]).push($e),Re},{}):{},le=j.filter(Re=>Re.persistence==="screen"&&!et.some($e=>$e.id===Re.id)),ve=Object.keys(V).length>0,Ee=le.length>0;if(!ve&&!Ee)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 we=[];if(ve)for(const[Re,$e]of Object.entries(V)){const Qe=$e,qe=p.jsx("div",{className:"session-group-label",children:Re},`${Re}-label`),Lt=Qe.map(({session:ft})=>{const Ti=Qe.find(mt=>mt.session.id===ft.id)?.connection;return p.jsx(vl,{session:ft,ghosted:!0,onClick:async()=>{if(!Ti)return;v(`Attaching ${ft.name}…`);const mt=ot();if(mt)try{const ji=(await mt.buildRemoteScreenAttach?.(Ti,ft.screenName??ft.name))?.args,Ps=Array.isArray(ji)?ji.indexOf("--"):-1,fr=Ps>0?ji[Ps-1]:Ti.hostName??Ti.alias,pi={...await mt.createSshSession({target:fr,name:ft.name}),screenName:ft.screenName??ft.name,persistence:"screen",backend:"screen"};J(Ri=>Ri.some(Fi=>Fi.id===pi.id)?Ri.map(Fi=>Fi.id===pi.id?pi:Fi):[...Ri,pi]),zt(pi),await Mt(pi),await mt.attachSession(pi.id);const Ft=ji&&Ps>0?ji.slice(Ps+1).join(" "):`screen -x ${ft.screenName??ft.name}`;await Jr(mt,pi.id),mt.write(pi.id,`${Ft}\r`),await Ii(),v(`Connected to ${ft.name}`)}catch(fs){v(fs instanceof Error?fs.message:String(fs))}}},ft.id)});we.push(qe,...Lt)}return Ee&&!ve&&(we.push(p.jsx("div",{className:"session-group-label",children:"local"},"local-label")),le.forEach(Re=>{we.push(p.jsx(vl,{session:Re,ghosted:!0,onClick:()=>{zt(Re),Mt(Re),v(`Reconnecting to ${Re.name}…`)}},Re.id))})),p.jsx(p.Fragment,{children:we})},Qn=N==="split-v"?"pane-grid split-v":N==="split-h"?"pane-grid split-h":N==="grid"?"pane-grid grid":"pane-grid",Jn=!Ot&&(N==="split-v"||N==="grid"),Is=!Ot&&(N==="split-h"||N==="grid"),vi=C.sessions.splitColumnRatio,Ut=C.sessions.splitRowRatio,Yt=_e.useRef(null),ea=Ot?void 0:{...Jn?{gridTemplateColumns:`${vi}fr ${1-vi}fr`}:{},...Is?{gridTemplateRows:`${Ut}fr ${1-Ut}fr`}:{}},ta=(H,V)=>{const le=Yt.current?.getBoundingClientRect();if(!le)return;const ve=H==="column"?(V.clientX-le.left)/le.width:(V.clientY-le.top)/le.height;Number.isFinite(ve)&&$r("sessions",H==="column"?{splitColumnRatio:ve}:{splitRowRatio:ve})},cr=(H,V)=>{const ve=(H==="column"?vi:Ut)+V*.02;ri("sessions",H==="column"?{splitColumnRatio:ve}:{splitRowRatio:ve})},en=H=>{ri("sessions",H==="column"?{splitColumnRatio:He.sessions.splitColumnRatio}:{splitRowRatio:He.sessions.splitRowRatio})},Gi={layout:N,maximized:!!Ot,columnRatio:vi,rowRatio:Ut,sessionCount:et.length,lastSplit:oe.current},ia=_e.useRef(null),Xt=H=>{const V=ia.current?.getBoundingClientRect();V&&$r("sessions",{sidebarWidth:Math.round(H.clientX-V.left)})},tn=H=>{$(H),R(V=>V===H?null:H)},sn=H=>{if(H.kind==="restore"){R(null);return}if(H.kind==="show"){R(null),ee(H.layout);return}if(H.kind==="reset-splits"){ri("sessions",H.ratios);return}const V=q??d?.id??et[0]?.id;V&&R(V)},ur=H=>{if(!Ot||et.length<2)return;const le=(et.findIndex(Ee=>Ee.id===Ot)+H+et.length)%et.length,ve=et[le];$(ve.id),y(ve),R(ve.id)},Wi=()=>(Ye.current??=new Yp({createWorker:()=>new Worker(new URL(""+new URL("voice-worker-DoNT0zEM.js",import.meta.url).href,import.meta.url),{type:"module"})}),Ye.current),sa=H=>{if(H.kind==="notice"){v(H.message);return}H.progress!==null&&v(`Loading speech model… ${Math.round(H.progress)}%`)},rn=()=>{const H=tt.current;window.clearTimeout(De.current),je.current?.cancel(),je.current=null,tt.current=null,be({status:"idle",sessionId:null}),si(H)},mi=()=>{const H=Se?.sessionId;Le(null),si(H)},ra=async()=>{const H=je.current,V=tt.current;if(!H||!V)return;window.clearTimeout(De.current),je.current=null,be({status:"transcribing",sessionId:V}),v("Transcribing…");const le=await H.stop();if(!le||Md(le,C.speech.silenceThreshold)){tt.current=null,be({status:"idle",sessionId:null}),v("Voice: no speech detected — lower the silence threshold in Settings if this is wrong"),si(V);return}try{const ve=await Wi().transcribe(le,C.speech,sa);if(tt.current=null,be({status:"idle",sessionId:null}),!ve.text){v("Voice: nothing transcribed"),si(V);return}if(C.ai.voiceInsert==="review"){Le({sessionId:V,text:ve.text}),v(`Voice: review "${ve.text}"`);return}ot()?.write(V,ve.text),v(`Voice: "${ve.text}"`),si(V)}catch(ve){tt.current=null,be({status:"idle",sessionId:null}),v(`Voice error: ${ve instanceof Error?ve.message:String(ve)}`),si(V)}},na=async H=>{if(fe.status==="listening"&&fe.sessionId===H.id){await ra();return}if(fe.status!=="idle")return;if(Oe.status!=="idle"){v("The speech test in Settings is using the microphone");return}const V=new Ld;try{await V.start()}catch(le){v(`Microphone unavailable: ${le instanceof Error?le.message:String(le)}`);return}je.current=V,tt.current=H.id,be({status:"listening",sessionId:H.id}),si(H.id),window.clearTimeout(De.current),De.current=window.setTimeout(()=>{ra()},C.speech.maxUtteranceSeconds*1e3),v(`Listening on ${H.name}… click the mic again to transcribe, Esc to discard`)},aa=H=>{const V=ot();if(!V)return;const le=Pd(C.ai);V.write(H.id,`${le}\r`),v(`Sent "${le}" to ${H.name}`),si(H.id)},hr=async()=>{const H=Ne.current;if(!H)return;window.clearTimeout(_t.current),Ne.current=null,ze({status:"transcribing",message:"Transcribing…",transcript:null,error:null});const V=await H.stop();if(!V){ze({status:"idle",error:"Nothing was recorded."});return}const le=Zd(V),ve=Md(V,C.speech.silenceThreshold);try{const Ee=await Wi().transcribe(V,C.speech,we=>{ze(Re=>({...Re,message:we.kind==="notice"?we.message:we.progress!==null?`Loading speech model… ${Math.round(we.progress)}%`:"Loading speech model…"}))});ze({status:"idle",transcript:Ee.text,elapsedMs:Ee.elapsedMs,level:le,message:ve?"Below the silence threshold — a real recording at this level would have been discarded.":Ee.engine==="server"?"Transcribed by the local server.":"Transcribed by the built-in engine.",error:null})}catch(Ee){ze({status:"idle",level:le,error:Ee instanceof Error?Ee.message:String(Ee)})}},xl=async()=>{if(Oe.status==="recording"){await hr();return}if(Oe.status==="transcribing")return;if(fe.status!=="idle"){ze({status:"idle",error:"A terminal pane is recording — stop that first."});return}const H=new Ld;try{await H.start()}catch(V){ze({status:"idle",error:`Microphone unavailable: ${V instanceof Error?V.message:String(V)}`});return}Ne.current=H,ze({status:"recording",message:"Listening… say a command, then stop.",transcript:null,error:null}),window.clearTimeout(_t.current),_t.current=window.setTimeout(()=>{hr()},C.speech.maxUtteranceSeconds*1e3)};_e.useEffect(()=>()=>{window.clearTimeout(De.current),window.clearTimeout(_t.current),je.current?.cancel(),Ne.current?.cancel(),Ye.current?.dispose()},[]);const Al=async H=>{fe.sessionId===H.id&&rn();const V=et.filter(ve=>ve.id!==H.id);Z(ve=>ve.map(Ee=>({...Ee,sessionIds:Ee.sessionIds.filter(we=>we!==H.id)}))),d?.id===H.id&&y(V[0]??null),q===H.id&&$(V[0]?.id),ie===H.id&&R(null),ee(ml(V.length));const le=ot();if(le)try{await le.closeSession(H.id)}catch(ve){v(ve instanceof Error?ve.message:String(ve));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`),Ii()};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===Nt?.id?"active":""}`,onClick:()=>{f(H.id);const V=j.find(le=>H.sessionIds.includes(le.id));y(V??null),$(V?.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?et.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(Ve,{name:"grid"}),p.jsx("span",{children:"Overview"})]}),p.jsxs("button",{type:"button",className:"bar-button",onClick:Bi,title:"New workspace (Ctrl+Shift+N)",children:[p.jsx(Ve,{name:"plus"}),p.jsx("span",{children:"New"})]}),p.jsxs("button",{type:"button",className:"bar-button",onClick:async()=>{const H=ot();if(!H)return;const V=await H.requestAiCommand();if(C.ai.requireApproval){ae(V);return}const le=d?.id??q;if(!le){v("No terminal selected for the suggestion");return}H.write(le,`${V.command}\r`),v(`Ran suggestion: ${V.command}`)},children:[p.jsx(Ve,{name:"spark"}),p.jsx("span",{children:"Suggest"})]}),p.jsx("button",{type:"button",className:"bar-button theme-button",onClick:()=>ri("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(Ve,{name:O==="dark"?"sun":"moon"})})]})]}),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(Ve,{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(Ve,{name:"sessions"})}),p.jsx("button",{type:"button",className:"rail-button",onClick:()=>W(!0),title:"Overview",children:p.jsx(Ve,{name:"grid"})}),p.jsx("span",{className:"rail-spacer"}),p.jsx("button",{type:"button",className:"rail-button",onClick:qs,title:"New local terminal (Ctrl+Shift+T)","aria-label":"New local terminal",children:p.jsx(Ve,{name:"terminal"})}),p.jsx("button",{type:"button",className:"rail-button",onClick:()=>ni("ssh"),title:"Connect SSH",children:p.jsx(Ve,{name:"ssh"})}),p.jsx("button",{type:"button",className:`rail-button ${jt?"active":""}`,title:"Settings (Ctrl+Shift+,)","aria-label":"Settings","aria-expanded":jt,onClick:()=>de(H=>!H),children:p.jsx(Ve,{name:"settings"})})]}),!m&&p.jsxs("aside",{className:"session-drawer",ref:ia,style:{width:C.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:Nt?.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(Ve,{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(Ve,{name:"history"})}),p.jsx("button",{type:"button",className:"square-button",onClick:qs,title:"New local terminal","aria-label":"New local terminal",children:p.jsx(Ve,{name:"plus"})})]})]}),p.jsx("div",{className:"drawer-tools",role:"tablist","aria-label":"Session inventory",children:["terminals","screens","connections"].map(H=>{const V={terminals:"Terminals",screens:"Screens",connections:"Connections"},le=H==="terminals"?et.length:H==="screens"?j.filter(ve=>(ve.persistence==="screen"||ve.screenName)&&!et.some(Ee=>Ee.id===ve.id)).length+Vn.length:j.filter(ve=>ve.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:[V[H]," ",p.jsx("span",{children:le})]},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:()=>{Ii()},children:"Retry"})]}):c==="terminals"?et.length?et.map(H=>p.jsx(vl,{session:H,active:d?.id===H.id,onClick:()=>{Mt(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"?Zn():c==="connections"?Ct.length?Ct.map(H=>p.jsxs("button",{type:"button",className:"session-row",onClick:()=>ni("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(vl,{session:H,ghosted:!0,onClick:async()=>{zt(H),v(`Attaching remote screen ${H.name}…`);const V=ot();if(V)try{const ve=(await V.buildRemoteScreenAttach?.({alias:H.host,hostName:H.host},H.screenName??H.name))?.args?.find(we=>we.includes("@")||!we.startsWith("-"))??H.host,Ee=await V.createSshSession({target:ve,name:H.name});J(we=>we.map(Re=>Re.id===H.id?Ee:Re)),await Mt(Ee)}catch(le){v(le instanceof Error?le.message:String(le))}}},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:qs,children:[p.jsx(Ve,{name:"plus"})," Local terminal ",p.jsx("kbd",{children:"⌘⇧T"})]}),p.jsxs("button",{type:"button",className:"drawer-action",onClick:()=>ni("ssh"),children:[p.jsx(Ve,{name:"ssh"})," Connect SSH"]}),p.jsxs("div",{className:"drawer-status",children:[p.jsx("span",{className:"status-dot connected"}),h]})]})]}),!m&&p.jsx(zc,{orientation:"vertical",className:"sidebar-resizer",label:"Sidebar width",valuePercent:C.sessions.sidebarWidth/yt.sidebarWidth.max*100,onDrag:Xt,onCommit:()=>ri("sessions",{sidebarWidth:C.sessions.sidebarWidth}),onNudge:H=>ri("sessions",{sidebarWidth:C.sessions.sidebarWidth+H*16}),onReset:()=>ri("sessions",{sidebarWidth:He.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(Ve,{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??Nt?.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:ge?"layout-button active":"layout-button",onClick:()=>ye(H=>!H),disabled:!Pi.available||!ot()?.sftpOpen,title:Pi.reason,"aria-label":"Transfer files over SFTP",children:p.jsx(Ve,{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"||Ot?"layout-button active":"layout-button",onClick:()=>sn(c_(Gi)),title:jp(Gi),children:p.jsx(Ve,{name:"stack"})}),Lp.map(({layout:H,icon:V})=>p.jsx("button",{type:"button",className:N===H&&!Ot?"layout-button active":"layout-button",onClick:()=>sn(Op(H,Gi)),title:Bp(H,Gi),children:p.jsx(Ve,{name:V})},H))]})]})]}),p.jsxs("div",{className:`${Qn} ${Ot?"maximized-pane-grid":""}`,ref:Yt,style:ea,children:[Jn&&p.jsx(zc,{orientation:"vertical",className:"pane-resizer pane-resizer-column",label:"Pane column split",valuePercent:vi*100,style:{left:`calc((100% - 1px) * ${vi} + 0.5px)`},onDrag:H=>ta("column",H),onCommit:()=>ri("sessions",{splitColumnRatio:vi}),onNudge:H=>cr("column",H),onReset:()=>en("column")}),Is&&p.jsx(zc,{orientation:"horizontal",className:"pane-resizer pane-resizer-row",label:"Pane row split",valuePercent:Ut*100,style:{top:`calc((100% - 1px) * ${Ut} + 0.5px)`},onDrag:H=>ta("row",H),onCommit:()=>ri("sessions",{splitRowRatio:Ut}),onNudge:H=>cr("row",H),onReset:()=>en("row")}),Array.from({length:El},(H,V)=>{const le=us[V];if(!le)return p.jsx(Qp,{index:V+1,onCreate:qs},V);const ve=fe.sessionId===le.id&&fe.status!=="idle"?fe.status:null;return p.jsxs("article",{className:`pane terminal-pane ${q===le.id?"focused":""} ${Ot===le.id?"maximized-pane":""} ${Zr(le,V)?"":"overflow-pane"}`,onMouseDown:()=>$(le.id),children:[p.jsxs("div",{className:"pane-title",children:[p.jsxs("span",{children:[p.jsx("span",{className:"pane-live"})," ",le.name]}),p.jsxs("span",{className:"pane-actions",children:[Ot&&p.jsxs(p.Fragment,{children:[p.jsx("button",{type:"button",className:"pane-nav",onClick:()=>ur(-1),title:"Previous session",children:p.jsx(Ve,{name:"chevron-left"})}),p.jsx("button",{type:"button",className:"pane-nav",onClick:()=>ur(1),title:"Next session",children:p.jsx(Ve,{name:"chevron-right"})})]}),b?"connecting…":ve?`${ve}…`:le.kind==="ssh"?"ssh":"bash",p.jsx("button",{type:"button",className:"pane-proceed",onClick:()=>aa(le),title:`Send "${wt}" and press Enter`,"aria-label":`Send "${wt}" to ${le.name}`,children:p.jsx(Ve,{name:"check"})}),p.jsx("button",{type:"button",className:ve?`pane-mic ${ve}`:"pane-mic",onClick:()=>{na(le)},disabled:fe.status!=="idle"&&!ve,title:ve==="listening"?"Stop and transcribe":ve==="transcribing"?"Transcribing…":"Voice input","aria-label":ve==="listening"?`Stop recording ${le.name}`:`Voice input for ${le.name}`,children:p.jsx(Ve,{name:"mic"})}),p.jsx("button",{type:"button",className:"pane-maximize",onClick:()=>tn(le.id),title:Ot?"Restore pane":"Maximize pane",children:p.jsx(Ve,{name:Ot?"restore":"maximize"})}),p.jsx("button",{type:"button",className:"pane-close",onClick:()=>{Al(le)},title:"Close pane","aria-label":`Close ${le.name}`,children:p.jsx(Ve,{name:"x"})})]})]}),p.jsx(Zp,{sessionId:le.id,focused:q===le.id,onStatus:v,appearance:C.appearance,terminalSettings:C.terminal,registerFocus:qi})]},le.id)})]}),p.jsxs("footer",{className:"status-bar",children:[p.jsx("span",{children:"ZeroG"}),p.jsx("span",{className:"status-separator"}),p.jsx("span",{children:Nt?.name??"Workspace"}),p.jsx("span",{className:"status-separator"}),p.jsx("span",{children:Ot?"maximized pane":N==="stack"?"1 pane":`${cs} 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",...$n,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:Nt?.name??"Choose a session"})]}),p.jsx("button",{type:"button",className:"close-button",onClick:()=>W(!1),children:"Esc"})]}),p.jsx("div",{className:"thumbnail-grid",children:et.length?et.map(H=>p.jsxs("button",{type:"button",className:`thumbnail ${d?.id===H.id?"active":""}`,onClick:()=>{Mt(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),qs()},children:"+ Local terminal"}),p.jsx("button",{type:"button",onClick:()=>{W(!1),ni("ssh")},children:"Connect SSH"}),p.jsx("button",{type:"button",onClick:()=>{W(!1),Bi()},children:"+ Workspace"}),p.jsx("span",{className:"overview-hint",children:"Press Esc to close"})]})]})}),l&&p.jsx("div",{className:"history-layer",role:"presentation",...Vr,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:"×"})]}),Wt.length?Wt.slice().sort((H,V)=>V.timestamp.localeCompare(H.timestamp)).map(H=>p.jsxs("button",{type:"button",className:"history-item",onClick:async()=>{_(!1);const V=!!H.session.screenName,le=H.session.kind==="ssh"&&!V;if(V||H.session.backend==="screen"){a("screens");const ve=H.session.screenName||H.session.name,Ee=j.find(Qe=>Qe.kind==="ssh"&&Qe.screenName===ve),we=j.find(Qe=>Qe.screenName===ve&&Qe.kind==="local");if(Ee){zt(Ee),await Mt(Ee),v(`Reconnecting to ${Ee.name}…`);return}if(we){zt(we),await Mt(we),v(`Reconnecting to ${we.name}…`);return}const Re=ot();if(!Re)return;const $e=Ct.find(Qe=>(H.session.host||"").includes(Qe.hostName||Qe.alias)||(Qe.hostName||Qe.alias).includes(H.session.host||""));if($e){await Qr({...H.session,screenName:ve,host:$e.hostName||$e.alias},$e);return}if(H.session.host){const Qe=H.session.host,qe=await Re.createSshSession({target:Qe,name:H.session.name});J(ft=>[...ft,qe]),zt(qe),$(qe.id),R(null),ee(ml(et.length+1)),await Mt(qe);const Lt=H.session.screenName||H.session.name;Re.write(qe.id,`screen -x ${Lt}\r`),v(`Connected to ${qe.name}`)}return}if(le){const ve=H.session.host||H.session.sshTarget||"",Ee=ve.replace(/[^a-zA-Z0-9_.-]+/g,"-").slice(0,40);F(ve),me(H.session.name&&H.session.name!==Ee?H.session.name:"");const we=ot();if(!we)return;const Re=Ct.find(qe=>ve.includes(qe.hostName||qe.alias)||(qe.hostName||qe.alias).includes(ve)),$e=H.session.name||Ee,Qe=await we.createSshSession({target:ve,name:$e});if(J(qe=>[...qe,Qe]),zt(Qe),await Mt(Qe),v(`Connected to ${Qe.name}`),we.discoverRemoteScreens&&Re)try{const qe=await we.discoverRemoteScreens(Re);if(qe.length){const Lt=qe.find(ft=>ft.status==="detached")??qe[0];await Qr(Lt,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:V=>{V.stopPropagation(),ot()?.removeHistory(H.id).then(()=>ii(le=>le.filter(ve=>ve.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",...Hs,children:p.jsxs("form",{className:"modal-card",onSubmit:T==="workspace"?Us:T==="local"?hs:Et,children:[p.jsxs("div",{className:"modal-head",children:[p.jsxs("div",{children:[p.jsx("span",{className:"eyebrow",children:Hc(T).eyebrow}),p.jsx("h2",{children:Hc(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:ar.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:V=>{const le=Mp(H.kind,V.key);le&&(V.preventDefault(),U(le),document.getElementById(`session-tab-${le}`)?.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:z,onChange:H=>A(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 “",Nt?.name??"this workspace","”."]}),p.jsxs("label",{children:["Terminal name",p.jsx("input",{autoFocus:!0,value:B,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:ct,onChange:H=>{const V=H.target.value;_i(V)},children:Ue.length?Ue.map(H=>p.jsx("option",{value:H.backend,children:H.label},H.backend)):p.jsx("option",{value:"bash",children:"bash"})})]}),ct==="wsl"&&p.jsxs("label",{children:["WSL distribution",p.jsx("input",{value:Ht,onChange:H=>$t(H.target.value),placeholder:"Ubuntu"})]})]}),T==="ssh"&&p.jsxs(p.Fragment,{children:[p.jsxs("p",{children:["Connect a remote host into “",Nt?.name??"this workspace","”."]}),p.jsxs("label",{children:["SSH target",p.jsx("input",{autoFocus:!0,value:pe,onChange:H=>F(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:re,onChange:H=>me(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…":Hc(T).submit})]})]})}),ge&&d&&Rt&&ot()&&p.jsx(ap,{session:d,target:Rt,api:ot(),onClose:()=>ye(!1),backdrop:Xn},d.id),jt&&p.jsx(Tp,{settings:C,onChange:ri,onReset:Xr,onClose:()=>de(!1),backdrop:Ns,backends:Ue,wslDistributions:Ke,speechTest:Oe,onSpeechTest:()=>{xl()}}),Se&&p.jsx("div",{className:"modal-layer",role:"presentation",...wl,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:()=>{ot()?.write(Se.sessionId,Se.text),v(`Voice: "${Se.text}"`),mi()},children:"Insert"})]})]})}),k&&p.jsx("div",{className:"modal-layer",role:"presentation",...Cl,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:()=>ae(null),children:"Esc"})]}),p.jsx("p",{children:k.explanation}),p.jsx("code",{children:k.command}),p.jsxs("div",{className:"modal-actions",children:[p.jsx("button",{type:"button",onClick:()=>ae(null),children:"Cancel"}),p.jsx("button",{type:"button",className:"primary-button",onClick:()=>{d&&ot()?.write(d.id,`${k.command}\r`),ae(null)},children:"Approve & run"})]})]})})]})}function $d(C){return C==="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 Uc(C){let L=C.length+1;const O=new Set(C.map(j=>j.name.toLowerCase()));for(;O.has(`workspace ${L}`);)L+=1;return`Workspace ${L}`}function eg(C,L){const O=C.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,24)||"term",j=new Set(L.map(se=>se.name.toLowerCase()));if(!j.has(O))return O;let J=2;for(;j.has(`${O}-${J}`);)J+=1;return`${O}-${J}`}function ml(C){return C<=1?"stack":C===2?"split-v":"grid"}Cm.createRoot(document.getElementById("root")).render(p.jsx(Jp,{}));
|