deckide 3.5.29 → 3.5.31

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.
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Gi=Symbol.for("react.element"),ff=Symbol.for("react.portal"),pf=Symbol.for("react.fragment"),_f=Symbol.for("react.strict_mode"),vf=Symbol.for("react.profiler"),mf=Symbol.for("react.provider"),gf=Symbol.for("react.context"),yf=Symbol.for("react.forward_ref"),Sf=Symbol.for("react.suspense"),Cf=Symbol.for("react.memo"),wf=Symbol.for("react.lazy"),ea=Symbol.iterator;function xf(e){return e===null||typeof e!="object"?null:(e=ea&&e[ea]||e["@@iterator"],typeof e=="function"?e:null)}var Oc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Nc=Object.assign,jc={};function ti(e,t,r){this.props=e,this.context=t,this.refs=jc,this.updater=r||Oc}ti.prototype.isReactComponent={};ti.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ti.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ic(){}Ic.prototype=ti.prototype;function il(e,t,r){this.props=e,this.context=t,this.refs=jc,this.updater=r||Oc}var nl=il.prototype=new Ic;nl.constructor=il;Nc(nl,ti.prototype);nl.isPureReactComponent=!0;var ta=Array.isArray,Fc=Object.prototype.hasOwnProperty,sl={current:null},Hc={key:!0,ref:!0,__self:!0,__source:!0};function zc(e,t,r){var i,n={},h=null,_=null;if(t!=null)for(i in t.ref!==void 0&&(_=t.ref),t.key!==void 0&&(h=""+t.key),t)Fc.call(t,i)&&!Hc.hasOwnProperty(i)&&(n[i]=t[i]);var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){for(var u=Array(l),f=0;f<l;f++)u[f]=arguments[f+2];n.children=u}if(e&&e.defaultProps)for(i in l=e.defaultProps,l)n[i]===void 0&&(n[i]=l[i]);return{$$typeof:Gi,type:e,key:h,ref:_,props:n,_owner:sl.current}}function bf(e,t){return{$$typeof:Gi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ol(e){return typeof e=="object"&&e!==null&&e.$$typeof===Gi}function Ef(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var ra=/\/+/g;function Rs(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ef(""+e.key):t.toString(36)}function xn(e,t,r,i,n){var h=typeof e;(h==="undefined"||h==="boolean")&&(e=null);var _=!1;if(e===null)_=!0;else switch(h){case"string":case"number":_=!0;break;case"object":switch(e.$$typeof){case Gi:case ff:_=!0}}if(_)return _=e,n=n(_),e=i===""?"."+Rs(_,0):i,ta(n)?(r="",e!=null&&(r=e.replace(ra,"$&/")+"/"),xn(n,t,r,"",function(f){return f})):n!=null&&(ol(n)&&(n=bf(n,r+(!n.key||_&&_.key===n.key?"":(""+n.key).replace(ra,"$&/")+"/")+e)),t.push(n)),1;if(_=0,i=i===""?".":i+":",ta(e))for(var l=0;l<e.length;l++){h=e[l];var u=i+Rs(h,l);_+=xn(h,t,r,u,n)}else if(u=xf(e),typeof u=="function")for(e=u.call(e),l=0;!(h=e.next()).done;)h=h.value,u=i+Rs(h,l++),_+=xn(h,t,r,u,n);else if(h==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return _}function rn(e,t,r){if(e==null)return e;var i=[],n=0;return xn(e,i,"","",function(h){return t.call(r,h,n++)}),i}function kf(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var qe={current:null},bn={transition:null},Lf={ReactCurrentDispatcher:qe,ReactCurrentBatchConfig:bn,ReactCurrentOwner:sl};function $c(){throw Error("act(...) is not supported in production builds of React.")}le.Children={map:rn,forEach:function(e,t,r){rn(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return rn(e,function(){t++}),t},toArray:function(e){return rn(e,function(t){return t})||[]},only:function(e){if(!ol(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};le.Component=ti;le.Fragment=pf;le.Profiler=vf;le.PureComponent=il;le.StrictMode=_f;le.Suspense=Sf;le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lf;le.act=$c;le.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=Nc({},e.props),n=e.key,h=e.ref,_=e._owner;if(t!=null){if(t.ref!==void 0&&(h=t.ref,_=sl.current),t.key!==void 0&&(n=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)Fc.call(t,u)&&!Hc.hasOwnProperty(u)&&(i[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)i.children=r;else if(1<u){l=Array(u);for(var f=0;f<u;f++)l[f]=arguments[f+2];i.children=l}return{$$typeof:Gi,type:e.type,key:n,ref:h,props:i,_owner:_}};le.createContext=function(e){return e={$$typeof:gf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:mf,_context:e},e.Consumer=e};le.createElement=zc;le.createFactory=function(e){var t=zc.bind(null,e);return t.type=e,t};le.createRef=function(){return{current:null}};le.forwardRef=function(e){return{$$typeof:yf,render:e}};le.isValidElement=ol;le.lazy=function(e){return{$$typeof:wf,_payload:{_status:-1,_result:e},_init:kf}};le.memo=function(e,t){return{$$typeof:Cf,type:e,compare:t===void 0?null:t}};le.startTransition=function(e){var t=bn.transition;bn.transition={};try{e()}finally{bn.transition=t}};le.unstable_act=$c;le.useCallback=function(e,t){return qe.current.useCallback(e,t)};le.useContext=function(e){return qe.current.useContext(e)};le.useDebugValue=function(){};le.useDeferredValue=function(e){return qe.current.useDeferredValue(e)};le.useEffect=function(e,t){return qe.current.useEffect(e,t)};le.useId=function(){return qe.current.useId()};le.useImperativeHandle=function(e,t,r){return qe.current.useImperativeHandle(e,t,r)};le.useInsertionEffect=function(e,t){return qe.current.useInsertionEffect(e,t)};le.useLayoutEffect=function(e,t){return qe.current.useLayoutEffect(e,t)};le.useMemo=function(e,t){return qe.current.useMemo(e,t)};le.useReducer=function(e,t,r){return qe.current.useReducer(e,t,r)};le.useRef=function(e){return qe.current.useRef(e)};le.useState=function(e){return qe.current.useState(e)};le.useSyncExternalStore=function(e,t,r){return qe.current.useSyncExternalStore(e,t,r)};le.useTransition=function(){return qe.current.useTransition()};le.version="18.3.1";Bc.exports=le;var N=Bc.exports;const vr=df(N);/**
9
+ */var Gi=Symbol.for("react.element"),ff=Symbol.for("react.portal"),pf=Symbol.for("react.fragment"),_f=Symbol.for("react.strict_mode"),vf=Symbol.for("react.profiler"),mf=Symbol.for("react.provider"),gf=Symbol.for("react.context"),yf=Symbol.for("react.forward_ref"),Sf=Symbol.for("react.suspense"),Cf=Symbol.for("react.memo"),wf=Symbol.for("react.lazy"),ea=Symbol.iterator;function xf(e){return e===null||typeof e!="object"?null:(e=ea&&e[ea]||e["@@iterator"],typeof e=="function"?e:null)}var Oc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Nc=Object.assign,jc={};function ti(e,t,r){this.props=e,this.context=t,this.refs=jc,this.updater=r||Oc}ti.prototype.isReactComponent={};ti.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};ti.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ic(){}Ic.prototype=ti.prototype;function il(e,t,r){this.props=e,this.context=t,this.refs=jc,this.updater=r||Oc}var nl=il.prototype=new Ic;nl.constructor=il;Nc(nl,ti.prototype);nl.isPureReactComponent=!0;var ta=Array.isArray,Fc=Object.prototype.hasOwnProperty,sl={current:null},Hc={key:!0,ref:!0,__self:!0,__source:!0};function zc(e,t,r){var i,n={},h=null,_=null;if(t!=null)for(i in t.ref!==void 0&&(_=t.ref),t.key!==void 0&&(h=""+t.key),t)Fc.call(t,i)&&!Hc.hasOwnProperty(i)&&(n[i]=t[i]);var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){for(var u=Array(l),f=0;f<l;f++)u[f]=arguments[f+2];n.children=u}if(e&&e.defaultProps)for(i in l=e.defaultProps,l)n[i]===void 0&&(n[i]=l[i]);return{$$typeof:Gi,type:e,key:h,ref:_,props:n,_owner:sl.current}}function bf(e,t){return{$$typeof:Gi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ol(e){return typeof e=="object"&&e!==null&&e.$$typeof===Gi}function Ef(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var ra=/\/+/g;function Rs(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Ef(""+e.key):t.toString(36)}function xn(e,t,r,i,n){var h=typeof e;(h==="undefined"||h==="boolean")&&(e=null);var _=!1;if(e===null)_=!0;else switch(h){case"string":case"number":_=!0;break;case"object":switch(e.$$typeof){case Gi:case ff:_=!0}}if(_)return _=e,n=n(_),e=i===""?"."+Rs(_,0):i,ta(n)?(r="",e!=null&&(r=e.replace(ra,"$&/")+"/"),xn(n,t,r,"",function(f){return f})):n!=null&&(ol(n)&&(n=bf(n,r+(!n.key||_&&_.key===n.key?"":(""+n.key).replace(ra,"$&/")+"/")+e)),t.push(n)),1;if(_=0,i=i===""?".":i+":",ta(e))for(var l=0;l<e.length;l++){h=e[l];var u=i+Rs(h,l);_+=xn(h,t,r,u,n)}else if(u=xf(e),typeof u=="function")for(e=u.call(e),l=0;!(h=e.next()).done;)h=h.value,u=i+Rs(h,l++),_+=xn(h,t,r,u,n);else if(h==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return _}function rn(e,t,r){if(e==null)return e;var i=[],n=0;return xn(e,i,"","",function(h){return t.call(r,h,n++)}),i}function kf(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ge={current:null},bn={transition:null},Lf={ReactCurrentDispatcher:Ge,ReactCurrentBatchConfig:bn,ReactCurrentOwner:sl};function $c(){throw Error("act(...) is not supported in production builds of React.")}le.Children={map:rn,forEach:function(e,t,r){rn(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return rn(e,function(){t++}),t},toArray:function(e){return rn(e,function(t){return t})||[]},only:function(e){if(!ol(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};le.Component=ti;le.Fragment=pf;le.Profiler=vf;le.PureComponent=il;le.StrictMode=_f;le.Suspense=Sf;le.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Lf;le.act=$c;le.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=Nc({},e.props),n=e.key,h=e.ref,_=e._owner;if(t!=null){if(t.ref!==void 0&&(h=t.ref,_=sl.current),t.key!==void 0&&(n=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(u in t)Fc.call(t,u)&&!Hc.hasOwnProperty(u)&&(i[u]=t[u]===void 0&&l!==void 0?l[u]:t[u])}var u=arguments.length-2;if(u===1)i.children=r;else if(1<u){l=Array(u);for(var f=0;f<u;f++)l[f]=arguments[f+2];i.children=l}return{$$typeof:Gi,type:e.type,key:n,ref:h,props:i,_owner:_}};le.createContext=function(e){return e={$$typeof:gf,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:mf,_context:e},e.Consumer=e};le.createElement=zc;le.createFactory=function(e){var t=zc.bind(null,e);return t.type=e,t};le.createRef=function(){return{current:null}};le.forwardRef=function(e){return{$$typeof:yf,render:e}};le.isValidElement=ol;le.lazy=function(e){return{$$typeof:wf,_payload:{_status:-1,_result:e},_init:kf}};le.memo=function(e,t){return{$$typeof:Cf,type:e,compare:t===void 0?null:t}};le.startTransition=function(e){var t=bn.transition;bn.transition={};try{e()}finally{bn.transition=t}};le.unstable_act=$c;le.useCallback=function(e,t){return Ge.current.useCallback(e,t)};le.useContext=function(e){return Ge.current.useContext(e)};le.useDebugValue=function(){};le.useDeferredValue=function(e){return Ge.current.useDeferredValue(e)};le.useEffect=function(e,t){return Ge.current.useEffect(e,t)};le.useId=function(){return Ge.current.useId()};le.useImperativeHandle=function(e,t,r){return Ge.current.useImperativeHandle(e,t,r)};le.useInsertionEffect=function(e,t){return Ge.current.useInsertionEffect(e,t)};le.useLayoutEffect=function(e,t){return Ge.current.useLayoutEffect(e,t)};le.useMemo=function(e,t){return Ge.current.useMemo(e,t)};le.useReducer=function(e,t,r){return Ge.current.useReducer(e,t,r)};le.useRef=function(e){return Ge.current.useRef(e)};le.useState=function(e){return Ge.current.useState(e)};le.useSyncExternalStore=function(e,t,r){return Ge.current.useSyncExternalStore(e,t,r)};le.useTransition=function(){return Ge.current.useTransition()};le.version="18.3.1";Bc.exports=le;var N=Bc.exports;const vr=df(N);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(E,A){var P=E.length;E.push(A);e:for(;0<P;){var M=P-1>>>1,H=E[M];if(0<n(H,A))E[M]=A,E[P]=H,P=M;else break e}}function r(E){return E.length===0?null:E[0]}function i(E){if(E.length===0)return null;var A=E[0],P=E.pop();if(P!==A){E[0]=P;e:for(var M=0,H=E.length,K=H>>>1;M<K;){var X=2*(M+1)-1,q=E[X],se=X+1,D=E[se];if(0>n(q,P))se<H&&0>n(D,q)?(E[M]=D,E[se]=P,M=se):(E[M]=q,E[X]=P,M=X);else if(se<H&&0>n(D,P))E[M]=D,E[se]=P,M=se;else break e}}return A}function n(E,A){var P=E.sortIndex-A.sortIndex;return P!==0?P:E.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var _=Date,l=_.now();e.unstable_now=function(){return _.now()-l}}var u=[],f=[],S=1,d=null,m=3,C=!1,w=!1,g=!1,a=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function c(E){for(var A=r(f);A!==null;){if(A.callback===null)i(f);else if(A.startTime<=E)i(f),A.sortIndex=A.expirationTime,t(u,A);else break;A=r(f)}}function p(E){if(g=!1,c(E),!w)if(r(u)!==null)w=!0,j(v);else{var A=r(f);A!==null&&$(p,A.startTime-E)}}function v(E,A){w=!1,g&&(g=!1,o(y),y=-1),C=!0;var P=m;try{for(c(A),d=r(u);d!==null&&(!(d.expirationTime>A)||E&&!O());){var M=d.callback;if(typeof M=="function"){d.callback=null,m=d.priorityLevel;var H=M(d.expirationTime<=A);A=e.unstable_now(),typeof H=="function"?d.callback=H:d===r(u)&&i(u),c(A)}else i(u);d=r(u)}if(d!==null)var K=!0;else{var X=r(f);X!==null&&$(p,X.startTime-A),K=!1}return K}finally{d=null,m=P,C=!1}}var x=!1,b=null,y=-1,k=5,R=-1;function O(){return!(e.unstable_now()-R<k)}function T(){if(b!==null){var E=e.unstable_now();R=E;var A=!0;try{A=b(!0,E)}finally{A?B():(x=!1,b=null)}}else x=!1}var B;if(typeof s=="function")B=function(){s(T)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,I=z.port2;z.port1.onmessage=T,B=function(){I.postMessage(null)}}else B=function(){a(T,0)};function j(E){b=E,x||(x=!0,B())}function $(E,A){y=a(function(){E(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(E){E.callback=null},e.unstable_continueExecution=function(){w||C||(w=!0,j(v))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(E){switch(m){case 1:case 2:case 3:var A=3;break;default:A=m}var P=m;m=A;try{return E()}finally{m=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,A){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var P=m;m=E;try{return A()}finally{m=P}},e.unstable_scheduleCallback=function(E,A,P){var M=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?M+P:M):P=M,E){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=P+H,E={id:S++,callback:A,priorityLevel:E,startTime:P,expirationTime:H,sortIndex:-1},P>M?(E.sortIndex=P,t(f,E),r(u)===null&&E===r(f)&&(g?(o(y),y=-1):g=!0,$(p,P-M))):(E.sortIndex=H,t(u,E),w||C||(w=!0,j(v))),E},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(E){var A=m;return function(){var P=m;m=A;try{return E.apply(this,arguments)}finally{m=P}}}})(Kc);Vc.exports=Kc;var Bf=Vc.exports;/**
25
+ */(function(e){function t(E,A){var P=E.length;E.push(A);e:for(;0<P;){var M=P-1>>>1,H=E[M];if(0<n(H,A))E[M]=A,E[P]=H,P=M;else break e}}function r(E){return E.length===0?null:E[0]}function i(E){if(E.length===0)return null;var A=E[0],P=E.pop();if(P!==A){E[0]=P;e:for(var M=0,H=E.length,K=H>>>1;M<K;){var X=2*(M+1)-1,q=E[X],se=X+1,D=E[se];if(0>n(q,P))se<H&&0>n(D,q)?(E[M]=D,E[se]=P,M=se):(E[M]=q,E[X]=P,M=X);else if(se<H&&0>n(D,P))E[M]=D,E[se]=P,M=se;else break e}}return A}function n(E,A){var P=E.sortIndex-A.sortIndex;return P!==0?P:E.id-A.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var _=Date,l=_.now();e.unstable_now=function(){return _.now()-l}}var u=[],f=[],y=1,d=null,m=3,C=!1,w=!1,g=!1,a=typeof setTimeout=="function"?setTimeout:null,o=typeof clearTimeout=="function"?clearTimeout:null,s=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function c(E){for(var A=r(f);A!==null;){if(A.callback===null)i(f);else if(A.startTime<=E)i(f),A.sortIndex=A.expirationTime,t(u,A);else break;A=r(f)}}function p(E){if(g=!1,c(E),!w)if(r(u)!==null)w=!0,j(v);else{var A=r(f);A!==null&&$(p,A.startTime-E)}}function v(E,A){w=!1,g&&(g=!1,o(S),S=-1),C=!0;var P=m;try{for(c(A),d=r(u);d!==null&&(!(d.expirationTime>A)||E&&!O());){var M=d.callback;if(typeof M=="function"){d.callback=null,m=d.priorityLevel;var H=M(d.expirationTime<=A);A=e.unstable_now(),typeof H=="function"?d.callback=H:d===r(u)&&i(u),c(A)}else i(u);d=r(u)}if(d!==null)var K=!0;else{var X=r(f);X!==null&&$(p,X.startTime-A),K=!1}return K}finally{d=null,m=P,C=!1}}var x=!1,b=null,S=-1,k=5,R=-1;function O(){return!(e.unstable_now()-R<k)}function T(){if(b!==null){var E=e.unstable_now();R=E;var A=!0;try{A=b(!0,E)}finally{A?B():(x=!1,b=null)}}else x=!1}var B;if(typeof s=="function")B=function(){s(T)};else if(typeof MessageChannel<"u"){var z=new MessageChannel,I=z.port2;z.port1.onmessage=T,B=function(){I.postMessage(null)}}else B=function(){a(T,0)};function j(E){b=E,x||(x=!0,B())}function $(E,A){S=a(function(){E(e.unstable_now())},A)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(E){E.callback=null},e.unstable_continueExecution=function(){w||C||(w=!0,j(v))},e.unstable_forceFrameRate=function(E){0>E||125<E?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<E?Math.floor(1e3/E):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(u)},e.unstable_next=function(E){switch(m){case 1:case 2:case 3:var A=3;break;default:A=m}var P=m;m=A;try{return E()}finally{m=P}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(E,A){switch(E){case 1:case 2:case 3:case 4:case 5:break;default:E=3}var P=m;m=E;try{return A()}finally{m=P}},e.unstable_scheduleCallback=function(E,A,P){var M=e.unstable_now();switch(typeof P=="object"&&P!==null?(P=P.delay,P=typeof P=="number"&&0<P?M+P:M):P=M,E){case 1:var H=-1;break;case 2:H=250;break;case 5:H=1073741823;break;case 4:H=1e4;break;default:H=5e3}return H=P+H,E={id:y++,callback:A,priorityLevel:E,startTime:P,expirationTime:H,sortIndex:-1},P>M?(E.sortIndex=P,t(f,E),r(u)===null&&E===r(f)&&(g?(o(S),S=-1):g=!0,$(p,P-M))):(E.sortIndex=H,t(u,E),w||C||(w=!0,j(v))),E},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(E){var A=m;return function(){var P=m;m=A;try{return E.apply(this,arguments)}finally{m=P}}}})(Kc);Vc.exports=Kc;var Bf=Vc.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,28 +30,28 @@
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Of=N,lt=Bf;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var qc=new Set,Ti={};function br(e,t){Gr(e,t),Gr(e+"Capture",t)}function Gr(e,t){for(Ti[e]=t,e=0;e<t.length;e++)qc.add(t[e])}var It=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ao=Object.prototype.hasOwnProperty,Nf=/^[: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]*$/,ia={},na={};function jf(e){return ao.call(na,e)?!0:ao.call(ia,e)?!1:Nf.test(e)?na[e]=!0:(ia[e]=!0,!1)}function If(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ff(e,t,r,i){if(t===null||typeof t>"u"||If(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ge(e,t,r,i,n,h,_){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=_}var Ie={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Ie[e]=new Ge(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Ie[t]=new Ge(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Ie[e]=new Ge(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Ie[e]=new Ge(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Ie[e]=new Ge(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Ie[e]=new Ge(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Ie[e]=new Ge(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Ie[e]=new Ge(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Ie[e]=new Ge(e,5,!1,e.toLowerCase(),null,!1,!1)});var ll=/[\-:]([a-z])/g;function al(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ll,al);Ie[t]=new Ge(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ll,al);Ie[t]=new Ge(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ll,al);Ie[t]=new Ge(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Ie[e]=new Ge(e,1,!1,e.toLowerCase(),null,!1,!1)});Ie.xlinkHref=new Ge("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Ie[e]=new Ge(e,1,!1,e.toLowerCase(),null,!0,!0)});function cl(e,t,r,i){var n=Ie.hasOwnProperty(t)?Ie[t]:null;(n!==null?n.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ff(t,r,n,i)&&(r=null),i||n===null?jf(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):n.mustUseProperty?e[n.propertyName]=r===null?n.type===3?!1:"":r:(t=n.attributeName,i=n.attributeNamespace,r===null?e.removeAttribute(t):(n=n.type,r=n===3||n===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var $t=Of.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nn=Symbol.for("react.element"),Rr=Symbol.for("react.portal"),Tr=Symbol.for("react.fragment"),ul=Symbol.for("react.strict_mode"),co=Symbol.for("react.profiler"),Gc=Symbol.for("react.provider"),Xc=Symbol.for("react.context"),hl=Symbol.for("react.forward_ref"),uo=Symbol.for("react.suspense"),ho=Symbol.for("react.suspense_list"),dl=Symbol.for("react.memo"),Vt=Symbol.for("react.lazy"),Yc=Symbol.for("react.offscreen"),sa=Symbol.iterator;function si(e){return e===null||typeof e!="object"?null:(e=sa&&e[sa]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,Ts;function pi(e){if(Ts===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ts=t&&t[1]||""}return`
33
+ */var Of=N,lt=Bf;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);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."}var qc=new Set,Ti={};function br(e,t){Gr(e,t),Gr(e+"Capture",t)}function Gr(e,t){for(Ti[e]=t,e=0;e<t.length;e++)qc.add(t[e])}var It=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ao=Object.prototype.hasOwnProperty,Nf=/^[: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]*$/,ia={},na={};function jf(e){return ao.call(na,e)?!0:ao.call(ia,e)?!1:Nf.test(e)?na[e]=!0:(ia[e]=!0,!1)}function If(e,t,r,i){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return i?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ff(e,t,r,i){if(t===null||typeof t>"u"||If(e,t,r,i))return!0;if(i)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Xe(e,t,r,i,n,h,_){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=n,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=_}var Fe={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Fe[e]=new Xe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Fe[t]=new Xe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Fe[e]=new Xe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Fe[e]=new Xe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Fe[e]=new Xe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Fe[e]=new Xe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Fe[e]=new Xe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Fe[e]=new Xe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Fe[e]=new Xe(e,5,!1,e.toLowerCase(),null,!1,!1)});var ll=/[\-:]([a-z])/g;function al(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ll,al);Fe[t]=new Xe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ll,al);Fe[t]=new Xe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ll,al);Fe[t]=new Xe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Fe[e]=new Xe(e,1,!1,e.toLowerCase(),null,!1,!1)});Fe.xlinkHref=new Xe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Fe[e]=new Xe(e,1,!1,e.toLowerCase(),null,!0,!0)});function cl(e,t,r,i){var n=Fe.hasOwnProperty(t)?Fe[t]:null;(n!==null?n.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ff(t,r,n,i)&&(r=null),i||n===null?jf(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):n.mustUseProperty?e[n.propertyName]=r===null?n.type===3?!1:"":r:(t=n.attributeName,i=n.attributeNamespace,r===null?e.removeAttribute(t):(n=n.type,r=n===3||n===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var $t=Of.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,nn=Symbol.for("react.element"),Rr=Symbol.for("react.portal"),Tr=Symbol.for("react.fragment"),ul=Symbol.for("react.strict_mode"),co=Symbol.for("react.profiler"),Gc=Symbol.for("react.provider"),Xc=Symbol.for("react.context"),hl=Symbol.for("react.forward_ref"),uo=Symbol.for("react.suspense"),ho=Symbol.for("react.suspense_list"),dl=Symbol.for("react.memo"),Vt=Symbol.for("react.lazy"),Yc=Symbol.for("react.offscreen"),sa=Symbol.iterator;function si(e){return e===null||typeof e!="object"?null:(e=sa&&e[sa]||e["@@iterator"],typeof e=="function"?e:null)}var Ee=Object.assign,Ts;function pi(e){if(Ts===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);Ts=t&&t[1]||""}return`
34
34
  `+Ts+e}var As=!1;function Ps(e,t){if(!e||As)return"";As=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(f){var i=f}Reflect.construct(e,[],t)}else{try{t.call()}catch(f){i=f}e.call(t.prototype)}else{try{throw Error()}catch(f){i=f}e()}}catch(f){if(f&&i&&typeof f.stack=="string"){for(var n=f.stack.split(`
35
35
  `),h=i.stack.split(`
36
36
  `),_=n.length-1,l=h.length-1;1<=_&&0<=l&&n[_]!==h[l];)l--;for(;1<=_&&0<=l;_--,l--)if(n[_]!==h[l]){if(_!==1||l!==1)do if(_--,l--,0>l||n[_]!==h[l]){var u=`
37
- `+n[_].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=_&&0<=l);break}}}finally{As=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?pi(e):""}function Hf(e){switch(e.tag){case 5:return pi(e.type);case 16:return pi("Lazy");case 13:return pi("Suspense");case 19:return pi("SuspenseList");case 0:case 2:case 15:return e=Ps(e.type,!1),e;case 11:return e=Ps(e.type.render,!1),e;case 1:return e=Ps(e.type,!0),e;default:return""}}function fo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Tr:return"Fragment";case Rr:return"Portal";case co:return"Profiler";case ul:return"StrictMode";case uo:return"Suspense";case ho:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xc:return(e.displayName||"Context")+".Consumer";case Gc:return(e._context.displayName||"Context")+".Provider";case hl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case dl:return t=e.displayName||null,t!==null?t:fo(e.type)||"Memo";case Vt:t=e._payload,e=e._init;try{return fo(e(t))}catch{}}return null}function zf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fo(t);case 8:return t===ul?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function or(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $f(e){var t=Qc(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,h=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(_){i=""+_,h.call(this,_)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(_){i=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sn(e){e._valueTracker||(e._valueTracker=$f(e))}function Jc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Qc(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function On(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}}function po(e,t){var r=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function oa(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=or(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Zc(e,t){t=t.checked,t!=null&&cl(e,"checked",t,!1)}function _o(e,t){Zc(e,t);var r=or(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vo(e,t.type,r):t.hasOwnProperty("defaultValue")&&vo(e,t.type,or(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function la(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function vo(e,t,r){(t!=="number"||On(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var _i=Array.isArray;function $r(e,t,r,i){if(e=e.options,t){t={};for(var n=0;n<r.length;n++)t["$"+r[n]]=!0;for(r=0;r<e.length;r++)n=t.hasOwnProperty("$"+e[r].value),e[r].selected!==n&&(e[r].selected=n),n&&i&&(e[r].defaultSelected=!0)}else{for(r=""+or(r),t=null,n=0;n<e.length;n++){if(e[n].value===r){e[n].selected=!0,i&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function mo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function aa(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(G(92));if(_i(r)){if(1<r.length)throw Error(G(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:or(r)}}function eu(e,t){var r=or(t.value),i=or(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function ca(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tu(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function go(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var on,ru=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,n){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,n)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(on=on||document.createElement("div"),on.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=on.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ai(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Si={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Uf=["Webkit","ms","Moz","O"];Object.keys(Si).forEach(function(e){Uf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Si[t]=Si[e]})});function iu(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Si.hasOwnProperty(e)&&Si[e]?(""+t).trim():t+"px"}function nu(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,n=iu(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,n):e[r]=n}}var Wf=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yo(e,t){if(t){if(Wf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function So(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Co=null;function fl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wo=null,Ur=null,Wr=null;function ua(e){if(e=Qi(e)){if(typeof wo!="function")throw Error(G(280));var t=e.stateNode;t&&(t=ps(t),wo(e.stateNode,e.type,t))}}function su(e){Ur?Wr?Wr.push(e):Wr=[e]:Ur=e}function ou(){if(Ur){var e=Ur,t=Wr;if(Wr=Ur=null,ua(e),t)for(e=0;e<t.length;e++)ua(t[e])}}function lu(e,t){return e(t)}function au(){}var Ms=!1;function cu(e,t,r){if(Ms)return e(t,r);Ms=!0;try{return lu(e,t,r)}finally{Ms=!1,(Ur!==null||Wr!==null)&&(au(),ou())}}function Pi(e,t){var r=e.stateNode;if(r===null)return null;var i=ps(r);if(i===null)return null;r=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(G(231,t,typeof r));return r}var xo=!1;if(It)try{var oi={};Object.defineProperty(oi,"passive",{get:function(){xo=!0}}),window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch{xo=!1}function Vf(e,t,r,i,n,h,_,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(S){this.onError(S)}}var Ci=!1,Nn=null,jn=!1,bo=null,Kf={onError:function(e){Ci=!0,Nn=e}};function qf(e,t,r,i,n,h,_,l,u){Ci=!1,Nn=null,Vf.apply(Kf,arguments)}function Gf(e,t,r,i,n,h,_,l,u){if(qf.apply(this,arguments),Ci){if(Ci){var f=Nn;Ci=!1,Nn=null}else throw Error(G(198));jn||(jn=!0,bo=f)}}function Er(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function uu(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 ha(e){if(Er(e)!==e)throw Error(G(188))}function Xf(e){var t=e.alternate;if(!t){if(t=Er(e),t===null)throw Error(G(188));return t!==e?null:e}for(var r=e,i=t;;){var n=r.return;if(n===null)break;var h=n.alternate;if(h===null){if(i=n.return,i!==null){r=i;continue}break}if(n.child===h.child){for(h=n.child;h;){if(h===r)return ha(n),e;if(h===i)return ha(n),t;h=h.sibling}throw Error(G(188))}if(r.return!==i.return)r=n,i=h;else{for(var _=!1,l=n.child;l;){if(l===r){_=!0,r=n,i=h;break}if(l===i){_=!0,i=n,r=h;break}l=l.sibling}if(!_){for(l=h.child;l;){if(l===r){_=!0,r=h,i=n;break}if(l===i){_=!0,i=h,r=n;break}l=l.sibling}if(!_)throw Error(G(189))}}if(r.alternate!==i)throw Error(G(190))}if(r.tag!==3)throw Error(G(188));return r.stateNode.current===r?e:t}function hu(e){return e=Xf(e),e!==null?du(e):null}function du(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=du(e);if(t!==null)return t;e=e.sibling}return null}var fu=lt.unstable_scheduleCallback,da=lt.unstable_cancelCallback,Yf=lt.unstable_shouldYield,Qf=lt.unstable_requestPaint,Le=lt.unstable_now,Jf=lt.unstable_getCurrentPriorityLevel,pl=lt.unstable_ImmediatePriority,pu=lt.unstable_UserBlockingPriority,In=lt.unstable_NormalPriority,Zf=lt.unstable_LowPriority,_u=lt.unstable_IdlePriority,us=null,Dt=null;function ep(e){if(Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(us,e,void 0,(e.current.flags&128)===128)}catch{}}var wt=Math.clz32?Math.clz32:ip,tp=Math.log,rp=Math.LN2;function ip(e){return e>>>=0,e===0?32:31-(tp(e)/rp|0)|0}var ln=64,an=4194304;function vi(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fn(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,h=e.pingedLanes,_=r&268435455;if(_!==0){var l=_&~n;l!==0?i=vi(l):(h&=_,h!==0&&(i=vi(h)))}else _=r&~n,_!==0?i=vi(_):h!==0&&(i=vi(h));if(i===0)return 0;if(t!==0&&t!==i&&!(t&n)&&(n=i&-i,h=t&-t,n>=h||n===16&&(h&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-wt(t),n=1<<r,i|=e[r],t&=~n;return i}function np(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sp(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,n=e.expirationTimes,h=e.pendingLanes;0<h;){var _=31-wt(h),l=1<<_,u=n[_];u===-1?(!(l&r)||l&i)&&(n[_]=np(l,t)):u<=t&&(e.expiredLanes|=l),h&=~l}}function Eo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function vu(){var e=ln;return ln<<=1,!(ln&4194240)&&(ln=64),e}function Bs(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Xi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wt(t),e[t]=r}function op(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var n=31-wt(r),h=1<<n;t[n]=0,i[n]=-1,e[n]=-1,r&=~h}}function _l(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-wt(r),n=1<<i;n&t|e[i]&t&&(e[i]|=t),r&=~n}}var de=0;function mu(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var gu,vl,yu,Su,Cu,ko=!1,cn=[],Qt=null,Jt=null,Zt=null,Mi=new Map,Bi=new Map,qt=[],lp="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 submit".split(" ");function fa(e,t){switch(e){case"focusin":case"focusout":Qt=null;break;case"dragenter":case"dragleave":Jt=null;break;case"mouseover":case"mouseout":Zt=null;break;case"pointerover":case"pointerout":Mi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bi.delete(t.pointerId)}}function li(e,t,r,i,n,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:h,targetContainers:[n]},t!==null&&(t=Qi(t),t!==null&&vl(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function ap(e,t,r,i,n){switch(t){case"focusin":return Qt=li(Qt,e,t,r,i,n),!0;case"dragenter":return Jt=li(Jt,e,t,r,i,n),!0;case"mouseover":return Zt=li(Zt,e,t,r,i,n),!0;case"pointerover":var h=n.pointerId;return Mi.set(h,li(Mi.get(h)||null,e,t,r,i,n)),!0;case"gotpointercapture":return h=n.pointerId,Bi.set(h,li(Bi.get(h)||null,e,t,r,i,n)),!0}return!1}function wu(e){var t=fr(e.target);if(t!==null){var r=Er(t);if(r!==null){if(t=r.tag,t===13){if(t=uu(r),t!==null){e.blockedOn=t,Cu(e.priority,function(){yu(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function En(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Lo(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Co=i,r.target.dispatchEvent(i),Co=null}else return t=Qi(r),t!==null&&vl(t),e.blockedOn=r,!1;t.shift()}return!0}function pa(e,t,r){En(e)&&r.delete(t)}function cp(){ko=!1,Qt!==null&&En(Qt)&&(Qt=null),Jt!==null&&En(Jt)&&(Jt=null),Zt!==null&&En(Zt)&&(Zt=null),Mi.forEach(pa),Bi.forEach(pa)}function ai(e,t){e.blockedOn===t&&(e.blockedOn=null,ko||(ko=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,cp)))}function Oi(e){function t(n){return ai(n,e)}if(0<cn.length){ai(cn[0],e);for(var r=1;r<cn.length;r++){var i=cn[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Qt!==null&&ai(Qt,e),Jt!==null&&ai(Jt,e),Zt!==null&&ai(Zt,e),Mi.forEach(t),Bi.forEach(t),r=0;r<qt.length;r++)i=qt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<qt.length&&(r=qt[0],r.blockedOn===null);)wu(r),r.blockedOn===null&&qt.shift()}var Vr=$t.ReactCurrentBatchConfig,Hn=!0;function up(e,t,r,i){var n=de,h=Vr.transition;Vr.transition=null;try{de=1,ml(e,t,r,i)}finally{de=n,Vr.transition=h}}function hp(e,t,r,i){var n=de,h=Vr.transition;Vr.transition=null;try{de=4,ml(e,t,r,i)}finally{de=n,Vr.transition=h}}function ml(e,t,r,i){if(Hn){var n=Lo(e,t,r,i);if(n===null)Ws(e,t,i,zn,r),fa(e,i);else if(ap(n,e,t,r,i))i.stopPropagation();else if(fa(e,i),t&4&&-1<lp.indexOf(e)){for(;n!==null;){var h=Qi(n);if(h!==null&&gu(h),h=Lo(e,t,r,i),h===null&&Ws(e,t,i,zn,r),h===n)break;n=h}n!==null&&i.stopPropagation()}else Ws(e,t,i,null,r)}}var zn=null;function Lo(e,t,r,i){if(zn=null,e=fl(i),e=fr(e),e!==null)if(t=Er(e),t===null)e=null;else if(r=t.tag,r===13){if(e=uu(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return zn=e,null}function xu(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Jf()){case pl:return 1;case pu:return 4;case In:case Zf:return 16;case _u:return 536870912;default:return 16}default:return 16}}var Xt=null,gl=null,kn=null;function bu(){if(kn)return kn;var e,t=gl,r=t.length,i,n="value"in Xt?Xt.value:Xt.textContent,h=n.length;for(e=0;e<r&&t[e]===n[e];e++);var _=r-e;for(i=1;i<=_&&t[r-i]===n[h-i];i++);return kn=n.slice(e,1<i?1-i:void 0)}function Ln(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 un(){return!0}function _a(){return!1}function ct(e){function t(r,i,n,h,_){this._reactName=r,this._targetInst=n,this.type=i,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(h):h[l]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?un:_a,this.isPropagationStopped=_a,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=un)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=un)},persist:function(){},isPersistent:un}),t}var ri={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yl=ct(ri),Yi=Ee({},ri,{view:0,detail:0}),dp=ct(Yi),Os,Ns,ci,hs=Ee({},Yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sl,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!==ci&&(ci&&e.type==="mousemove"?(Os=e.screenX-ci.screenX,Ns=e.screenY-ci.screenY):Ns=Os=0,ci=e),Os)},movementY:function(e){return"movementY"in e?e.movementY:Ns}}),va=ct(hs),fp=Ee({},hs,{dataTransfer:0}),pp=ct(fp),_p=Ee({},Yi,{relatedTarget:0}),js=ct(_p),vp=Ee({},ri,{animationName:0,elapsedTime:0,pseudoElement:0}),mp=ct(vp),gp=Ee({},ri,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yp=ct(gp),Sp=Ee({},ri,{data:0}),ma=ct(Sp),Cp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wp={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"},xp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xp[e])?!!t[e]:!1}function Sl(){return bp}var Ep=Ee({},Yi,{key:function(e){if(e.key){var t=Cp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ln(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sl,charCode:function(e){return e.type==="keypress"?Ln(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ln(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kp=ct(Ep),Lp=Ee({},hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ga=ct(Lp),Dp=Ee({},Yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sl}),Rp=ct(Dp),Tp=Ee({},ri,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ap=ct(Tp),Pp=Ee({},hs,{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}),Mp=ct(Pp),Bp=[9,13,27,32],Cl=It&&"CompositionEvent"in window,wi=null;It&&"documentMode"in document&&(wi=document.documentMode);var Op=It&&"TextEvent"in window&&!wi,Eu=It&&(!Cl||wi&&8<wi&&11>=wi),ya=" ",Sa=!1;function ku(e,t){switch(e){case"keyup":return Bp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function Np(e,t){switch(e){case"compositionend":return Lu(t);case"keypress":return t.which!==32?null:(Sa=!0,ya);case"textInput":return e=t.data,e===ya&&Sa?null:e;default:return null}}function jp(e,t){if(Ar)return e==="compositionend"||!Cl&&ku(e,t)?(e=bu(),kn=gl=Xt=null,Ar=!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 Eu&&t.locale!=="ko"?null:t.data;default:return null}}var Ip={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 Ca(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ip[e.type]:t==="textarea"}function Du(e,t,r,i){su(i),t=$n(t,"onChange"),0<t.length&&(r=new yl("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var xi=null,Ni=null;function Fp(e){Fu(e,0)}function ds(e){var t=Br(e);if(Jc(t))return e}function Hp(e,t){if(e==="change")return t}var Ru=!1;if(It){var Is;if(It){var Fs="oninput"in document;if(!Fs){var wa=document.createElement("div");wa.setAttribute("oninput","return;"),Fs=typeof wa.oninput=="function"}Is=Fs}else Is=!1;Ru=Is&&(!document.documentMode||9<document.documentMode)}function xa(){xi&&(xi.detachEvent("onpropertychange",Tu),Ni=xi=null)}function Tu(e){if(e.propertyName==="value"&&ds(Ni)){var t=[];Du(t,Ni,e,fl(e)),cu(Fp,t)}}function zp(e,t,r){e==="focusin"?(xa(),xi=t,Ni=r,xi.attachEvent("onpropertychange",Tu)):e==="focusout"&&xa()}function $p(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ds(Ni)}function Up(e,t){if(e==="click")return ds(t)}function Wp(e,t){if(e==="input"||e==="change")return ds(t)}function Vp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:Vp;function ji(e,t){if(bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var n=r[i];if(!ao.call(t,n)||!bt(e[n],t[n]))return!1}return!0}function ba(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ea(e,t){var r=ba(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ba(r)}}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 Pu(){for(var e=window,t=On();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=On(e.document)}return t}function wl(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")}function Kp(e){var t=Pu(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Au(r.ownerDocument.documentElement,r)){if(i!==null&&wl(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var n=r.textContent.length,h=Math.min(i.start,n);i=i.end===void 0?h:Math.min(i.end,n),!e.extend&&h>i&&(n=i,i=h,h=n),n=Ea(r,h);var _=Ea(r,i);n&&_&&(e.rangeCount!==1||e.anchorNode!==n.node||e.anchorOffset!==n.offset||e.focusNode!==_.node||e.focusOffset!==_.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),e.removeAllRanges(),h>i?(e.addRange(t),e.extend(_.node,_.offset)):(t.setEnd(_.node,_.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var qp=It&&"documentMode"in document&&11>=document.documentMode,Pr=null,Do=null,bi=null,Ro=!1;function ka(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ro||Pr==null||Pr!==On(i)||(i=Pr,"selectionStart"in i&&wl(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),bi&&ji(bi,i)||(bi=i,i=$n(Do,"onSelect"),0<i.length&&(t=new yl("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Pr)))}function hn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Mr={animationend:hn("Animation","AnimationEnd"),animationiteration:hn("Animation","AnimationIteration"),animationstart:hn("Animation","AnimationStart"),transitionend:hn("Transition","TransitionEnd")},Hs={},Mu={};It&&(Mu=document.createElement("div").style,"AnimationEvent"in window||(delete Mr.animationend.animation,delete Mr.animationiteration.animation,delete Mr.animationstart.animation),"TransitionEvent"in window||delete Mr.transitionend.transition);function fs(e){if(Hs[e])return Hs[e];if(!Mr[e])return e;var t=Mr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Mu)return Hs[e]=t[r];return e}var Bu=fs("animationend"),Ou=fs("animationiteration"),Nu=fs("animationstart"),ju=fs("transitionend"),Iu=new Map,La="abort auxClick 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(" ");function ar(e,t){Iu.set(e,t),br(t,[e])}for(var zs=0;zs<La.length;zs++){var $s=La[zs],Gp=$s.toLowerCase(),Xp=$s[0].toUpperCase()+$s.slice(1);ar(Gp,"on"+Xp)}ar(Bu,"onAnimationEnd");ar(Ou,"onAnimationIteration");ar(Nu,"onAnimationStart");ar("dblclick","onDoubleClick");ar("focusin","onFocus");ar("focusout","onBlur");ar(ju,"onTransitionEnd");Gr("onMouseEnter",["mouseout","mouseover"]);Gr("onMouseLeave",["mouseout","mouseover"]);Gr("onPointerEnter",["pointerout","pointerover"]);Gr("onPointerLeave",["pointerout","pointerover"]);br("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));br("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));br("onBeforeInput",["compositionend","keypress","textInput","paste"]);br("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));br("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));br("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mi="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(" "),Yp=new Set("cancel close invalid load scroll toggle".split(" ").concat(mi));function Da(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,Gf(i,t,void 0,e),e.currentTarget=null}function Fu(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],n=i.event;i=i.listeners;e:{var h=void 0;if(t)for(var _=i.length-1;0<=_;_--){var l=i[_],u=l.instance,f=l.currentTarget;if(l=l.listener,u!==h&&n.isPropagationStopped())break e;Da(n,l,f),h=u}else for(_=0;_<i.length;_++){if(l=i[_],u=l.instance,f=l.currentTarget,l=l.listener,u!==h&&n.isPropagationStopped())break e;Da(n,l,f),h=u}}}if(jn)throw e=bo,jn=!1,bo=null,e}function ye(e,t){var r=t[Bo];r===void 0&&(r=t[Bo]=new Set);var i=e+"__bubble";r.has(i)||(Hu(t,e,2,!1),r.add(i))}function Us(e,t,r){var i=0;t&&(i|=4),Hu(r,e,i,t)}var dn="_reactListening"+Math.random().toString(36).slice(2);function Ii(e){if(!e[dn]){e[dn]=!0,qc.forEach(function(r){r!=="selectionchange"&&(Yp.has(r)||Us(r,!1,e),Us(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[dn]||(t[dn]=!0,Us("selectionchange",!1,t))}}function Hu(e,t,r,i){switch(xu(t)){case 1:var n=up;break;case 4:n=hp;break;default:n=ml}r=n.bind(null,t,r,e),n=void 0,!xo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),i?n!==void 0?e.addEventListener(t,r,{capture:!0,passive:n}):e.addEventListener(t,r,!0):n!==void 0?e.addEventListener(t,r,{passive:n}):e.addEventListener(t,r,!1)}function Ws(e,t,r,i,n){var h=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var _=i.tag;if(_===3||_===4){var l=i.stateNode.containerInfo;if(l===n||l.nodeType===8&&l.parentNode===n)break;if(_===4)for(_=i.return;_!==null;){var u=_.tag;if((u===3||u===4)&&(u=_.stateNode.containerInfo,u===n||u.nodeType===8&&u.parentNode===n))return;_=_.return}for(;l!==null;){if(_=fr(l),_===null)return;if(u=_.tag,u===5||u===6){i=h=_;continue e}l=l.parentNode}}i=i.return}cu(function(){var f=h,S=fl(r),d=[];e:{var m=Iu.get(e);if(m!==void 0){var C=yl,w=e;switch(e){case"keypress":if(Ln(r)===0)break e;case"keydown":case"keyup":C=kp;break;case"focusin":w="focus",C=js;break;case"focusout":w="blur",C=js;break;case"beforeblur":case"afterblur":C=js;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":C=va;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":C=pp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":C=Rp;break;case Bu:case Ou:case Nu:C=mp;break;case ju:C=Ap;break;case"scroll":C=dp;break;case"wheel":C=Mp;break;case"copy":case"cut":case"paste":C=yp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":C=ga}var g=(t&4)!==0,a=!g&&e==="scroll",o=g?m!==null?m+"Capture":null:m;g=[];for(var s=f,c;s!==null;){c=s;var p=c.stateNode;if(c.tag===5&&p!==null&&(c=p,o!==null&&(p=Pi(s,o),p!=null&&g.push(Fi(s,p,c)))),a)break;s=s.return}0<g.length&&(m=new C(m,w,null,r,S),d.push({event:m,listeners:g}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",C=e==="mouseout"||e==="pointerout",m&&r!==Co&&(w=r.relatedTarget||r.fromElement)&&(fr(w)||w[Ft]))break e;if((C||m)&&(m=S.window===S?S:(m=S.ownerDocument)?m.defaultView||m.parentWindow:window,C?(w=r.relatedTarget||r.toElement,C=f,w=w?fr(w):null,w!==null&&(a=Er(w),w!==a||w.tag!==5&&w.tag!==6)&&(w=null)):(C=null,w=f),C!==w)){if(g=va,p="onMouseLeave",o="onMouseEnter",s="mouse",(e==="pointerout"||e==="pointerover")&&(g=ga,p="onPointerLeave",o="onPointerEnter",s="pointer"),a=C==null?m:Br(C),c=w==null?m:Br(w),m=new g(p,s+"leave",C,r,S),m.target=a,m.relatedTarget=c,p=null,fr(S)===f&&(g=new g(o,s+"enter",w,r,S),g.target=c,g.relatedTarget=a,p=g),a=p,C&&w)t:{for(g=C,o=w,s=0,c=g;c;c=Lr(c))s++;for(c=0,p=o;p;p=Lr(p))c++;for(;0<s-c;)g=Lr(g),s--;for(;0<c-s;)o=Lr(o),c--;for(;s--;){if(g===o||o!==null&&g===o.alternate)break t;g=Lr(g),o=Lr(o)}g=null}else g=null;C!==null&&Ra(d,m,C,g,!1),w!==null&&a!==null&&Ra(d,a,w,g,!0)}}e:{if(m=f?Br(f):window,C=m.nodeName&&m.nodeName.toLowerCase(),C==="select"||C==="input"&&m.type==="file")var v=Hp;else if(Ca(m))if(Ru)v=Wp;else{v=$p;var x=zp}else(C=m.nodeName)&&C.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(v=Up);if(v&&(v=v(e,f))){Du(d,v,r,S);break e}x&&x(e,m,f),e==="focusout"&&(x=m._wrapperState)&&x.controlled&&m.type==="number"&&vo(m,"number",m.value)}switch(x=f?Br(f):window,e){case"focusin":(Ca(x)||x.contentEditable==="true")&&(Pr=x,Do=f,bi=null);break;case"focusout":bi=Do=Pr=null;break;case"mousedown":Ro=!0;break;case"contextmenu":case"mouseup":case"dragend":Ro=!1,ka(d,r,S);break;case"selectionchange":if(qp)break;case"keydown":case"keyup":ka(d,r,S)}var b;if(Cl)e:{switch(e){case"compositionstart":var y="onCompositionStart";break e;case"compositionend":y="onCompositionEnd";break e;case"compositionupdate":y="onCompositionUpdate";break e}y=void 0}else Ar?ku(e,r)&&(y="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(y="onCompositionStart");y&&(Eu&&r.locale!=="ko"&&(Ar||y!=="onCompositionStart"?y==="onCompositionEnd"&&Ar&&(b=bu()):(Xt=S,gl="value"in Xt?Xt.value:Xt.textContent,Ar=!0)),x=$n(f,y),0<x.length&&(y=new ma(y,e,null,r,S),d.push({event:y,listeners:x}),b?y.data=b:(b=Lu(r),b!==null&&(y.data=b)))),(b=Op?Np(e,r):jp(e,r))&&(f=$n(f,"onBeforeInput"),0<f.length&&(S=new ma("onBeforeInput","beforeinput",null,r,S),d.push({event:S,listeners:f}),S.data=b))}Fu(d,t)})}function Fi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function $n(e,t){for(var r=t+"Capture",i=[];e!==null;){var n=e,h=n.stateNode;n.tag===5&&h!==null&&(n=h,h=Pi(e,r),h!=null&&i.unshift(Fi(e,h,n)),h=Pi(e,t),h!=null&&i.push(Fi(e,h,n))),e=e.return}return i}function Lr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ra(e,t,r,i,n){for(var h=t._reactName,_=[];r!==null&&r!==i;){var l=r,u=l.alternate,f=l.stateNode;if(u!==null&&u===i)break;l.tag===5&&f!==null&&(l=f,n?(u=Pi(r,h),u!=null&&_.unshift(Fi(r,u,l))):n||(u=Pi(r,h),u!=null&&_.push(Fi(r,u,l)))),r=r.return}_.length!==0&&e.push({event:t,listeners:_})}var Qp=/\r\n?/g,Jp=/\u0000|\uFFFD/g;function Ta(e){return(typeof e=="string"?e:""+e).replace(Qp,`
38
- `).replace(Jp,"")}function fn(e,t,r){if(t=Ta(t),Ta(e)!==t&&r)throw Error(G(425))}function Un(){}var To=null,Ao=null;function Po(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Mo=typeof setTimeout=="function"?setTimeout:void 0,Zp=typeof clearTimeout=="function"?clearTimeout:void 0,Aa=typeof Promise=="function"?Promise:void 0,e_=typeof queueMicrotask=="function"?queueMicrotask:typeof Aa<"u"?function(e){return Aa.resolve(null).then(e).catch(t_)}:Mo;function t_(e){setTimeout(function(){throw e})}function Vs(e,t){var r=t,i=0;do{var n=r.nextSibling;if(e.removeChild(r),n&&n.nodeType===8)if(r=n.data,r==="/$"){if(i===0){e.removeChild(n),Oi(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=n}while(r);Oi(t)}function er(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==="$?")break;if(t==="/$")return null}}return e}function Pa(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var ii=Math.random().toString(36).slice(2),Lt="__reactFiber$"+ii,Hi="__reactProps$"+ii,Ft="__reactContainer$"+ii,Bo="__reactEvents$"+ii,r_="__reactListeners$"+ii,i_="__reactHandles$"+ii;function fr(e){var t=e[Lt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ft]||r[Lt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Pa(e);e!==null;){if(r=e[Lt])return r;e=Pa(e)}return t}e=r,r=e.parentNode}return null}function Qi(e){return e=e[Lt]||e[Ft],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Br(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function ps(e){return e[Hi]||null}var Oo=[],Or=-1;function cr(e){return{current:e}}function Se(e){0>Or||(e.current=Oo[Or],Oo[Or]=null,Or--)}function ve(e,t){Or++,Oo[Or]=e.current,e.current=t}var lr={},$e=cr(lr),Je=cr(!1),yr=lr;function Xr(e,t){var r=e.type.contextTypes;if(!r)return lr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var n={},h;for(h in r)n[h]=t[h];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n),n}function Ze(e){return e=e.childContextTypes,e!=null}function Wn(){Se(Je),Se($e)}function Ma(e,t,r){if($e.current!==lr)throw Error(G(168));ve($e,t),ve(Je,r)}function zu(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var n in i)if(!(n in t))throw Error(G(108,zf(e)||"Unknown",n));return Ee({},r,i)}function Vn(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lr,yr=$e.current,ve($e,e),ve(Je,Je.current),!0}function Ba(e,t,r){var i=e.stateNode;if(!i)throw Error(G(169));r?(e=zu(e,t,yr),i.__reactInternalMemoizedMergedChildContext=e,Se(Je),Se($e),ve($e,e)):Se(Je),ve(Je,r)}var Bt=null,_s=!1,Ks=!1;function $u(e){Bt===null?Bt=[e]:Bt.push(e)}function n_(e){_s=!0,$u(e)}function ur(){if(!Ks&&Bt!==null){Ks=!0;var e=0,t=de;try{var r=Bt;for(de=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Bt=null,_s=!1}catch(n){throw Bt!==null&&(Bt=Bt.slice(e+1)),fu(pl,ur),n}finally{de=t,Ks=!1}}return null}var Nr=[],jr=0,Kn=null,qn=0,dt=[],ft=0,Sr=null,Ot=1,Nt="";function hr(e,t){Nr[jr++]=qn,Nr[jr++]=Kn,Kn=e,qn=t}function Uu(e,t,r){dt[ft++]=Ot,dt[ft++]=Nt,dt[ft++]=Sr,Sr=e;var i=Ot;e=Nt;var n=32-wt(i)-1;i&=~(1<<n),r+=1;var h=32-wt(t)+n;if(30<h){var _=n-n%5;h=(i&(1<<_)-1).toString(32),i>>=_,n-=_,Ot=1<<32-wt(t)+n|r<<n|i,Nt=h+e}else Ot=1<<h|r<<n|i,Nt=e}function xl(e){e.return!==null&&(hr(e,1),Uu(e,1,0))}function bl(e){for(;e===Kn;)Kn=Nr[--jr],Nr[jr]=null,qn=Nr[--jr],Nr[jr]=null;for(;e===Sr;)Sr=dt[--ft],dt[ft]=null,Nt=dt[--ft],dt[ft]=null,Ot=dt[--ft],dt[ft]=null}var ot=null,st=null,Ce=!1,Ct=null;function Wu(e,t){var r=pt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Oa(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ot=e,st=er(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ot=e,st=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Sr!==null?{id:Ot,overflow:Nt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=pt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ot=e,st=null,!0):!1;default:return!1}}function No(e){return(e.mode&1)!==0&&(e.flags&128)===0}function jo(e){if(Ce){var t=st;if(t){var r=t;if(!Oa(e,t)){if(No(e))throw Error(G(418));t=er(r.nextSibling);var i=ot;t&&Oa(e,t)?Wu(i,r):(e.flags=e.flags&-4097|2,Ce=!1,ot=e)}}else{if(No(e))throw Error(G(418));e.flags=e.flags&-4097|2,Ce=!1,ot=e}}}function Na(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ot=e}function pn(e){if(e!==ot)return!1;if(!Ce)return Na(e),Ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Po(e.type,e.memoizedProps)),t&&(t=st)){if(No(e))throw Vu(),Error(G(418));for(;t;)Wu(e,t),t=er(t.nextSibling)}if(Na(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){st=er(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}st=null}}else st=ot?er(e.stateNode.nextSibling):null;return!0}function Vu(){for(var e=st;e;)e=er(e.nextSibling)}function Yr(){st=ot=null,Ce=!1}function El(e){Ct===null?Ct=[e]:Ct.push(e)}var s_=$t.ReactCurrentBatchConfig;function ui(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(G(309));var i=r.stateNode}if(!i)throw Error(G(147,e));var n=i,h=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===h?t.ref:(t=function(_){var l=n.refs;_===null?delete l[h]:l[h]=_},t._stringRef=h,t)}if(typeof e!="string")throw Error(G(284));if(!r._owner)throw Error(G(290,e))}return e}function _n(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ja(e){var t=e._init;return t(e._payload)}function Ku(e){function t(o,s){if(e){var c=o.deletions;c===null?(o.deletions=[s],o.flags|=16):c.push(s)}}function r(o,s){if(!e)return null;for(;s!==null;)t(o,s),s=s.sibling;return null}function i(o,s){for(o=new Map;s!==null;)s.key!==null?o.set(s.key,s):o.set(s.index,s),s=s.sibling;return o}function n(o,s){return o=nr(o,s),o.index=0,o.sibling=null,o}function h(o,s,c){return o.index=c,e?(c=o.alternate,c!==null?(c=c.index,c<s?(o.flags|=2,s):c):(o.flags|=2,s)):(o.flags|=1048576,s)}function _(o){return e&&o.alternate===null&&(o.flags|=2),o}function l(o,s,c,p){return s===null||s.tag!==6?(s=Zs(c,o.mode,p),s.return=o,s):(s=n(s,c),s.return=o,s)}function u(o,s,c,p){var v=c.type;return v===Tr?S(o,s,c.props.children,p,c.key):s!==null&&(s.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===Vt&&ja(v)===s.type)?(p=n(s,c.props),p.ref=ui(o,s,c),p.return=o,p):(p=Bn(c.type,c.key,c.props,null,o.mode,p),p.ref=ui(o,s,c),p.return=o,p)}function f(o,s,c,p){return s===null||s.tag!==4||s.stateNode.containerInfo!==c.containerInfo||s.stateNode.implementation!==c.implementation?(s=eo(c,o.mode,p),s.return=o,s):(s=n(s,c.children||[]),s.return=o,s)}function S(o,s,c,p,v){return s===null||s.tag!==7?(s=gr(c,o.mode,p,v),s.return=o,s):(s=n(s,c),s.return=o,s)}function d(o,s,c){if(typeof s=="string"&&s!==""||typeof s=="number")return s=Zs(""+s,o.mode,c),s.return=o,s;if(typeof s=="object"&&s!==null){switch(s.$$typeof){case nn:return c=Bn(s.type,s.key,s.props,null,o.mode,c),c.ref=ui(o,null,s),c.return=o,c;case Rr:return s=eo(s,o.mode,c),s.return=o,s;case Vt:var p=s._init;return d(o,p(s._payload),c)}if(_i(s)||si(s))return s=gr(s,o.mode,c,null),s.return=o,s;_n(o,s)}return null}function m(o,s,c,p){var v=s!==null?s.key:null;if(typeof c=="string"&&c!==""||typeof c=="number")return v!==null?null:l(o,s,""+c,p);if(typeof c=="object"&&c!==null){switch(c.$$typeof){case nn:return c.key===v?u(o,s,c,p):null;case Rr:return c.key===v?f(o,s,c,p):null;case Vt:return v=c._init,m(o,s,v(c._payload),p)}if(_i(c)||si(c))return v!==null?null:S(o,s,c,p,null);_n(o,c)}return null}function C(o,s,c,p,v){if(typeof p=="string"&&p!==""||typeof p=="number")return o=o.get(c)||null,l(s,o,""+p,v);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case nn:return o=o.get(p.key===null?c:p.key)||null,u(s,o,p,v);case Rr:return o=o.get(p.key===null?c:p.key)||null,f(s,o,p,v);case Vt:var x=p._init;return C(o,s,c,x(p._payload),v)}if(_i(p)||si(p))return o=o.get(c)||null,S(s,o,p,v,null);_n(s,p)}return null}function w(o,s,c,p){for(var v=null,x=null,b=s,y=s=0,k=null;b!==null&&y<c.length;y++){b.index>y?(k=b,b=null):k=b.sibling;var R=m(o,b,c[y],p);if(R===null){b===null&&(b=k);break}e&&b&&R.alternate===null&&t(o,b),s=h(R,s,y),x===null?v=R:x.sibling=R,x=R,b=k}if(y===c.length)return r(o,b),Ce&&hr(o,y),v;if(b===null){for(;y<c.length;y++)b=d(o,c[y],p),b!==null&&(s=h(b,s,y),x===null?v=b:x.sibling=b,x=b);return Ce&&hr(o,y),v}for(b=i(o,b);y<c.length;y++)k=C(b,o,y,c[y],p),k!==null&&(e&&k.alternate!==null&&b.delete(k.key===null?y:k.key),s=h(k,s,y),x===null?v=k:x.sibling=k,x=k);return e&&b.forEach(function(O){return t(o,O)}),Ce&&hr(o,y),v}function g(o,s,c,p){var v=si(c);if(typeof v!="function")throw Error(G(150));if(c=v.call(c),c==null)throw Error(G(151));for(var x=v=null,b=s,y=s=0,k=null,R=c.next();b!==null&&!R.done;y++,R=c.next()){b.index>y?(k=b,b=null):k=b.sibling;var O=m(o,b,R.value,p);if(O===null){b===null&&(b=k);break}e&&b&&O.alternate===null&&t(o,b),s=h(O,s,y),x===null?v=O:x.sibling=O,x=O,b=k}if(R.done)return r(o,b),Ce&&hr(o,y),v;if(b===null){for(;!R.done;y++,R=c.next())R=d(o,R.value,p),R!==null&&(s=h(R,s,y),x===null?v=R:x.sibling=R,x=R);return Ce&&hr(o,y),v}for(b=i(o,b);!R.done;y++,R=c.next())R=C(b,o,y,R.value,p),R!==null&&(e&&R.alternate!==null&&b.delete(R.key===null?y:R.key),s=h(R,s,y),x===null?v=R:x.sibling=R,x=R);return e&&b.forEach(function(T){return t(o,T)}),Ce&&hr(o,y),v}function a(o,s,c,p){if(typeof c=="object"&&c!==null&&c.type===Tr&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case nn:e:{for(var v=c.key,x=s;x!==null;){if(x.key===v){if(v=c.type,v===Tr){if(x.tag===7){r(o,x.sibling),s=n(x,c.props.children),s.return=o,o=s;break e}}else if(x.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===Vt&&ja(v)===x.type){r(o,x.sibling),s=n(x,c.props),s.ref=ui(o,x,c),s.return=o,o=s;break e}r(o,x);break}else t(o,x);x=x.sibling}c.type===Tr?(s=gr(c.props.children,o.mode,p,c.key),s.return=o,o=s):(p=Bn(c.type,c.key,c.props,null,o.mode,p),p.ref=ui(o,s,c),p.return=o,o=p)}return _(o);case Rr:e:{for(x=c.key;s!==null;){if(s.key===x)if(s.tag===4&&s.stateNode.containerInfo===c.containerInfo&&s.stateNode.implementation===c.implementation){r(o,s.sibling),s=n(s,c.children||[]),s.return=o,o=s;break e}else{r(o,s);break}else t(o,s);s=s.sibling}s=eo(c,o.mode,p),s.return=o,o=s}return _(o);case Vt:return x=c._init,a(o,s,x(c._payload),p)}if(_i(c))return w(o,s,c,p);if(si(c))return g(o,s,c,p);_n(o,c)}return typeof c=="string"&&c!==""||typeof c=="number"?(c=""+c,s!==null&&s.tag===6?(r(o,s.sibling),s=n(s,c),s.return=o,o=s):(r(o,s),s=Zs(c,o.mode,p),s.return=o,o=s),_(o)):r(o,s)}return a}var Qr=Ku(!0),qu=Ku(!1),Gn=cr(null),Xn=null,Ir=null,kl=null;function Ll(){kl=Ir=Xn=null}function Dl(e){var t=Gn.current;Se(Gn),e._currentValue=t}function Io(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Kr(e,t){Xn=e,kl=Ir=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Qe=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(kl!==e)if(e={context:e,memoizedValue:t,next:null},Ir===null){if(Xn===null)throw Error(G(308));Ir=e,Xn.dependencies={lanes:0,firstContext:e}}else Ir=Ir.next=e;return t}var pr=null;function Rl(e){pr===null?pr=[e]:pr.push(e)}function Gu(e,t,r,i){var n=t.interleaved;return n===null?(r.next=r,Rl(t)):(r.next=n.next,n.next=r),t.interleaved=r,Ht(e,i)}function Ht(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Kt=!1;function Tl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function tr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,he&2){var n=i.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),i.pending=t,Ht(e,r)}return n=i.interleaved,n===null?(t.next=t,Rl(i)):(t.next=n.next,n.next=t),i.interleaved=t,Ht(e,r)}function Dn(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,_l(e,r)}}function Ia(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var n=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var _={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};h===null?n=h=_:h=h.next=_,r=r.next}while(r!==null);h===null?n=h=t:h=h.next=t}else n=h=t;r={baseState:i.baseState,firstBaseUpdate:n,lastBaseUpdate:h,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Yn(e,t,r,i){var n=e.updateQueue;Kt=!1;var h=n.firstBaseUpdate,_=n.lastBaseUpdate,l=n.shared.pending;if(l!==null){n.shared.pending=null;var u=l,f=u.next;u.next=null,_===null?h=f:_.next=f,_=u;var S=e.alternate;S!==null&&(S=S.updateQueue,l=S.lastBaseUpdate,l!==_&&(l===null?S.firstBaseUpdate=f:l.next=f,S.lastBaseUpdate=u))}if(h!==null){var d=n.baseState;_=0,S=f=u=null,l=h;do{var m=l.lane,C=l.eventTime;if((i&m)===m){S!==null&&(S=S.next={eventTime:C,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,g=l;switch(m=t,C=r,g.tag){case 1:if(w=g.payload,typeof w=="function"){d=w.call(C,d,m);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=g.payload,m=typeof w=="function"?w.call(C,d,m):w,m==null)break e;d=Ee({},d,m);break e;case 2:Kt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=n.effects,m===null?n.effects=[l]:m.push(l))}else C={eventTime:C,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},S===null?(f=S=C,u=d):S=S.next=C,_|=m;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;m=l,l=m.next,m.next=null,n.lastBaseUpdate=m,n.shared.pending=null}}while(!0);if(S===null&&(u=d),n.baseState=u,n.firstBaseUpdate=f,n.lastBaseUpdate=S,t=n.shared.interleaved,t!==null){n=t;do _|=n.lane,n=n.next;while(n!==t)}else h===null&&(n.shared.lanes=0);wr|=_,e.lanes=_,e.memoizedState=d}}function Fa(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],n=i.callback;if(n!==null){if(i.callback=null,i=r,typeof n!="function")throw Error(G(191,n));n.call(i)}}}var Ji={},Rt=cr(Ji),zi=cr(Ji),$i=cr(Ji);function _r(e){if(e===Ji)throw Error(G(174));return e}function Al(e,t){switch(ve($i,t),ve(zi,e),ve(Rt,Ji),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:go(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=go(t,e)}Se(Rt),ve(Rt,t)}function Jr(){Se(Rt),Se(zi),Se($i)}function Yu(e){_r($i.current);var t=_r(Rt.current),r=go(t,e.type);t!==r&&(ve(zi,e),ve(Rt,r))}function Pl(e){zi.current===e&&(Se(Rt),Se(zi))}var xe=cr(0);function Qn(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 qs=[];function Ml(){for(var e=0;e<qs.length;e++)qs[e]._workInProgressVersionPrimary=null;qs.length=0}var Rn=$t.ReactCurrentDispatcher,Gs=$t.ReactCurrentBatchConfig,Cr=0,be=null,Re=null,Ae=null,Jn=!1,Ei=!1,Ui=0,o_=0;function Fe(){throw Error(G(321))}function Bl(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!bt(e[r],t[r]))return!1;return!0}function Ol(e,t,r,i,n,h){if(Cr=h,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Rn.current=e===null||e.memoizedState===null?u_:h_,e=r(i,n),Ei){h=0;do{if(Ei=!1,Ui=0,25<=h)throw Error(G(301));h+=1,Ae=Re=null,t.updateQueue=null,Rn.current=d_,e=r(i,n)}while(Ei)}if(Rn.current=Zn,t=Re!==null&&Re.next!==null,Cr=0,Ae=Re=be=null,Jn=!1,t)throw Error(G(300));return e}function Nl(){var e=Ui!==0;return Ui=0,e}function kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ae===null?be.memoizedState=Ae=e:Ae=Ae.next=e,Ae}function mt(){if(Re===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Ae===null?be.memoizedState:Ae.next;if(t!==null)Ae=t,Re=e;else{if(e===null)throw Error(G(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Ae===null?be.memoizedState=Ae=e:Ae=Ae.next=e}return Ae}function Wi(e,t){return typeof t=="function"?t(e):t}function Xs(e){var t=mt(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var i=Re,n=i.baseQueue,h=r.pending;if(h!==null){if(n!==null){var _=n.next;n.next=h.next,h.next=_}i.baseQueue=n=h,r.pending=null}if(n!==null){h=n.next,i=i.baseState;var l=_=null,u=null,f=h;do{var S=f.lane;if((Cr&S)===S)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),i=f.hasEagerState?f.eagerState:e(i,f.action);else{var d={lane:S,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=d,_=i):u=u.next=d,be.lanes|=S,wr|=S}f=f.next}while(f!==null&&f!==h);u===null?_=i:u.next=l,bt(i,t.memoizedState)||(Qe=!0),t.memoizedState=i,t.baseState=_,t.baseQueue=u,r.lastRenderedState=i}if(e=r.interleaved,e!==null){n=e;do h=n.lane,be.lanes|=h,wr|=h,n=n.next;while(n!==e)}else n===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ys(e){var t=mt(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var i=r.dispatch,n=r.pending,h=t.memoizedState;if(n!==null){r.pending=null;var _=n=n.next;do h=e(h,_.action),_=_.next;while(_!==n);bt(h,t.memoizedState)||(Qe=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),r.lastRenderedState=h}return[h,i]}function Qu(){}function Ju(e,t){var r=be,i=mt(),n=t(),h=!bt(i.memoizedState,n);if(h&&(i.memoizedState=n,Qe=!0),i=i.queue,jl(th.bind(null,r,i,e),[e]),i.getSnapshot!==t||h||Ae!==null&&Ae.memoizedState.tag&1){if(r.flags|=2048,Vi(9,eh.bind(null,r,i,n,t),void 0,null),Me===null)throw Error(G(349));Cr&30||Zu(r,t,n)}return n}function Zu(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function eh(e,t,r,i){t.value=r,t.getSnapshot=i,rh(t)&&ih(e)}function th(e,t,r){return r(function(){rh(t)&&ih(e)})}function rh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!bt(e,r)}catch{return!0}}function ih(e){var t=Ht(e,1);t!==null&&xt(t,e,1,-1)}function Ha(e){var t=kt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wi,lastRenderedState:e},t.queue=e,e=e.dispatch=c_.bind(null,be,e),[t.memoizedState,e]}function Vi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function nh(){return mt().memoizedState}function Tn(e,t,r,i){var n=kt();be.flags|=e,n.memoizedState=Vi(1|t,r,void 0,i===void 0?null:i)}function vs(e,t,r,i){var n=mt();i=i===void 0?null:i;var h=void 0;if(Re!==null){var _=Re.memoizedState;if(h=_.destroy,i!==null&&Bl(i,_.deps)){n.memoizedState=Vi(t,r,h,i);return}}be.flags|=e,n.memoizedState=Vi(1|t,r,h,i)}function za(e,t){return Tn(8390656,8,e,t)}function jl(e,t){return vs(2048,8,e,t)}function sh(e,t){return vs(4,2,e,t)}function oh(e,t){return vs(4,4,e,t)}function lh(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ah(e,t,r){return r=r!=null?r.concat([e]):null,vs(4,4,lh.bind(null,t,e),r)}function Il(){}function ch(e,t){var r=mt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Bl(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function uh(e,t){var r=mt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Bl(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function hh(e,t,r){return Cr&21?(bt(r,t)||(r=vu(),be.lanes|=r,wr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Qe=!0),e.memoizedState=r)}function l_(e,t){var r=de;de=r!==0&&4>r?r:4,e(!0);var i=Gs.transition;Gs.transition={};try{e(!1),t()}finally{de=r,Gs.transition=i}}function dh(){return mt().memoizedState}function a_(e,t,r){var i=ir(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},fh(e))ph(t,r);else if(r=Gu(e,t,r,i),r!==null){var n=Ke();xt(r,e,i,n),_h(r,t,i)}}function c_(e,t,r){var i=ir(e),n={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(fh(e))ph(t,n);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var _=t.lastRenderedState,l=h(_,r);if(n.hasEagerState=!0,n.eagerState=l,bt(l,_)){var u=t.interleaved;u===null?(n.next=n,Rl(t)):(n.next=u.next,u.next=n),t.interleaved=n;return}}catch{}finally{}r=Gu(e,t,n,i),r!==null&&(n=Ke(),xt(r,e,i,n),_h(r,t,i))}}function fh(e){var t=e.alternate;return e===be||t!==null&&t===be}function ph(e,t){Ei=Jn=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function _h(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,_l(e,r)}}var Zn={readContext:vt,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useInsertionEffect:Fe,useLayoutEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useMutableSource:Fe,useSyncExternalStore:Fe,useId:Fe,unstable_isNewReconciler:!1},u_={readContext:vt,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:za,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Tn(4194308,4,lh.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Tn(4194308,4,e,t)},useInsertionEffect:function(e,t){return Tn(4,2,e,t)},useMemo:function(e,t){var r=kt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=kt();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=a_.bind(null,be,e),[i.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:Ha,useDebugValue:Il,useDeferredValue:function(e){return kt().memoizedState=e},useTransition:function(){var e=Ha(!1),t=e[0];return e=l_.bind(null,e[1]),kt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=be,n=kt();if(Ce){if(r===void 0)throw Error(G(407));r=r()}else{if(r=t(),Me===null)throw Error(G(349));Cr&30||Zu(i,t,r)}n.memoizedState=r;var h={value:r,getSnapshot:t};return n.queue=h,za(th.bind(null,i,h,e),[e]),i.flags|=2048,Vi(9,eh.bind(null,i,h,r,t),void 0,null),r},useId:function(){var e=kt(),t=Me.identifierPrefix;if(Ce){var r=Nt,i=Ot;r=(i&~(1<<32-wt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ui++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=o_++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},h_={readContext:vt,useCallback:ch,useContext:vt,useEffect:jl,useImperativeHandle:ah,useInsertionEffect:sh,useLayoutEffect:oh,useMemo:uh,useReducer:Xs,useRef:nh,useState:function(){return Xs(Wi)},useDebugValue:Il,useDeferredValue:function(e){var t=mt();return hh(t,Re.memoizedState,e)},useTransition:function(){var e=Xs(Wi)[0],t=mt().memoizedState;return[e,t]},useMutableSource:Qu,useSyncExternalStore:Ju,useId:dh,unstable_isNewReconciler:!1},d_={readContext:vt,useCallback:ch,useContext:vt,useEffect:jl,useImperativeHandle:ah,useInsertionEffect:sh,useLayoutEffect:oh,useMemo:uh,useReducer:Ys,useRef:nh,useState:function(){return Ys(Wi)},useDebugValue:Il,useDeferredValue:function(e){var t=mt();return Re===null?t.memoizedState=e:hh(t,Re.memoizedState,e)},useTransition:function(){var e=Ys(Wi)[0],t=mt().memoizedState;return[e,t]},useMutableSource:Qu,useSyncExternalStore:Ju,useId:dh,unstable_isNewReconciler:!1};function yt(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Fo(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:Ee({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ms={isMounted:function(e){return(e=e._reactInternals)?Er(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=Ke(),n=ir(e),h=jt(i,n);h.payload=t,r!=null&&(h.callback=r),t=tr(e,h,n),t!==null&&(xt(t,e,n,i),Dn(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=Ke(),n=ir(e),h=jt(i,n);h.tag=1,h.payload=t,r!=null&&(h.callback=r),t=tr(e,h,n),t!==null&&(xt(t,e,n,i),Dn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=Ke(),i=ir(e),n=jt(r,i);n.tag=2,t!=null&&(n.callback=t),t=tr(e,n,i),t!==null&&(xt(t,e,i,r),Dn(t,e,i))}};function $a(e,t,r,i,n,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,_):t.prototype&&t.prototype.isPureReactComponent?!ji(r,i)||!ji(n,h):!0}function vh(e,t,r){var i=!1,n=lr,h=t.contextType;return typeof h=="object"&&h!==null?h=vt(h):(n=Ze(t)?yr:$e.current,i=t.contextTypes,h=(i=i!=null)?Xr(e,n):lr),t=new t(r,h),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ms,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=h),t}function Ua(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&ms.enqueueReplaceState(t,t.state,null)}function Ho(e,t,r,i){var n=e.stateNode;n.props=r,n.state=e.memoizedState,n.refs={},Tl(e);var h=t.contextType;typeof h=="object"&&h!==null?n.context=vt(h):(h=Ze(t)?yr:$e.current,n.context=Xr(e,h)),n.state=e.memoizedState,h=t.getDerivedStateFromProps,typeof h=="function"&&(Fo(e,t,h,r),n.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(t=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),t!==n.state&&ms.enqueueReplaceState(n,n.state,null),Yn(e,r,n,i),n.state=e.memoizedState),typeof n.componentDidMount=="function"&&(e.flags|=4194308)}function Zr(e,t){try{var r="",i=t;do r+=Hf(i),i=i.return;while(i);var n=r}catch(h){n=`
37
+ `+n[_].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}while(1<=_&&0<=l);break}}}finally{As=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?pi(e):""}function Hf(e){switch(e.tag){case 5:return pi(e.type);case 16:return pi("Lazy");case 13:return pi("Suspense");case 19:return pi("SuspenseList");case 0:case 2:case 15:return e=Ps(e.type,!1),e;case 11:return e=Ps(e.type.render,!1),e;case 1:return e=Ps(e.type,!0),e;default:return""}}function fo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Tr:return"Fragment";case Rr:return"Portal";case co:return"Profiler";case ul:return"StrictMode";case uo:return"Suspense";case ho:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xc:return(e.displayName||"Context")+".Consumer";case Gc:return(e._context.displayName||"Context")+".Provider";case hl:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case dl:return t=e.displayName||null,t!==null?t:fo(e.type)||"Memo";case Vt:t=e._payload,e=e._init;try{return fo(e(t))}catch{}}return null}function zf(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return fo(t);case 8:return t===ul?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function or(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Qc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function $f(e){var t=Qc(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var n=r.get,h=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return n.call(this)},set:function(_){i=""+_,h.call(this,_)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(_){i=""+_},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sn(e){e._valueTracker||(e._valueTracker=$f(e))}function Jc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=Qc(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function On(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}}function po(e,t){var r=t.checked;return Ee({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function oa(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=or(t.value!=null?t.value:r),e._wrapperState={initialChecked:i,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Zc(e,t){t=t.checked,t!=null&&cl(e,"checked",t,!1)}function _o(e,t){Zc(e,t);var r=or(t.value),i=t.type;if(r!=null)i==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(i==="submit"||i==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?vo(e,t.type,r):t.hasOwnProperty("defaultValue")&&vo(e,t.type,or(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function la(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!(i!=="submit"&&i!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function vo(e,t,r){(t!=="number"||On(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var _i=Array.isArray;function $r(e,t,r,i){if(e=e.options,t){t={};for(var n=0;n<r.length;n++)t["$"+r[n]]=!0;for(r=0;r<e.length;r++)n=t.hasOwnProperty("$"+e[r].value),e[r].selected!==n&&(e[r].selected=n),n&&i&&(e[r].defaultSelected=!0)}else{for(r=""+or(r),t=null,n=0;n<e.length;n++){if(e[n].value===r){e[n].selected=!0,i&&(e[n].defaultSelected=!0);return}t!==null||e[n].disabled||(t=e[n])}t!==null&&(t.selected=!0)}}function mo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return Ee({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function aa(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(G(92));if(_i(r)){if(1<r.length)throw Error(G(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:or(r)}}function eu(e,t){var r=or(t.value),i=or(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),i!=null&&(e.defaultValue=""+i)}function ca(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function tu(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function go(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?tu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var on,ru=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,n){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,n)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(on=on||document.createElement("div"),on.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=on.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ai(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Si={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Uf=["Webkit","ms","Moz","O"];Object.keys(Si).forEach(function(e){Uf.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Si[t]=Si[e]})});function iu(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Si.hasOwnProperty(e)&&Si[e]?(""+t).trim():t+"px"}function nu(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,n=iu(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,n):e[r]=n}}var Wf=Ee({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function yo(e,t){if(t){if(Wf[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function So(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Co=null;function fl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wo=null,Ur=null,Wr=null;function ua(e){if(e=Qi(e)){if(typeof wo!="function")throw Error(G(280));var t=e.stateNode;t&&(t=ps(t),wo(e.stateNode,e.type,t))}}function su(e){Ur?Wr?Wr.push(e):Wr=[e]:Ur=e}function ou(){if(Ur){var e=Ur,t=Wr;if(Wr=Ur=null,ua(e),t)for(e=0;e<t.length;e++)ua(t[e])}}function lu(e,t){return e(t)}function au(){}var Ms=!1;function cu(e,t,r){if(Ms)return e(t,r);Ms=!0;try{return lu(e,t,r)}finally{Ms=!1,(Ur!==null||Wr!==null)&&(au(),ou())}}function Pi(e,t){var r=e.stateNode;if(r===null)return null;var i=ps(r);if(i===null)return null;r=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(G(231,t,typeof r));return r}var xo=!1;if(It)try{var oi={};Object.defineProperty(oi,"passive",{get:function(){xo=!0}}),window.addEventListener("test",oi,oi),window.removeEventListener("test",oi,oi)}catch{xo=!1}function Vf(e,t,r,i,n,h,_,l,u){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(y){this.onError(y)}}var Ci=!1,Nn=null,jn=!1,bo=null,Kf={onError:function(e){Ci=!0,Nn=e}};function qf(e,t,r,i,n,h,_,l,u){Ci=!1,Nn=null,Vf.apply(Kf,arguments)}function Gf(e,t,r,i,n,h,_,l,u){if(qf.apply(this,arguments),Ci){if(Ci){var f=Nn;Ci=!1,Nn=null}else throw Error(G(198));jn||(jn=!0,bo=f)}}function Er(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function uu(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 ha(e){if(Er(e)!==e)throw Error(G(188))}function Xf(e){var t=e.alternate;if(!t){if(t=Er(e),t===null)throw Error(G(188));return t!==e?null:e}for(var r=e,i=t;;){var n=r.return;if(n===null)break;var h=n.alternate;if(h===null){if(i=n.return,i!==null){r=i;continue}break}if(n.child===h.child){for(h=n.child;h;){if(h===r)return ha(n),e;if(h===i)return ha(n),t;h=h.sibling}throw Error(G(188))}if(r.return!==i.return)r=n,i=h;else{for(var _=!1,l=n.child;l;){if(l===r){_=!0,r=n,i=h;break}if(l===i){_=!0,i=n,r=h;break}l=l.sibling}if(!_){for(l=h.child;l;){if(l===r){_=!0,r=h,i=n;break}if(l===i){_=!0,i=h,r=n;break}l=l.sibling}if(!_)throw Error(G(189))}}if(r.alternate!==i)throw Error(G(190))}if(r.tag!==3)throw Error(G(188));return r.stateNode.current===r?e:t}function hu(e){return e=Xf(e),e!==null?du(e):null}function du(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=du(e);if(t!==null)return t;e=e.sibling}return null}var fu=lt.unstable_scheduleCallback,da=lt.unstable_cancelCallback,Yf=lt.unstable_shouldYield,Qf=lt.unstable_requestPaint,Le=lt.unstable_now,Jf=lt.unstable_getCurrentPriorityLevel,pl=lt.unstable_ImmediatePriority,pu=lt.unstable_UserBlockingPriority,In=lt.unstable_NormalPriority,Zf=lt.unstable_LowPriority,_u=lt.unstable_IdlePriority,us=null,Dt=null;function ep(e){if(Dt&&typeof Dt.onCommitFiberRoot=="function")try{Dt.onCommitFiberRoot(us,e,void 0,(e.current.flags&128)===128)}catch{}}var wt=Math.clz32?Math.clz32:ip,tp=Math.log,rp=Math.LN2;function ip(e){return e>>>=0,e===0?32:31-(tp(e)/rp|0)|0}var ln=64,an=4194304;function vi(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Fn(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,n=e.suspendedLanes,h=e.pingedLanes,_=r&268435455;if(_!==0){var l=_&~n;l!==0?i=vi(l):(h&=_,h!==0&&(i=vi(h)))}else _=r&~n,_!==0?i=vi(_):h!==0&&(i=vi(h));if(i===0)return 0;if(t!==0&&t!==i&&!(t&n)&&(n=i&-i,h=t&-t,n>=h||n===16&&(h&4194240)!==0))return t;if(i&4&&(i|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=i;0<t;)r=31-wt(t),n=1<<r,i|=e[r],t&=~n;return i}function np(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function sp(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,n=e.expirationTimes,h=e.pendingLanes;0<h;){var _=31-wt(h),l=1<<_,u=n[_];u===-1?(!(l&r)||l&i)&&(n[_]=np(l,t)):u<=t&&(e.expiredLanes|=l),h&=~l}}function Eo(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function vu(){var e=ln;return ln<<=1,!(ln&4194240)&&(ln=64),e}function Bs(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function Xi(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-wt(t),e[t]=r}function op(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var i=e.eventTimes;for(e=e.expirationTimes;0<r;){var n=31-wt(r),h=1<<n;t[n]=0,i[n]=-1,e[n]=-1,r&=~h}}function _l(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-wt(r),n=1<<i;n&t|e[i]&t&&(e[i]|=t),r&=~n}}var de=0;function mu(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var gu,vl,yu,Su,Cu,ko=!1,cn=[],Qt=null,Jt=null,Zt=null,Mi=new Map,Bi=new Map,qt=[],lp="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 submit".split(" ");function fa(e,t){switch(e){case"focusin":case"focusout":Qt=null;break;case"dragenter":case"dragleave":Jt=null;break;case"mouseover":case"mouseout":Zt=null;break;case"pointerover":case"pointerout":Mi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bi.delete(t.pointerId)}}function li(e,t,r,i,n,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:h,targetContainers:[n]},t!==null&&(t=Qi(t),t!==null&&vl(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,n!==null&&t.indexOf(n)===-1&&t.push(n),e)}function ap(e,t,r,i,n){switch(t){case"focusin":return Qt=li(Qt,e,t,r,i,n),!0;case"dragenter":return Jt=li(Jt,e,t,r,i,n),!0;case"mouseover":return Zt=li(Zt,e,t,r,i,n),!0;case"pointerover":var h=n.pointerId;return Mi.set(h,li(Mi.get(h)||null,e,t,r,i,n)),!0;case"gotpointercapture":return h=n.pointerId,Bi.set(h,li(Bi.get(h)||null,e,t,r,i,n)),!0}return!1}function wu(e){var t=fr(e.target);if(t!==null){var r=Er(t);if(r!==null){if(t=r.tag,t===13){if(t=uu(r),t!==null){e.blockedOn=t,Cu(e.priority,function(){yu(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function En(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Lo(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Co=i,r.target.dispatchEvent(i),Co=null}else return t=Qi(r),t!==null&&vl(t),e.blockedOn=r,!1;t.shift()}return!0}function pa(e,t,r){En(e)&&r.delete(t)}function cp(){ko=!1,Qt!==null&&En(Qt)&&(Qt=null),Jt!==null&&En(Jt)&&(Jt=null),Zt!==null&&En(Zt)&&(Zt=null),Mi.forEach(pa),Bi.forEach(pa)}function ai(e,t){e.blockedOn===t&&(e.blockedOn=null,ko||(ko=!0,lt.unstable_scheduleCallback(lt.unstable_NormalPriority,cp)))}function Oi(e){function t(n){return ai(n,e)}if(0<cn.length){ai(cn[0],e);for(var r=1;r<cn.length;r++){var i=cn[r];i.blockedOn===e&&(i.blockedOn=null)}}for(Qt!==null&&ai(Qt,e),Jt!==null&&ai(Jt,e),Zt!==null&&ai(Zt,e),Mi.forEach(t),Bi.forEach(t),r=0;r<qt.length;r++)i=qt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<qt.length&&(r=qt[0],r.blockedOn===null);)wu(r),r.blockedOn===null&&qt.shift()}var Vr=$t.ReactCurrentBatchConfig,Hn=!0;function up(e,t,r,i){var n=de,h=Vr.transition;Vr.transition=null;try{de=1,ml(e,t,r,i)}finally{de=n,Vr.transition=h}}function hp(e,t,r,i){var n=de,h=Vr.transition;Vr.transition=null;try{de=4,ml(e,t,r,i)}finally{de=n,Vr.transition=h}}function ml(e,t,r,i){if(Hn){var n=Lo(e,t,r,i);if(n===null)Ws(e,t,i,zn,r),fa(e,i);else if(ap(n,e,t,r,i))i.stopPropagation();else if(fa(e,i),t&4&&-1<lp.indexOf(e)){for(;n!==null;){var h=Qi(n);if(h!==null&&gu(h),h=Lo(e,t,r,i),h===null&&Ws(e,t,i,zn,r),h===n)break;n=h}n!==null&&i.stopPropagation()}else Ws(e,t,i,null,r)}}var zn=null;function Lo(e,t,r,i){if(zn=null,e=fl(i),e=fr(e),e!==null)if(t=Er(e),t===null)e=null;else if(r=t.tag,r===13){if(e=uu(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return zn=e,null}function xu(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Jf()){case pl:return 1;case pu:return 4;case In:case Zf:return 16;case _u:return 536870912;default:return 16}default:return 16}}var Xt=null,gl=null,kn=null;function bu(){if(kn)return kn;var e,t=gl,r=t.length,i,n="value"in Xt?Xt.value:Xt.textContent,h=n.length;for(e=0;e<r&&t[e]===n[e];e++);var _=r-e;for(i=1;i<=_&&t[r-i]===n[h-i];i++);return kn=n.slice(e,1<i?1-i:void 0)}function Ln(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 un(){return!0}function _a(){return!1}function ct(e){function t(r,i,n,h,_){this._reactName=r,this._targetInst=n,this.type=i,this.nativeEvent=h,this.target=_,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(h):h[l]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?un:_a,this.isPropagationStopped=_a,this}return Ee(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=un)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=un)},persist:function(){},isPersistent:un}),t}var ri={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},yl=ct(ri),Yi=Ee({},ri,{view:0,detail:0}),dp=ct(Yi),Os,Ns,ci,hs=Ee({},Yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sl,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!==ci&&(ci&&e.type==="mousemove"?(Os=e.screenX-ci.screenX,Ns=e.screenY-ci.screenY):Ns=Os=0,ci=e),Os)},movementY:function(e){return"movementY"in e?e.movementY:Ns}}),va=ct(hs),fp=Ee({},hs,{dataTransfer:0}),pp=ct(fp),_p=Ee({},Yi,{relatedTarget:0}),js=ct(_p),vp=Ee({},ri,{animationName:0,elapsedTime:0,pseudoElement:0}),mp=ct(vp),gp=Ee({},ri,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),yp=ct(gp),Sp=Ee({},ri,{data:0}),ma=ct(Sp),Cp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wp={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"},xp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function bp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xp[e])?!!t[e]:!1}function Sl(){return bp}var Ep=Ee({},Yi,{key:function(e){if(e.key){var t=Cp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ln(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sl,charCode:function(e){return e.type==="keypress"?Ln(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ln(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),kp=ct(Ep),Lp=Ee({},hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ga=ct(Lp),Dp=Ee({},Yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sl}),Rp=ct(Dp),Tp=Ee({},ri,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ap=ct(Tp),Pp=Ee({},hs,{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}),Mp=ct(Pp),Bp=[9,13,27,32],Cl=It&&"CompositionEvent"in window,wi=null;It&&"documentMode"in document&&(wi=document.documentMode);var Op=It&&"TextEvent"in window&&!wi,Eu=It&&(!Cl||wi&&8<wi&&11>=wi),ya=" ",Sa=!1;function ku(e,t){switch(e){case"keyup":return Bp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ar=!1;function Np(e,t){switch(e){case"compositionend":return Lu(t);case"keypress":return t.which!==32?null:(Sa=!0,ya);case"textInput":return e=t.data,e===ya&&Sa?null:e;default:return null}}function jp(e,t){if(Ar)return e==="compositionend"||!Cl&&ku(e,t)?(e=bu(),kn=gl=Xt=null,Ar=!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 Eu&&t.locale!=="ko"?null:t.data;default:return null}}var Ip={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 Ca(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Ip[e.type]:t==="textarea"}function Du(e,t,r,i){su(i),t=$n(t,"onChange"),0<t.length&&(r=new yl("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var xi=null,Ni=null;function Fp(e){Fu(e,0)}function ds(e){var t=Br(e);if(Jc(t))return e}function Hp(e,t){if(e==="change")return t}var Ru=!1;if(It){var Is;if(It){var Fs="oninput"in document;if(!Fs){var wa=document.createElement("div");wa.setAttribute("oninput","return;"),Fs=typeof wa.oninput=="function"}Is=Fs}else Is=!1;Ru=Is&&(!document.documentMode||9<document.documentMode)}function xa(){xi&&(xi.detachEvent("onpropertychange",Tu),Ni=xi=null)}function Tu(e){if(e.propertyName==="value"&&ds(Ni)){var t=[];Du(t,Ni,e,fl(e)),cu(Fp,t)}}function zp(e,t,r){e==="focusin"?(xa(),xi=t,Ni=r,xi.attachEvent("onpropertychange",Tu)):e==="focusout"&&xa()}function $p(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ds(Ni)}function Up(e,t){if(e==="click")return ds(t)}function Wp(e,t){if(e==="input"||e==="change")return ds(t)}function Vp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var bt=typeof Object.is=="function"?Object.is:Vp;function ji(e,t){if(bt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;for(i=0;i<r.length;i++){var n=r[i];if(!ao.call(t,n)||!bt(e[n],t[n]))return!1}return!0}function ba(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ea(e,t){var r=ba(e);e=0;for(var i;r;){if(r.nodeType===3){if(i=e+r.textContent.length,e<=t&&i>=t)return{node:r,offset:t-e};e=i}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=ba(r)}}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 Pu(){for(var e=window,t=On();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=On(e.document)}return t}function wl(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")}function Kp(e){var t=Pu(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Au(r.ownerDocument.documentElement,r)){if(i!==null&&wl(r)){if(t=i.start,e=i.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var n=r.textContent.length,h=Math.min(i.start,n);i=i.end===void 0?h:Math.min(i.end,n),!e.extend&&h>i&&(n=i,i=h,h=n),n=Ea(r,h);var _=Ea(r,i);n&&_&&(e.rangeCount!==1||e.anchorNode!==n.node||e.anchorOffset!==n.offset||e.focusNode!==_.node||e.focusOffset!==_.offset)&&(t=t.createRange(),t.setStart(n.node,n.offset),e.removeAllRanges(),h>i?(e.addRange(t),e.extend(_.node,_.offset)):(t.setEnd(_.node,_.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var qp=It&&"documentMode"in document&&11>=document.documentMode,Pr=null,Do=null,bi=null,Ro=!1;function ka(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ro||Pr==null||Pr!==On(i)||(i=Pr,"selectionStart"in i&&wl(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),bi&&ji(bi,i)||(bi=i,i=$n(Do,"onSelect"),0<i.length&&(t=new yl("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Pr)))}function hn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Mr={animationend:hn("Animation","AnimationEnd"),animationiteration:hn("Animation","AnimationIteration"),animationstart:hn("Animation","AnimationStart"),transitionend:hn("Transition","TransitionEnd")},Hs={},Mu={};It&&(Mu=document.createElement("div").style,"AnimationEvent"in window||(delete Mr.animationend.animation,delete Mr.animationiteration.animation,delete Mr.animationstart.animation),"TransitionEvent"in window||delete Mr.transitionend.transition);function fs(e){if(Hs[e])return Hs[e];if(!Mr[e])return e;var t=Mr[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Mu)return Hs[e]=t[r];return e}var Bu=fs("animationend"),Ou=fs("animationiteration"),Nu=fs("animationstart"),ju=fs("transitionend"),Iu=new Map,La="abort auxClick 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(" ");function ar(e,t){Iu.set(e,t),br(t,[e])}for(var zs=0;zs<La.length;zs++){var $s=La[zs],Gp=$s.toLowerCase(),Xp=$s[0].toUpperCase()+$s.slice(1);ar(Gp,"on"+Xp)}ar(Bu,"onAnimationEnd");ar(Ou,"onAnimationIteration");ar(Nu,"onAnimationStart");ar("dblclick","onDoubleClick");ar("focusin","onFocus");ar("focusout","onBlur");ar(ju,"onTransitionEnd");Gr("onMouseEnter",["mouseout","mouseover"]);Gr("onMouseLeave",["mouseout","mouseover"]);Gr("onPointerEnter",["pointerout","pointerover"]);Gr("onPointerLeave",["pointerout","pointerover"]);br("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));br("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));br("onBeforeInput",["compositionend","keypress","textInput","paste"]);br("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));br("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));br("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mi="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(" "),Yp=new Set("cancel close invalid load scroll toggle".split(" ").concat(mi));function Da(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,Gf(i,t,void 0,e),e.currentTarget=null}function Fu(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],n=i.event;i=i.listeners;e:{var h=void 0;if(t)for(var _=i.length-1;0<=_;_--){var l=i[_],u=l.instance,f=l.currentTarget;if(l=l.listener,u!==h&&n.isPropagationStopped())break e;Da(n,l,f),h=u}else for(_=0;_<i.length;_++){if(l=i[_],u=l.instance,f=l.currentTarget,l=l.listener,u!==h&&n.isPropagationStopped())break e;Da(n,l,f),h=u}}}if(jn)throw e=bo,jn=!1,bo=null,e}function ye(e,t){var r=t[Bo];r===void 0&&(r=t[Bo]=new Set);var i=e+"__bubble";r.has(i)||(Hu(t,e,2,!1),r.add(i))}function Us(e,t,r){var i=0;t&&(i|=4),Hu(r,e,i,t)}var dn="_reactListening"+Math.random().toString(36).slice(2);function Ii(e){if(!e[dn]){e[dn]=!0,qc.forEach(function(r){r!=="selectionchange"&&(Yp.has(r)||Us(r,!1,e),Us(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[dn]||(t[dn]=!0,Us("selectionchange",!1,t))}}function Hu(e,t,r,i){switch(xu(t)){case 1:var n=up;break;case 4:n=hp;break;default:n=ml}r=n.bind(null,t,r,e),n=void 0,!xo||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(n=!0),i?n!==void 0?e.addEventListener(t,r,{capture:!0,passive:n}):e.addEventListener(t,r,!0):n!==void 0?e.addEventListener(t,r,{passive:n}):e.addEventListener(t,r,!1)}function Ws(e,t,r,i,n){var h=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var _=i.tag;if(_===3||_===4){var l=i.stateNode.containerInfo;if(l===n||l.nodeType===8&&l.parentNode===n)break;if(_===4)for(_=i.return;_!==null;){var u=_.tag;if((u===3||u===4)&&(u=_.stateNode.containerInfo,u===n||u.nodeType===8&&u.parentNode===n))return;_=_.return}for(;l!==null;){if(_=fr(l),_===null)return;if(u=_.tag,u===5||u===6){i=h=_;continue e}l=l.parentNode}}i=i.return}cu(function(){var f=h,y=fl(r),d=[];e:{var m=Iu.get(e);if(m!==void 0){var C=yl,w=e;switch(e){case"keypress":if(Ln(r)===0)break e;case"keydown":case"keyup":C=kp;break;case"focusin":w="focus",C=js;break;case"focusout":w="blur",C=js;break;case"beforeblur":case"afterblur":C=js;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":C=va;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":C=pp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":C=Rp;break;case Bu:case Ou:case Nu:C=mp;break;case ju:C=Ap;break;case"scroll":C=dp;break;case"wheel":C=Mp;break;case"copy":case"cut":case"paste":C=yp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":C=ga}var g=(t&4)!==0,a=!g&&e==="scroll",o=g?m!==null?m+"Capture":null:m;g=[];for(var s=f,c;s!==null;){c=s;var p=c.stateNode;if(c.tag===5&&p!==null&&(c=p,o!==null&&(p=Pi(s,o),p!=null&&g.push(Fi(s,p,c)))),a)break;s=s.return}0<g.length&&(m=new C(m,w,null,r,y),d.push({event:m,listeners:g}))}}if(!(t&7)){e:{if(m=e==="mouseover"||e==="pointerover",C=e==="mouseout"||e==="pointerout",m&&r!==Co&&(w=r.relatedTarget||r.fromElement)&&(fr(w)||w[Ft]))break e;if((C||m)&&(m=y.window===y?y:(m=y.ownerDocument)?m.defaultView||m.parentWindow:window,C?(w=r.relatedTarget||r.toElement,C=f,w=w?fr(w):null,w!==null&&(a=Er(w),w!==a||w.tag!==5&&w.tag!==6)&&(w=null)):(C=null,w=f),C!==w)){if(g=va,p="onMouseLeave",o="onMouseEnter",s="mouse",(e==="pointerout"||e==="pointerover")&&(g=ga,p="onPointerLeave",o="onPointerEnter",s="pointer"),a=C==null?m:Br(C),c=w==null?m:Br(w),m=new g(p,s+"leave",C,r,y),m.target=a,m.relatedTarget=c,p=null,fr(y)===f&&(g=new g(o,s+"enter",w,r,y),g.target=c,g.relatedTarget=a,p=g),a=p,C&&w)t:{for(g=C,o=w,s=0,c=g;c;c=Lr(c))s++;for(c=0,p=o;p;p=Lr(p))c++;for(;0<s-c;)g=Lr(g),s--;for(;0<c-s;)o=Lr(o),c--;for(;s--;){if(g===o||o!==null&&g===o.alternate)break t;g=Lr(g),o=Lr(o)}g=null}else g=null;C!==null&&Ra(d,m,C,g,!1),w!==null&&a!==null&&Ra(d,a,w,g,!0)}}e:{if(m=f?Br(f):window,C=m.nodeName&&m.nodeName.toLowerCase(),C==="select"||C==="input"&&m.type==="file")var v=Hp;else if(Ca(m))if(Ru)v=Wp;else{v=$p;var x=zp}else(C=m.nodeName)&&C.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(v=Up);if(v&&(v=v(e,f))){Du(d,v,r,y);break e}x&&x(e,m,f),e==="focusout"&&(x=m._wrapperState)&&x.controlled&&m.type==="number"&&vo(m,"number",m.value)}switch(x=f?Br(f):window,e){case"focusin":(Ca(x)||x.contentEditable==="true")&&(Pr=x,Do=f,bi=null);break;case"focusout":bi=Do=Pr=null;break;case"mousedown":Ro=!0;break;case"contextmenu":case"mouseup":case"dragend":Ro=!1,ka(d,r,y);break;case"selectionchange":if(qp)break;case"keydown":case"keyup":ka(d,r,y)}var b;if(Cl)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Ar?ku(e,r)&&(S="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(Eu&&r.locale!=="ko"&&(Ar||S!=="onCompositionStart"?S==="onCompositionEnd"&&Ar&&(b=bu()):(Xt=y,gl="value"in Xt?Xt.value:Xt.textContent,Ar=!0)),x=$n(f,S),0<x.length&&(S=new ma(S,e,null,r,y),d.push({event:S,listeners:x}),b?S.data=b:(b=Lu(r),b!==null&&(S.data=b)))),(b=Op?Np(e,r):jp(e,r))&&(f=$n(f,"onBeforeInput"),0<f.length&&(y=new ma("onBeforeInput","beforeinput",null,r,y),d.push({event:y,listeners:f}),y.data=b))}Fu(d,t)})}function Fi(e,t,r){return{instance:e,listener:t,currentTarget:r}}function $n(e,t){for(var r=t+"Capture",i=[];e!==null;){var n=e,h=n.stateNode;n.tag===5&&h!==null&&(n=h,h=Pi(e,r),h!=null&&i.unshift(Fi(e,h,n)),h=Pi(e,t),h!=null&&i.push(Fi(e,h,n))),e=e.return}return i}function Lr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ra(e,t,r,i,n){for(var h=t._reactName,_=[];r!==null&&r!==i;){var l=r,u=l.alternate,f=l.stateNode;if(u!==null&&u===i)break;l.tag===5&&f!==null&&(l=f,n?(u=Pi(r,h),u!=null&&_.unshift(Fi(r,u,l))):n||(u=Pi(r,h),u!=null&&_.push(Fi(r,u,l)))),r=r.return}_.length!==0&&e.push({event:t,listeners:_})}var Qp=/\r\n?/g,Jp=/\u0000|\uFFFD/g;function Ta(e){return(typeof e=="string"?e:""+e).replace(Qp,`
38
+ `).replace(Jp,"")}function fn(e,t,r){if(t=Ta(t),Ta(e)!==t&&r)throw Error(G(425))}function Un(){}var To=null,Ao=null;function Po(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Mo=typeof setTimeout=="function"?setTimeout:void 0,Zp=typeof clearTimeout=="function"?clearTimeout:void 0,Aa=typeof Promise=="function"?Promise:void 0,e_=typeof queueMicrotask=="function"?queueMicrotask:typeof Aa<"u"?function(e){return Aa.resolve(null).then(e).catch(t_)}:Mo;function t_(e){setTimeout(function(){throw e})}function Vs(e,t){var r=t,i=0;do{var n=r.nextSibling;if(e.removeChild(r),n&&n.nodeType===8)if(r=n.data,r==="/$"){if(i===0){e.removeChild(n),Oi(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=n}while(r);Oi(t)}function er(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==="$?")break;if(t==="/$")return null}}return e}function Pa(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var ii=Math.random().toString(36).slice(2),Lt="__reactFiber$"+ii,Hi="__reactProps$"+ii,Ft="__reactContainer$"+ii,Bo="__reactEvents$"+ii,r_="__reactListeners$"+ii,i_="__reactHandles$"+ii;function fr(e){var t=e[Lt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ft]||r[Lt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Pa(e);e!==null;){if(r=e[Lt])return r;e=Pa(e)}return t}e=r,r=e.parentNode}return null}function Qi(e){return e=e[Lt]||e[Ft],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Br(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function ps(e){return e[Hi]||null}var Oo=[],Or=-1;function cr(e){return{current:e}}function Se(e){0>Or||(e.current=Oo[Or],Oo[Or]=null,Or--)}function ve(e,t){Or++,Oo[Or]=e.current,e.current=t}var lr={},Ue=cr(lr),Ze=cr(!1),yr=lr;function Xr(e,t){var r=e.type.contextTypes;if(!r)return lr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var n={},h;for(h in r)n[h]=t[h];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n),n}function et(e){return e=e.childContextTypes,e!=null}function Wn(){Se(Ze),Se(Ue)}function Ma(e,t,r){if(Ue.current!==lr)throw Error(G(168));ve(Ue,t),ve(Ze,r)}function zu(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var n in i)if(!(n in t))throw Error(G(108,zf(e)||"Unknown",n));return Ee({},r,i)}function Vn(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||lr,yr=Ue.current,ve(Ue,e),ve(Ze,Ze.current),!0}function Ba(e,t,r){var i=e.stateNode;if(!i)throw Error(G(169));r?(e=zu(e,t,yr),i.__reactInternalMemoizedMergedChildContext=e,Se(Ze),Se(Ue),ve(Ue,e)):Se(Ze),ve(Ze,r)}var Bt=null,_s=!1,Ks=!1;function $u(e){Bt===null?Bt=[e]:Bt.push(e)}function n_(e){_s=!0,$u(e)}function ur(){if(!Ks&&Bt!==null){Ks=!0;var e=0,t=de;try{var r=Bt;for(de=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Bt=null,_s=!1}catch(n){throw Bt!==null&&(Bt=Bt.slice(e+1)),fu(pl,ur),n}finally{de=t,Ks=!1}}return null}var Nr=[],jr=0,Kn=null,qn=0,dt=[],ft=0,Sr=null,Ot=1,Nt="";function hr(e,t){Nr[jr++]=qn,Nr[jr++]=Kn,Kn=e,qn=t}function Uu(e,t,r){dt[ft++]=Ot,dt[ft++]=Nt,dt[ft++]=Sr,Sr=e;var i=Ot;e=Nt;var n=32-wt(i)-1;i&=~(1<<n),r+=1;var h=32-wt(t)+n;if(30<h){var _=n-n%5;h=(i&(1<<_)-1).toString(32),i>>=_,n-=_,Ot=1<<32-wt(t)+n|r<<n|i,Nt=h+e}else Ot=1<<h|r<<n|i,Nt=e}function xl(e){e.return!==null&&(hr(e,1),Uu(e,1,0))}function bl(e){for(;e===Kn;)Kn=Nr[--jr],Nr[jr]=null,qn=Nr[--jr],Nr[jr]=null;for(;e===Sr;)Sr=dt[--ft],dt[ft]=null,Nt=dt[--ft],dt[ft]=null,Ot=dt[--ft],dt[ft]=null}var ot=null,st=null,Ce=!1,Ct=null;function Wu(e,t){var r=pt(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Oa(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ot=e,st=er(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ot=e,st=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Sr!==null?{id:Ot,overflow:Nt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=pt(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,ot=e,st=null,!0):!1;default:return!1}}function No(e){return(e.mode&1)!==0&&(e.flags&128)===0}function jo(e){if(Ce){var t=st;if(t){var r=t;if(!Oa(e,t)){if(No(e))throw Error(G(418));t=er(r.nextSibling);var i=ot;t&&Oa(e,t)?Wu(i,r):(e.flags=e.flags&-4097|2,Ce=!1,ot=e)}}else{if(No(e))throw Error(G(418));e.flags=e.flags&-4097|2,Ce=!1,ot=e}}}function Na(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ot=e}function pn(e){if(e!==ot)return!1;if(!Ce)return Na(e),Ce=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Po(e.type,e.memoizedProps)),t&&(t=st)){if(No(e))throw Vu(),Error(G(418));for(;t;)Wu(e,t),t=er(t.nextSibling)}if(Na(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){st=er(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}st=null}}else st=ot?er(e.stateNode.nextSibling):null;return!0}function Vu(){for(var e=st;e;)e=er(e.nextSibling)}function Yr(){st=ot=null,Ce=!1}function El(e){Ct===null?Ct=[e]:Ct.push(e)}var s_=$t.ReactCurrentBatchConfig;function ui(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(G(309));var i=r.stateNode}if(!i)throw Error(G(147,e));var n=i,h=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===h?t.ref:(t=function(_){var l=n.refs;_===null?delete l[h]:l[h]=_},t._stringRef=h,t)}if(typeof e!="string")throw Error(G(284));if(!r._owner)throw Error(G(290,e))}return e}function _n(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ja(e){var t=e._init;return t(e._payload)}function Ku(e){function t(o,s){if(e){var c=o.deletions;c===null?(o.deletions=[s],o.flags|=16):c.push(s)}}function r(o,s){if(!e)return null;for(;s!==null;)t(o,s),s=s.sibling;return null}function i(o,s){for(o=new Map;s!==null;)s.key!==null?o.set(s.key,s):o.set(s.index,s),s=s.sibling;return o}function n(o,s){return o=nr(o,s),o.index=0,o.sibling=null,o}function h(o,s,c){return o.index=c,e?(c=o.alternate,c!==null?(c=c.index,c<s?(o.flags|=2,s):c):(o.flags|=2,s)):(o.flags|=1048576,s)}function _(o){return e&&o.alternate===null&&(o.flags|=2),o}function l(o,s,c,p){return s===null||s.tag!==6?(s=Zs(c,o.mode,p),s.return=o,s):(s=n(s,c),s.return=o,s)}function u(o,s,c,p){var v=c.type;return v===Tr?y(o,s,c.props.children,p,c.key):s!==null&&(s.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===Vt&&ja(v)===s.type)?(p=n(s,c.props),p.ref=ui(o,s,c),p.return=o,p):(p=Bn(c.type,c.key,c.props,null,o.mode,p),p.ref=ui(o,s,c),p.return=o,p)}function f(o,s,c,p){return s===null||s.tag!==4||s.stateNode.containerInfo!==c.containerInfo||s.stateNode.implementation!==c.implementation?(s=eo(c,o.mode,p),s.return=o,s):(s=n(s,c.children||[]),s.return=o,s)}function y(o,s,c,p,v){return s===null||s.tag!==7?(s=gr(c,o.mode,p,v),s.return=o,s):(s=n(s,c),s.return=o,s)}function d(o,s,c){if(typeof s=="string"&&s!==""||typeof s=="number")return s=Zs(""+s,o.mode,c),s.return=o,s;if(typeof s=="object"&&s!==null){switch(s.$$typeof){case nn:return c=Bn(s.type,s.key,s.props,null,o.mode,c),c.ref=ui(o,null,s),c.return=o,c;case Rr:return s=eo(s,o.mode,c),s.return=o,s;case Vt:var p=s._init;return d(o,p(s._payload),c)}if(_i(s)||si(s))return s=gr(s,o.mode,c,null),s.return=o,s;_n(o,s)}return null}function m(o,s,c,p){var v=s!==null?s.key:null;if(typeof c=="string"&&c!==""||typeof c=="number")return v!==null?null:l(o,s,""+c,p);if(typeof c=="object"&&c!==null){switch(c.$$typeof){case nn:return c.key===v?u(o,s,c,p):null;case Rr:return c.key===v?f(o,s,c,p):null;case Vt:return v=c._init,m(o,s,v(c._payload),p)}if(_i(c)||si(c))return v!==null?null:y(o,s,c,p,null);_n(o,c)}return null}function C(o,s,c,p,v){if(typeof p=="string"&&p!==""||typeof p=="number")return o=o.get(c)||null,l(s,o,""+p,v);if(typeof p=="object"&&p!==null){switch(p.$$typeof){case nn:return o=o.get(p.key===null?c:p.key)||null,u(s,o,p,v);case Rr:return o=o.get(p.key===null?c:p.key)||null,f(s,o,p,v);case Vt:var x=p._init;return C(o,s,c,x(p._payload),v)}if(_i(p)||si(p))return o=o.get(c)||null,y(s,o,p,v,null);_n(s,p)}return null}function w(o,s,c,p){for(var v=null,x=null,b=s,S=s=0,k=null;b!==null&&S<c.length;S++){b.index>S?(k=b,b=null):k=b.sibling;var R=m(o,b,c[S],p);if(R===null){b===null&&(b=k);break}e&&b&&R.alternate===null&&t(o,b),s=h(R,s,S),x===null?v=R:x.sibling=R,x=R,b=k}if(S===c.length)return r(o,b),Ce&&hr(o,S),v;if(b===null){for(;S<c.length;S++)b=d(o,c[S],p),b!==null&&(s=h(b,s,S),x===null?v=b:x.sibling=b,x=b);return Ce&&hr(o,S),v}for(b=i(o,b);S<c.length;S++)k=C(b,o,S,c[S],p),k!==null&&(e&&k.alternate!==null&&b.delete(k.key===null?S:k.key),s=h(k,s,S),x===null?v=k:x.sibling=k,x=k);return e&&b.forEach(function(O){return t(o,O)}),Ce&&hr(o,S),v}function g(o,s,c,p){var v=si(c);if(typeof v!="function")throw Error(G(150));if(c=v.call(c),c==null)throw Error(G(151));for(var x=v=null,b=s,S=s=0,k=null,R=c.next();b!==null&&!R.done;S++,R=c.next()){b.index>S?(k=b,b=null):k=b.sibling;var O=m(o,b,R.value,p);if(O===null){b===null&&(b=k);break}e&&b&&O.alternate===null&&t(o,b),s=h(O,s,S),x===null?v=O:x.sibling=O,x=O,b=k}if(R.done)return r(o,b),Ce&&hr(o,S),v;if(b===null){for(;!R.done;S++,R=c.next())R=d(o,R.value,p),R!==null&&(s=h(R,s,S),x===null?v=R:x.sibling=R,x=R);return Ce&&hr(o,S),v}for(b=i(o,b);!R.done;S++,R=c.next())R=C(b,o,S,R.value,p),R!==null&&(e&&R.alternate!==null&&b.delete(R.key===null?S:R.key),s=h(R,s,S),x===null?v=R:x.sibling=R,x=R);return e&&b.forEach(function(T){return t(o,T)}),Ce&&hr(o,S),v}function a(o,s,c,p){if(typeof c=="object"&&c!==null&&c.type===Tr&&c.key===null&&(c=c.props.children),typeof c=="object"&&c!==null){switch(c.$$typeof){case nn:e:{for(var v=c.key,x=s;x!==null;){if(x.key===v){if(v=c.type,v===Tr){if(x.tag===7){r(o,x.sibling),s=n(x,c.props.children),s.return=o,o=s;break e}}else if(x.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===Vt&&ja(v)===x.type){r(o,x.sibling),s=n(x,c.props),s.ref=ui(o,x,c),s.return=o,o=s;break e}r(o,x);break}else t(o,x);x=x.sibling}c.type===Tr?(s=gr(c.props.children,o.mode,p,c.key),s.return=o,o=s):(p=Bn(c.type,c.key,c.props,null,o.mode,p),p.ref=ui(o,s,c),p.return=o,o=p)}return _(o);case Rr:e:{for(x=c.key;s!==null;){if(s.key===x)if(s.tag===4&&s.stateNode.containerInfo===c.containerInfo&&s.stateNode.implementation===c.implementation){r(o,s.sibling),s=n(s,c.children||[]),s.return=o,o=s;break e}else{r(o,s);break}else t(o,s);s=s.sibling}s=eo(c,o.mode,p),s.return=o,o=s}return _(o);case Vt:return x=c._init,a(o,s,x(c._payload),p)}if(_i(c))return w(o,s,c,p);if(si(c))return g(o,s,c,p);_n(o,c)}return typeof c=="string"&&c!==""||typeof c=="number"?(c=""+c,s!==null&&s.tag===6?(r(o,s.sibling),s=n(s,c),s.return=o,o=s):(r(o,s),s=Zs(c,o.mode,p),s.return=o,o=s),_(o)):r(o,s)}return a}var Qr=Ku(!0),qu=Ku(!1),Gn=cr(null),Xn=null,Ir=null,kl=null;function Ll(){kl=Ir=Xn=null}function Dl(e){var t=Gn.current;Se(Gn),e._currentValue=t}function Io(e,t,r){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===r)break;e=e.return}}function Kr(e,t){Xn=e,kl=Ir=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Je=!0),e.firstContext=null)}function vt(e){var t=e._currentValue;if(kl!==e)if(e={context:e,memoizedValue:t,next:null},Ir===null){if(Xn===null)throw Error(G(308));Ir=e,Xn.dependencies={lanes:0,firstContext:e}}else Ir=Ir.next=e;return t}var pr=null;function Rl(e){pr===null?pr=[e]:pr.push(e)}function Gu(e,t,r,i){var n=t.interleaved;return n===null?(r.next=r,Rl(t)):(r.next=n.next,n.next=r),t.interleaved=r,Ht(e,i)}function Ht(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Kt=!1;function Tl(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function jt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function tr(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,he&2){var n=i.pending;return n===null?t.next=t:(t.next=n.next,n.next=t),i.pending=t,Ht(e,r)}return n=i.interleaved,n===null?(t.next=t,Rl(i)):(t.next=n.next,n.next=t),i.interleaved=t,Ht(e,r)}function Dn(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,_l(e,r)}}function Ia(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var n=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var _={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};h===null?n=h=_:h=h.next=_,r=r.next}while(r!==null);h===null?n=h=t:h=h.next=t}else n=h=t;r={baseState:i.baseState,firstBaseUpdate:n,lastBaseUpdate:h,shared:i.shared,effects:i.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Yn(e,t,r,i){var n=e.updateQueue;Kt=!1;var h=n.firstBaseUpdate,_=n.lastBaseUpdate,l=n.shared.pending;if(l!==null){n.shared.pending=null;var u=l,f=u.next;u.next=null,_===null?h=f:_.next=f,_=u;var y=e.alternate;y!==null&&(y=y.updateQueue,l=y.lastBaseUpdate,l!==_&&(l===null?y.firstBaseUpdate=f:l.next=f,y.lastBaseUpdate=u))}if(h!==null){var d=n.baseState;_=0,y=f=u=null,l=h;do{var m=l.lane,C=l.eventTime;if((i&m)===m){y!==null&&(y=y.next={eventTime:C,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var w=e,g=l;switch(m=t,C=r,g.tag){case 1:if(w=g.payload,typeof w=="function"){d=w.call(C,d,m);break e}d=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=g.payload,m=typeof w=="function"?w.call(C,d,m):w,m==null)break e;d=Ee({},d,m);break e;case 2:Kt=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=n.effects,m===null?n.effects=[l]:m.push(l))}else C={eventTime:C,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},y===null?(f=y=C,u=d):y=y.next=C,_|=m;if(l=l.next,l===null){if(l=n.shared.pending,l===null)break;m=l,l=m.next,m.next=null,n.lastBaseUpdate=m,n.shared.pending=null}}while(!0);if(y===null&&(u=d),n.baseState=u,n.firstBaseUpdate=f,n.lastBaseUpdate=y,t=n.shared.interleaved,t!==null){n=t;do _|=n.lane,n=n.next;while(n!==t)}else h===null&&(n.shared.lanes=0);wr|=_,e.lanes=_,e.memoizedState=d}}function Fa(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],n=i.callback;if(n!==null){if(i.callback=null,i=r,typeof n!="function")throw Error(G(191,n));n.call(i)}}}var Ji={},Rt=cr(Ji),zi=cr(Ji),$i=cr(Ji);function _r(e){if(e===Ji)throw Error(G(174));return e}function Al(e,t){switch(ve($i,t),ve(zi,e),ve(Rt,Ji),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:go(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=go(t,e)}Se(Rt),ve(Rt,t)}function Jr(){Se(Rt),Se(zi),Se($i)}function Yu(e){_r($i.current);var t=_r(Rt.current),r=go(t,e.type);t!==r&&(ve(zi,e),ve(Rt,r))}function Pl(e){zi.current===e&&(Se(Rt),Se(zi))}var xe=cr(0);function Qn(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 qs=[];function Ml(){for(var e=0;e<qs.length;e++)qs[e]._workInProgressVersionPrimary=null;qs.length=0}var Rn=$t.ReactCurrentDispatcher,Gs=$t.ReactCurrentBatchConfig,Cr=0,be=null,Re=null,Ae=null,Jn=!1,Ei=!1,Ui=0,o_=0;function He(){throw Error(G(321))}function Bl(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!bt(e[r],t[r]))return!1;return!0}function Ol(e,t,r,i,n,h){if(Cr=h,be=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Rn.current=e===null||e.memoizedState===null?u_:h_,e=r(i,n),Ei){h=0;do{if(Ei=!1,Ui=0,25<=h)throw Error(G(301));h+=1,Ae=Re=null,t.updateQueue=null,Rn.current=d_,e=r(i,n)}while(Ei)}if(Rn.current=Zn,t=Re!==null&&Re.next!==null,Cr=0,Ae=Re=be=null,Jn=!1,t)throw Error(G(300));return e}function Nl(){var e=Ui!==0;return Ui=0,e}function kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ae===null?be.memoizedState=Ae=e:Ae=Ae.next=e,Ae}function mt(){if(Re===null){var e=be.alternate;e=e!==null?e.memoizedState:null}else e=Re.next;var t=Ae===null?be.memoizedState:Ae.next;if(t!==null)Ae=t,Re=e;else{if(e===null)throw Error(G(310));Re=e,e={memoizedState:Re.memoizedState,baseState:Re.baseState,baseQueue:Re.baseQueue,queue:Re.queue,next:null},Ae===null?be.memoizedState=Ae=e:Ae=Ae.next=e}return Ae}function Wi(e,t){return typeof t=="function"?t(e):t}function Xs(e){var t=mt(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var i=Re,n=i.baseQueue,h=r.pending;if(h!==null){if(n!==null){var _=n.next;n.next=h.next,h.next=_}i.baseQueue=n=h,r.pending=null}if(n!==null){h=n.next,i=i.baseState;var l=_=null,u=null,f=h;do{var y=f.lane;if((Cr&y)===y)u!==null&&(u=u.next={lane:0,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null}),i=f.hasEagerState?f.eagerState:e(i,f.action);else{var d={lane:y,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};u===null?(l=u=d,_=i):u=u.next=d,be.lanes|=y,wr|=y}f=f.next}while(f!==null&&f!==h);u===null?_=i:u.next=l,bt(i,t.memoizedState)||(Je=!0),t.memoizedState=i,t.baseState=_,t.baseQueue=u,r.lastRenderedState=i}if(e=r.interleaved,e!==null){n=e;do h=n.lane,be.lanes|=h,wr|=h,n=n.next;while(n!==e)}else n===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Ys(e){var t=mt(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var i=r.dispatch,n=r.pending,h=t.memoizedState;if(n!==null){r.pending=null;var _=n=n.next;do h=e(h,_.action),_=_.next;while(_!==n);bt(h,t.memoizedState)||(Je=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),r.lastRenderedState=h}return[h,i]}function Qu(){}function Ju(e,t){var r=be,i=mt(),n=t(),h=!bt(i.memoizedState,n);if(h&&(i.memoizedState=n,Je=!0),i=i.queue,jl(th.bind(null,r,i,e),[e]),i.getSnapshot!==t||h||Ae!==null&&Ae.memoizedState.tag&1){if(r.flags|=2048,Vi(9,eh.bind(null,r,i,n,t),void 0,null),Me===null)throw Error(G(349));Cr&30||Zu(r,t,n)}return n}function Zu(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function eh(e,t,r,i){t.value=r,t.getSnapshot=i,rh(t)&&ih(e)}function th(e,t,r){return r(function(){rh(t)&&ih(e)})}function rh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!bt(e,r)}catch{return!0}}function ih(e){var t=Ht(e,1);t!==null&&xt(t,e,1,-1)}function Ha(e){var t=kt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Wi,lastRenderedState:e},t.queue=e,e=e.dispatch=c_.bind(null,be,e),[t.memoizedState,e]}function Vi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=be.updateQueue,t===null?(t={lastEffect:null,stores:null},be.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(i=r.next,r.next=e,e.next=i,t.lastEffect=e)),e}function nh(){return mt().memoizedState}function Tn(e,t,r,i){var n=kt();be.flags|=e,n.memoizedState=Vi(1|t,r,void 0,i===void 0?null:i)}function vs(e,t,r,i){var n=mt();i=i===void 0?null:i;var h=void 0;if(Re!==null){var _=Re.memoizedState;if(h=_.destroy,i!==null&&Bl(i,_.deps)){n.memoizedState=Vi(t,r,h,i);return}}be.flags|=e,n.memoizedState=Vi(1|t,r,h,i)}function za(e,t){return Tn(8390656,8,e,t)}function jl(e,t){return vs(2048,8,e,t)}function sh(e,t){return vs(4,2,e,t)}function oh(e,t){return vs(4,4,e,t)}function lh(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ah(e,t,r){return r=r!=null?r.concat([e]):null,vs(4,4,lh.bind(null,t,e),r)}function Il(){}function ch(e,t){var r=mt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Bl(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function uh(e,t){var r=mt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Bl(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function hh(e,t,r){return Cr&21?(bt(r,t)||(r=vu(),be.lanes|=r,wr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Je=!0),e.memoizedState=r)}function l_(e,t){var r=de;de=r!==0&&4>r?r:4,e(!0);var i=Gs.transition;Gs.transition={};try{e(!1),t()}finally{de=r,Gs.transition=i}}function dh(){return mt().memoizedState}function a_(e,t,r){var i=ir(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},fh(e))ph(t,r);else if(r=Gu(e,t,r,i),r!==null){var n=qe();xt(r,e,i,n),_h(r,t,i)}}function c_(e,t,r){var i=ir(e),n={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(fh(e))ph(t,n);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var _=t.lastRenderedState,l=h(_,r);if(n.hasEagerState=!0,n.eagerState=l,bt(l,_)){var u=t.interleaved;u===null?(n.next=n,Rl(t)):(n.next=u.next,u.next=n),t.interleaved=n;return}}catch{}finally{}r=Gu(e,t,n,i),r!==null&&(n=qe(),xt(r,e,i,n),_h(r,t,i))}}function fh(e){var t=e.alternate;return e===be||t!==null&&t===be}function ph(e,t){Ei=Jn=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function _h(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,_l(e,r)}}var Zn={readContext:vt,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useInsertionEffect:He,useLayoutEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useMutableSource:He,useSyncExternalStore:He,useId:He,unstable_isNewReconciler:!1},u_={readContext:vt,useCallback:function(e,t){return kt().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:za,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Tn(4194308,4,lh.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Tn(4194308,4,e,t)},useInsertionEffect:function(e,t){return Tn(4,2,e,t)},useMemo:function(e,t){var r=kt();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=kt();return t=r!==void 0?r(t):t,i.memoizedState=i.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},i.queue=e,e=e.dispatch=a_.bind(null,be,e),[i.memoizedState,e]},useRef:function(e){var t=kt();return e={current:e},t.memoizedState=e},useState:Ha,useDebugValue:Il,useDeferredValue:function(e){return kt().memoizedState=e},useTransition:function(){var e=Ha(!1),t=e[0];return e=l_.bind(null,e[1]),kt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=be,n=kt();if(Ce){if(r===void 0)throw Error(G(407));r=r()}else{if(r=t(),Me===null)throw Error(G(349));Cr&30||Zu(i,t,r)}n.memoizedState=r;var h={value:r,getSnapshot:t};return n.queue=h,za(th.bind(null,i,h,e),[e]),i.flags|=2048,Vi(9,eh.bind(null,i,h,r,t),void 0,null),r},useId:function(){var e=kt(),t=Me.identifierPrefix;if(Ce){var r=Nt,i=Ot;r=(i&~(1<<32-wt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Ui++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=o_++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},h_={readContext:vt,useCallback:ch,useContext:vt,useEffect:jl,useImperativeHandle:ah,useInsertionEffect:sh,useLayoutEffect:oh,useMemo:uh,useReducer:Xs,useRef:nh,useState:function(){return Xs(Wi)},useDebugValue:Il,useDeferredValue:function(e){var t=mt();return hh(t,Re.memoizedState,e)},useTransition:function(){var e=Xs(Wi)[0],t=mt().memoizedState;return[e,t]},useMutableSource:Qu,useSyncExternalStore:Ju,useId:dh,unstable_isNewReconciler:!1},d_={readContext:vt,useCallback:ch,useContext:vt,useEffect:jl,useImperativeHandle:ah,useInsertionEffect:sh,useLayoutEffect:oh,useMemo:uh,useReducer:Ys,useRef:nh,useState:function(){return Ys(Wi)},useDebugValue:Il,useDeferredValue:function(e){var t=mt();return Re===null?t.memoizedState=e:hh(t,Re.memoizedState,e)},useTransition:function(){var e=Ys(Wi)[0],t=mt().memoizedState;return[e,t]},useMutableSource:Qu,useSyncExternalStore:Ju,useId:dh,unstable_isNewReconciler:!1};function yt(e,t){if(e&&e.defaultProps){t=Ee({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Fo(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:Ee({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var ms={isMounted:function(e){return(e=e._reactInternals)?Er(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=qe(),n=ir(e),h=jt(i,n);h.payload=t,r!=null&&(h.callback=r),t=tr(e,h,n),t!==null&&(xt(t,e,n,i),Dn(t,e,n))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=qe(),n=ir(e),h=jt(i,n);h.tag=1,h.payload=t,r!=null&&(h.callback=r),t=tr(e,h,n),t!==null&&(xt(t,e,n,i),Dn(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=qe(),i=ir(e),n=jt(r,i);n.tag=2,t!=null&&(n.callback=t),t=tr(e,n,i),t!==null&&(xt(t,e,i,r),Dn(t,e,i))}};function $a(e,t,r,i,n,h,_){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,_):t.prototype&&t.prototype.isPureReactComponent?!ji(r,i)||!ji(n,h):!0}function vh(e,t,r){var i=!1,n=lr,h=t.contextType;return typeof h=="object"&&h!==null?h=vt(h):(n=et(t)?yr:Ue.current,i=t.contextTypes,h=(i=i!=null)?Xr(e,n):lr),t=new t(r,h),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=ms,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=h),t}function Ua(e,t,r,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,i),t.state!==e&&ms.enqueueReplaceState(t,t.state,null)}function Ho(e,t,r,i){var n=e.stateNode;n.props=r,n.state=e.memoizedState,n.refs={},Tl(e);var h=t.contextType;typeof h=="object"&&h!==null?n.context=vt(h):(h=et(t)?yr:Ue.current,n.context=Xr(e,h)),n.state=e.memoizedState,h=t.getDerivedStateFromProps,typeof h=="function"&&(Fo(e,t,h,r),n.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof n.getSnapshotBeforeUpdate=="function"||typeof n.UNSAFE_componentWillMount!="function"&&typeof n.componentWillMount!="function"||(t=n.state,typeof n.componentWillMount=="function"&&n.componentWillMount(),typeof n.UNSAFE_componentWillMount=="function"&&n.UNSAFE_componentWillMount(),t!==n.state&&ms.enqueueReplaceState(n,n.state,null),Yn(e,r,n,i),n.state=e.memoizedState),typeof n.componentDidMount=="function"&&(e.flags|=4194308)}function Zr(e,t){try{var r="",i=t;do r+=Hf(i),i=i.return;while(i);var n=r}catch(h){n=`
39
39
  Error generating stack: `+h.message+`
40
- `+h.stack}return{value:e,source:t,stack:n,digest:null}}function Qs(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function zo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var f_=typeof WeakMap=="function"?WeakMap:Map;function mh(e,t,r){r=jt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){ts||(ts=!0,Qo=i),zo(e,t)},r}function gh(e,t,r){r=jt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var n=t.value;r.payload=function(){return i(n)},r.callback=function(){zo(e,t)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(r.callback=function(){zo(e,t),typeof i!="function"&&(rr===null?rr=new Set([this]):rr.add(this));var _=t.stack;this.componentDidCatch(t.value,{componentStack:_!==null?_:""})}),r}function Wa(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new f_;var n=new Set;i.set(t,n)}else n=i.get(t),n===void 0&&(n=new Set,i.set(t,n));n.has(r)||(n.add(r),e=L_.bind(null,e,t,r),t.then(e,e))}function Va(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ka(e,t,r,i,n){return e.mode&1?(e.flags|=65536,e.lanes=n,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=jt(-1,1),t.tag=2,tr(r,t,1))),r.lanes|=1),e)}var p_=$t.ReactCurrentOwner,Qe=!1;function Ve(e,t,r,i){t.child=e===null?qu(t,null,r,i):Qr(t,e.child,r,i)}function qa(e,t,r,i,n){r=r.render;var h=t.ref;return Kr(t,n),i=Ol(e,t,r,i,h,n),r=Nl(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,zt(e,t,n)):(Ce&&r&&xl(t),t.flags|=1,Ve(e,t,i,n),t.child)}function Ga(e,t,r,i,n){if(e===null){var h=r.type;return typeof h=="function"&&!Kl(h)&&h.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=h,yh(e,t,h,i,n)):(e=Bn(r.type,null,i,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!(e.lanes&n)){var _=h.memoizedProps;if(r=r.compare,r=r!==null?r:ji,r(_,i)&&e.ref===t.ref)return zt(e,t,n)}return t.flags|=1,e=nr(h,i),e.ref=t.ref,e.return=t,t.child=e}function yh(e,t,r,i,n){if(e!==null){var h=e.memoizedProps;if(ji(h,i)&&e.ref===t.ref)if(Qe=!1,t.pendingProps=i=h,(e.lanes&n)!==0)e.flags&131072&&(Qe=!0);else return t.lanes=e.lanes,zt(e,t,n)}return $o(e,t,r,i,n)}function Sh(e,t,r){var i=t.pendingProps,n=i.children,h=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(Hr,it),it|=r;else{if(!(r&1073741824))return e=h!==null?h.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ve(Hr,it),it|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=h!==null?h.baseLanes:r,ve(Hr,it),it|=i}else h!==null?(i=h.baseLanes|r,t.memoizedState=null):i=r,ve(Hr,it),it|=i;return Ve(e,t,n,r),t.child}function Ch(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function $o(e,t,r,i,n){var h=Ze(r)?yr:$e.current;return h=Xr(t,h),Kr(t,n),r=Ol(e,t,r,i,h,n),i=Nl(),e!==null&&!Qe?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,zt(e,t,n)):(Ce&&i&&xl(t),t.flags|=1,Ve(e,t,r,n),t.child)}function Xa(e,t,r,i,n){if(Ze(r)){var h=!0;Vn(t)}else h=!1;if(Kr(t,n),t.stateNode===null)An(e,t),vh(t,r,i),Ho(t,r,i,n),i=!0;else if(e===null){var _=t.stateNode,l=t.memoizedProps;_.props=l;var u=_.context,f=r.contextType;typeof f=="object"&&f!==null?f=vt(f):(f=Ze(r)?yr:$e.current,f=Xr(t,f));var S=r.getDerivedStateFromProps,d=typeof S=="function"||typeof _.getSnapshotBeforeUpdate=="function";d||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(l!==i||u!==f)&&Ua(t,_,i,f),Kt=!1;var m=t.memoizedState;_.state=m,Yn(t,i,_,n),u=t.memoizedState,l!==i||m!==u||Je.current||Kt?(typeof S=="function"&&(Fo(t,r,S,i),u=t.memoizedState),(l=Kt||$a(t,r,l,i,m,u,f))?(d||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=u),_.props=i,_.state=u,_.context=f,i=l):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{_=t.stateNode,Xu(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:yt(t.type,l),_.props=f,d=t.pendingProps,m=_.context,u=r.contextType,typeof u=="object"&&u!==null?u=vt(u):(u=Ze(r)?yr:$e.current,u=Xr(t,u));var C=r.getDerivedStateFromProps;(S=typeof C=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(l!==d||m!==u)&&Ua(t,_,i,u),Kt=!1,m=t.memoizedState,_.state=m,Yn(t,i,_,n);var w=t.memoizedState;l!==d||m!==w||Je.current||Kt?(typeof C=="function"&&(Fo(t,r,C,i),w=t.memoizedState),(f=Kt||$a(t,r,f,i,m,w,u)||!1)?(S||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(i,w,u),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(i,w,u)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=w),_.props=i,_.state=w,_.context=u,i=f):(typeof _.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),i=!1)}return Uo(e,t,r,i,h,n)}function Uo(e,t,r,i,n,h){Ch(e,t);var _=(t.flags&128)!==0;if(!i&&!_)return n&&Ba(t,r,!1),zt(e,t,h);i=t.stateNode,p_.current=t;var l=_&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&_?(t.child=Qr(t,e.child,null,h),t.child=Qr(t,null,l,h)):Ve(e,t,l,h),t.memoizedState=i.state,n&&Ba(t,r,!0),t.child}function wh(e){var t=e.stateNode;t.pendingContext?Ma(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ma(e,t.context,!1),Al(e,t.containerInfo)}function Ya(e,t,r,i,n){return Yr(),El(n),t.flags|=256,Ve(e,t,r,i),t.child}var Wo={dehydrated:null,treeContext:null,retryLane:0};function Vo(e){return{baseLanes:e,cachePool:null,transitions:null}}function xh(e,t,r){var i=t.pendingProps,n=xe.current,h=!1,_=(t.flags&128)!==0,l;if((l=_)||(l=e!==null&&e.memoizedState===null?!1:(n&2)!==0),l?(h=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(n|=1),ve(xe,n&1),e===null)return jo(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(_=i.children,e=i.fallback,h?(i=t.mode,h=t.child,_={mode:"hidden",children:_},!(i&1)&&h!==null?(h.childLanes=0,h.pendingProps=_):h=Ss(_,i,0,null),e=gr(e,i,r,null),h.return=t,e.return=t,h.sibling=e,t.child=h,t.child.memoizedState=Vo(r),t.memoizedState=Wo,e):Fl(t,_));if(n=e.memoizedState,n!==null&&(l=n.dehydrated,l!==null))return __(e,t,_,i,l,n,r);if(h){h=i.fallback,_=t.mode,n=e.child,l=n.sibling;var u={mode:"hidden",children:i.children};return!(_&1)&&t.child!==n?(i=t.child,i.childLanes=0,i.pendingProps=u,t.deletions=null):(i=nr(n,u),i.subtreeFlags=n.subtreeFlags&14680064),l!==null?h=nr(l,h):(h=gr(h,_,r,null),h.flags|=2),h.return=t,i.return=t,i.sibling=h,t.child=i,i=h,h=t.child,_=e.child.memoizedState,_=_===null?Vo(r):{baseLanes:_.baseLanes|r,cachePool:null,transitions:_.transitions},h.memoizedState=_,h.childLanes=e.childLanes&~r,t.memoizedState=Wo,i}return h=e.child,e=h.sibling,i=nr(h,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Fl(e,t){return t=Ss({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vn(e,t,r,i){return i!==null&&El(i),Qr(t,e.child,null,r),e=Fl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function __(e,t,r,i,n,h,_){if(r)return t.flags&256?(t.flags&=-257,i=Qs(Error(G(422))),vn(e,t,_,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(h=i.fallback,n=t.mode,i=Ss({mode:"visible",children:i.children},n,0,null),h=gr(h,n,_,null),h.flags|=2,i.return=t,h.return=t,i.sibling=h,t.child=i,t.mode&1&&Qr(t,e.child,null,_),t.child.memoizedState=Vo(_),t.memoizedState=Wo,h);if(!(t.mode&1))return vn(e,t,_,null);if(n.data==="$!"){if(i=n.nextSibling&&n.nextSibling.dataset,i)var l=i.dgst;return i=l,h=Error(G(419)),i=Qs(h,i,void 0),vn(e,t,_,i)}if(l=(_&e.childLanes)!==0,Qe||l){if(i=Me,i!==null){switch(_&-_){case 4:n=2;break;case 16:n=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(i.suspendedLanes|_)?0:n,n!==0&&n!==h.retryLane&&(h.retryLane=n,Ht(e,n),xt(i,e,n,-1))}return Vl(),i=Qs(Error(G(421))),vn(e,t,_,i)}return n.data==="$?"?(t.flags|=128,t.child=e.child,t=D_.bind(null,e),n._reactRetry=t,null):(e=h.treeContext,st=er(n.nextSibling),ot=t,Ce=!0,Ct=null,e!==null&&(dt[ft++]=Ot,dt[ft++]=Nt,dt[ft++]=Sr,Ot=e.id,Nt=e.overflow,Sr=t),t=Fl(t,i.children),t.flags|=4096,t)}function Qa(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Io(e.return,t,r)}function Js(e,t,r,i,n){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:n}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=r,h.tailMode=n)}function bh(e,t,r){var i=t.pendingProps,n=i.revealOrder,h=i.tail;if(Ve(e,t,i.children,r),i=xe.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qa(e,r,t);else if(e.tag===19)Qa(e,r,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}i&=1}if(ve(xe,i),!(t.mode&1))t.memoizedState=null;else switch(n){case"forwards":for(r=t.child,n=null;r!==null;)e=r.alternate,e!==null&&Qn(e)===null&&(n=r),r=r.sibling;r=n,r===null?(n=t.child,t.child=null):(n=r.sibling,r.sibling=null),Js(t,!1,n,r,h);break;case"backwards":for(r=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Qn(e)===null){t.child=n;break}e=n.sibling,n.sibling=r,r=n,n=e}Js(t,!0,r,null,h);break;case"together":Js(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function An(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),wr|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,r=nr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=nr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function v_(e,t,r){switch(t.tag){case 3:wh(t),Yr();break;case 5:Yu(t);break;case 1:Ze(t.type)&&Vn(t);break;case 4:Al(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,n=t.memoizedProps.value;ve(Gn,i._currentValue),i._currentValue=n;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ve(xe,xe.current&1),t.flags|=128,null):r&t.child.childLanes?xh(e,t,r):(ve(xe,xe.current&1),e=zt(e,t,r),e!==null?e.sibling:null);ve(xe,xe.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return bh(e,t,r);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),ve(xe,xe.current),i)break;return null;case 22:case 23:return t.lanes=0,Sh(e,t,r)}return zt(e,t,r)}var Eh,Ko,kh,Lh;Eh=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Ko=function(){};kh=function(e,t,r,i){var n=e.memoizedProps;if(n!==i){e=t.stateNode,_r(Rt.current);var h=null;switch(r){case"input":n=po(e,n),i=po(e,i),h=[];break;case"select":n=Ee({},n,{value:void 0}),i=Ee({},i,{value:void 0}),h=[];break;case"textarea":n=mo(e,n),i=mo(e,i),h=[];break;default:typeof n.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Un)}yo(r,i);var _;r=null;for(f in n)if(!i.hasOwnProperty(f)&&n.hasOwnProperty(f)&&n[f]!=null)if(f==="style"){var l=n[f];for(_ in l)l.hasOwnProperty(_)&&(r||(r={}),r[_]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Ti.hasOwnProperty(f)?h||(h=[]):(h=h||[]).push(f,null));for(f in i){var u=i[f];if(l=n!=null?n[f]:void 0,i.hasOwnProperty(f)&&u!==l&&(u!=null||l!=null))if(f==="style")if(l){for(_ in l)!l.hasOwnProperty(_)||u&&u.hasOwnProperty(_)||(r||(r={}),r[_]="");for(_ in u)u.hasOwnProperty(_)&&l[_]!==u[_]&&(r||(r={}),r[_]=u[_])}else r||(h||(h=[]),h.push(f,r)),r=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(h=h||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(h=h||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Ti.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&ye("scroll",e),h||l===u||(h=[])):(h=h||[]).push(f,u))}r&&(h=h||[]).push("style",r);var f=h;(t.updateQueue=f)&&(t.flags|=4)}};Lh=function(e,t,r,i){r!==i&&(t.flags|=4)};function hi(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags&14680064,i|=n.flags&14680064,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function m_(e,t,r){var i=t.pendingProps;switch(bl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return Ze(t.type)&&Wn(),He(t),null;case 3:return i=t.stateNode,Jr(),Se(Je),Se($e),Ml(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(pn(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ct!==null&&(el(Ct),Ct=null))),Ko(e,t),He(t),null;case 5:Pl(t);var n=_r($i.current);if(r=t.type,e!==null&&t.stateNode!=null)kh(e,t,r,i,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(G(166));return He(t),null}if(e=_r(Rt.current),pn(t)){i=t.stateNode,r=t.type;var h=t.memoizedProps;switch(i[Lt]=t,i[Hi]=h,e=(t.mode&1)!==0,r){case"dialog":ye("cancel",i),ye("close",i);break;case"iframe":case"object":case"embed":ye("load",i);break;case"video":case"audio":for(n=0;n<mi.length;n++)ye(mi[n],i);break;case"source":ye("error",i);break;case"img":case"image":case"link":ye("error",i),ye("load",i);break;case"details":ye("toggle",i);break;case"input":oa(i,h),ye("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!h.multiple},ye("invalid",i);break;case"textarea":aa(i,h),ye("invalid",i)}yo(r,h),n=null;for(var _ in h)if(h.hasOwnProperty(_)){var l=h[_];_==="children"?typeof l=="string"?i.textContent!==l&&(h.suppressHydrationWarning!==!0&&fn(i.textContent,l,e),n=["children",l]):typeof l=="number"&&i.textContent!==""+l&&(h.suppressHydrationWarning!==!0&&fn(i.textContent,l,e),n=["children",""+l]):Ti.hasOwnProperty(_)&&l!=null&&_==="onScroll"&&ye("scroll",i)}switch(r){case"input":sn(i),la(i,h,!0);break;case"textarea":sn(i),ca(i);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(i.onclick=Un)}i=n,t.updateQueue=i,i!==null&&(t.flags|=4)}else{_=n.nodeType===9?n:n.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tu(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=_.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=_.createElement(r,{is:i.is}):(e=_.createElement(r),r==="select"&&(_=e,i.multiple?_.multiple=!0:i.size&&(_.size=i.size))):e=_.createElementNS(e,r),e[Lt]=t,e[Hi]=i,Eh(e,t,!1,!1),t.stateNode=e;e:{switch(_=So(r,i),r){case"dialog":ye("cancel",e),ye("close",e),n=i;break;case"iframe":case"object":case"embed":ye("load",e),n=i;break;case"video":case"audio":for(n=0;n<mi.length;n++)ye(mi[n],e);n=i;break;case"source":ye("error",e),n=i;break;case"img":case"image":case"link":ye("error",e),ye("load",e),n=i;break;case"details":ye("toggle",e),n=i;break;case"input":oa(e,i),n=po(e,i),ye("invalid",e);break;case"option":n=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},n=Ee({},i,{value:void 0}),ye("invalid",e);break;case"textarea":aa(e,i),n=mo(e,i),ye("invalid",e);break;default:n=i}yo(r,n),l=n;for(h in l)if(l.hasOwnProperty(h)){var u=l[h];h==="style"?nu(e,u):h==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&ru(e,u)):h==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Ai(e,u):typeof u=="number"&&Ai(e,""+u):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(Ti.hasOwnProperty(h)?u!=null&&h==="onScroll"&&ye("scroll",e):u!=null&&cl(e,h,u,_))}switch(r){case"input":sn(e),la(e,i,!1);break;case"textarea":sn(e),ca(e);break;case"option":i.value!=null&&e.setAttribute("value",""+or(i.value));break;case"select":e.multiple=!!i.multiple,h=i.value,h!=null?$r(e,!!i.multiple,h,!1):i.defaultValue!=null&&$r(e,!!i.multiple,i.defaultValue,!0);break;default:typeof n.onClick=="function"&&(e.onclick=Un)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return He(t),null;case 6:if(e&&t.stateNode!=null)Lh(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(G(166));if(r=_r($i.current),_r(Rt.current),pn(t)){if(i=t.stateNode,r=t.memoizedProps,i[Lt]=t,(h=i.nodeValue!==r)&&(e=ot,e!==null))switch(e.tag){case 3:fn(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&fn(i.nodeValue,r,(e.mode&1)!==0)}h&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[Lt]=t,t.stateNode=i}return He(t),null;case 13:if(Se(xe),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ce&&st!==null&&t.mode&1&&!(t.flags&128))Vu(),Yr(),t.flags|=98560,h=!1;else if(h=pn(t),i!==null&&i.dehydrated!==null){if(e===null){if(!h)throw Error(G(318));if(h=t.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(G(317));h[Lt]=t}else Yr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;He(t),h=!1}else Ct!==null&&(el(Ct),Ct=null),h=!0;if(!h)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||xe.current&1?Te===0&&(Te=3):Vl())),t.updateQueue!==null&&(t.flags|=4),He(t),null);case 4:return Jr(),Ko(e,t),e===null&&Ii(t.stateNode.containerInfo),He(t),null;case 10:return Dl(t.type._context),He(t),null;case 17:return Ze(t.type)&&Wn(),He(t),null;case 19:if(Se(xe),h=t.memoizedState,h===null)return He(t),null;if(i=(t.flags&128)!==0,_=h.rendering,_===null)if(i)hi(h,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(_=Qn(e),_!==null){for(t.flags|=128,hi(h,!1),i=_.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)h=r,e=i,h.flags&=14680066,_=h.alternate,_===null?(h.childLanes=0,h.lanes=e,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=_.childLanes,h.lanes=_.lanes,h.child=_.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=_.memoizedProps,h.memoizedState=_.memoizedState,h.updateQueue=_.updateQueue,h.type=_.type,e=_.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ve(xe,xe.current&1|2),t.child}e=e.sibling}h.tail!==null&&Le()>ei&&(t.flags|=128,i=!0,hi(h,!1),t.lanes=4194304)}else{if(!i)if(e=Qn(_),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),hi(h,!0),h.tail===null&&h.tailMode==="hidden"&&!_.alternate&&!Ce)return He(t),null}else 2*Le()-h.renderingStartTime>ei&&r!==1073741824&&(t.flags|=128,i=!0,hi(h,!1),t.lanes=4194304);h.isBackwards?(_.sibling=t.child,t.child=_):(r=h.last,r!==null?r.sibling=_:t.child=_,h.last=_)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=Le(),t.sibling=null,r=xe.current,ve(xe,i?r&1|2:r&1),t):(He(t),null);case 22:case 23:return Wl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?it&1073741824&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function g_(e,t){switch(bl(t),t.tag){case 1:return Ze(t.type)&&Wn(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jr(),Se(Je),Se($e),Ml(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pl(t),null;case 13:if(Se(xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));Yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(xe),null;case 4:return Jr(),null;case 10:return Dl(t.type._context),null;case 22:case 23:return Wl(),null;case 24:return null;default:return null}}var mn=!1,ze=!1,y_=typeof WeakSet=="function"?WeakSet:Set,Z=null;function Fr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){ke(e,t,i)}else r.current=null}function qo(e,t,r){try{r()}catch(i){ke(e,t,i)}}var Ja=!1;function S_(e,t){if(To=Hn,e=Pu(),wl(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var n=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var _=0,l=-1,u=-1,f=0,S=0,d=e,m=null;t:for(;;){for(var C;d!==r||n!==0&&d.nodeType!==3||(l=_+n),d!==h||i!==0&&d.nodeType!==3||(u=_+i),d.nodeType===3&&(_+=d.nodeValue.length),(C=d.firstChild)!==null;)m=d,d=C;for(;;){if(d===e)break t;if(m===r&&++f===n&&(l=_),m===h&&++S===i&&(u=_),(C=d.nextSibling)!==null)break;d=m,m=d.parentNode}d=C}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ao={focusedElem:e,selectionRange:r},Hn=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var g=w.memoizedProps,a=w.memoizedState,o=t.stateNode,s=o.getSnapshotBeforeUpdate(t.elementType===t.type?g:yt(t.type,g),a);o.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var c=t.stateNode.containerInfo;c.nodeType===1?c.textContent="":c.nodeType===9&&c.documentElement&&c.removeChild(c.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(p){ke(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return w=Ja,Ja=!1,w}function ki(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&e)===e){var h=n.destroy;n.destroy=void 0,h!==void 0&&qo(t,r,h)}n=n.next}while(n!==i)}}function gs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function Go(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Dh(e){var t=e.alternate;t!==null&&(e.alternate=null,Dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lt],delete t[Hi],delete t[Bo],delete t[r_],delete t[i_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Rh(e){return e.tag===5||e.tag===3||e.tag===4}function Za(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rh(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.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 Xo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Un));else if(i!==4&&(e=e.child,e!==null))for(Xo(e,t,r),e=e.sibling;e!==null;)Xo(e,t,r),e=e.sibling}function Yo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Yo(e,t,r),e=e.sibling;e!==null;)Yo(e,t,r),e=e.sibling}var Oe=null,St=!1;function Wt(e,t,r){for(r=r.child;r!==null;)Th(e,t,r),r=r.sibling}function Th(e,t,r){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(us,r)}catch{}switch(r.tag){case 5:ze||Fr(r,t);case 6:var i=Oe,n=St;Oe=null,Wt(e,t,r),Oe=i,St=n,Oe!==null&&(St?(e=Oe,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Oe.removeChild(r.stateNode));break;case 18:Oe!==null&&(St?(e=Oe,r=r.stateNode,e.nodeType===8?Vs(e.parentNode,r):e.nodeType===1&&Vs(e,r),Oi(e)):Vs(Oe,r.stateNode));break;case 4:i=Oe,n=St,Oe=r.stateNode.containerInfo,St=!0,Wt(e,t,r),Oe=i,St=n;break;case 0:case 11:case 14:case 15:if(!ze&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var h=n,_=h.destroy;h=h.tag,_!==void 0&&(h&2||h&4)&&qo(r,t,_),n=n.next}while(n!==i)}Wt(e,t,r);break;case 1:if(!ze&&(Fr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(l){ke(r,t,l)}Wt(e,t,r);break;case 21:Wt(e,t,r);break;case 22:r.mode&1?(ze=(i=ze)||r.memoizedState!==null,Wt(e,t,r),ze=i):Wt(e,t,r);break;default:Wt(e,t,r)}}function ec(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new y_),t.forEach(function(i){var n=R_.bind(null,e,i);r.has(i)||(r.add(i),i.then(n,n))})}}function gt(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var n=r[i];try{var h=e,_=t,l=_;e:for(;l!==null;){switch(l.tag){case 5:Oe=l.stateNode,St=!1;break e;case 3:Oe=l.stateNode.containerInfo,St=!0;break e;case 4:Oe=l.stateNode.containerInfo,St=!0;break e}l=l.return}if(Oe===null)throw Error(G(160));Th(h,_,n),Oe=null,St=!1;var u=n.alternate;u!==null&&(u.return=null),n.return=null}catch(f){ke(n,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ah(t,e),t=t.sibling}function Ah(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gt(t,e),Et(e),i&4){try{ki(3,e,e.return),gs(3,e)}catch(g){ke(e,e.return,g)}try{ki(5,e,e.return)}catch(g){ke(e,e.return,g)}}break;case 1:gt(t,e),Et(e),i&512&&r!==null&&Fr(r,r.return);break;case 5:if(gt(t,e),Et(e),i&512&&r!==null&&Fr(r,r.return),e.flags&32){var n=e.stateNode;try{Ai(n,"")}catch(g){ke(e,e.return,g)}}if(i&4&&(n=e.stateNode,n!=null)){var h=e.memoizedProps,_=r!==null?r.memoizedProps:h,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&h.type==="radio"&&h.name!=null&&Zc(n,h),So(l,_);var f=So(l,h);for(_=0;_<u.length;_+=2){var S=u[_],d=u[_+1];S==="style"?nu(n,d):S==="dangerouslySetInnerHTML"?ru(n,d):S==="children"?Ai(n,d):cl(n,S,d,f)}switch(l){case"input":_o(n,h);break;case"textarea":eu(n,h);break;case"select":var m=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!h.multiple;var C=h.value;C!=null?$r(n,!!h.multiple,C,!1):m!==!!h.multiple&&(h.defaultValue!=null?$r(n,!!h.multiple,h.defaultValue,!0):$r(n,!!h.multiple,h.multiple?[]:"",!1))}n[Hi]=h}catch(g){ke(e,e.return,g)}}break;case 6:if(gt(t,e),Et(e),i&4){if(e.stateNode===null)throw Error(G(162));n=e.stateNode,h=e.memoizedProps;try{n.nodeValue=h}catch(g){ke(e,e.return,g)}}break;case 3:if(gt(t,e),Et(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Oi(t.containerInfo)}catch(g){ke(e,e.return,g)}break;case 4:gt(t,e),Et(e);break;case 13:gt(t,e),Et(e),n=e.child,n.flags&8192&&(h=n.memoizedState!==null,n.stateNode.isHidden=h,!h||n.alternate!==null&&n.alternate.memoizedState!==null||($l=Le())),i&4&&ec(e);break;case 22:if(S=r!==null&&r.memoizedState!==null,e.mode&1?(ze=(f=ze)||S,gt(t,e),ze=f):gt(t,e),Et(e),i&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!S&&e.mode&1)for(Z=e,S=e.child;S!==null;){for(d=Z=S;Z!==null;){switch(m=Z,C=m.child,m.tag){case 0:case 11:case 14:case 15:ki(4,m,m.return);break;case 1:Fr(m,m.return);var w=m.stateNode;if(typeof w.componentWillUnmount=="function"){i=m,r=m.return;try{t=i,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(g){ke(i,r,g)}}break;case 5:Fr(m,m.return);break;case 22:if(m.memoizedState!==null){rc(d);continue}}C!==null?(C.return=m,Z=C):rc(d)}S=S.sibling}e:for(S=null,d=e;;){if(d.tag===5){if(S===null){S=d;try{n=d.stateNode,f?(h=n.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(l=d.stateNode,u=d.memoizedProps.style,_=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=iu("display",_))}catch(g){ke(e,e.return,g)}}}else if(d.tag===6){if(S===null)try{d.stateNode.nodeValue=f?"":d.memoizedProps}catch(g){ke(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;S===d&&(S=null),d=d.return}S===d&&(S=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:gt(t,e),Et(e),i&4&&ec(e);break;case 21:break;default:gt(t,e),Et(e)}}function Et(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Rh(r)){var i=r;break e}r=r.return}throw Error(G(160))}switch(i.tag){case 5:var n=i.stateNode;i.flags&32&&(Ai(n,""),i.flags&=-33);var h=Za(e);Yo(e,h,n);break;case 3:case 4:var _=i.stateNode.containerInfo,l=Za(e);Xo(e,l,_);break;default:throw Error(G(161))}}catch(u){ke(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function C_(e,t,r){Z=e,Ph(e)}function Ph(e,t,r){for(var i=(e.mode&1)!==0;Z!==null;){var n=Z,h=n.child;if(n.tag===22&&i){var _=n.memoizedState!==null||mn;if(!_){var l=n.alternate,u=l!==null&&l.memoizedState!==null||ze;l=mn;var f=ze;if(mn=_,(ze=u)&&!f)for(Z=n;Z!==null;)_=Z,u=_.child,_.tag===22&&_.memoizedState!==null?ic(n):u!==null?(u.return=_,Z=u):ic(n);for(;h!==null;)Z=h,Ph(h),h=h.sibling;Z=n,mn=l,ze=f}tc(e)}else n.subtreeFlags&8772&&h!==null?(h.return=n,Z=h):tc(e)}}function tc(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:ze||gs(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!ze)if(r===null)i.componentDidMount();else{var n=t.elementType===t.type?r.memoizedProps:yt(t.type,r.memoizedProps);i.componentDidUpdate(n,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var h=t.updateQueue;h!==null&&Fa(t,h,i);break;case 3:var _=t.updateQueue;if(_!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Fa(t,_,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var S=f.memoizedState;if(S!==null){var d=S.dehydrated;d!==null&&Oi(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}ze||t.flags&512&&Go(t)}catch(m){ke(t,t.return,m)}}if(t===e){Z=null;break}if(r=t.sibling,r!==null){r.return=t.return,Z=r;break}Z=t.return}}function rc(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Z=r;break}Z=t.return}}function ic(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{gs(4,t)}catch(u){ke(t,r,u)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var n=t.return;try{i.componentDidMount()}catch(u){ke(t,n,u)}}var h=t.return;try{Go(t)}catch(u){ke(t,h,u)}break;case 5:var _=t.return;try{Go(t)}catch(u){ke(t,_,u)}}}catch(u){ke(t,t.return,u)}if(t===e){Z=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Z=l;break}Z=t.return}}var w_=Math.ceil,es=$t.ReactCurrentDispatcher,Hl=$t.ReactCurrentOwner,_t=$t.ReactCurrentBatchConfig,he=0,Me=null,De=null,je=0,it=0,Hr=cr(0),Te=0,Ki=null,wr=0,ys=0,zl=0,Li=null,Ye=null,$l=0,ei=1/0,Mt=null,ts=!1,Qo=null,rr=null,gn=!1,Yt=null,rs=0,Di=0,Jo=null,Pn=-1,Mn=0;function Ke(){return he&6?Le():Pn!==-1?Pn:Pn=Le()}function ir(e){return e.mode&1?he&2&&je!==0?je&-je:s_.transition!==null?(Mn===0&&(Mn=vu()),Mn):(e=de,e!==0||(e=window.event,e=e===void 0?16:xu(e.type)),e):1}function xt(e,t,r,i){if(50<Di)throw Di=0,Jo=null,Error(G(185));Xi(e,r,i),(!(he&2)||e!==Me)&&(e===Me&&(!(he&2)&&(ys|=r),Te===4&&Gt(e,je)),et(e,i),r===1&&he===0&&!(t.mode&1)&&(ei=Le()+500,_s&&ur()))}function et(e,t){var r=e.callbackNode;sp(e,t);var i=Fn(e,e===Me?je:0);if(i===0)r!==null&&da(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&da(r),t===1)e.tag===0?n_(nc.bind(null,e)):$u(nc.bind(null,e)),e_(function(){!(he&6)&&ur()}),r=null;else{switch(mu(i)){case 1:r=pl;break;case 4:r=pu;break;case 16:r=In;break;case 536870912:r=_u;break;default:r=In}r=Hh(r,Mh.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Mh(e,t){if(Pn=-1,Mn=0,he&6)throw Error(G(327));var r=e.callbackNode;if(qr()&&e.callbackNode!==r)return null;var i=Fn(e,e===Me?je:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=is(e,i);else{t=i;var n=he;he|=2;var h=Oh();(Me!==e||je!==t)&&(Mt=null,ei=Le()+500,mr(e,t));do try{E_();break}catch(l){Bh(e,l)}while(!0);Ll(),es.current=h,he=n,De!==null?t=0:(Me=null,je=0,t=Te)}if(t!==0){if(t===2&&(n=Eo(e),n!==0&&(i=n,t=Zo(e,n))),t===1)throw r=Ki,mr(e,0),Gt(e,i),et(e,Le()),r;if(t===6)Gt(e,i);else{if(n=e.current.alternate,!(i&30)&&!x_(n)&&(t=is(e,i),t===2&&(h=Eo(e),h!==0&&(i=h,t=Zo(e,h))),t===1))throw r=Ki,mr(e,0),Gt(e,i),et(e,Le()),r;switch(e.finishedWork=n,e.finishedLanes=i,t){case 0:case 1:throw Error(G(345));case 2:dr(e,Ye,Mt);break;case 3:if(Gt(e,i),(i&130023424)===i&&(t=$l+500-Le(),10<t)){if(Fn(e,0)!==0)break;if(n=e.suspendedLanes,(n&i)!==i){Ke(),e.pingedLanes|=e.suspendedLanes&n;break}e.timeoutHandle=Mo(dr.bind(null,e,Ye,Mt),t);break}dr(e,Ye,Mt);break;case 4:if(Gt(e,i),(i&4194240)===i)break;for(t=e.eventTimes,n=-1;0<i;){var _=31-wt(i);h=1<<_,_=t[_],_>n&&(n=_),i&=~h}if(i=n,i=Le()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*w_(i/1960))-i,10<i){e.timeoutHandle=Mo(dr.bind(null,e,Ye,Mt),i);break}dr(e,Ye,Mt);break;case 5:dr(e,Ye,Mt);break;default:throw Error(G(329))}}}return et(e,Le()),e.callbackNode===r?Mh.bind(null,e):null}function Zo(e,t){var r=Li;return e.current.memoizedState.isDehydrated&&(mr(e,t).flags|=256),e=is(e,t),e!==2&&(t=Ye,Ye=r,t!==null&&el(t)),e}function el(e){Ye===null?Ye=e:Ye.push.apply(Ye,e)}function x_(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var n=r[i],h=n.getSnapshot;n=n.value;try{if(!bt(h(),n))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Gt(e,t){for(t&=~zl,t&=~ys,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-wt(t),i=1<<r;e[r]=-1,t&=~i}}function nc(e){if(he&6)throw Error(G(327));qr();var t=Fn(e,0);if(!(t&1))return et(e,Le()),null;var r=is(e,t);if(e.tag!==0&&r===2){var i=Eo(e);i!==0&&(t=i,r=Zo(e,i))}if(r===1)throw r=Ki,mr(e,0),Gt(e,t),et(e,Le()),r;if(r===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,dr(e,Ye,Mt),et(e,Le()),null}function Ul(e,t){var r=he;he|=1;try{return e(t)}finally{he=r,he===0&&(ei=Le()+500,_s&&ur())}}function xr(e){Yt!==null&&Yt.tag===0&&!(he&6)&&qr();var t=he;he|=1;var r=_t.transition,i=de;try{if(_t.transition=null,de=1,e)return e()}finally{de=i,_t.transition=r,he=t,!(he&6)&&ur()}}function Wl(){it=Hr.current,Se(Hr)}function mr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Zp(r)),De!==null)for(r=De.return;r!==null;){var i=r;switch(bl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Wn();break;case 3:Jr(),Se(Je),Se($e),Ml();break;case 5:Pl(i);break;case 4:Jr();break;case 13:Se(xe);break;case 19:Se(xe);break;case 10:Dl(i.type._context);break;case 22:case 23:Wl()}r=r.return}if(Me=e,De=e=nr(e.current,null),je=it=t,Te=0,Ki=null,zl=ys=wr=0,Ye=Li=null,pr!==null){for(t=0;t<pr.length;t++)if(r=pr[t],i=r.interleaved,i!==null){r.interleaved=null;var n=i.next,h=r.pending;if(h!==null){var _=h.next;h.next=n,i.next=_}r.pending=i}pr=null}return e}function Bh(e,t){do{var r=De;try{if(Ll(),Rn.current=Zn,Jn){for(var i=be.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}Jn=!1}if(Cr=0,Ae=Re=be=null,Ei=!1,Ui=0,Hl.current=null,r===null||r.return===null){Te=1,Ki=t,De=null;break}e:{var h=e,_=r.return,l=r,u=t;if(t=je,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,S=l,d=S.tag;if(!(S.mode&1)&&(d===0||d===11||d===15)){var m=S.alternate;m?(S.updateQueue=m.updateQueue,S.memoizedState=m.memoizedState,S.lanes=m.lanes):(S.updateQueue=null,S.memoizedState=null)}var C=Va(_);if(C!==null){C.flags&=-257,Ka(C,_,l,h,t),C.mode&1&&Wa(h,f,t),t=C,u=f;var w=t.updateQueue;if(w===null){var g=new Set;g.add(u),t.updateQueue=g}else w.add(u);break e}else{if(!(t&1)){Wa(h,f,t),Vl();break e}u=Error(G(426))}}else if(Ce&&l.mode&1){var a=Va(_);if(a!==null){!(a.flags&65536)&&(a.flags|=256),Ka(a,_,l,h,t),El(Zr(u,l));break e}}h=u=Zr(u,l),Te!==4&&(Te=2),Li===null?Li=[h]:Li.push(h),h=_;do{switch(h.tag){case 3:h.flags|=65536,t&=-t,h.lanes|=t;var o=mh(h,u,t);Ia(h,o);break e;case 1:l=u;var s=h.type,c=h.stateNode;if(!(h.flags&128)&&(typeof s.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(rr===null||!rr.has(c)))){h.flags|=65536,t&=-t,h.lanes|=t;var p=gh(h,l,t);Ia(h,p);break e}}h=h.return}while(h!==null)}jh(r)}catch(v){t=v,De===r&&r!==null&&(De=r=r.return);continue}break}while(!0)}function Oh(){var e=es.current;return es.current=Zn,e===null?Zn:e}function Vl(){(Te===0||Te===3||Te===2)&&(Te=4),Me===null||!(wr&268435455)&&!(ys&268435455)||Gt(Me,je)}function is(e,t){var r=he;he|=2;var i=Oh();(Me!==e||je!==t)&&(Mt=null,mr(e,t));do try{b_();break}catch(n){Bh(e,n)}while(!0);if(Ll(),he=r,es.current=i,De!==null)throw Error(G(261));return Me=null,je=0,Te}function b_(){for(;De!==null;)Nh(De)}function E_(){for(;De!==null&&!Yf();)Nh(De)}function Nh(e){var t=Fh(e.alternate,e,it);e.memoizedProps=e.pendingProps,t===null?jh(e):De=t,Hl.current=null}function jh(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=g_(r,t),r!==null){r.flags&=32767,De=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,De=null;return}}else if(r=m_(r,t,it),r!==null){De=r;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Te===0&&(Te=5)}function dr(e,t,r){var i=de,n=_t.transition;try{_t.transition=null,de=1,k_(e,t,r,i)}finally{_t.transition=n,de=i}return null}function k_(e,t,r,i){do qr();while(Yt!==null);if(he&6)throw Error(G(327));r=e.finishedWork;var n=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var h=r.lanes|r.childLanes;if(op(e,h),e===Me&&(De=Me=null,je=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||gn||(gn=!0,Hh(In,function(){return qr(),null})),h=(r.flags&15990)!==0,r.subtreeFlags&15990||h){h=_t.transition,_t.transition=null;var _=de;de=1;var l=he;he|=4,Hl.current=null,S_(e,r),Ah(r,e),Kp(Ao),Hn=!!To,Ao=To=null,e.current=r,C_(r),Qf(),he=l,de=_,_t.transition=h}else e.current=r;if(gn&&(gn=!1,Yt=e,rs=n),h=e.pendingLanes,h===0&&(rr=null),ep(r.stateNode),et(e,Le()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)n=t[r],i(n.value,{componentStack:n.stack,digest:n.digest});if(ts)throw ts=!1,e=Qo,Qo=null,e;return rs&1&&e.tag!==0&&qr(),h=e.pendingLanes,h&1?e===Jo?Di++:(Di=0,Jo=e):Di=0,ur(),null}function qr(){if(Yt!==null){var e=mu(rs),t=_t.transition,r=de;try{if(_t.transition=null,de=16>e?16:e,Yt===null)var i=!1;else{if(e=Yt,Yt=null,rs=0,he&6)throw Error(G(331));var n=he;for(he|=4,Z=e.current;Z!==null;){var h=Z,_=h.child;if(Z.flags&16){var l=h.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for(Z=f;Z!==null;){var S=Z;switch(S.tag){case 0:case 11:case 15:ki(8,S,h)}var d=S.child;if(d!==null)d.return=S,Z=d;else for(;Z!==null;){S=Z;var m=S.sibling,C=S.return;if(Dh(S),S===f){Z=null;break}if(m!==null){m.return=C,Z=m;break}Z=C}}}var w=h.alternate;if(w!==null){var g=w.child;if(g!==null){w.child=null;do{var a=g.sibling;g.sibling=null,g=a}while(g!==null)}}Z=h}}if(h.subtreeFlags&2064&&_!==null)_.return=h,Z=_;else e:for(;Z!==null;){if(h=Z,h.flags&2048)switch(h.tag){case 0:case 11:case 15:ki(9,h,h.return)}var o=h.sibling;if(o!==null){o.return=h.return,Z=o;break e}Z=h.return}}var s=e.current;for(Z=s;Z!==null;){_=Z;var c=_.child;if(_.subtreeFlags&2064&&c!==null)c.return=_,Z=c;else e:for(_=s;Z!==null;){if(l=Z,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:gs(9,l)}}catch(v){ke(l,l.return,v)}if(l===_){Z=null;break e}var p=l.sibling;if(p!==null){p.return=l.return,Z=p;break e}Z=l.return}}if(he=n,ur(),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(us,e)}catch{}i=!0}return i}finally{de=r,_t.transition=t}}return!1}function sc(e,t,r){t=Zr(r,t),t=mh(e,t,1),e=tr(e,t,1),t=Ke(),e!==null&&(Xi(e,1,t),et(e,t))}function ke(e,t,r){if(e.tag===3)sc(e,e,r);else for(;t!==null;){if(t.tag===3){sc(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(rr===null||!rr.has(i))){e=Zr(r,e),e=gh(t,e,1),t=tr(t,e,1),e=Ke(),t!==null&&(Xi(t,1,e),et(t,e));break}}t=t.return}}function L_(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=Ke(),e.pingedLanes|=e.suspendedLanes&r,Me===e&&(je&r)===r&&(Te===4||Te===3&&(je&130023424)===je&&500>Le()-$l?mr(e,0):zl|=r),et(e,t)}function Ih(e,t){t===0&&(e.mode&1?(t=an,an<<=1,!(an&130023424)&&(an=4194304)):t=1);var r=Ke();e=Ht(e,t),e!==null&&(Xi(e,t,r),et(e,r))}function D_(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Ih(e,r)}function R_(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,n=e.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(G(314))}i!==null&&i.delete(t),Ih(e,r)}var Fh;Fh=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Je.current)Qe=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Qe=!1,v_(e,t,r);Qe=!!(e.flags&131072)}else Qe=!1,Ce&&t.flags&1048576&&Uu(t,qn,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;An(e,t),e=t.pendingProps;var n=Xr(t,$e.current);Kr(t,r),n=Ol(null,t,i,e,n,r);var h=Nl();return t.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ze(i)?(h=!0,Vn(t)):h=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,Tl(t),n.updater=ms,t.stateNode=n,n._reactInternals=t,Ho(t,i,e,r),t=Uo(null,t,i,!0,h,r)):(t.tag=0,Ce&&h&&xl(t),Ve(null,t,n,r),t=t.child),t;case 16:i=t.elementType;e:{switch(An(e,t),e=t.pendingProps,n=i._init,i=n(i._payload),t.type=i,n=t.tag=A_(i),e=yt(i,e),n){case 0:t=$o(null,t,i,e,r);break e;case 1:t=Xa(null,t,i,e,r);break e;case 11:t=qa(null,t,i,e,r);break e;case 14:t=Ga(null,t,i,yt(i.type,e),r);break e}throw Error(G(306,i,""))}return t;case 0:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:yt(i,n),$o(e,t,i,n,r);case 1:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:yt(i,n),Xa(e,t,i,n,r);case 3:e:{if(wh(t),e===null)throw Error(G(387));i=t.pendingProps,h=t.memoizedState,n=h.element,Xu(e,t),Yn(t,i,null,r);var _=t.memoizedState;if(i=_.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){n=Zr(Error(G(423)),t),t=Ya(e,t,i,r,n);break e}else if(i!==n){n=Zr(Error(G(424)),t),t=Ya(e,t,i,r,n);break e}else for(st=er(t.stateNode.containerInfo.firstChild),ot=t,Ce=!0,Ct=null,r=qu(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Yr(),i===n){t=zt(e,t,r);break e}Ve(e,t,i,r)}t=t.child}return t;case 5:return Yu(t),e===null&&jo(t),i=t.type,n=t.pendingProps,h=e!==null?e.memoizedProps:null,_=n.children,Po(i,n)?_=null:h!==null&&Po(i,h)&&(t.flags|=32),Ch(e,t),Ve(e,t,_,r),t.child;case 6:return e===null&&jo(t),null;case 13:return xh(e,t,r);case 4:return Al(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Qr(t,null,i,r):Ve(e,t,i,r),t.child;case 11:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:yt(i,n),qa(e,t,i,n,r);case 7:return Ve(e,t,t.pendingProps,r),t.child;case 8:return Ve(e,t,t.pendingProps.children,r),t.child;case 12:return Ve(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,n=t.pendingProps,h=t.memoizedProps,_=n.value,ve(Gn,i._currentValue),i._currentValue=_,h!==null)if(bt(h.value,_)){if(h.children===n.children&&!Je.current){t=zt(e,t,r);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var l=h.dependencies;if(l!==null){_=h.child;for(var u=l.firstContext;u!==null;){if(u.context===i){if(h.tag===1){u=jt(-1,r&-r),u.tag=2;var f=h.updateQueue;if(f!==null){f=f.shared;var S=f.pending;S===null?u.next=u:(u.next=S.next,S.next=u),f.pending=u}}h.lanes|=r,u=h.alternate,u!==null&&(u.lanes|=r),Io(h.return,r,t),l.lanes|=r;break}u=u.next}}else if(h.tag===10)_=h.type===t.type?null:h.child;else if(h.tag===18){if(_=h.return,_===null)throw Error(G(341));_.lanes|=r,l=_.alternate,l!==null&&(l.lanes|=r),Io(_,r,t),_=h.sibling}else _=h.child;if(_!==null)_.return=h;else for(_=h;_!==null;){if(_===t){_=null;break}if(h=_.sibling,h!==null){h.return=_.return,_=h;break}_=_.return}h=_}Ve(e,t,n.children,r),t=t.child}return t;case 9:return n=t.type,i=t.pendingProps.children,Kr(t,r),n=vt(n),i=i(n),t.flags|=1,Ve(e,t,i,r),t.child;case 14:return i=t.type,n=yt(i,t.pendingProps),n=yt(i.type,n),Ga(e,t,i,n,r);case 15:return yh(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:yt(i,n),An(e,t),t.tag=1,Ze(i)?(e=!0,Vn(t)):e=!1,Kr(t,r),vh(t,i,n),Ho(t,i,n,r),Uo(null,t,i,!0,e,r);case 19:return bh(e,t,r);case 22:return Sh(e,t,r)}throw Error(G(156,t.tag))};function Hh(e,t){return fu(e,t)}function T_(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pt(e,t,r,i){return new T_(e,t,r,i)}function Kl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function A_(e){if(typeof e=="function")return Kl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hl)return 11;if(e===dl)return 14}return 2}function nr(e,t){var r=e.alternate;return r===null?(r=pt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Bn(e,t,r,i,n,h){var _=2;if(i=e,typeof e=="function")Kl(e)&&(_=1);else if(typeof e=="string")_=5;else e:switch(e){case Tr:return gr(r.children,n,h,t);case ul:_=8,n|=8;break;case co:return e=pt(12,r,t,n|2),e.elementType=co,e.lanes=h,e;case uo:return e=pt(13,r,t,n),e.elementType=uo,e.lanes=h,e;case ho:return e=pt(19,r,t,n),e.elementType=ho,e.lanes=h,e;case Yc:return Ss(r,n,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Gc:_=10;break e;case Xc:_=9;break e;case hl:_=11;break e;case dl:_=14;break e;case Vt:_=16,i=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=pt(_,r,t,n),t.elementType=e,t.type=i,t.lanes=h,t}function gr(e,t,r,i){return e=pt(7,e,i,t),e.lanes=r,e}function Ss(e,t,r,i){return e=pt(22,e,i,t),e.elementType=Yc,e.lanes=r,e.stateNode={isHidden:!1},e}function Zs(e,t,r){return e=pt(6,e,null,t),e.lanes=r,e}function eo(e,t,r){return t=pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function P_(e,t,r,i,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bs(0),this.expirationTimes=Bs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bs(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function ql(e,t,r,i,n,h,_,l,u){return e=new P_(e,t,r,l,u),t===1?(t=1,h===!0&&(t|=8)):t=0,h=pt(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tl(h),e}function M_(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function zh(e){if(!e)return lr;e=e._reactInternals;e:{if(Er(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ze(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var r=e.type;if(Ze(r))return zu(e,r,t)}return t}function $h(e,t,r,i,n,h,_,l,u){return e=ql(r,i,!0,e,n,h,_,l,u),e.context=zh(null),r=e.current,i=Ke(),n=ir(r),h=jt(i,n),h.callback=t??null,tr(r,h,n),e.current.lanes=n,Xi(e,n,i),et(e,i),e}function Cs(e,t,r,i){var n=t.current,h=Ke(),_=ir(n);return r=zh(r),t.context===null?t.context=r:t.pendingContext=r,t=jt(h,_),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=tr(n,t,_),e!==null&&(xt(e,n,_,h),Dn(e,n,_)),_}function ns(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function oc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Gl(e,t){oc(e,t),(e=e.alternate)&&oc(e,t)}function B_(){return null}var Uh=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xl(e){this._internalRoot=e}ws.prototype.render=Xl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Cs(e,t,null,null)};ws.prototype.unmount=Xl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xr(function(){Cs(null,e,null,null)}),t[Ft]=null}};function ws(e){this._internalRoot=e}ws.prototype.unstable_scheduleHydration=function(e){if(e){var t=Su();e={blockedOn:null,target:e,priority:t};for(var r=0;r<qt.length&&t!==0&&t<qt[r].priority;r++);qt.splice(r,0,e),r===0&&wu(e)}};function Yl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function lc(){}function O_(e,t,r,i,n){if(n){if(typeof i=="function"){var h=i;i=function(){var f=ns(_);h.call(f)}}var _=$h(t,i,e,0,null,!1,!1,"",lc);return e._reactRootContainer=_,e[Ft]=_.current,Ii(e.nodeType===8?e.parentNode:e),xr(),_}for(;n=e.lastChild;)e.removeChild(n);if(typeof i=="function"){var l=i;i=function(){var f=ns(u);l.call(f)}}var u=ql(e,0,!1,null,null,!1,!1,"",lc);return e._reactRootContainer=u,e[Ft]=u.current,Ii(e.nodeType===8?e.parentNode:e),xr(function(){Cs(t,u,r,i)}),u}function bs(e,t,r,i,n){var h=r._reactRootContainer;if(h){var _=h;if(typeof n=="function"){var l=n;n=function(){var u=ns(_);l.call(u)}}Cs(t,_,e,n)}else _=O_(r,t,e,n,i);return ns(_)}gu=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=vi(t.pendingLanes);r!==0&&(_l(t,r|1),et(t,Le()),!(he&6)&&(ei=Le()+500,ur()))}break;case 13:xr(function(){var i=Ht(e,1);if(i!==null){var n=Ke();xt(i,e,1,n)}}),Gl(e,1)}};vl=function(e){if(e.tag===13){var t=Ht(e,134217728);if(t!==null){var r=Ke();xt(t,e,134217728,r)}Gl(e,134217728)}};yu=function(e){if(e.tag===13){var t=ir(e),r=Ht(e,t);if(r!==null){var i=Ke();xt(r,e,t,i)}Gl(e,t)}};Su=function(){return de};Cu=function(e,t){var r=de;try{return de=e,t()}finally{de=r}};wo=function(e,t,r){switch(t){case"input":if(_o(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var n=ps(i);if(!n)throw Error(G(90));Jc(i),_o(i,n)}}}break;case"textarea":eu(e,r);break;case"select":t=r.value,t!=null&&$r(e,!!r.multiple,t,!1)}};lu=Ul;au=xr;var N_={usingClientEntryPoint:!1,Events:[Qi,Br,ps,su,ou,Ul]},di={findFiberByHostInstance:fr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},j_={bundleType:di.bundleType,version:di.version,rendererPackageName:di.rendererPackageName,rendererConfig:di.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$t.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=hu(e),e===null?null:e.stateNode},findFiberByHostInstance:di.findFiberByHostInstance||B_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yn=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yn.isDisabled&&yn.supportsFiber)try{us=yn.inject(j_),Dt=yn}catch{}}at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N_;at.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yl(t))throw Error(G(200));return M_(e,t,null,r)};at.createRoot=function(e,t){if(!Yl(e))throw Error(G(299));var r=!1,i="",n=Uh;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(n=t.onRecoverableError)),t=ql(e,1,!1,null,null,r,!1,i,n),e[Ft]=t.current,Ii(e.nodeType===8?e.parentNode:e),new Xl(t)};at.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=hu(t),e=e===null?null:e.stateNode,e};at.flushSync=function(e){return xr(e)};at.hydrate=function(e,t,r){if(!xs(t))throw Error(G(200));return bs(null,e,t,!0,r)};at.hydrateRoot=function(e,t,r){if(!Yl(e))throw Error(G(405));var i=r!=null&&r.hydratedSources||null,n=!1,h="",_=Uh;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onRecoverableError!==void 0&&(_=r.onRecoverableError)),t=$h(t,null,e,1,r??null,n,!1,h,_),e[Ft]=t.current,Ii(e),i)for(e=0;e<i.length;e++)r=i[e],n=r._getVersion,n=n(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,n]:t.mutableSourceEagerHydrationData.push(r,n);return new ws(t)};at.render=function(e,t,r){if(!xs(t))throw Error(G(200));return bs(null,e,t,!1,r)};at.unmountComponentAtNode=function(e){if(!xs(e))throw Error(G(40));return e._reactRootContainer?(xr(function(){bs(null,null,e,!1,function(){e._reactRootContainer=null,e[Ft]=null})}),!0):!1};at.unstable_batchedUpdates=Ul;at.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!xs(r))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return bs(e,t,r,!1,i)};at.version="18.3.1-next-f1338f8080-20240426";function Wh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wh)}catch(e){console.error(e)}}Wh(),Wc.exports=at;var I_=Wc.exports,ac=I_;lo.createRoot=ac.createRoot,lo.hydrateRoot=ac.hydrateRoot;function Vh(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=Vh(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function tt(){for(var e,t,r=0,i="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=Vh(e))&&(i&&(i+=" "),i+=t);return i}function Kh(e,t){const r=N.useRef(null);return N.useEffect(()=>{if(!e)return;const i=r.current;if(!i)return;const n=()=>Array.from(i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])"));requestAnimationFrame(()=>{const _=n(),l=_.find(u=>u.tagName!=="BUTTON")??_[0];l==null||l.focus()});const h=_=>{if(_.key==="Escape"){_.preventDefault(),t();return}if(_.key!=="Tab")return;const l=n();if(l.length===0)return;const u=l[0],f=l[l.length-1];_.shiftKey?document.activeElement===u&&(_.preventDefault(),f.focus()):document.activeElement===f&&(_.preventDefault(),u.focus())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]),r}const F_=({isOpen:e,workspaces:t,onSubmit:r,onClose:i})=>{var m;const[n,h]=N.useState(((m=t[0])==null?void 0:m.id)||""),[_,l]=N.useState(""),[u,f]=N.useState(!1),S=Kh(e,i);N.useEffect(()=>{e&&t.length>0&&!n&&h(t[0].id)},[e,t,n]);const d=async C=>{if(C.preventDefault(),!u){f(!0);try{await r(_.trim(),n),l("")}finally{f(!1)}}};return e?L.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"deck-modal-title",children:L.jsxs("form",{className:"modal",ref:S,onSubmit:d,children:[L.jsx("div",{className:"text-[14px] font-semibold mb-3",id:"deck-modal-title",children:"デッキ作成"}),L.jsxs("label",{className:"grid gap-1 text-xs",children:[L.jsx("span",{children:"デッキ名 (任意)"}),L.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:_,placeholder:"空白のままでもOK",maxLength:100,onChange:C=>l(C.target.value)})]}),L.jsxs("label",{className:"grid gap-1 text-xs mt-3",children:[L.jsx("span",{children:"ワークスペース"}),L.jsx("select",{className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:n,onChange:C=>h(C.target.value),children:t.map(C=>L.jsx("option",{value:C.id,children:C.path},C.id))})]}),L.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:u,children:"キャンセル"}),L.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u,children:u?"作成中...":"作成"})]})]})}):null};function H_({activeView:e,onSelect:t,theme:r,onToggleTheme:i,onOpenSettings:n}){return L.jsxs("nav",{className:"activity-bar",children:[L.jsxs("div",{className:"activity-bar-top",children:[L.jsx("button",{type:"button",className:tt("activity-bar-item",e==="workspace"&&"active"),onClick:()=>t("workspace"),"aria-label":"Explorer",title:"Explorer (Ctrl+Shift+E)",children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M17.5 0h-9L7 1.5V6H2.5L1 7.5v15.07L2.5 24h12.07L16 22.57V18h4.7l1.3-1.43V4.5L17.5 0zm0 2.12l2.38 2.38H17.5V2.12zm-3 20.38h-12v-15H7v9.07L8.5 18h6v4.5zm6-6h-12v-15H16V6h4.5v10.5z",fill:"currentColor"})})}),L.jsx("button",{type:"button",className:tt("activity-bar-item",e==="terminal"&&"active"),onClick:()=>t("terminal"),"aria-label":"Terminal",title:"Terminal (Ctrl+`)",children:L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M21 4H3a1 1 0 00-1 1v14a1 1 0 001 1h18a1 1 0 001-1V5a1 1 0 00-1-1zM4 18V6h16v12H4z",fill:"currentColor"}),L.jsx("path",{d:"M6.5 15.5L10 12 6.5 8.5 8 7l5 5-5 5-1.5-1.5z",fill:"currentColor"}),L.jsx("path",{d:"M13 14h5v2h-5z",fill:"currentColor"})]})})]}),L.jsxs("div",{className:"activity-bar-bottom",children:[L.jsx("button",{type:"button",className:"activity-bar-item",onClick:i,"aria-label":"Toggle Theme",title:r==="dark"?"Switch to Light Theme":"Switch to Dark Theme",children:r==="dark"?L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 000-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z",fill:"currentColor"})}):L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M12 3a9 9 0 109 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 01-4.4 2.26 5.403 5.403 0 01-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"})})}),L.jsx("button",{type:"button",className:"activity-bar-item",onClick:n,"aria-label":"Settings",title:"Settings",children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z",fill:"currentColor"})})})]})]})}const z_=({message:e})=>e?L.jsx("div",{className:"status-float",role:"status",children:e}):null;var qh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={4567:function(_,l,u){var f=this&&this.__decorate||function(c,p,v,x){var b,y=arguments.length,k=y<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(c,p,v,x);else for(var R=c.length-1;R>=0;R--)(b=c[R])&&(k=(y<3?b(k):y>3?b(p,v,k):b(p,v))||k);return y>3&&k&&Object.defineProperty(p,v,k),k},S=this&&this.__param||function(c,p){return function(v,x){p(v,x,c)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const d=u(9042),m=u(6114),C=u(9924),w=u(844),g=u(5596),a=u(4725),o=u(3656);let s=l.AccessibilityManager=class extends w.Disposable{constructor(c,p){super(),this._terminal=c,this._renderService=p,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let v=0;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);if(this._topBoundaryFocusListener=v=>this._handleBoundaryFocus(v,0),this._bottomBoundaryFocusListener=v=>this._handleBoundaryFocus(v,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=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new C.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(v=>this._handleResize(v.rows))),this.register(this._terminal.onRender(v=>this._refreshRows(v.start,v.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(v=>this._handleChar(v))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
40
+ `+h.stack}return{value:e,source:t,stack:n,digest:null}}function Qs(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function zo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var f_=typeof WeakMap=="function"?WeakMap:Map;function mh(e,t,r){r=jt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){ts||(ts=!0,Qo=i),zo(e,t)},r}function gh(e,t,r){r=jt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var n=t.value;r.payload=function(){return i(n)},r.callback=function(){zo(e,t)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(r.callback=function(){zo(e,t),typeof i!="function"&&(rr===null?rr=new Set([this]):rr.add(this));var _=t.stack;this.componentDidCatch(t.value,{componentStack:_!==null?_:""})}),r}function Wa(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new f_;var n=new Set;i.set(t,n)}else n=i.get(t),n===void 0&&(n=new Set,i.set(t,n));n.has(r)||(n.add(r),e=L_.bind(null,e,t,r),t.then(e,e))}function Va(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Ka(e,t,r,i,n){return e.mode&1?(e.flags|=65536,e.lanes=n,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=jt(-1,1),t.tag=2,tr(r,t,1))),r.lanes|=1),e)}var p_=$t.ReactCurrentOwner,Je=!1;function Ke(e,t,r,i){t.child=e===null?qu(t,null,r,i):Qr(t,e.child,r,i)}function qa(e,t,r,i,n){r=r.render;var h=t.ref;return Kr(t,n),i=Ol(e,t,r,i,h,n),r=Nl(),e!==null&&!Je?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,zt(e,t,n)):(Ce&&r&&xl(t),t.flags|=1,Ke(e,t,i,n),t.child)}function Ga(e,t,r,i,n){if(e===null){var h=r.type;return typeof h=="function"&&!Kl(h)&&h.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=h,yh(e,t,h,i,n)):(e=Bn(r.type,null,i,t,t.mode,n),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!(e.lanes&n)){var _=h.memoizedProps;if(r=r.compare,r=r!==null?r:ji,r(_,i)&&e.ref===t.ref)return zt(e,t,n)}return t.flags|=1,e=nr(h,i),e.ref=t.ref,e.return=t,t.child=e}function yh(e,t,r,i,n){if(e!==null){var h=e.memoizedProps;if(ji(h,i)&&e.ref===t.ref)if(Je=!1,t.pendingProps=i=h,(e.lanes&n)!==0)e.flags&131072&&(Je=!0);else return t.lanes=e.lanes,zt(e,t,n)}return $o(e,t,r,i,n)}function Sh(e,t,r){var i=t.pendingProps,n=i.children,h=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ve(Hr,it),it|=r;else{if(!(r&1073741824))return e=h!==null?h.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ve(Hr,it),it|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=h!==null?h.baseLanes:r,ve(Hr,it),it|=i}else h!==null?(i=h.baseLanes|r,t.memoizedState=null):i=r,ve(Hr,it),it|=i;return Ke(e,t,n,r),t.child}function Ch(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function $o(e,t,r,i,n){var h=et(r)?yr:Ue.current;return h=Xr(t,h),Kr(t,n),r=Ol(e,t,r,i,h,n),i=Nl(),e!==null&&!Je?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n,zt(e,t,n)):(Ce&&i&&xl(t),t.flags|=1,Ke(e,t,r,n),t.child)}function Xa(e,t,r,i,n){if(et(r)){var h=!0;Vn(t)}else h=!1;if(Kr(t,n),t.stateNode===null)An(e,t),vh(t,r,i),Ho(t,r,i,n),i=!0;else if(e===null){var _=t.stateNode,l=t.memoizedProps;_.props=l;var u=_.context,f=r.contextType;typeof f=="object"&&f!==null?f=vt(f):(f=et(r)?yr:Ue.current,f=Xr(t,f));var y=r.getDerivedStateFromProps,d=typeof y=="function"||typeof _.getSnapshotBeforeUpdate=="function";d||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(l!==i||u!==f)&&Ua(t,_,i,f),Kt=!1;var m=t.memoizedState;_.state=m,Yn(t,i,_,n),u=t.memoizedState,l!==i||m!==u||Ze.current||Kt?(typeof y=="function"&&(Fo(t,r,y,i),u=t.memoizedState),(l=Kt||$a(t,r,l,i,m,u,f))?(d||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(t.flags|=4194308)):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=u),_.props=i,_.state=u,_.context=f,i=l):(typeof _.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{_=t.stateNode,Xu(e,t),l=t.memoizedProps,f=t.type===t.elementType?l:yt(t.type,l),_.props=f,d=t.pendingProps,m=_.context,u=r.contextType,typeof u=="object"&&u!==null?u=vt(u):(u=et(r)?yr:Ue.current,u=Xr(t,u));var C=r.getDerivedStateFromProps;(y=typeof C=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(l!==d||m!==u)&&Ua(t,_,i,u),Kt=!1,m=t.memoizedState,_.state=m,Yn(t,i,_,n);var w=t.memoizedState;l!==d||m!==w||Ze.current||Kt?(typeof C=="function"&&(Fo(t,r,C,i),w=t.memoizedState),(f=Kt||$a(t,r,f,i,m,w,u)||!1)?(y||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(i,w,u),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(i,w,u)),typeof _.componentDidUpdate=="function"&&(t.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof _.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=w),_.props=i,_.state=w,_.context=u,i=f):(typeof _.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),i=!1)}return Uo(e,t,r,i,h,n)}function Uo(e,t,r,i,n,h){Ch(e,t);var _=(t.flags&128)!==0;if(!i&&!_)return n&&Ba(t,r,!1),zt(e,t,h);i=t.stateNode,p_.current=t;var l=_&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&_?(t.child=Qr(t,e.child,null,h),t.child=Qr(t,null,l,h)):Ke(e,t,l,h),t.memoizedState=i.state,n&&Ba(t,r,!0),t.child}function wh(e){var t=e.stateNode;t.pendingContext?Ma(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ma(e,t.context,!1),Al(e,t.containerInfo)}function Ya(e,t,r,i,n){return Yr(),El(n),t.flags|=256,Ke(e,t,r,i),t.child}var Wo={dehydrated:null,treeContext:null,retryLane:0};function Vo(e){return{baseLanes:e,cachePool:null,transitions:null}}function xh(e,t,r){var i=t.pendingProps,n=xe.current,h=!1,_=(t.flags&128)!==0,l;if((l=_)||(l=e!==null&&e.memoizedState===null?!1:(n&2)!==0),l?(h=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(n|=1),ve(xe,n&1),e===null)return jo(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(_=i.children,e=i.fallback,h?(i=t.mode,h=t.child,_={mode:"hidden",children:_},!(i&1)&&h!==null?(h.childLanes=0,h.pendingProps=_):h=Ss(_,i,0,null),e=gr(e,i,r,null),h.return=t,e.return=t,h.sibling=e,t.child=h,t.child.memoizedState=Vo(r),t.memoizedState=Wo,e):Fl(t,_));if(n=e.memoizedState,n!==null&&(l=n.dehydrated,l!==null))return __(e,t,_,i,l,n,r);if(h){h=i.fallback,_=t.mode,n=e.child,l=n.sibling;var u={mode:"hidden",children:i.children};return!(_&1)&&t.child!==n?(i=t.child,i.childLanes=0,i.pendingProps=u,t.deletions=null):(i=nr(n,u),i.subtreeFlags=n.subtreeFlags&14680064),l!==null?h=nr(l,h):(h=gr(h,_,r,null),h.flags|=2),h.return=t,i.return=t,i.sibling=h,t.child=i,i=h,h=t.child,_=e.child.memoizedState,_=_===null?Vo(r):{baseLanes:_.baseLanes|r,cachePool:null,transitions:_.transitions},h.memoizedState=_,h.childLanes=e.childLanes&~r,t.memoizedState=Wo,i}return h=e.child,e=h.sibling,i=nr(h,{mode:"visible",children:i.children}),!(t.mode&1)&&(i.lanes=r),i.return=t,i.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Fl(e,t){return t=Ss({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function vn(e,t,r,i){return i!==null&&El(i),Qr(t,e.child,null,r),e=Fl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function __(e,t,r,i,n,h,_){if(r)return t.flags&256?(t.flags&=-257,i=Qs(Error(G(422))),vn(e,t,_,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(h=i.fallback,n=t.mode,i=Ss({mode:"visible",children:i.children},n,0,null),h=gr(h,n,_,null),h.flags|=2,i.return=t,h.return=t,i.sibling=h,t.child=i,t.mode&1&&Qr(t,e.child,null,_),t.child.memoizedState=Vo(_),t.memoizedState=Wo,h);if(!(t.mode&1))return vn(e,t,_,null);if(n.data==="$!"){if(i=n.nextSibling&&n.nextSibling.dataset,i)var l=i.dgst;return i=l,h=Error(G(419)),i=Qs(h,i,void 0),vn(e,t,_,i)}if(l=(_&e.childLanes)!==0,Je||l){if(i=Me,i!==null){switch(_&-_){case 4:n=2;break;case 16:n=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:n=32;break;case 536870912:n=268435456;break;default:n=0}n=n&(i.suspendedLanes|_)?0:n,n!==0&&n!==h.retryLane&&(h.retryLane=n,Ht(e,n),xt(i,e,n,-1))}return Vl(),i=Qs(Error(G(421))),vn(e,t,_,i)}return n.data==="$?"?(t.flags|=128,t.child=e.child,t=D_.bind(null,e),n._reactRetry=t,null):(e=h.treeContext,st=er(n.nextSibling),ot=t,Ce=!0,Ct=null,e!==null&&(dt[ft++]=Ot,dt[ft++]=Nt,dt[ft++]=Sr,Ot=e.id,Nt=e.overflow,Sr=t),t=Fl(t,i.children),t.flags|=4096,t)}function Qa(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Io(e.return,t,r)}function Js(e,t,r,i,n){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:n}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=r,h.tailMode=n)}function bh(e,t,r){var i=t.pendingProps,n=i.revealOrder,h=i.tail;if(Ke(e,t,i.children,r),i=xe.current,i&2)i=i&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Qa(e,r,t);else if(e.tag===19)Qa(e,r,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}i&=1}if(ve(xe,i),!(t.mode&1))t.memoizedState=null;else switch(n){case"forwards":for(r=t.child,n=null;r!==null;)e=r.alternate,e!==null&&Qn(e)===null&&(n=r),r=r.sibling;r=n,r===null?(n=t.child,t.child=null):(n=r.sibling,r.sibling=null),Js(t,!1,n,r,h);break;case"backwards":for(r=null,n=t.child,t.child=null;n!==null;){if(e=n.alternate,e!==null&&Qn(e)===null){t.child=n;break}e=n.sibling,n.sibling=r,r=n,n=e}Js(t,!0,r,null,h);break;case"together":Js(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function An(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function zt(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),wr|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,r=nr(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=nr(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function v_(e,t,r){switch(t.tag){case 3:wh(t),Yr();break;case 5:Yu(t);break;case 1:et(t.type)&&Vn(t);break;case 4:Al(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,n=t.memoizedProps.value;ve(Gn,i._currentValue),i._currentValue=n;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(ve(xe,xe.current&1),t.flags|=128,null):r&t.child.childLanes?xh(e,t,r):(ve(xe,xe.current&1),e=zt(e,t,r),e!==null?e.sibling:null);ve(xe,xe.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return bh(e,t,r);t.flags|=128}if(n=t.memoizedState,n!==null&&(n.rendering=null,n.tail=null,n.lastEffect=null),ve(xe,xe.current),i)break;return null;case 22:case 23:return t.lanes=0,Sh(e,t,r)}return zt(e,t,r)}var Eh,Ko,kh,Lh;Eh=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Ko=function(){};kh=function(e,t,r,i){var n=e.memoizedProps;if(n!==i){e=t.stateNode,_r(Rt.current);var h=null;switch(r){case"input":n=po(e,n),i=po(e,i),h=[];break;case"select":n=Ee({},n,{value:void 0}),i=Ee({},i,{value:void 0}),h=[];break;case"textarea":n=mo(e,n),i=mo(e,i),h=[];break;default:typeof n.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Un)}yo(r,i);var _;r=null;for(f in n)if(!i.hasOwnProperty(f)&&n.hasOwnProperty(f)&&n[f]!=null)if(f==="style"){var l=n[f];for(_ in l)l.hasOwnProperty(_)&&(r||(r={}),r[_]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Ti.hasOwnProperty(f)?h||(h=[]):(h=h||[]).push(f,null));for(f in i){var u=i[f];if(l=n!=null?n[f]:void 0,i.hasOwnProperty(f)&&u!==l&&(u!=null||l!=null))if(f==="style")if(l){for(_ in l)!l.hasOwnProperty(_)||u&&u.hasOwnProperty(_)||(r||(r={}),r[_]="");for(_ in u)u.hasOwnProperty(_)&&l[_]!==u[_]&&(r||(r={}),r[_]=u[_])}else r||(h||(h=[]),h.push(f,r)),r=u;else f==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,l=l?l.__html:void 0,u!=null&&l!==u&&(h=h||[]).push(f,u)):f==="children"?typeof u!="string"&&typeof u!="number"||(h=h||[]).push(f,""+u):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Ti.hasOwnProperty(f)?(u!=null&&f==="onScroll"&&ye("scroll",e),h||l===u||(h=[])):(h=h||[]).push(f,u))}r&&(h=h||[]).push("style",r);var f=h;(t.updateQueue=f)&&(t.flags|=4)}};Lh=function(e,t,r,i){r!==i&&(t.flags|=4)};function hi(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags&14680064,i|=n.flags&14680064,n.return=e,n=n.sibling;else for(n=e.child;n!==null;)r|=n.lanes|n.childLanes,i|=n.subtreeFlags,i|=n.flags,n.return=e,n=n.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function m_(e,t,r){var i=t.pendingProps;switch(bl(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ze(t),null;case 1:return et(t.type)&&Wn(),ze(t),null;case 3:return i=t.stateNode,Jr(),Se(Ze),Se(Ue),Ml(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(pn(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ct!==null&&(el(Ct),Ct=null))),Ko(e,t),ze(t),null;case 5:Pl(t);var n=_r($i.current);if(r=t.type,e!==null&&t.stateNode!=null)kh(e,t,r,i,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(G(166));return ze(t),null}if(e=_r(Rt.current),pn(t)){i=t.stateNode,r=t.type;var h=t.memoizedProps;switch(i[Lt]=t,i[Hi]=h,e=(t.mode&1)!==0,r){case"dialog":ye("cancel",i),ye("close",i);break;case"iframe":case"object":case"embed":ye("load",i);break;case"video":case"audio":for(n=0;n<mi.length;n++)ye(mi[n],i);break;case"source":ye("error",i);break;case"img":case"image":case"link":ye("error",i),ye("load",i);break;case"details":ye("toggle",i);break;case"input":oa(i,h),ye("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!h.multiple},ye("invalid",i);break;case"textarea":aa(i,h),ye("invalid",i)}yo(r,h),n=null;for(var _ in h)if(h.hasOwnProperty(_)){var l=h[_];_==="children"?typeof l=="string"?i.textContent!==l&&(h.suppressHydrationWarning!==!0&&fn(i.textContent,l,e),n=["children",l]):typeof l=="number"&&i.textContent!==""+l&&(h.suppressHydrationWarning!==!0&&fn(i.textContent,l,e),n=["children",""+l]):Ti.hasOwnProperty(_)&&l!=null&&_==="onScroll"&&ye("scroll",i)}switch(r){case"input":sn(i),la(i,h,!0);break;case"textarea":sn(i),ca(i);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(i.onclick=Un)}i=n,t.updateQueue=i,i!==null&&(t.flags|=4)}else{_=n.nodeType===9?n:n.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=tu(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=_.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=_.createElement(r,{is:i.is}):(e=_.createElement(r),r==="select"&&(_=e,i.multiple?_.multiple=!0:i.size&&(_.size=i.size))):e=_.createElementNS(e,r),e[Lt]=t,e[Hi]=i,Eh(e,t,!1,!1),t.stateNode=e;e:{switch(_=So(r,i),r){case"dialog":ye("cancel",e),ye("close",e),n=i;break;case"iframe":case"object":case"embed":ye("load",e),n=i;break;case"video":case"audio":for(n=0;n<mi.length;n++)ye(mi[n],e);n=i;break;case"source":ye("error",e),n=i;break;case"img":case"image":case"link":ye("error",e),ye("load",e),n=i;break;case"details":ye("toggle",e),n=i;break;case"input":oa(e,i),n=po(e,i),ye("invalid",e);break;case"option":n=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},n=Ee({},i,{value:void 0}),ye("invalid",e);break;case"textarea":aa(e,i),n=mo(e,i),ye("invalid",e);break;default:n=i}yo(r,n),l=n;for(h in l)if(l.hasOwnProperty(h)){var u=l[h];h==="style"?nu(e,u):h==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&ru(e,u)):h==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Ai(e,u):typeof u=="number"&&Ai(e,""+u):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(Ti.hasOwnProperty(h)?u!=null&&h==="onScroll"&&ye("scroll",e):u!=null&&cl(e,h,u,_))}switch(r){case"input":sn(e),la(e,i,!1);break;case"textarea":sn(e),ca(e);break;case"option":i.value!=null&&e.setAttribute("value",""+or(i.value));break;case"select":e.multiple=!!i.multiple,h=i.value,h!=null?$r(e,!!i.multiple,h,!1):i.defaultValue!=null&&$r(e,!!i.multiple,i.defaultValue,!0);break;default:typeof n.onClick=="function"&&(e.onclick=Un)}switch(r){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}}i&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return ze(t),null;case 6:if(e&&t.stateNode!=null)Lh(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(G(166));if(r=_r($i.current),_r(Rt.current),pn(t)){if(i=t.stateNode,r=t.memoizedProps,i[Lt]=t,(h=i.nodeValue!==r)&&(e=ot,e!==null))switch(e.tag){case 3:fn(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&fn(i.nodeValue,r,(e.mode&1)!==0)}h&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[Lt]=t,t.stateNode=i}return ze(t),null;case 13:if(Se(xe),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ce&&st!==null&&t.mode&1&&!(t.flags&128))Vu(),Yr(),t.flags|=98560,h=!1;else if(h=pn(t),i!==null&&i.dehydrated!==null){if(e===null){if(!h)throw Error(G(318));if(h=t.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(G(317));h[Lt]=t}else Yr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;ze(t),h=!1}else Ct!==null&&(el(Ct),Ct=null),h=!0;if(!h)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(i=i!==null,i!==(e!==null&&e.memoizedState!==null)&&i&&(t.child.flags|=8192,t.mode&1&&(e===null||xe.current&1?Te===0&&(Te=3):Vl())),t.updateQueue!==null&&(t.flags|=4),ze(t),null);case 4:return Jr(),Ko(e,t),e===null&&Ii(t.stateNode.containerInfo),ze(t),null;case 10:return Dl(t.type._context),ze(t),null;case 17:return et(t.type)&&Wn(),ze(t),null;case 19:if(Se(xe),h=t.memoizedState,h===null)return ze(t),null;if(i=(t.flags&128)!==0,_=h.rendering,_===null)if(i)hi(h,!1);else{if(Te!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(_=Qn(e),_!==null){for(t.flags|=128,hi(h,!1),i=_.updateQueue,i!==null&&(t.updateQueue=i,t.flags|=4),t.subtreeFlags=0,i=r,r=t.child;r!==null;)h=r,e=i,h.flags&=14680066,_=h.alternate,_===null?(h.childLanes=0,h.lanes=e,h.child=null,h.subtreeFlags=0,h.memoizedProps=null,h.memoizedState=null,h.updateQueue=null,h.dependencies=null,h.stateNode=null):(h.childLanes=_.childLanes,h.lanes=_.lanes,h.child=_.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=_.memoizedProps,h.memoizedState=_.memoizedState,h.updateQueue=_.updateQueue,h.type=_.type,e=_.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return ve(xe,xe.current&1|2),t.child}e=e.sibling}h.tail!==null&&Le()>ei&&(t.flags|=128,i=!0,hi(h,!1),t.lanes=4194304)}else{if(!i)if(e=Qn(_),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),hi(h,!0),h.tail===null&&h.tailMode==="hidden"&&!_.alternate&&!Ce)return ze(t),null}else 2*Le()-h.renderingStartTime>ei&&r!==1073741824&&(t.flags|=128,i=!0,hi(h,!1),t.lanes=4194304);h.isBackwards?(_.sibling=t.child,t.child=_):(r=h.last,r!==null?r.sibling=_:t.child=_,h.last=_)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=Le(),t.sibling=null,r=xe.current,ve(xe,i?r&1|2:r&1),t):(ze(t),null);case 22:case 23:return Wl(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?it&1073741824&&(ze(t),t.subtreeFlags&6&&(t.flags|=8192)):ze(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function g_(e,t){switch(bl(t),t.tag){case 1:return et(t.type)&&Wn(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Jr(),Se(Ze),Se(Ue),Ml(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Pl(t),null;case 13:if(Se(xe),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));Yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Se(xe),null;case 4:return Jr(),null;case 10:return Dl(t.type._context),null;case 22:case 23:return Wl(),null;case 24:return null;default:return null}}var mn=!1,$e=!1,y_=typeof WeakSet=="function"?WeakSet:Set,Z=null;function Fr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){ke(e,t,i)}else r.current=null}function qo(e,t,r){try{r()}catch(i){ke(e,t,i)}}var Ja=!1;function S_(e,t){if(To=Hn,e=Pu(),wl(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var n=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var _=0,l=-1,u=-1,f=0,y=0,d=e,m=null;t:for(;;){for(var C;d!==r||n!==0&&d.nodeType!==3||(l=_+n),d!==h||i!==0&&d.nodeType!==3||(u=_+i),d.nodeType===3&&(_+=d.nodeValue.length),(C=d.firstChild)!==null;)m=d,d=C;for(;;){if(d===e)break t;if(m===r&&++f===n&&(l=_),m===h&&++y===i&&(u=_),(C=d.nextSibling)!==null)break;d=m,m=d.parentNode}d=C}r=l===-1||u===-1?null:{start:l,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(Ao={focusedElem:e,selectionRange:r},Hn=!1,Z=t;Z!==null;)if(t=Z,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Z=e;else for(;Z!==null;){t=Z;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var g=w.memoizedProps,a=w.memoizedState,o=t.stateNode,s=o.getSnapshotBeforeUpdate(t.elementType===t.type?g:yt(t.type,g),a);o.__reactInternalSnapshotBeforeUpdate=s}break;case 3:var c=t.stateNode.containerInfo;c.nodeType===1?c.textContent="":c.nodeType===9&&c.documentElement&&c.removeChild(c.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(p){ke(t,t.return,p)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return w=Ja,Ja=!1,w}function ki(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var n=i=i.next;do{if((n.tag&e)===e){var h=n.destroy;n.destroy=void 0,h!==void 0&&qo(t,r,h)}n=n.next}while(n!==i)}}function gs(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var i=r.create;r.destroy=i()}r=r.next}while(r!==t)}}function Go(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Dh(e){var t=e.alternate;t!==null&&(e.alternate=null,Dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Lt],delete t[Hi],delete t[Bo],delete t[r_],delete t[i_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Rh(e){return e.tag===5||e.tag===3||e.tag===4}function Za(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Rh(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.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 Xo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=Un));else if(i!==4&&(e=e.child,e!==null))for(Xo(e,t,r),e=e.sibling;e!==null;)Xo(e,t,r),e=e.sibling}function Yo(e,t,r){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(i!==4&&(e=e.child,e!==null))for(Yo(e,t,r),e=e.sibling;e!==null;)Yo(e,t,r),e=e.sibling}var Oe=null,St=!1;function Wt(e,t,r){for(r=r.child;r!==null;)Th(e,t,r),r=r.sibling}function Th(e,t,r){if(Dt&&typeof Dt.onCommitFiberUnmount=="function")try{Dt.onCommitFiberUnmount(us,r)}catch{}switch(r.tag){case 5:$e||Fr(r,t);case 6:var i=Oe,n=St;Oe=null,Wt(e,t,r),Oe=i,St=n,Oe!==null&&(St?(e=Oe,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Oe.removeChild(r.stateNode));break;case 18:Oe!==null&&(St?(e=Oe,r=r.stateNode,e.nodeType===8?Vs(e.parentNode,r):e.nodeType===1&&Vs(e,r),Oi(e)):Vs(Oe,r.stateNode));break;case 4:i=Oe,n=St,Oe=r.stateNode.containerInfo,St=!0,Wt(e,t,r),Oe=i,St=n;break;case 0:case 11:case 14:case 15:if(!$e&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){n=i=i.next;do{var h=n,_=h.destroy;h=h.tag,_!==void 0&&(h&2||h&4)&&qo(r,t,_),n=n.next}while(n!==i)}Wt(e,t,r);break;case 1:if(!$e&&(Fr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(l){ke(r,t,l)}Wt(e,t,r);break;case 21:Wt(e,t,r);break;case 22:r.mode&1?($e=(i=$e)||r.memoizedState!==null,Wt(e,t,r),$e=i):Wt(e,t,r);break;default:Wt(e,t,r)}}function ec(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new y_),t.forEach(function(i){var n=R_.bind(null,e,i);r.has(i)||(r.add(i),i.then(n,n))})}}function gt(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var n=r[i];try{var h=e,_=t,l=_;e:for(;l!==null;){switch(l.tag){case 5:Oe=l.stateNode,St=!1;break e;case 3:Oe=l.stateNode.containerInfo,St=!0;break e;case 4:Oe=l.stateNode.containerInfo,St=!0;break e}l=l.return}if(Oe===null)throw Error(G(160));Th(h,_,n),Oe=null,St=!1;var u=n.alternate;u!==null&&(u.return=null),n.return=null}catch(f){ke(n,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Ah(t,e),t=t.sibling}function Ah(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gt(t,e),Et(e),i&4){try{ki(3,e,e.return),gs(3,e)}catch(g){ke(e,e.return,g)}try{ki(5,e,e.return)}catch(g){ke(e,e.return,g)}}break;case 1:gt(t,e),Et(e),i&512&&r!==null&&Fr(r,r.return);break;case 5:if(gt(t,e),Et(e),i&512&&r!==null&&Fr(r,r.return),e.flags&32){var n=e.stateNode;try{Ai(n,"")}catch(g){ke(e,e.return,g)}}if(i&4&&(n=e.stateNode,n!=null)){var h=e.memoizedProps,_=r!==null?r.memoizedProps:h,l=e.type,u=e.updateQueue;if(e.updateQueue=null,u!==null)try{l==="input"&&h.type==="radio"&&h.name!=null&&Zc(n,h),So(l,_);var f=So(l,h);for(_=0;_<u.length;_+=2){var y=u[_],d=u[_+1];y==="style"?nu(n,d):y==="dangerouslySetInnerHTML"?ru(n,d):y==="children"?Ai(n,d):cl(n,y,d,f)}switch(l){case"input":_o(n,h);break;case"textarea":eu(n,h);break;case"select":var m=n._wrapperState.wasMultiple;n._wrapperState.wasMultiple=!!h.multiple;var C=h.value;C!=null?$r(n,!!h.multiple,C,!1):m!==!!h.multiple&&(h.defaultValue!=null?$r(n,!!h.multiple,h.defaultValue,!0):$r(n,!!h.multiple,h.multiple?[]:"",!1))}n[Hi]=h}catch(g){ke(e,e.return,g)}}break;case 6:if(gt(t,e),Et(e),i&4){if(e.stateNode===null)throw Error(G(162));n=e.stateNode,h=e.memoizedProps;try{n.nodeValue=h}catch(g){ke(e,e.return,g)}}break;case 3:if(gt(t,e),Et(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Oi(t.containerInfo)}catch(g){ke(e,e.return,g)}break;case 4:gt(t,e),Et(e);break;case 13:gt(t,e),Et(e),n=e.child,n.flags&8192&&(h=n.memoizedState!==null,n.stateNode.isHidden=h,!h||n.alternate!==null&&n.alternate.memoizedState!==null||($l=Le())),i&4&&ec(e);break;case 22:if(y=r!==null&&r.memoizedState!==null,e.mode&1?($e=(f=$e)||y,gt(t,e),$e=f):gt(t,e),Et(e),i&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!y&&e.mode&1)for(Z=e,y=e.child;y!==null;){for(d=Z=y;Z!==null;){switch(m=Z,C=m.child,m.tag){case 0:case 11:case 14:case 15:ki(4,m,m.return);break;case 1:Fr(m,m.return);var w=m.stateNode;if(typeof w.componentWillUnmount=="function"){i=m,r=m.return;try{t=i,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(g){ke(i,r,g)}}break;case 5:Fr(m,m.return);break;case 22:if(m.memoizedState!==null){rc(d);continue}}C!==null?(C.return=m,Z=C):rc(d)}y=y.sibling}e:for(y=null,d=e;;){if(d.tag===5){if(y===null){y=d;try{n=d.stateNode,f?(h=n.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(l=d.stateNode,u=d.memoizedProps.style,_=u!=null&&u.hasOwnProperty("display")?u.display:null,l.style.display=iu("display",_))}catch(g){ke(e,e.return,g)}}}else if(d.tag===6){if(y===null)try{d.stateNode.nodeValue=f?"":d.memoizedProps}catch(g){ke(e,e.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;y===d&&(y=null),d=d.return}y===d&&(y=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:gt(t,e),Et(e),i&4&&ec(e);break;case 21:break;default:gt(t,e),Et(e)}}function Et(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Rh(r)){var i=r;break e}r=r.return}throw Error(G(160))}switch(i.tag){case 5:var n=i.stateNode;i.flags&32&&(Ai(n,""),i.flags&=-33);var h=Za(e);Yo(e,h,n);break;case 3:case 4:var _=i.stateNode.containerInfo,l=Za(e);Xo(e,l,_);break;default:throw Error(G(161))}}catch(u){ke(e,e.return,u)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function C_(e,t,r){Z=e,Ph(e)}function Ph(e,t,r){for(var i=(e.mode&1)!==0;Z!==null;){var n=Z,h=n.child;if(n.tag===22&&i){var _=n.memoizedState!==null||mn;if(!_){var l=n.alternate,u=l!==null&&l.memoizedState!==null||$e;l=mn;var f=$e;if(mn=_,($e=u)&&!f)for(Z=n;Z!==null;)_=Z,u=_.child,_.tag===22&&_.memoizedState!==null?ic(n):u!==null?(u.return=_,Z=u):ic(n);for(;h!==null;)Z=h,Ph(h),h=h.sibling;Z=n,mn=l,$e=f}tc(e)}else n.subtreeFlags&8772&&h!==null?(h.return=n,Z=h):tc(e)}}function tc(e){for(;Z!==null;){var t=Z;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:$e||gs(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!$e)if(r===null)i.componentDidMount();else{var n=t.elementType===t.type?r.memoizedProps:yt(t.type,r.memoizedProps);i.componentDidUpdate(n,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var h=t.updateQueue;h!==null&&Fa(t,h,i);break;case 3:var _=t.updateQueue;if(_!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Fa(t,_,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var u=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":u.autoFocus&&r.focus();break;case"img":u.src&&(r.src=u.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var f=t.alternate;if(f!==null){var y=f.memoizedState;if(y!==null){var d=y.dehydrated;d!==null&&Oi(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}$e||t.flags&512&&Go(t)}catch(m){ke(t,t.return,m)}}if(t===e){Z=null;break}if(r=t.sibling,r!==null){r.return=t.return,Z=r;break}Z=t.return}}function rc(e){for(;Z!==null;){var t=Z;if(t===e){Z=null;break}var r=t.sibling;if(r!==null){r.return=t.return,Z=r;break}Z=t.return}}function ic(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{gs(4,t)}catch(u){ke(t,r,u)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var n=t.return;try{i.componentDidMount()}catch(u){ke(t,n,u)}}var h=t.return;try{Go(t)}catch(u){ke(t,h,u)}break;case 5:var _=t.return;try{Go(t)}catch(u){ke(t,_,u)}}}catch(u){ke(t,t.return,u)}if(t===e){Z=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Z=l;break}Z=t.return}}var w_=Math.ceil,es=$t.ReactCurrentDispatcher,Hl=$t.ReactCurrentOwner,_t=$t.ReactCurrentBatchConfig,he=0,Me=null,De=null,je=0,it=0,Hr=cr(0),Te=0,Ki=null,wr=0,ys=0,zl=0,Li=null,Qe=null,$l=0,ei=1/0,Mt=null,ts=!1,Qo=null,rr=null,gn=!1,Yt=null,rs=0,Di=0,Jo=null,Pn=-1,Mn=0;function qe(){return he&6?Le():Pn!==-1?Pn:Pn=Le()}function ir(e){return e.mode&1?he&2&&je!==0?je&-je:s_.transition!==null?(Mn===0&&(Mn=vu()),Mn):(e=de,e!==0||(e=window.event,e=e===void 0?16:xu(e.type)),e):1}function xt(e,t,r,i){if(50<Di)throw Di=0,Jo=null,Error(G(185));Xi(e,r,i),(!(he&2)||e!==Me)&&(e===Me&&(!(he&2)&&(ys|=r),Te===4&&Gt(e,je)),tt(e,i),r===1&&he===0&&!(t.mode&1)&&(ei=Le()+500,_s&&ur()))}function tt(e,t){var r=e.callbackNode;sp(e,t);var i=Fn(e,e===Me?je:0);if(i===0)r!==null&&da(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&da(r),t===1)e.tag===0?n_(nc.bind(null,e)):$u(nc.bind(null,e)),e_(function(){!(he&6)&&ur()}),r=null;else{switch(mu(i)){case 1:r=pl;break;case 4:r=pu;break;case 16:r=In;break;case 536870912:r=_u;break;default:r=In}r=Hh(r,Mh.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Mh(e,t){if(Pn=-1,Mn=0,he&6)throw Error(G(327));var r=e.callbackNode;if(qr()&&e.callbackNode!==r)return null;var i=Fn(e,e===Me?je:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=is(e,i);else{t=i;var n=he;he|=2;var h=Oh();(Me!==e||je!==t)&&(Mt=null,ei=Le()+500,mr(e,t));do try{E_();break}catch(l){Bh(e,l)}while(!0);Ll(),es.current=h,he=n,De!==null?t=0:(Me=null,je=0,t=Te)}if(t!==0){if(t===2&&(n=Eo(e),n!==0&&(i=n,t=Zo(e,n))),t===1)throw r=Ki,mr(e,0),Gt(e,i),tt(e,Le()),r;if(t===6)Gt(e,i);else{if(n=e.current.alternate,!(i&30)&&!x_(n)&&(t=is(e,i),t===2&&(h=Eo(e),h!==0&&(i=h,t=Zo(e,h))),t===1))throw r=Ki,mr(e,0),Gt(e,i),tt(e,Le()),r;switch(e.finishedWork=n,e.finishedLanes=i,t){case 0:case 1:throw Error(G(345));case 2:dr(e,Qe,Mt);break;case 3:if(Gt(e,i),(i&130023424)===i&&(t=$l+500-Le(),10<t)){if(Fn(e,0)!==0)break;if(n=e.suspendedLanes,(n&i)!==i){qe(),e.pingedLanes|=e.suspendedLanes&n;break}e.timeoutHandle=Mo(dr.bind(null,e,Qe,Mt),t);break}dr(e,Qe,Mt);break;case 4:if(Gt(e,i),(i&4194240)===i)break;for(t=e.eventTimes,n=-1;0<i;){var _=31-wt(i);h=1<<_,_=t[_],_>n&&(n=_),i&=~h}if(i=n,i=Le()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*w_(i/1960))-i,10<i){e.timeoutHandle=Mo(dr.bind(null,e,Qe,Mt),i);break}dr(e,Qe,Mt);break;case 5:dr(e,Qe,Mt);break;default:throw Error(G(329))}}}return tt(e,Le()),e.callbackNode===r?Mh.bind(null,e):null}function Zo(e,t){var r=Li;return e.current.memoizedState.isDehydrated&&(mr(e,t).flags|=256),e=is(e,t),e!==2&&(t=Qe,Qe=r,t!==null&&el(t)),e}function el(e){Qe===null?Qe=e:Qe.push.apply(Qe,e)}function x_(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var i=0;i<r.length;i++){var n=r[i],h=n.getSnapshot;n=n.value;try{if(!bt(h(),n))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;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 Gt(e,t){for(t&=~zl,t&=~ys,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-wt(t),i=1<<r;e[r]=-1,t&=~i}}function nc(e){if(he&6)throw Error(G(327));qr();var t=Fn(e,0);if(!(t&1))return tt(e,Le()),null;var r=is(e,t);if(e.tag!==0&&r===2){var i=Eo(e);i!==0&&(t=i,r=Zo(e,i))}if(r===1)throw r=Ki,mr(e,0),Gt(e,t),tt(e,Le()),r;if(r===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,dr(e,Qe,Mt),tt(e,Le()),null}function Ul(e,t){var r=he;he|=1;try{return e(t)}finally{he=r,he===0&&(ei=Le()+500,_s&&ur())}}function xr(e){Yt!==null&&Yt.tag===0&&!(he&6)&&qr();var t=he;he|=1;var r=_t.transition,i=de;try{if(_t.transition=null,de=1,e)return e()}finally{de=i,_t.transition=r,he=t,!(he&6)&&ur()}}function Wl(){it=Hr.current,Se(Hr)}function mr(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Zp(r)),De!==null)for(r=De.return;r!==null;){var i=r;switch(bl(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Wn();break;case 3:Jr(),Se(Ze),Se(Ue),Ml();break;case 5:Pl(i);break;case 4:Jr();break;case 13:Se(xe);break;case 19:Se(xe);break;case 10:Dl(i.type._context);break;case 22:case 23:Wl()}r=r.return}if(Me=e,De=e=nr(e.current,null),je=it=t,Te=0,Ki=null,zl=ys=wr=0,Qe=Li=null,pr!==null){for(t=0;t<pr.length;t++)if(r=pr[t],i=r.interleaved,i!==null){r.interleaved=null;var n=i.next,h=r.pending;if(h!==null){var _=h.next;h.next=n,i.next=_}r.pending=i}pr=null}return e}function Bh(e,t){do{var r=De;try{if(Ll(),Rn.current=Zn,Jn){for(var i=be.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}Jn=!1}if(Cr=0,Ae=Re=be=null,Ei=!1,Ui=0,Hl.current=null,r===null||r.return===null){Te=1,Ki=t,De=null;break}e:{var h=e,_=r.return,l=r,u=t;if(t=je,l.flags|=32768,u!==null&&typeof u=="object"&&typeof u.then=="function"){var f=u,y=l,d=y.tag;if(!(y.mode&1)&&(d===0||d===11||d===15)){var m=y.alternate;m?(y.updateQueue=m.updateQueue,y.memoizedState=m.memoizedState,y.lanes=m.lanes):(y.updateQueue=null,y.memoizedState=null)}var C=Va(_);if(C!==null){C.flags&=-257,Ka(C,_,l,h,t),C.mode&1&&Wa(h,f,t),t=C,u=f;var w=t.updateQueue;if(w===null){var g=new Set;g.add(u),t.updateQueue=g}else w.add(u);break e}else{if(!(t&1)){Wa(h,f,t),Vl();break e}u=Error(G(426))}}else if(Ce&&l.mode&1){var a=Va(_);if(a!==null){!(a.flags&65536)&&(a.flags|=256),Ka(a,_,l,h,t),El(Zr(u,l));break e}}h=u=Zr(u,l),Te!==4&&(Te=2),Li===null?Li=[h]:Li.push(h),h=_;do{switch(h.tag){case 3:h.flags|=65536,t&=-t,h.lanes|=t;var o=mh(h,u,t);Ia(h,o);break e;case 1:l=u;var s=h.type,c=h.stateNode;if(!(h.flags&128)&&(typeof s.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(rr===null||!rr.has(c)))){h.flags|=65536,t&=-t,h.lanes|=t;var p=gh(h,l,t);Ia(h,p);break e}}h=h.return}while(h!==null)}jh(r)}catch(v){t=v,De===r&&r!==null&&(De=r=r.return);continue}break}while(!0)}function Oh(){var e=es.current;return es.current=Zn,e===null?Zn:e}function Vl(){(Te===0||Te===3||Te===2)&&(Te=4),Me===null||!(wr&268435455)&&!(ys&268435455)||Gt(Me,je)}function is(e,t){var r=he;he|=2;var i=Oh();(Me!==e||je!==t)&&(Mt=null,mr(e,t));do try{b_();break}catch(n){Bh(e,n)}while(!0);if(Ll(),he=r,es.current=i,De!==null)throw Error(G(261));return Me=null,je=0,Te}function b_(){for(;De!==null;)Nh(De)}function E_(){for(;De!==null&&!Yf();)Nh(De)}function Nh(e){var t=Fh(e.alternate,e,it);e.memoizedProps=e.pendingProps,t===null?jh(e):De=t,Hl.current=null}function jh(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=g_(r,t),r!==null){r.flags&=32767,De=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Te=6,De=null;return}}else if(r=m_(r,t,it),r!==null){De=r;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);Te===0&&(Te=5)}function dr(e,t,r){var i=de,n=_t.transition;try{_t.transition=null,de=1,k_(e,t,r,i)}finally{_t.transition=n,de=i}return null}function k_(e,t,r,i){do qr();while(Yt!==null);if(he&6)throw Error(G(327));r=e.finishedWork;var n=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var h=r.lanes|r.childLanes;if(op(e,h),e===Me&&(De=Me=null,je=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||gn||(gn=!0,Hh(In,function(){return qr(),null})),h=(r.flags&15990)!==0,r.subtreeFlags&15990||h){h=_t.transition,_t.transition=null;var _=de;de=1;var l=he;he|=4,Hl.current=null,S_(e,r),Ah(r,e),Kp(Ao),Hn=!!To,Ao=To=null,e.current=r,C_(r),Qf(),he=l,de=_,_t.transition=h}else e.current=r;if(gn&&(gn=!1,Yt=e,rs=n),h=e.pendingLanes,h===0&&(rr=null),ep(r.stateNode),tt(e,Le()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)n=t[r],i(n.value,{componentStack:n.stack,digest:n.digest});if(ts)throw ts=!1,e=Qo,Qo=null,e;return rs&1&&e.tag!==0&&qr(),h=e.pendingLanes,h&1?e===Jo?Di++:(Di=0,Jo=e):Di=0,ur(),null}function qr(){if(Yt!==null){var e=mu(rs),t=_t.transition,r=de;try{if(_t.transition=null,de=16>e?16:e,Yt===null)var i=!1;else{if(e=Yt,Yt=null,rs=0,he&6)throw Error(G(331));var n=he;for(he|=4,Z=e.current;Z!==null;){var h=Z,_=h.child;if(Z.flags&16){var l=h.deletions;if(l!==null){for(var u=0;u<l.length;u++){var f=l[u];for(Z=f;Z!==null;){var y=Z;switch(y.tag){case 0:case 11:case 15:ki(8,y,h)}var d=y.child;if(d!==null)d.return=y,Z=d;else for(;Z!==null;){y=Z;var m=y.sibling,C=y.return;if(Dh(y),y===f){Z=null;break}if(m!==null){m.return=C,Z=m;break}Z=C}}}var w=h.alternate;if(w!==null){var g=w.child;if(g!==null){w.child=null;do{var a=g.sibling;g.sibling=null,g=a}while(g!==null)}}Z=h}}if(h.subtreeFlags&2064&&_!==null)_.return=h,Z=_;else e:for(;Z!==null;){if(h=Z,h.flags&2048)switch(h.tag){case 0:case 11:case 15:ki(9,h,h.return)}var o=h.sibling;if(o!==null){o.return=h.return,Z=o;break e}Z=h.return}}var s=e.current;for(Z=s;Z!==null;){_=Z;var c=_.child;if(_.subtreeFlags&2064&&c!==null)c.return=_,Z=c;else e:for(_=s;Z!==null;){if(l=Z,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:gs(9,l)}}catch(v){ke(l,l.return,v)}if(l===_){Z=null;break e}var p=l.sibling;if(p!==null){p.return=l.return,Z=p;break e}Z=l.return}}if(he=n,ur(),Dt&&typeof Dt.onPostCommitFiberRoot=="function")try{Dt.onPostCommitFiberRoot(us,e)}catch{}i=!0}return i}finally{de=r,_t.transition=t}}return!1}function sc(e,t,r){t=Zr(r,t),t=mh(e,t,1),e=tr(e,t,1),t=qe(),e!==null&&(Xi(e,1,t),tt(e,t))}function ke(e,t,r){if(e.tag===3)sc(e,e,r);else for(;t!==null;){if(t.tag===3){sc(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(rr===null||!rr.has(i))){e=Zr(r,e),e=gh(t,e,1),t=tr(t,e,1),e=qe(),t!==null&&(Xi(t,1,e),tt(t,e));break}}t=t.return}}function L_(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=qe(),e.pingedLanes|=e.suspendedLanes&r,Me===e&&(je&r)===r&&(Te===4||Te===3&&(je&130023424)===je&&500>Le()-$l?mr(e,0):zl|=r),tt(e,t)}function Ih(e,t){t===0&&(e.mode&1?(t=an,an<<=1,!(an&130023424)&&(an=4194304)):t=1);var r=qe();e=Ht(e,t),e!==null&&(Xi(e,t,r),tt(e,r))}function D_(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Ih(e,r)}function R_(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,n=e.memoizedState;n!==null&&(r=n.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(G(314))}i!==null&&i.delete(t),Ih(e,r)}var Fh;Fh=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ze.current)Je=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Je=!1,v_(e,t,r);Je=!!(e.flags&131072)}else Je=!1,Ce&&t.flags&1048576&&Uu(t,qn,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;An(e,t),e=t.pendingProps;var n=Xr(t,Ue.current);Kr(t,r),n=Ol(null,t,i,e,n,r);var h=Nl();return t.flags|=1,typeof n=="object"&&n!==null&&typeof n.render=="function"&&n.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,et(i)?(h=!0,Vn(t)):h=!1,t.memoizedState=n.state!==null&&n.state!==void 0?n.state:null,Tl(t),n.updater=ms,t.stateNode=n,n._reactInternals=t,Ho(t,i,e,r),t=Uo(null,t,i,!0,h,r)):(t.tag=0,Ce&&h&&xl(t),Ke(null,t,n,r),t=t.child),t;case 16:i=t.elementType;e:{switch(An(e,t),e=t.pendingProps,n=i._init,i=n(i._payload),t.type=i,n=t.tag=A_(i),e=yt(i,e),n){case 0:t=$o(null,t,i,e,r);break e;case 1:t=Xa(null,t,i,e,r);break e;case 11:t=qa(null,t,i,e,r);break e;case 14:t=Ga(null,t,i,yt(i.type,e),r);break e}throw Error(G(306,i,""))}return t;case 0:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:yt(i,n),$o(e,t,i,n,r);case 1:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:yt(i,n),Xa(e,t,i,n,r);case 3:e:{if(wh(t),e===null)throw Error(G(387));i=t.pendingProps,h=t.memoizedState,n=h.element,Xu(e,t),Yn(t,i,null,r);var _=t.memoizedState;if(i=_.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){n=Zr(Error(G(423)),t),t=Ya(e,t,i,r,n);break e}else if(i!==n){n=Zr(Error(G(424)),t),t=Ya(e,t,i,r,n);break e}else for(st=er(t.stateNode.containerInfo.firstChild),ot=t,Ce=!0,Ct=null,r=qu(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Yr(),i===n){t=zt(e,t,r);break e}Ke(e,t,i,r)}t=t.child}return t;case 5:return Yu(t),e===null&&jo(t),i=t.type,n=t.pendingProps,h=e!==null?e.memoizedProps:null,_=n.children,Po(i,n)?_=null:h!==null&&Po(i,h)&&(t.flags|=32),Ch(e,t),Ke(e,t,_,r),t.child;case 6:return e===null&&jo(t),null;case 13:return xh(e,t,r);case 4:return Al(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Qr(t,null,i,r):Ke(e,t,i,r),t.child;case 11:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:yt(i,n),qa(e,t,i,n,r);case 7:return Ke(e,t,t.pendingProps,r),t.child;case 8:return Ke(e,t,t.pendingProps.children,r),t.child;case 12:return Ke(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,n=t.pendingProps,h=t.memoizedProps,_=n.value,ve(Gn,i._currentValue),i._currentValue=_,h!==null)if(bt(h.value,_)){if(h.children===n.children&&!Ze.current){t=zt(e,t,r);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var l=h.dependencies;if(l!==null){_=h.child;for(var u=l.firstContext;u!==null;){if(u.context===i){if(h.tag===1){u=jt(-1,r&-r),u.tag=2;var f=h.updateQueue;if(f!==null){f=f.shared;var y=f.pending;y===null?u.next=u:(u.next=y.next,y.next=u),f.pending=u}}h.lanes|=r,u=h.alternate,u!==null&&(u.lanes|=r),Io(h.return,r,t),l.lanes|=r;break}u=u.next}}else if(h.tag===10)_=h.type===t.type?null:h.child;else if(h.tag===18){if(_=h.return,_===null)throw Error(G(341));_.lanes|=r,l=_.alternate,l!==null&&(l.lanes|=r),Io(_,r,t),_=h.sibling}else _=h.child;if(_!==null)_.return=h;else for(_=h;_!==null;){if(_===t){_=null;break}if(h=_.sibling,h!==null){h.return=_.return,_=h;break}_=_.return}h=_}Ke(e,t,n.children,r),t=t.child}return t;case 9:return n=t.type,i=t.pendingProps.children,Kr(t,r),n=vt(n),i=i(n),t.flags|=1,Ke(e,t,i,r),t.child;case 14:return i=t.type,n=yt(i,t.pendingProps),n=yt(i.type,n),Ga(e,t,i,n,r);case 15:return yh(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,n=t.pendingProps,n=t.elementType===i?n:yt(i,n),An(e,t),t.tag=1,et(i)?(e=!0,Vn(t)):e=!1,Kr(t,r),vh(t,i,n),Ho(t,i,n,r),Uo(null,t,i,!0,e,r);case 19:return bh(e,t,r);case 22:return Sh(e,t,r)}throw Error(G(156,t.tag))};function Hh(e,t){return fu(e,t)}function T_(e,t,r,i){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function pt(e,t,r,i){return new T_(e,t,r,i)}function Kl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function A_(e){if(typeof e=="function")return Kl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===hl)return 11;if(e===dl)return 14}return 2}function nr(e,t){var r=e.alternate;return r===null?(r=pt(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Bn(e,t,r,i,n,h){var _=2;if(i=e,typeof e=="function")Kl(e)&&(_=1);else if(typeof e=="string")_=5;else e:switch(e){case Tr:return gr(r.children,n,h,t);case ul:_=8,n|=8;break;case co:return e=pt(12,r,t,n|2),e.elementType=co,e.lanes=h,e;case uo:return e=pt(13,r,t,n),e.elementType=uo,e.lanes=h,e;case ho:return e=pt(19,r,t,n),e.elementType=ho,e.lanes=h,e;case Yc:return Ss(r,n,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Gc:_=10;break e;case Xc:_=9;break e;case hl:_=11;break e;case dl:_=14;break e;case Vt:_=16,i=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=pt(_,r,t,n),t.elementType=e,t.type=i,t.lanes=h,t}function gr(e,t,r,i){return e=pt(7,e,i,t),e.lanes=r,e}function Ss(e,t,r,i){return e=pt(22,e,i,t),e.elementType=Yc,e.lanes=r,e.stateNode={isHidden:!1},e}function Zs(e,t,r){return e=pt(6,e,null,t),e.lanes=r,e}function eo(e,t,r){return t=pt(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function P_(e,t,r,i,n){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Bs(0),this.expirationTimes=Bs(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bs(0),this.identifierPrefix=i,this.onRecoverableError=n,this.mutableSourceEagerHydrationData=null}function ql(e,t,r,i,n,h,_,l,u){return e=new P_(e,t,r,l,u),t===1?(t=1,h===!0&&(t|=8)):t=0,h=pt(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Tl(h),e}function M_(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Rr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function zh(e){if(!e)return lr;e=e._reactInternals;e:{if(Er(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(et(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var r=e.type;if(et(r))return zu(e,r,t)}return t}function $h(e,t,r,i,n,h,_,l,u){return e=ql(r,i,!0,e,n,h,_,l,u),e.context=zh(null),r=e.current,i=qe(),n=ir(r),h=jt(i,n),h.callback=t??null,tr(r,h,n),e.current.lanes=n,Xi(e,n,i),tt(e,i),e}function Cs(e,t,r,i){var n=t.current,h=qe(),_=ir(n);return r=zh(r),t.context===null?t.context=r:t.pendingContext=r,t=jt(h,_),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=tr(n,t,_),e!==null&&(xt(e,n,_,h),Dn(e,n,_)),_}function ns(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function oc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function Gl(e,t){oc(e,t),(e=e.alternate)&&oc(e,t)}function B_(){return null}var Uh=typeof reportError=="function"?reportError:function(e){console.error(e)};function Xl(e){this._internalRoot=e}ws.prototype.render=Xl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Cs(e,t,null,null)};ws.prototype.unmount=Xl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xr(function(){Cs(null,e,null,null)}),t[Ft]=null}};function ws(e){this._internalRoot=e}ws.prototype.unstable_scheduleHydration=function(e){if(e){var t=Su();e={blockedOn:null,target:e,priority:t};for(var r=0;r<qt.length&&t!==0&&t<qt[r].priority;r++);qt.splice(r,0,e),r===0&&wu(e)}};function Yl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function xs(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function lc(){}function O_(e,t,r,i,n){if(n){if(typeof i=="function"){var h=i;i=function(){var f=ns(_);h.call(f)}}var _=$h(t,i,e,0,null,!1,!1,"",lc);return e._reactRootContainer=_,e[Ft]=_.current,Ii(e.nodeType===8?e.parentNode:e),xr(),_}for(;n=e.lastChild;)e.removeChild(n);if(typeof i=="function"){var l=i;i=function(){var f=ns(u);l.call(f)}}var u=ql(e,0,!1,null,null,!1,!1,"",lc);return e._reactRootContainer=u,e[Ft]=u.current,Ii(e.nodeType===8?e.parentNode:e),xr(function(){Cs(t,u,r,i)}),u}function bs(e,t,r,i,n){var h=r._reactRootContainer;if(h){var _=h;if(typeof n=="function"){var l=n;n=function(){var u=ns(_);l.call(u)}}Cs(t,_,e,n)}else _=O_(r,t,e,n,i);return ns(_)}gu=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=vi(t.pendingLanes);r!==0&&(_l(t,r|1),tt(t,Le()),!(he&6)&&(ei=Le()+500,ur()))}break;case 13:xr(function(){var i=Ht(e,1);if(i!==null){var n=qe();xt(i,e,1,n)}}),Gl(e,1)}};vl=function(e){if(e.tag===13){var t=Ht(e,134217728);if(t!==null){var r=qe();xt(t,e,134217728,r)}Gl(e,134217728)}};yu=function(e){if(e.tag===13){var t=ir(e),r=Ht(e,t);if(r!==null){var i=qe();xt(r,e,t,i)}Gl(e,t)}};Su=function(){return de};Cu=function(e,t){var r=de;try{return de=e,t()}finally{de=r}};wo=function(e,t,r){switch(t){case"input":if(_o(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var i=r[t];if(i!==e&&i.form===e.form){var n=ps(i);if(!n)throw Error(G(90));Jc(i),_o(i,n)}}}break;case"textarea":eu(e,r);break;case"select":t=r.value,t!=null&&$r(e,!!r.multiple,t,!1)}};lu=Ul;au=xr;var N_={usingClientEntryPoint:!1,Events:[Qi,Br,ps,su,ou,Ul]},di={findFiberByHostInstance:fr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},j_={bundleType:di.bundleType,version:di.version,rendererPackageName:di.rendererPackageName,rendererConfig:di.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:$t.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=hu(e),e===null?null:e.stateNode},findFiberByHostInstance:di.findFiberByHostInstance||B_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var yn=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!yn.isDisabled&&yn.supportsFiber)try{us=yn.inject(j_),Dt=yn}catch{}}at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N_;at.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Yl(t))throw Error(G(200));return M_(e,t,null,r)};at.createRoot=function(e,t){if(!Yl(e))throw Error(G(299));var r=!1,i="",n=Uh;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(n=t.onRecoverableError)),t=ql(e,1,!1,null,null,r,!1,i,n),e[Ft]=t.current,Ii(e.nodeType===8?e.parentNode:e),new Xl(t)};at.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=hu(t),e=e===null?null:e.stateNode,e};at.flushSync=function(e){return xr(e)};at.hydrate=function(e,t,r){if(!xs(t))throw Error(G(200));return bs(null,e,t,!0,r)};at.hydrateRoot=function(e,t,r){if(!Yl(e))throw Error(G(405));var i=r!=null&&r.hydratedSources||null,n=!1,h="",_=Uh;if(r!=null&&(r.unstable_strictMode===!0&&(n=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onRecoverableError!==void 0&&(_=r.onRecoverableError)),t=$h(t,null,e,1,r??null,n,!1,h,_),e[Ft]=t.current,Ii(e),i)for(e=0;e<i.length;e++)r=i[e],n=r._getVersion,n=n(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,n]:t.mutableSourceEagerHydrationData.push(r,n);return new ws(t)};at.render=function(e,t,r){if(!xs(t))throw Error(G(200));return bs(null,e,t,!1,r)};at.unmountComponentAtNode=function(e){if(!xs(e))throw Error(G(40));return e._reactRootContainer?(xr(function(){bs(null,null,e,!1,function(){e._reactRootContainer=null,e[Ft]=null})}),!0):!1};at.unstable_batchedUpdates=Ul;at.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!xs(r))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return bs(e,t,r,!1,i)};at.version="18.3.1-next-f1338f8080-20240426";function Wh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Wh)}catch(e){console.error(e)}}Wh(),Wc.exports=at;var I_=Wc.exports,ac=I_;lo.createRoot=ac.createRoot,lo.hydrateRoot=ac.hydrateRoot;function Vh(e){var t,r,i="";if(typeof e=="string"||typeof e=="number")i+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(r=Vh(e[t]))&&(i&&(i+=" "),i+=r)}else for(r in e)e[r]&&(i&&(i+=" "),i+=r);return i}function Ie(){for(var e,t,r=0,i="",n=arguments.length;r<n;r++)(e=arguments[r])&&(t=Vh(e))&&(i&&(i+=" "),i+=t);return i}function Kh(e,t){const r=N.useRef(null);return N.useEffect(()=>{if(!e)return;const i=r.current;if(!i)return;const n=()=>Array.from(i.querySelectorAll("input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled])"));requestAnimationFrame(()=>{const _=n(),l=_.find(u=>u.tagName!=="BUTTON")??_[0];l==null||l.focus()});const h=_=>{if(_.key==="Escape"){_.preventDefault(),t();return}if(_.key!=="Tab")return;const l=n();if(l.length===0)return;const u=l[0],f=l[l.length-1];_.shiftKey?document.activeElement===u&&(_.preventDefault(),f.focus()):document.activeElement===f&&(_.preventDefault(),u.focus())};return document.addEventListener("keydown",h),()=>document.removeEventListener("keydown",h)},[e,t]),r}const F_=({isOpen:e,workspaces:t,onSubmit:r,onClose:i})=>{var m;const[n,h]=N.useState(((m=t[0])==null?void 0:m.id)||""),[_,l]=N.useState(""),[u,f]=N.useState(!1),y=Kh(e,i);N.useEffect(()=>{e&&t.length>0&&!n&&h(t[0].id)},[e,t,n]);const d=async C=>{if(C.preventDefault(),!u){f(!0);try{await r(_.trim(),n),l("")}finally{f(!1)}}};return e?L.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"deck-modal-title",children:L.jsxs("form",{className:"modal",ref:y,onSubmit:d,children:[L.jsx("div",{className:"text-[14px] font-semibold mb-3",id:"deck-modal-title",children:"デッキ作成"}),L.jsxs("label",{className:"grid gap-1 text-xs",children:[L.jsx("span",{children:"デッキ名 (任意)"}),L.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:_,placeholder:"空白のままでもOK",maxLength:100,onChange:C=>l(C.target.value)})]}),L.jsxs("label",{className:"grid gap-1 text-xs mt-3",children:[L.jsx("span",{children:"ワークスペース"}),L.jsx("select",{className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:n,onChange:C=>h(C.target.value),children:t.map(C=>L.jsx("option",{value:C.id,children:C.path},C.id))})]}),L.jsxs("div",{className:"flex justify-end gap-2 mt-4",children:[L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:u,children:"キャンセル"}),L.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:u,children:u?"作成中...":"作成"})]})]})}):null};function H_({activeView:e,onSelect:t,theme:r,onToggleTheme:i,onOpenSettings:n}){return L.jsxs("nav",{className:"activity-bar",children:[L.jsxs("div",{className:"activity-bar-top",children:[L.jsx("button",{type:"button",className:Ie("activity-bar-item",e==="workspace"&&"active"),onClick:()=>t("workspace"),"aria-label":"Explorer",title:"Explorer (Ctrl+Shift+E)",children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M17.5 0h-9L7 1.5V6H2.5L1 7.5v15.07L2.5 24h12.07L16 22.57V18h4.7l1.3-1.43V4.5L17.5 0zm0 2.12l2.38 2.38H17.5V2.12zm-3 20.38h-12v-15H7v9.07L8.5 18h6v4.5zm6-6h-12v-15H16V6h4.5v10.5z",fill:"currentColor"})})}),L.jsx("button",{type:"button",className:Ie("activity-bar-item",e==="terminal"&&"active"),onClick:()=>t("terminal"),"aria-label":"Terminal",title:"Terminal (Ctrl+`)",children:L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M21 4H3a1 1 0 00-1 1v14a1 1 0 001 1h18a1 1 0 001-1V5a1 1 0 00-1-1zM4 18V6h16v12H4z",fill:"currentColor"}),L.jsx("path",{d:"M6.5 15.5L10 12 6.5 8.5 8 7l5 5-5 5-1.5-1.5z",fill:"currentColor"}),L.jsx("path",{d:"M13 14h5v2h-5z",fill:"currentColor"})]})})]}),L.jsxs("div",{className:"activity-bar-bottom",children:[L.jsx("button",{type:"button",className:"activity-bar-item",onClick:i,"aria-label":"Toggle Theme",title:r==="dark"?"Switch to Light Theme":"Switch to Dark Theme",children:r==="dark"?L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1zM5.99 4.58a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41L5.99 4.58zm12.37 12.37a.996.996 0 00-1.41 0 .996.996 0 000 1.41l1.06 1.06c.39.39 1.03.39 1.41 0a.996.996 0 000-1.41l-1.06-1.06zm1.06-10.96a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06zM7.05 18.36a.996.996 0 000-1.41.996.996 0 00-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06z",fill:"currentColor"})}):L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M12 3a9 9 0 109 9c0-.46-.04-.92-.1-1.36a5.389 5.389 0 01-4.4 2.26 5.403 5.403 0 01-3.14-9.8c-.44-.06-.9-.1-1.36-.1z",fill:"currentColor"})})}),L.jsx("button",{type:"button",className:"activity-bar-item",onClick:n,"aria-label":"Settings",title:"Settings",children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58a.49.49 0 00.12-.61l-1.92-3.32a.488.488 0 00-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54a.484.484 0 00-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58a.49.49 0 00-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61l-2.01-1.58zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z",fill:"currentColor"})})})]})]})}const z_=({message:e})=>e?L.jsx("div",{className:"status-float",role:"status",children:e}):null;var qh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={4567:function(_,l,u){var f=this&&this.__decorate||function(c,p,v,x){var b,S=arguments.length,k=S<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(c,p,v,x);else for(var R=c.length-1;R>=0;R--)(b=c[R])&&(k=(S<3?b(k):S>3?b(p,v,k):b(p,v))||k);return S>3&&k&&Object.defineProperty(p,v,k),k},y=this&&this.__param||function(c,p){return function(v,x){p(v,x,c)}};Object.defineProperty(l,"__esModule",{value:!0}),l.AccessibilityManager=void 0;const d=u(9042),m=u(6114),C=u(9924),w=u(844),g=u(5596),a=u(4725),o=u(3656);let s=l.AccessibilityManager=class extends w.Disposable{constructor(c,p){super(),this._terminal=c,this._renderService=p,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let v=0;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);if(this._topBoundaryFocusListener=v=>this._handleBoundaryFocus(v,0),this._bottomBoundaryFocusListener=v=>this._handleBoundaryFocus(v,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=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new C.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(v=>this._handleResize(v.rows))),this.register(this._terminal.onRender(v=>this._refreshRows(v.start,v.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(v=>this._handleChar(v))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
41
41
  `))),this.register(this._terminal.onA11yTab(v=>this._handleTab(v))),this.register(this._terminal.onKey(v=>this._handleKey(v.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new g.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,o.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,w.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(c){for(let p=0;p<c;p++)this._handleChar(" ")}_handleChar(c){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==c&&(this._charsToAnnounce+=c):this._charsToAnnounce+=c,c===`
42
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),m.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,m.isMac&&this._liveRegion.remove()}_handleKey(c){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(c)||this._charsToConsume.push(c)}_refreshRows(c,p){this._liveRegionDebouncer.refresh(c,p,this._terminal.rows)}_renderRows(c,p){const v=this._terminal.buffer,x=v.lines.length.toString();for(let b=c;b<=p;b++){const y=v.translateBufferLineToString(v.ydisp+b,!0),k=(v.ydisp+b+1).toString(),R=this._rowElements[b];R&&(y.length===0?R.innerText=" ":R.textContent=y,R.setAttribute("aria-posinset",k),R.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,p){const v=c.target,x=this._rowElements[p===0?1:this._rowElements.length-2];if(v.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==x)return;let b,y;if(p===0?(b=v,y=this._rowElements.pop(),this._rowContainer.removeChild(y)):(b=this._rowElements.shift(),y=v,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),y.removeEventListener("focus",this._bottomBoundaryFocusListener),p===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(p===0?-1:1),this._rowElements[p===0?1:this._rowElements.length-2].focus(),c.preventDefault(),c.stopImmediatePropagation()}_handleResize(c){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);for(;this._rowElements.length>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const c=document.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c}_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 c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}}_refreshRowDimensions(c){c.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=s=f([S(1,a.IRenderService)],s)},3614:(_,l)=>{function u(m){return m.replace(/\r?\n/g,"\r")}function f(m,C){return C?"\x1B[200~"+m+"\x1B[201~":m}function S(m,C,w,g){m=f(m=u(m),w.decPrivateModes.bracketedPasteMode&&g.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(m,!0),C.value=""}function d(m,C,w){const g=w.getBoundingClientRect(),a=m.clientX-g.left-10,o=m.clientY-g.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${a}px`,C.style.top=`${o}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=f,l.copyHandler=function(m,C){m.clipboardData&&m.clipboardData.setData("text/plain",C.selectionText),m.preventDefault()},l.handlePasteEvent=function(m,C,w,g){m.stopPropagation(),m.clipboardData&&S(m.clipboardData.getData("text/plain"),C,w,g)},l.paste=S,l.moveTextAreaUnderMouseCursor=d,l.rightClickHandler=function(m,C,w,g,a){d(m,C,w),a&&g.rightClickSelect(m),C.value=g.selectionText,C.select()}},7239:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const f=u(1505);l.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(S,d,m){this._css.set(S,d,m)}getCss(S,d){return this._css.get(S,d)}setColor(S,d,m){this._color.set(S,d,m)}getColor(S,d){return this._color.get(S,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,f,S,d){u.addEventListener(f,S,d);let m=!1;return{dispose:()=>{m||(m=!0,u.removeEventListener(f,S,d))}}}},6465:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},S=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier2=void 0;const d=u(3656),m=u(8460),C=u(844),w=u(2585);let g=l.Linkifier2=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(a){super(),this._bufferService=a,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(a){return this._linkProviders.push(a),{dispose:()=>{const o=this._linkProviders.indexOf(a);o!==-1&&this._linkProviders.splice(o,1)}}}attachToDom(a,o,s){this._element=a,this._mouseService=o,this._renderService=s,this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){if(this._lastMouseEvent=a,!this._element||!this._mouseService)return;const o=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const s=a.composedPath();for(let c=0;c<s.length;c++){const p=s[c];if(p.classList.contains("xterm"))break;if(p.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,o){var s,c;this._activeProviderReplies&&o||((s=this._activeProviderReplies)===null||s===void 0||s.forEach(v=>{v==null||v.forEach(x=>{x.link.dispose&&x.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=a.y);let p=!1;for(const[v,x]of this._linkProviders.entries())o?!((c=this._activeProviderReplies)===null||c===void 0)&&c.get(v)&&(p=this._checkLinkProviderResult(v,a,p)):x.provideLinks(a.y,b=>{var y,k;if(this._isMouseOut)return;const R=b==null?void 0:b.map(O=>({link:O}));(y=this._activeProviderReplies)===null||y===void 0||y.set(v,R),p=this._checkLinkProviderResult(v,a,p),((k=this._activeProviderReplies)===null||k===void 0?void 0:k.size)===this._linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)})}_removeIntersectingLinks(a,o){const s=new Set;for(let c=0;c<o.size;c++){const p=o.get(c);if(p)for(let v=0;v<p.length;v++){const x=p[v],b=x.link.range.start.y<a?0:x.link.range.start.x,y=x.link.range.end.y>a?this._bufferService.cols:x.link.range.end.x;for(let k=b;k<=y;k++){if(s.has(k)){p.splice(v--,1);break}s.add(k)}}}}_checkLinkProviderResult(a,o,s){var c;if(!this._activeProviderReplies)return s;const p=this._activeProviderReplies.get(a);let v=!1;for(let x=0;x<a;x++)this._activeProviderReplies.has(x)&&!this._activeProviderReplies.get(x)||(v=!0);if(!v&&p){const x=p.find(b=>this._linkAtPosition(b.link,o));x&&(s=!0,this._handleNewLink(x))}if(this._activeProviderReplies.size===this._linkProviders.length&&!s)for(let x=0;x<this._activeProviderReplies.size;x++){const b=(c=this._activeProviderReplies.get(x))===null||c===void 0?void 0:c.find(y=>this._linkAtPosition(y.link,o));if(b){s=!0,this._handleNewLink(b);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._element||!this._mouseService||!this._currentLink)return;const o=this._positionFromMouseEvent(a,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,o){this._element&&this._currentLink&&this._lastMouseEvent&&(!a||!o||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=o)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(a.link,o)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>{var s,c;return(c=(s=this._currentLink)===null||s===void 0?void 0:s.state)===null||c===void 0?void 0:c.decorations.pointerCursor},set:s=>{var c,p;!((c=this._currentLink)===null||c===void 0)&&c.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&((p=this._element)===null||p===void 0||p.classList.toggle("xterm-cursor-pointer",s)))}},underline:{get:()=>{var s,c;return(c=(s=this._currentLink)===null||s===void 0?void 0:s.state)===null||c===void 0?void 0:c.decorations.underline},set:s=>{var c,p,v;!((c=this._currentLink)===null||c===void 0)&&c.state&&((v=(p=this._currentLink)===null||p===void 0?void 0:p.state)===null||v===void 0?void 0:v.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,s))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;const c=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,p=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=p&&(this._clearCurrentLink(c,p),this._lastMouseEvent&&this._element)){const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._askForLink(v,!1)}})))}_linkHover(a,o,s){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(s,o.text)}_fireUnderlineEvent(a,o){const s=a.range,c=this._bufferService.buffer.ydisp,p=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-c-1,s.end.x,s.end.y-c-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(p)}_linkLeave(a,o,s){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(s,o.text)}_linkAtPosition(a,o){const s=a.range.start.y*this._bufferService.cols+a.range.start.x,c=a.range.end.y*this._bufferService.cols+a.range.end.x,p=o.y*this._bufferService.cols+o.x;return s<=p&&p<=c}_positionFromMouseEvent(a,o,s){const c=s.getCoords(a,o,this._bufferService.cols,this._bufferService.rows);if(c)return{x:c[0],y:c[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,o,s,c,p){return{x1:a,y1:o,x2:s,y2:c,cols:this._bufferService.cols,fg:p}}};l.Linkifier2=g=f([S(0,w.IBufferService)],g)},9042:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(_,l,u){var f=this&&this.__decorate||function(g,a,o,s){var c,p=arguments.length,v=p<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(g,a,o,s);else for(var x=g.length-1;x>=0;x--)(c=g[x])&&(v=(p<3?c(v):p>3?c(a,o,v):c(a,o))||v);return p>3&&v&&Object.defineProperty(a,o,v),v},S=this&&this.__param||function(g,a){return function(o,s){a(o,s,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const d=u(511),m=u(2585);let C=l.OscLinkProvider=class{constructor(g,a,o){this._bufferService=g,this._optionsService=a,this._oscLinkService=o}provideLinks(g,a){var o;const s=this._bufferService.buffer.lines.get(g-1);if(!s)return void a(void 0);const c=[],p=this._optionsService.rawOptions.linkHandler,v=new d.CellData,x=s.getTrimmedLength();let b=-1,y=-1,k=!1;for(let R=0;R<x;R++)if(y!==-1||s.hasContent(R)){if(s.loadCell(R,v),v.hasExtendedAttrs()&&v.extended.urlId){if(y===-1){y=R,b=v.extended.urlId;continue}k=v.extended.urlId!==b}else y!==-1&&(k=!0);if(k||y!==-1&&R===x-1){const O=(o=this._oscLinkService.getLinkData(b))===null||o===void 0?void 0:o.uri;if(O){const T={start:{x:y+1,y:g},end:{x:R+(k||R!==x-1?0:1),y:g}};let B=!1;if(!(p!=null&&p.allowNonHttpProtocols))try{const z=new URL(O);["http:","https:"].includes(z.protocol)||(B=!0)}catch{B=!0}B||c.push({text:O,range:T,activate:(z,I)=>p?p.activate(z,I,T):w(0,I),hover:(z,I)=>{var j;return(j=p==null?void 0:p.hover)===null||j===void 0?void 0:j.call(p,z,I,T)},leave:(z,I)=>{var j;return(j=p==null?void 0:p.leave)===null||j===void 0?void 0:j.call(p,z,I,T)}})}k=!1,v.hasExtendedAttrs()&&v.extended.urlId?(y=R,b=v.extended.urlId):(y=-1,b=-1)}}a(c)}};function w(g,a){if(confirm(`Do you want to navigate to ${a}?
42
+ `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)),m.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,m.isMac&&this._liveRegion.remove()}_handleKey(c){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(c)||this._charsToConsume.push(c)}_refreshRows(c,p){this._liveRegionDebouncer.refresh(c,p,this._terminal.rows)}_renderRows(c,p){const v=this._terminal.buffer,x=v.lines.length.toString();for(let b=c;b<=p;b++){const S=v.translateBufferLineToString(v.ydisp+b,!0),k=(v.ydisp+b+1).toString(),R=this._rowElements[b];R&&(S.length===0?R.innerText=" ":R.textContent=S,R.setAttribute("aria-posinset",k),R.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(c,p){const v=c.target,x=this._rowElements[p===0?1:this._rowElements.length-2];if(v.getAttribute("aria-posinset")===(p===0?"1":`${this._terminal.buffer.lines.length}`)||c.relatedTarget!==x)return;let b,S;if(p===0?(b=v,S=this._rowElements.pop(),this._rowContainer.removeChild(S)):(b=this._rowElements.shift(),S=v,this._rowContainer.removeChild(b)),b.removeEventListener("focus",this._topBoundaryFocusListener),S.removeEventListener("focus",this._bottomBoundaryFocusListener),p===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(p===0?-1:1),this._rowElements[p===0?1:this._rowElements.length-2].focus(),c.preventDefault(),c.stopImmediatePropagation()}_handleResize(c){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let p=this._rowContainer.children.length;p<this._terminal.rows;p++)this._rowElements[p]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[p]);for(;this._rowElements.length>c;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const c=document.createElement("div");return c.setAttribute("role","listitem"),c.tabIndex=-1,this._refreshRowDimensions(c),c}_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 c=0;c<this._terminal.rows;c++)this._refreshRowDimensions(this._rowElements[c])}}_refreshRowDimensions(c){c.style.height=`${this._renderService.dimensions.css.cell.height}px`}};l.AccessibilityManager=s=f([y(1,a.IRenderService)],s)},3614:(_,l)=>{function u(m){return m.replace(/\r?\n/g,"\r")}function f(m,C){return C?"\x1B[200~"+m+"\x1B[201~":m}function y(m,C,w,g){m=f(m=u(m),w.decPrivateModes.bracketedPasteMode&&g.rawOptions.ignoreBracketedPasteMode!==!0),w.triggerDataEvent(m,!0),C.value=""}function d(m,C,w){const g=w.getBoundingClientRect(),a=m.clientX-g.left-10,o=m.clientY-g.top-10;C.style.width="20px",C.style.height="20px",C.style.left=`${a}px`,C.style.top=`${o}px`,C.style.zIndex="1000",C.focus()}Object.defineProperty(l,"__esModule",{value:!0}),l.rightClickHandler=l.moveTextAreaUnderMouseCursor=l.paste=l.handlePasteEvent=l.copyHandler=l.bracketTextForPaste=l.prepareTextForTerminal=void 0,l.prepareTextForTerminal=u,l.bracketTextForPaste=f,l.copyHandler=function(m,C){m.clipboardData&&m.clipboardData.setData("text/plain",C.selectionText),m.preventDefault()},l.handlePasteEvent=function(m,C,w,g){m.stopPropagation(),m.clipboardData&&y(m.clipboardData.getData("text/plain"),C,w,g)},l.paste=y,l.moveTextAreaUnderMouseCursor=d,l.rightClickHandler=function(m,C,w,g,a){d(m,C,w),a&&g.rightClickSelect(m),C.value=g.selectionText,C.select()}},7239:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorContrastCache=void 0;const f=u(1505);l.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(y,d,m){this._css.set(y,d,m)}getCss(y,d){return this._css.get(y,d)}setColor(y,d,m){this._color.set(y,d,m)}getColor(y,d){return this._color.get(y,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.addDisposableDomListener=void 0,l.addDisposableDomListener=function(u,f,y,d){u.addEventListener(f,y,d);let m=!1;return{dispose:()=>{m||(m=!0,u.removeEventListener(f,y,d))}}}},6465:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},y=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Linkifier2=void 0;const d=u(3656),m=u(8460),C=u(844),w=u(2585);let g=l.Linkifier2=class extends C.Disposable{get currentLink(){return this._currentLink}constructor(a){super(),this._bufferService=a,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new m.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new m.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,C.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,C.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(a){return this._linkProviders.push(a),{dispose:()=>{const o=this._linkProviders.indexOf(a);o!==-1&&this._linkProviders.splice(o,1)}}}attachToDom(a,o,s){this._element=a,this._mouseService=o,this._renderService=s,this.register((0,d.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,d.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,d.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(a){if(this._lastMouseEvent=a,!this._element||!this._mouseService)return;const o=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!o)return;this._isMouseOut=!1;const s=a.composedPath();for(let c=0;c<s.length;c++){const p=s[c];if(p.classList.contains("xterm"))break;if(p.classList.contains("xterm-hover"))return}this._lastBufferCell&&o.x===this._lastBufferCell.x&&o.y===this._lastBufferCell.y||(this._handleHover(o),this._lastBufferCell=o)}_handleHover(a){if(this._activeLine!==a.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(a,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,a)||(this._clearCurrentLink(),this._askForLink(a,!0))}_askForLink(a,o){var s,c;this._activeProviderReplies&&o||((s=this._activeProviderReplies)===null||s===void 0||s.forEach(v=>{v==null||v.forEach(x=>{x.link.dispose&&x.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=a.y);let p=!1;for(const[v,x]of this._linkProviders.entries())o?!((c=this._activeProviderReplies)===null||c===void 0)&&c.get(v)&&(p=this._checkLinkProviderResult(v,a,p)):x.provideLinks(a.y,b=>{var S,k;if(this._isMouseOut)return;const R=b==null?void 0:b.map(O=>({link:O}));(S=this._activeProviderReplies)===null||S===void 0||S.set(v,R),p=this._checkLinkProviderResult(v,a,p),((k=this._activeProviderReplies)===null||k===void 0?void 0:k.size)===this._linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)})}_removeIntersectingLinks(a,o){const s=new Set;for(let c=0;c<o.size;c++){const p=o.get(c);if(p)for(let v=0;v<p.length;v++){const x=p[v],b=x.link.range.start.y<a?0:x.link.range.start.x,S=x.link.range.end.y>a?this._bufferService.cols:x.link.range.end.x;for(let k=b;k<=S;k++){if(s.has(k)){p.splice(v--,1);break}s.add(k)}}}}_checkLinkProviderResult(a,o,s){var c;if(!this._activeProviderReplies)return s;const p=this._activeProviderReplies.get(a);let v=!1;for(let x=0;x<a;x++)this._activeProviderReplies.has(x)&&!this._activeProviderReplies.get(x)||(v=!0);if(!v&&p){const x=p.find(b=>this._linkAtPosition(b.link,o));x&&(s=!0,this._handleNewLink(x))}if(this._activeProviderReplies.size===this._linkProviders.length&&!s)for(let x=0;x<this._activeProviderReplies.size;x++){const b=(c=this._activeProviderReplies.get(x))===null||c===void 0?void 0:c.find(S=>this._linkAtPosition(S.link,o));if(b){s=!0,this._handleNewLink(b);break}}return s}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._element||!this._mouseService||!this._currentLink)return;const o=this._positionFromMouseEvent(a,this._element,this._mouseService);o&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,o)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,o){this._element&&this._currentLink&&this._lastMouseEvent&&(!a||!o||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=o)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,C.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const o=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);o&&this._linkAtPosition(a.link,o)&&(this._currentLink=a,this._currentLink.state={decorations:{underline:a.link.decorations===void 0||a.link.decorations.underline,pointerCursor:a.link.decorations===void 0||a.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,a.link,this._lastMouseEvent),a.link.decorations={},Object.defineProperties(a.link.decorations,{pointerCursor:{get:()=>{var s,c;return(c=(s=this._currentLink)===null||s===void 0?void 0:s.state)===null||c===void 0?void 0:c.decorations.pointerCursor},set:s=>{var c,p;!((c=this._currentLink)===null||c===void 0)&&c.state&&this._currentLink.state.decorations.pointerCursor!==s&&(this._currentLink.state.decorations.pointerCursor=s,this._currentLink.state.isHovered&&((p=this._element)===null||p===void 0||p.classList.toggle("xterm-cursor-pointer",s)))}},underline:{get:()=>{var s,c;return(c=(s=this._currentLink)===null||s===void 0?void 0:s.state)===null||c===void 0?void 0:c.decorations.underline},set:s=>{var c,p,v;!((c=this._currentLink)===null||c===void 0)&&c.state&&((v=(p=this._currentLink)===null||p===void 0?void 0:p.state)===null||v===void 0?void 0:v.decorations.underline)!==s&&(this._currentLink.state.decorations.underline=s,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,s))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(s=>{if(!this._currentLink)return;const c=s.start===0?0:s.start+1+this._bufferService.buffer.ydisp,p=this._bufferService.buffer.ydisp+1+s.end;if(this._currentLink.link.range.start.y>=c&&this._currentLink.link.range.end.y<=p&&(this._clearCurrentLink(c,p),this._lastMouseEvent&&this._element)){const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._askForLink(v,!1)}})))}_linkHover(a,o,s){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),o.hover&&o.hover(s,o.text)}_fireUnderlineEvent(a,o){const s=a.range,c=this._bufferService.buffer.ydisp,p=this._createLinkUnderlineEvent(s.start.x-1,s.start.y-c-1,s.end.x,s.end.y-c-1,void 0);(o?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(p)}_linkLeave(a,o,s){var c;!((c=this._currentLink)===null||c===void 0)&&c.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(o,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),o.leave&&o.leave(s,o.text)}_linkAtPosition(a,o){const s=a.range.start.y*this._bufferService.cols+a.range.start.x,c=a.range.end.y*this._bufferService.cols+a.range.end.x,p=o.y*this._bufferService.cols+o.x;return s<=p&&p<=c}_positionFromMouseEvent(a,o,s){const c=s.getCoords(a,o,this._bufferService.cols,this._bufferService.rows);if(c)return{x:c[0],y:c[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,o,s,c,p){return{x1:a,y1:o,x2:s,y2:c,cols:this._bufferService.cols,fg:p}}};l.Linkifier2=g=f([y(0,w.IBufferService)],g)},9042:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.tooMuchOutput=l.promptLabel=void 0,l.promptLabel="Terminal input",l.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(_,l,u){var f=this&&this.__decorate||function(g,a,o,s){var c,p=arguments.length,v=p<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(g,a,o,s);else for(var x=g.length-1;x>=0;x--)(c=g[x])&&(v=(p<3?c(v):p>3?c(a,o,v):c(a,o))||v);return p>3&&v&&Object.defineProperty(a,o,v),v},y=this&&this.__param||function(g,a){return function(o,s){a(o,s,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkProvider=void 0;const d=u(511),m=u(2585);let C=l.OscLinkProvider=class{constructor(g,a,o){this._bufferService=g,this._optionsService=a,this._oscLinkService=o}provideLinks(g,a){var o;const s=this._bufferService.buffer.lines.get(g-1);if(!s)return void a(void 0);const c=[],p=this._optionsService.rawOptions.linkHandler,v=new d.CellData,x=s.getTrimmedLength();let b=-1,S=-1,k=!1;for(let R=0;R<x;R++)if(S!==-1||s.hasContent(R)){if(s.loadCell(R,v),v.hasExtendedAttrs()&&v.extended.urlId){if(S===-1){S=R,b=v.extended.urlId;continue}k=v.extended.urlId!==b}else S!==-1&&(k=!0);if(k||S!==-1&&R===x-1){const O=(o=this._oscLinkService.getLinkData(b))===null||o===void 0?void 0:o.uri;if(O){const T={start:{x:S+1,y:g},end:{x:R+(k||R!==x-1?0:1),y:g}};let B=!1;if(!(p!=null&&p.allowNonHttpProtocols))try{const z=new URL(O);["http:","https:"].includes(z.protocol)||(B=!0)}catch{B=!0}B||c.push({text:O,range:T,activate:(z,I)=>p?p.activate(z,I,T):w(0,I),hover:(z,I)=>{var j;return(j=p==null?void 0:p.hover)===null||j===void 0?void 0:j.call(p,z,I,T)},leave:(z,I)=>{var j;return(j=p==null?void 0:p.leave)===null||j===void 0?void 0:j.call(p,z,I,T)}})}k=!1,v.hasExtendedAttrs()&&v.extended.urlId?(S=R,b=v.extended.urlId):(S=-1,b=-1)}}a(c)}};function w(g,a){if(confirm(`Do you want to navigate to ${a}?
43
43
 
44
- WARNING: This link could potentially be dangerous`)){const o=window.open();if(o){try{o.opener=null}catch{}o.location.href=a}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=C=f([S(0,m.IBufferService),S(1,m.IOptionsService),S(2,m.IOscLinkService)],C)},6193:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,f){this._parentWindow=u,this._renderCallback=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(u,f,S){this._rowCount=S,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},5596:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ScreenDprMonitor=void 0;const f=u(844);class S extends f.Disposable{constructor(m){super(),this._parentWindow=m,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,f.toDisposable)(()=>{this.clearListener()}))}setListener(m){this._listener&&this.clearListener(),this._listener=m,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)===null||m===void 0||m.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}l.ScreenDprMonitor=S},3236:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const f=u(3614),S=u(3656),d=u(6465),m=u(9042),C=u(3730),w=u(1680),g=u(3107),a=u(5744),o=u(2950),s=u(1296),c=u(428),p=u(4269),v=u(5114),x=u(8934),b=u(3230),y=u(9312),k=u(4725),R=u(6731),O=u(8055),T=u(8969),B=u(8460),z=u(844),I=u(6114),j=u(8437),$=u(2584),E=u(7399),A=u(5941),P=u(9074),M=u(2585),H=u(5435),K=u(4567),X=typeof window<"u"?window.document:null;class q extends T.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(D={}){super(D),this.browser=I,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new z.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(d.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(P.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((F,W)=>this.refresh(F,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(F=>this._reportWindowsOptions(F))),this.register(this._inputHandler.onColor(F=>this._handleColorEvent(F))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(F=>this._afterResize(F.cols,F.rows))),this.register((0,z.toDisposable)(()=>{var F,W;this._customKeyEventHandler=void 0,(W=(F=this.element)===null||F===void 0?void 0:F.parentNode)===null||W===void 0||W.removeChild(this.element)}))}_handleColorEvent(D){if(this._themeService)for(const F of D){let W,U="";switch(F.index){case 256:W="foreground",U="10";break;case 257:W="background",U="11";break;case 258:W="cursor",U="12";break;default:W="ansi",U="4;"+F.index}switch(F.type){case 0:const re=O.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[F.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${U};${(0,A.toRgbString)(re)}${$.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(J=>J.ansi[F.index]=O.rgba.toColor(...F.color));else{const J=W;this._themeService.modifyColors(ae=>ae[J]=O.rgba.toColor(...F.color))}break;case 2:this._themeService.restoreColor(F.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(D){D?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(D){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[I"),this.updateCursorStyle(D),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var D;return(D=this.textarea)===null||D===void 0?void 0:D.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 D=this.buffer.ybase+this.buffer.y,F=this.buffer.lines.get(D);if(!F)return;const W=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,re=F.getWidth(W),J=this._renderService.dimensions.css.cell.width*re,ae=this.buffer.y*this._renderService.dimensions.css.cell.height,we=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=we+"px",this.textarea.style.top=ae+"px",this.textarea.style.width=J+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,S.addDisposableDomListener)(this.element,"copy",F=>{this.hasSelection()&&(0,f.copyHandler)(F,this._selectionService)}));const D=F=>(0,f.handlePasteEvent)(F,this.textarea,this.coreService,this.optionsService);this.register((0,S.addDisposableDomListener)(this.textarea,"paste",D)),this.register((0,S.addDisposableDomListener)(this.element,"paste",D)),I.isFirefox?this.register((0,S.addDisposableDomListener)(this.element,"mousedown",F=>{F.button===2&&(0,f.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,S.addDisposableDomListener)(this.element,"contextmenu",F=>{(0,f.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),I.isLinux&&this.register((0,S.addDisposableDomListener)(this.element,"auxclick",F=>{F.button===1&&(0,f.moveTextAreaUnderMouseCursor)(F,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,S.addDisposableDomListener)(this.textarea,"keyup",D=>this._keyUp(D),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keydown",D=>this._keyDown(D),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"keypress",D=>this._keyPress(D),!0)),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionupdate",D=>this._compositionHelper.compositionupdate(D))),this.register((0,S.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,S.addDisposableDomListener)(this.textarea,"input",D=>this._inputEvent(D),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(D){var F;if(!D)throw new Error("Terminal requires a parent element.");D.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=D.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),D.appendChild(this.element);const W=X.createDocumentFragment();this._viewportElement=X.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.appendChild(this._viewportElement),this._viewportScrollArea=X.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=X.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=X.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),W.appendChild(this.screenElement),this.textarea=X.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),I.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._instantiationService.createInstance(v.CoreBrowserService,this.textarea,(F=this._document.defaultView)!==null&&F!==void 0?F:window),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,S.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,S.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(b.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(U=>this._onRender.fire(U))),this.onResize(U=>this._renderService.resize(U.cols,U.rows)),this._compositionView=X.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(o.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(W);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(x.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(y.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(U=>this._renderService.handleSelectionChanged(U.start,U.end,U.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(U=>{this.textarea.value=U,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(U=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,S.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this.register((0,S.addDisposableDomListener)(this.element,"mousedown",U=>this._selectionService.handleMouseDown(U))),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",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const D=this,F=this.element;function W(J){const ae=D._mouseService.getMouseReportCoords(J,D.screenElement);if(!ae)return!1;let we,fe;switch(J.overrideType||J.type){case"mousemove":fe=32,J.buttons===void 0?(we=3,J.button!==void 0&&(we=J.button<3?J.button:3)):we=1&J.buttons?0:4&J.buttons?1:2&J.buttons?2:3;break;case"mouseup":fe=0,we=J.button<3?J.button:3;break;case"mousedown":fe=1,we=J.button<3?J.button:3;break;case"wheel":if(D.viewport.getLinesScrolled(J)===0)return!1;fe=J.deltaY<0?0:1,we=4;break;default:return!1}return!(fe===void 0||we===void 0||we>4)&&D.coreMouseService.triggerMouseEvent({col:ae.col,row:ae.row,x:ae.x,y:ae.y,button:we,action:fe,ctrl:J.ctrlKey,alt:J.altKey,shift:J.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},re={mouseup:J=>(W(J),J.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(J)),wheel:J=>(W(J),this.cancel(J,!0)),mousedrag:J=>{J.buttons&&W(J)},mousemove:J=>{J.buttons||W(J)}};this.register(this.coreMouseService.onProtocolChange(J=>{J?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(J)),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&J?U.mousemove||(F.addEventListener("mousemove",re.mousemove),U.mousemove=re.mousemove):(F.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&J?U.wheel||(F.addEventListener("wheel",re.wheel,{passive:!1}),U.wheel=re.wheel):(F.removeEventListener("wheel",U.wheel),U.wheel=null),2&J?U.mouseup||(F.addEventListener("mouseup",re.mouseup),U.mouseup=re.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),F.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&J?U.mousedrag||(U.mousedrag=re.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,S.addDisposableDomListener)(F,"mousedown",J=>{if(J.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(J))return W(J),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(J)})),this.register((0,S.addDisposableDomListener)(F,"wheel",J=>{if(!U.wheel){if(!this.buffer.hasScrollback){const ae=this.viewport.getLinesScrolled(J);if(ae===0)return;const we=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(J.deltaY<0?"A":"B");let fe="";for(let ut=0;ut<Math.abs(ae);ut++)fe+=we;return this.coreService.triggerDataEvent(fe,!0),this.cancel(J,!0)}return this.viewport.handleWheel(J)?this.cancel(J):void 0}},{passive:!1})),this.register((0,S.addDisposableDomListener)(F,"touchstart",J=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(J),this.cancel(J)},{passive:!0})),this.register((0,S.addDisposableDomListener)(F,"touchmove",J=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(J)?void 0:this.cancel(J)},{passive:!1}))}refresh(D,F){var W;(W=this._renderService)===null||W===void 0||W.refreshRows(D,F)}updateCursorStyle(D){var F;!((F=this._selectionService)===null||F===void 0)&&F.shouldColumnSelect(D)?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(D,F,W=0){var U;W===1?(super.scrollLines(D,F,W),this.refresh(0,this.rows-1)):(U=this.viewport)===null||U===void 0||U.scrollLines(D)}paste(D){(0,f.paste)(D,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(D){this._customKeyEventHandler=D}registerLinkProvider(D){return this.linkifier2.registerLinkProvider(D)}registerCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const F=this._characterJoinerService.register(D);return this.refresh(0,this.rows-1),F}deregisterCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(D)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(D){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+D)}registerDecoration(D){return this._decorationService.registerDecoration(D)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(D,F,W){this._selectionService.setSelection(D,F,W)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var D;(D=this._selectionService)===null||D===void 0||D.clearSelection()}selectAll(){var D;(D=this._selectionService)===null||D===void 0||D.selectAll()}selectLines(D,F){var W;(W=this._selectionService)===null||W===void 0||W.selectLines(D,F)}_keyDown(D){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;const F=this.browser.isMac&&this.options.macOptionIsMeta&&D.altKey;if(!F&&!this._compositionHelper.keydown(D))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;F||D.key!=="Dead"&&D.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,E.evaluateKeyboardEvent)(D,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(D),W.type===3||W.type===2){const U=this.rows-1;return this.scrollLines(W.type===2?-U:U),this.cancel(D,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,D)||(W.cancel&&this.cancel(D,!0),!W.key||!!(D.key&&!D.ctrlKey&&!D.altKey&&!D.metaKey&&D.key.length===1&&D.key.charCodeAt(0)>=65&&D.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==$.C0.ETX&&W.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||D.altKey||D.ctrlKey?this.cancel(D,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(D,F){const W=D.isMac&&!this.options.macOptionIsMeta&&F.altKey&&!F.ctrlKey&&!F.metaKey||D.isWindows&&F.altKey&&F.ctrlKey&&!F.metaKey||D.isWindows&&F.getModifierState("AltGraph");return F.type==="keypress"?W:W&&(!F.keyCode||F.keyCode>47)}_keyUp(D){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1||(function(F){return F.keyCode===16||F.keyCode===17||F.keyCode===18}(D)||this.focus(),this.updateCursorStyle(D),this._keyPressHandled=!1)}_keyPress(D){let F;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;if(this.cancel(D),D.charCode)F=D.charCode;else if(D.which===null||D.which===void 0)F=D.keyCode;else{if(D.which===0||D.charCode===0)return!1;F=D.which}return!(!F||(D.altKey||D.ctrlKey||D.metaKey)&&!this._isThirdLevelShift(this.browser,D)||(F=String.fromCharCode(F),this._onKey.fire({key:F,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(F,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(D){if(D.data&&D.inputType==="insertText"&&(!D.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const F=D.data;return this.coreService.triggerDataEvent(F,!0),this.cancel(D),!0}return!1}resize(D,F){D!==this.cols||F!==this.rows?super.resize(D,F):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(D,F){var W,U;(W=this._charSizeService)===null||W===void 0||W.measure(),(U=this.viewport)===null||U===void 0||U.syncScrollArea(!0)}clear(){var D;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(j.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(D=this.viewport)===null||D===void 0||D.reset(),this.refresh(0,this.rows-1)}}reset(){var D,F;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)===null||D===void 0||D.reset(),this._decorationService.reset(),(F=this.viewport)===null||F===void 0||F.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var D;(D=this._renderService)===null||D===void 0||D.clearTextureAtlas()}_reportFocus(){var D;!((D=this.element)===null||D===void 0)&&D.classList.contains("focus")?this.coreService.triggerDataEvent($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(D){if(this._renderService)switch(D){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const F=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${W};${F}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),re=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${re};${U}t`)}}cancel(D,F){if(this.options.cancelEvents||F)return D.preventDefault(),D.stopPropagation(),!1}}l.Terminal=q},9924:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,f=1e3){this._renderCallback=u,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,f,S){this._rowCount=S,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=d-this._lastRefreshMs,C=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f)}}},1680:function(_,l,u){var f=this&&this.__decorate||function(o,s,c,p){var v,x=arguments.length,b=x<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,s,c,p);else for(var y=o.length-1;y>=0;y--)(v=o[y])&&(b=(x<3?v(b):x>3?v(s,c,b):v(s,c))||b);return x>3&&b&&Object.defineProperty(s,c,b),b},S=this&&this.__param||function(o,s){return function(c,p){s(c,p,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=u(3656),m=u(4725),C=u(8460),w=u(844),g=u(2585);let a=l.Viewport=class extends w.Disposable{constructor(o,s,c,p,v,x,b,y){super(),this._viewportElement=o,this._scrollArea=s,this._bufferService=c,this._optionsService=p,this._charSizeService=v,this._renderService=x,this._coreBrowserService=b,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 C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(k=>this._renderDimensions=k)),this._handleThemeChange(y.colors),this.register(y.onChangeColors(k=>this._handleThemeChange(k))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(o){this._viewportElement.style.backgroundColor=o.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(o){if(o)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._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const o=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==o&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=o),this._refreshAnimationFrame=null}syncScrollArea(o=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(o);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(o)}_handleScroll(o){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 s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const o=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(o*(this._smoothScrollState.target-this._smoothScrollState.origin)),o<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(o,s){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&c<this._lastRecordedBufferHeight)||(o.cancelable&&o.preventDefault(),!1)}handleWheel(o){const s=this._getPixelsScrolled(o);return s!==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+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}scrollLines(o){if(o!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=o*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!1})}_getPixelsScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(o,s){var c;let p,v="";const x=[],b=s??this._bufferService.buffer.lines.length,y=this._bufferService.buffer.lines;for(let k=o;k<b;k++){const R=y.get(k);if(!R)continue;const O=(c=y.get(k+1))===null||c===void 0?void 0:c.isWrapped;if(v+=R.translateToString(!O),!O||k===y.length-1){const T=document.createElement("div");T.textContent=v,x.push(T),v.length>0&&(p=T),v=""}}return{bufferElements:x,cursorElement:p}}getLinesScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(o,s){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&s.altKey||c==="ctrl"&&s.ctrlKey||c==="shift"&&s.shiftKey?o*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:o*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(o){this._lastTouchY=o.touches[0].pageY}handleTouchMove(o){const s=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}};l.Viewport=a=f([S(2,g.IBufferService),S(3,g.IOptionsService),S(4,m.ICharSizeService),S(5,m.IRenderService),S(6,m.ICoreBrowserService),S(7,m.IThemeService)],a)},3107:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},S=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const d=u(3656),m=u(4725),C=u(844),w=u(2585);let g=l.BufferDecorationRenderer=class extends C.Disposable{constructor(a,o,s,c){super(),this._screenElement=a,this._bufferService=o,this._decorationService=s,this._renderService=c,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,d.addDisposableDomListener)(window,"resize",()=>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(p=>this._removeDecoration(p))),this.register((0,C.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 a of this._decorationService.decorations)this._renderDecoration(a);this._dimensionsChanged=!1}_renderDecoration(a){this._refreshStyle(a),this._dimensionsChanged&&this._refreshXPosition(a)}_createElement(a){var o,s;const c=document.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((o=a==null?void 0:a.options)===null||o===void 0?void 0:o.layer)==="top"),c.style.width=`${Math.round((a.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(a.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(a.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const p=(s=a.options.x)!==null&&s!==void 0?s:0;return p&&p>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(a,c),c}_refreshStyle(a){const o=a.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)a.element&&(a.element.style.display="none",a.onRenderEmitter.fire(a.element));else{let s=this._decorationElements.get(a);s||(s=this._createElement(a),a.element=s,this._decorationElements.set(a,s),this._container.appendChild(s),a.onDispose(()=>{this._decorationElements.delete(a),s.remove()})),s.style.top=o*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",a.onRenderEmitter.fire(s)}}_refreshXPosition(a,o=a.element){var s;if(!o)return;const c=(s=a.options.x)!==null&&s!==void 0?s:0;(a.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(a){var o;(o=this._decorationElements.get(a))===null||o===void 0||o.remove(),this._decorationElements.delete(a),a.dispose()}};l.BufferDecorationRenderer=g=f([S(1,w.IBufferService),S(2,w.IDecorationService),S(3,m.IRenderService)],g)},5871:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const f of this._zones)if(f.color===u.options.overviewRulerOptions.color&&f.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,u.marker.line))return;if(this._lineAdjacentToZone(f,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(f,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,f){return f>=u.startBufferLine&&f<=u.endBufferLine}_lineAdjacentToZone(u,f,S){return f>=u.startBufferLine-this._linePadding[S||"full"]&&f<=u.endBufferLine+this._linePadding[S||"full"]}_addLineToZone(u,f){u.startBufferLine=Math.min(u.startBufferLine,f),u.endBufferLine=Math.max(u.endBufferLine,f)}}},5744:function(_,l,u){var f=this&&this.__decorate||function(p,v,x,b){var y,k=arguments.length,R=k<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,v,x,b);else for(var O=p.length-1;O>=0;O--)(y=p[O])&&(R=(k<3?y(R):k>3?y(v,x,R):y(v,x))||R);return k>3&&R&&Object.defineProperty(v,x,R),R},S=this&&this.__param||function(p,v){return function(x,b){v(x,b,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const d=u(5871),m=u(3656),C=u(4725),w=u(844),g=u(2585),a={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let c=l.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,v,x,b,y,k,R){var O;super(),this._viewportElement=p,this._screenElement=v,this._bufferService=x,this._decorationService=b,this._renderService=y,this._optionsService=k,this._coreBrowseService=R,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)===null||O===void 0||O.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)(()=>{var B;(B=this._canvas)===null||B===void 0||B.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,m.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const p=Math.floor(this._canvas.width/3),v=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=p,o.center=v,o.right=p,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=o.left,s.right=o.left+o.center}_refreshDrawHeightConstants(){a.full=Math.round(2*this._coreBrowseService.dpr);const p=this._canvas.height/this._bufferService.buffer.lines.length,v=Math.round(Math.max(Math.min(p,12),6)*this._coreBrowseService.dpr);a.left=v,a.center=v,a.right=v}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.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 v of this._decorationService.decorations)this._colorZoneStore.addDecoration(v);this._ctx.lineWidth=1;const p=this._colorZoneStore.zones;for(const v of p)v.position!=="full"&&this._renderColorZone(v);for(const v of p)v.position==="full"&&this._renderColorZone(v);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(p){this._ctx.fillStyle=p.color,this._ctx.fillRect(s[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-a[p.position||"full"]/2),o[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+a[p.position||"full"]))}_queueRefresh(p,v){this._shouldUpdateDimensions=p||this._shouldUpdateDimensions,this._shouldUpdateAnchor=v||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};l.OverviewRulerRenderer=c=f([S(2,g.IBufferService),S(3,g.IDecorationService),S(4,C.IRenderService),S(5,g.IOptionsService),S(6,C.ICoreBrowserService)],c)},2950:function(_,l,u){var f=this&&this.__decorate||function(g,a,o,s){var c,p=arguments.length,v=p<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(g,a,o,s);else for(var x=g.length-1;x>=0;x--)(c=g[x])&&(v=(p<3?c(v):p>3?c(a,o,v):c(a,o))||v);return p>3&&v&&Object.defineProperty(a,o,v),v},S=this&&this.__param||function(g,a){return function(o,s){a(o,s,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const d=u(4725),m=u(2585),C=u(2584);let w=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(g,a,o,s,c,p){this._textarea=g,this._compositionView=a,this._bufferService=o,this._optionsService=s,this._coreService=c,this._renderService=p,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(g){this._compositionView.textContent=g.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(g){if(this._isComposing||this._isSendingComposition){if(g.keyCode===229||g.keyCode===16||g.keyCode===17||g.keyCode===18)return!1;this._finalizeComposition(!1)}return g.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(g){if(this._compositionView.classList.remove("active"),this._isComposing=!1,g){const a={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let o;this._isSendingComposition=!1,a.start+=this._dataAlreadySent.length,o=this._isComposing?this._textarea.value.substring(a.start,a.end):this._textarea.value.substring(a.start),o.length>0&&this._coreService.triggerDataEvent(o,!0)}},0)}else{this._isSendingComposition=!1;const a=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(a,!0)}}_handleAnyTextareaChanges(){const g=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const a=this._textarea.value,o=a.replace(g,"");this._dataAlreadySent=o,a.length>g.length?this._coreService.triggerDataEvent(o,!0):a.length<g.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):a.length===g.length&&a!==g&&this._coreService.triggerDataEvent(a,!0)}},0)}updateCompositionElements(g){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const a=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),o=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=a*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=o+"px",this._compositionView.style.lineHeight=o+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}g||setTimeout(()=>this.updateCompositionElements(!0),0)}}};l.CompositionHelper=w=f([S(2,m.IBufferService),S(3,m.IOptionsService),S(4,m.ICoreService),S(5,d.IRenderService)],w)},9806:(_,l)=>{function u(f,S,d){const m=d.getBoundingClientRect(),C=f.getComputedStyle(d),w=parseInt(C.getPropertyValue("padding-left")),g=parseInt(C.getPropertyValue("padding-top"));return[S.clientX-m.left-w,S.clientY-m.top-g]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(f,S,d,m,C,w,g,a,o){if(!w)return;const s=u(f,S,d);return s?(s[0]=Math.ceil((s[0]+(o?g/2:0))/g),s[1]=Math.ceil(s[1]/a),s[0]=Math.min(Math.max(s[0],1),m+(o?1:0)),s[1]=Math.min(Math.max(s[1],1),C),s):void 0}},9504:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const f=u(2584);function S(a,o,s,c){const p=a-d(a,s),v=o-d(o,s),x=Math.abs(p-v)-function(b,y,k){let R=0;const O=b-d(b,k),T=y-d(y,k);for(let B=0;B<Math.abs(O-T);B++){const z=m(b,y)==="A"?-1:1,I=k.buffer.lines.get(O+z*B);I!=null&&I.isWrapped&&R++}return R}(a,o,s);return g(x,w(m(a,o),c))}function d(a,o){let s=0,c=o.buffer.lines.get(a),p=c==null?void 0:c.isWrapped;for(;p&&a>=0&&a<o.rows;)s++,c=o.buffer.lines.get(--a),p=c==null?void 0:c.isWrapped;return s}function m(a,o){return a>o?"A":"B"}function C(a,o,s,c,p,v){let x=a,b=o,y="";for(;x!==s||b!==c;)x+=p?1:-1,p&&x>v.cols-1?(y+=v.buffer.translateBufferLineToString(b,!1,a,x),x=0,a=0,b++):!p&&x<0&&(y+=v.buffer.translateBufferLineToString(b,!1,0,a+1),x=v.cols-1,a=x,b--);return y+v.buffer.translateBufferLineToString(b,!1,a,x)}function w(a,o){const s=o?"O":"[";return f.C0.ESC+s+a}function g(a,o){a=Math.floor(a);let s="";for(let c=0;c<a;c++)s+=o;return s}l.moveToCellSequence=function(a,o,s,c){const p=s.buffer.x,v=s.buffer.y;if(!s.buffer.hasScrollback)return function(y,k,R,O,T,B){return S(k,O,T,B).length===0?"":g(C(y,k,y,k-d(k,T),!1,T).length,w("D",B))}(p,v,0,o,s,c)+S(v,o,s,c)+function(y,k,R,O,T,B){let z;z=S(k,O,T,B).length>0?O-d(O,T):k;const I=O,j=function($,E,A,P,M,H){let K;return K=S(A,P,M,H).length>0?P-d(P,M):E,$<A&&K<=P||$>=A&&K<P?"C":"D"}(y,k,R,O,T,B);return g(C(y,z,R,I,j==="C",T).length,w(j,B))}(p,v,a,o,s,c);let x;if(v===o)return x=p>a?"D":"C",g(Math.abs(p-a),w(x,c));x=v>o?"D":"C";const b=Math.abs(v-o);return g(function(y,k){return k.cols-y}(v>o?a:p,s)+(b-1)*s.cols+1+((v>o?p:a)-1),w(x,c))}},1296:function(_,l,u){var f=this&&this.__decorate||function(T,B,z,I){var j,$=arguments.length,E=$<3?B:I===null?I=Object.getOwnPropertyDescriptor(B,z):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(T,B,z,I);else for(var A=T.length-1;A>=0;A--)(j=T[A])&&(E=($<3?j(E):$>3?j(B,z,E):j(B,z))||E);return $>3&&E&&Object.defineProperty(B,z,E),E},S=this&&this.__param||function(T,B){return function(z,I){B(z,I,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=u(3787),m=u(2550),C=u(2223),w=u(6171),g=u(4725),a=u(8055),o=u(8460),s=u(844),c=u(2585),p="xterm-dom-renderer-owner-",v="xterm-rows",x="xterm-fg-",b="xterm-bg-",y="xterm-focus",k="xterm-selection";let R=1,O=l.DomRenderer=class extends s.Disposable{constructor(T,B,z,I,j,$,E,A,P,M){super(),this._element=T,this._screenElement=B,this._viewportElement=z,this._linkifier2=I,this._charSizeService=$,this._optionsService=E,this._bufferService=A,this._coreBrowserService=P,this._themeService=M,this._terminalClass=R++,this._rowElements=[],this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(v),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(k),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(H=>this._injectCss(H))),this._injectCss(this._themeService.colors),this._rowFactory=j.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(H=>this._handleLinkHover(H))),this.register(this._linkifier2.onHideLinkUnderline(H=>this._handleLinkLeave(H))),this.register((0,s.toDisposable)(()=>{this._element.classList.remove(p+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new m.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),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/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),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 z of this._rowElements)z.style.width=`${this.dimensions.css.canvas.width}px`,z.style.height=`${this.dimensions.css.cell.height}px`,z.style.lineHeight=`${this.dimensions.css.cell.height}px`,z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const B=`${this._terminalSelector} .${v} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=B,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(T){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let B=`${this._terminalSelector} .${v} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;B+=`${this._terminalSelector} .${v} .xterm-dim { color: ${a.color.multiplyOpacity(T.foreground,.5).css};}`,B+=`${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;}`,B+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",B+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,B+=`${this._terminalSelector} .${v}.${y} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${v}.${y} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,B+=`${this._terminalSelector} .${k} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${k} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${k} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[z,I]of T.ansi.entries())B+=`${this._terminalSelector} .${x}${z} { color: ${I.css}; }${this._terminalSelector} .${x}${z}.xterm-dim { color: ${a.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${b}${z} { background-color: ${I.css}; }`;B+=`${this._terminalSelector} .${x}${C.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(T.background).css}; }${this._terminalSelector} .${x}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${b}${C.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=B}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,B){for(let z=this._rowElements.length;z<=B;z++){const I=document.createElement("div");this._rowContainer.appendChild(I),this._rowElements.push(I)}for(;this._rowElements.length>B;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,B){this._refreshRowElements(T,B),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(y)}handleFocus(){this._rowContainer.classList.add(y),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(T,B,z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,B,z),this.renderRows(0,this._bufferService.rows-1),!T||!B)return;const I=T[1]-this._bufferService.buffer.ydisp,j=B[1]-this._bufferService.buffer.ydisp,$=Math.max(I,0),E=Math.min(j,this._bufferService.rows-1);if($>=this._bufferService.rows||E<0)return;const A=document.createDocumentFragment();if(z){const P=T[0]>B[0];A.appendChild(this._createSelectionElement($,P?B[0]:T[0],P?T[0]:B[0],E-$+1))}else{const P=I===$?T[0]:0,M=$===j?B[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement($,P,M));const H=E-$-1;if(A.appendChild(this._createSelectionElement($+1,0,this._bufferService.cols,H)),$!==E){const K=j===E?B[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(E,0,K))}}this._selectionContainer.appendChild(A)}_createSelectionElement(T,B,z,I=1){const j=document.createElement("div");return j.style.height=I*this.dimensions.css.cell.height+"px",j.style.top=T*this.dimensions.css.cell.height+"px",j.style.left=B*this.dimensions.css.cell.width+"px",j.style.width=this.dimensions.css.cell.width*(z-B)+"px",j}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 T of this._rowElements)T.replaceChildren()}renderRows(T,B){const z=this._bufferService.buffer,I=z.ybase+z.y,j=Math.min(z.x,this._bufferService.cols-1),$=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,A=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=T;P<=B;P++){const M=P+z.ydisp,H=this._rowElements[P],K=z.lines.get(M);if(!H||!K)break;H.replaceChildren(...this._rowFactory.createRow(K,M,M===I,E,A,j,$,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,B,z,I,j,$){z<0&&(T=0),I<0&&(B=0);const E=this._bufferService.rows-1;z=Math.max(Math.min(z,E),0),I=Math.max(Math.min(I,E),0),j=Math.min(j,this._bufferService.cols);const A=this._bufferService.buffer,P=A.ybase+A.y,M=Math.min(A.x,j-1),H=this._optionsService.rawOptions.cursorBlink,K=this._optionsService.rawOptions.cursorStyle,X=this._optionsService.rawOptions.cursorInactiveStyle;for(let q=z;q<=I;++q){const se=q+A.ydisp,D=this._rowElements[q],F=A.lines.get(se);if(!D||!F)break;D.replaceChildren(...this._rowFactory.createRow(F,se,se===P,K,X,M,H,this.dimensions.css.cell.width,this._widthCache,$?q===z?T:0:-1,$?(q===I?B:j)-1:-1))}}};l.DomRenderer=O=f([S(4,c.IInstantiationService),S(5,g.ICharSizeService),S(6,c.IOptionsService),S(7,c.IBufferService),S(8,g.ICoreBrowserService),S(9,g.IThemeService)],O)},3787:function(_,l,u){var f=this&&this.__decorate||function(x,b,y,k){var R,O=arguments.length,T=O<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,y):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,y,k);else for(var B=x.length-1;B>=0;B--)(R=x[B])&&(T=(O<3?R(T):O>3?R(b,y,T):R(b,y))||T);return O>3&&T&&Object.defineProperty(b,y,T),T},S=this&&this.__param||function(x,b){return function(y,k){b(y,k,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const d=u(2223),m=u(643),C=u(511),w=u(2585),g=u(8055),a=u(4725),o=u(4269),s=u(6171),c=u(3734);let p=l.DomRendererRowFactory=class{constructor(x,b,y,k,R,O,T){this._document=x,this._characterJoinerService=b,this._optionsService=y,this._coreBrowserService=k,this._coreService=R,this._decorationService=O,this._themeService=T,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,b,y){this._selectionStart=x,this._selectionEnd=b,this._columnSelectMode=y}createRow(x,b,y,k,R,O,T,B,z,I,j){const $=[],E=this._characterJoinerService.getJoinedCharacters(b),A=this._themeService.colors;let P,M=x.getNoBgTrimmedLength();y&&M<O+1&&(M=O+1);let H=0,K="",X=0,q=0,se=0,D=!1,F=0,W=!1,U=0;const re=[],J=I!==-1&&j!==-1;for(let ae=0;ae<M;ae++){x.loadCell(ae,this._workCell);let we=this._workCell.getWidth();if(we===0)continue;let fe=!1,ut=ae,ne=this._workCell;if(E.length>0&&ae===E[0][0]){fe=!0;const pe=E.shift();ne=new o.JoinedCellData(this._workCell,x.translateToString(!0,pe[0],pe[1]),pe[1]-pe[0]),ut=pe[1]-1,we=ne.getWidth()}const ht=this._isCellInSelection(ae,b),Xe=y&&ae===O,Ut=J&&ae>=I&&ae<=j;let Q=!1;this._decorationService.forEachDecorationAtCell(ae,b,void 0,pe=>{Q=!0});let Y=ne.getChars()||m.WHITESPACE_CELL_CHAR;if(Y===" "&&(ne.isUnderline()||ne.isOverline())&&(Y=" "),U=we*B-z.get(Y,ne.isBold(),ne.isItalic()),P){if(H&&(ht&&W||!ht&&!W&&ne.bg===X)&&(ht&&W&&A.selectionForeground||ne.fg===q)&&ne.extended.ext===se&&Ut===D&&U===F&&!Xe&&!fe&&!Q){K+=Y,H++;continue}H&&(P.textContent=K),P=this._document.createElement("span"),H=0,K=""}else P=this._document.createElement("span");if(X=ne.bg,q=ne.fg,se=ne.extended.ext,D=Ut,F=U,W=ht,fe&&O>=ae&&O<=ut&&(O=ae),!this._coreService.isCursorHidden&&Xe){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&re.push("xterm-cursor-blink"),re.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":re.push("xterm-cursor-outline");break;case"block":re.push("xterm-cursor-block");break;case"bar":re.push("xterm-cursor-bar");break;case"underline":re.push("xterm-cursor-underline")}}if(ne.isBold()&&re.push("xterm-bold"),ne.isItalic()&&re.push("xterm-italic"),ne.isDim()&&re.push("xterm-dim"),K=ne.isInvisible()?m.WHITESPACE_CELL_CHAR:ne.getChars()||m.WHITESPACE_CELL_CHAR,ne.isUnderline()&&(re.push(`xterm-underline-${ne.extended.underlineStyle}`),K===" "&&(K=" "),!ne.isUnderlineColorDefault()))if(ne.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(ne.getUnderlineColor()).join(",")})`;else{let pe=ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ne.isBold()&&pe<8&&(pe+=8),P.style.textDecorationColor=A.ansi[pe].css}ne.isOverline()&&(re.push("xterm-overline"),K===" "&&(K=" ")),ne.isStrikethrough()&&re.push("xterm-strikethrough"),Ut&&(P.style.textDecoration="underline");let te=ne.getFgColor(),ie=ne.getFgColorMode(),oe=ne.getBgColor(),ce=ne.getBgColorMode();const Be=!!ne.isInverse();if(Be){const pe=te;te=oe,oe=pe;const ni=ie;ie=ce,ce=ni}let me,Tt,We,At=!1;switch(this._decorationService.forEachDecorationAtCell(ae,b,void 0,pe=>{pe.options.layer!=="top"&&At||(pe.backgroundColorRGB&&(ce=50331648,oe=pe.backgroundColorRGB.rgba>>8&16777215,me=pe.backgroundColorRGB),pe.foregroundColorRGB&&(ie=50331648,te=pe.foregroundColorRGB.rgba>>8&16777215,Tt=pe.foregroundColorRGB),At=pe.options.layer==="top")}),!At&&ht&&(me=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,oe=me.rgba>>8&16777215,ce=50331648,At=!0,A.selectionForeground&&(ie=50331648,te=A.selectionForeground.rgba>>8&16777215,Tt=A.selectionForeground)),At&&re.push("xterm-decoration-top"),ce){case 16777216:case 33554432:We=A.ansi[oe],re.push(`xterm-bg-${oe}`);break;case 50331648:We=g.rgba.toColor(oe>>16,oe>>8&255,255&oe),this._addStyle(P,`background-color:#${v((oe>>>0).toString(16),"0",6)}`);break;default:Be?(We=A.foreground,re.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):We=A.background}switch(me||ne.isDim()&&(me=g.color.multiplyOpacity(We,.5)),ie){case 16777216:case 33554432:ne.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(P,We,A.ansi[te],ne,me,void 0)||re.push(`xterm-fg-${te}`);break;case 50331648:const pe=g.rgba.toColor(te>>16&255,te>>8&255,255&te);this._applyMinimumContrast(P,We,pe,ne,me,Tt)||this._addStyle(P,`color:#${v(te.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,We,A.foreground,ne,me,void 0)||Be&&re.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}re.length&&(P.className=re.join(" "),re.length=0),Xe||fe||Q?P.textContent=K:H++,U!==this.defaultSpacing&&(P.style.letterSpacing=`${U}px`),$.push(P),ae=ut}return P&&H&&(P.textContent=K),$}_applyMinimumContrast(x,b,y,k,R,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.excludeFromContrastRatioDemands)(k.getCode()))return!1;const T=this._getContrastCache(k);let B;if(R||O||(B=T.getColor(b.rgba,y.rgba)),B===void 0){const z=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);B=g.color.ensureContrastRatio(R||b,O||y,z),T.setColor((R||b).rgba,(O||y).rgba,B??null)}return!!B&&(this._addStyle(x,`color:${B.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,b){x.setAttribute("style",`${x.getAttribute("style")||""}${b};`)}_isCellInSelection(x,b){const y=this._selectionStart,k=this._selectionEnd;return!(!y||!k)&&(this._columnSelectMode?y[0]<=k[0]?x>=y[0]&&b>=y[1]&&x<k[0]&&b<=k[1]:x<y[0]&&b>=y[1]&&x>=k[0]&&b<=k[1]:b>y[1]&&b<k[1]||y[1]===k[1]&&b===y[1]&&x>=y[0]&&x<k[0]||y[1]<k[1]&&b===k[1]&&x<k[0]||y[1]<k[1]&&b===y[1]&&x>=y[0])}};function v(x,b,y){for(;x.length<y;)x=b+x;return x}l.DomRendererRowFactory=p=f([S(1,a.ICharacterJoinerService),S(2,w.IOptionsService),S(3,a.ICoreBrowserService),S(4,w.ICoreService),S(5,w.IDecorationService),S(6,a.IThemeService)],p)},2550:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const f=u.createElement("span"),S=u.createElement("span");S.style.fontWeight="bold";const d=u.createElement("span");d.style.fontStyle="italic";const m=u.createElement("span");m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[f,S,d,m],this._container.appendChild(f),this._container.appendChild(S),this._container.appendChild(d),this._container.appendChild(m),u.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,f,S,d){u===this._font&&f===this._fontSize&&S===this._weight&&d===this._weightBold||(this._font=u,this._fontSize=f,this._weight=S,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${S}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${S}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(u,f,S){let d=0;if(!f&&!S&&u.length===1&&(d=u.charCodeAt(0))<256)return this._flat[d]!==-9999?this._flat[d]:this._flat[d]=this._measure(u,0);let m=u;f&&(m+="B"),S&&(m+="I");let C=this._holey.get(m);if(C===void 0){let w=0;f&&(w|=1),S&&(w|=2),C=this._measure(u,w),this._holey.set(m,C)}return C}_measure(u,f){const S=this._measureElements[f];return S.textContent=u.repeat(32),S.offsetWidth/32}}},2223:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const f=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(_,l)=>{function u(f){return 57508<=f&&f<=57558}Object.defineProperty(l,"__esModule",{value:!0}),l.createRenderDimensions=l.excludeFromContrastRatioDemands=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},l.excludeFromContrastRatioDemands=function(f){return u(f)||function(S){return 9472<=S&&S<=9631}(f)},l.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}}}}},456:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,f=this.selectionEnd;return!(!u||!f)&&(u[1]>f[1]||u[1]===f[1]&&u[0]>f[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},S=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const d=u(2585),m=u(8460),C=u(844);let w=l.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(a,o,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new g(a,o,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())}};l.CharSizeService=w=f([S(2,d.IOptionsService)],w);class g{constructor(o,s,c){this._document=o,this._parentElement=s,this._optionsService=c,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const o={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return o.width!==0&&o.height!==0&&(this._result.width=o.width/32,this._result.height=Math.ceil(o.height)),this._result}}},4269:function(_,l,u){var f=this&&this.__decorate||function(o,s,c,p){var v,x=arguments.length,b=x<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,s,c,p);else for(var y=o.length-1;y>=0;y--)(v=o[y])&&(b=(x<3?v(b):x>3?v(s,c,b):v(s,c))||b);return x>3&&b&&Object.defineProperty(s,c,b),b},S=this&&this.__param||function(o,s){return function(c,p){s(c,p,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const d=u(3734),m=u(643),C=u(511),w=u(2585);class g extends d.AttributeData{constructor(s,c,p){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=c,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=g;let a=l.CharacterJoinerService=class Gh{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(s){const c={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(c),c.id}deregister(s){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===s)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(s);if(!c||c.length===0)return[];const p=[],v=c.translateToString(!0);let x=0,b=0,y=0,k=c.getFg(0),R=c.getBg(0);for(let O=0;O<c.getTrimmedLength();O++)if(c.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==R){if(O-x>1){const T=this._getJoinedRanges(v,y,b,c,x);for(let B=0;B<T.length;B++)p.push(T[B])}x=O,y=b,k=this._workCell.fg,R=this._workCell.bg}b+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const O=this._getJoinedRanges(v,y,b,c,x);for(let T=0;T<O.length;T++)p.push(O[T])}return p}_getJoinedRanges(s,c,p,v,x){const b=s.substring(c,p);let y=[];try{y=this._characterJoiners[0].handler(b)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const R=this._characterJoiners[k].handler(b);for(let O=0;O<R.length;O++)Gh._mergeRanges(y,R[O])}catch(R){console.error(R)}return this._stringRangesToCellRanges(y,v,x),y}_stringRangesToCellRanges(s,c,p){let v=0,x=!1,b=0,y=s[v];if(y){for(let k=p;k<this._bufferService.cols;k++){const R=c.getWidth(k),O=c.getString(k).length||m.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!x&&y[0]<=b&&(y[0]=k,x=!0),y[1]<=b){if(y[1]=k,y=s[++v],!y)break;y[0]<=b?(y[0]=k,x=!0):x=!1}b+=O}}y&&(y[1]=this._bufferService.cols)}}static _mergeRanges(s,c){let p=!1;for(let v=0;v<s.length;v++){const x=s[v];if(p){if(c[1]<=x[0])return s[v-1][1]=c[1],s;if(c[1]<=x[1])return s[v-1][1]=Math.max(c[1],x[1]),s.splice(v,1),s;s.splice(v,1),v--}else{if(c[1]<=x[0])return s.splice(v,0,c),s;if(c[1]<=x[1])return x[0]=Math.min(c[0],x[0]),s;c[0]<x[1]&&(x[0]=Math.min(c[0],x[0]),p=!0)}}return p?s[s.length-1][1]=c[1]:s.push(c),s}};l.CharacterJoinerService=a=f([S(0,w.IBufferService)],a)},5114:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0,l.CoreBrowserService=class{constructor(u,f){this._textarea=u,this.window=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}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}}},8934:function(_,l,u){var f=this&&this.__decorate||function(w,g,a,o){var s,c=arguments.length,p=c<3?g:o===null?o=Object.getOwnPropertyDescriptor(g,a):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(w,g,a,o);else for(var v=w.length-1;v>=0;v--)(s=w[v])&&(p=(c<3?s(p):c>3?s(g,a,p):s(g,a))||p);return c>3&&p&&Object.defineProperty(g,a,p),p},S=this&&this.__param||function(w,g){return function(a,o){g(a,o,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const d=u(4725),m=u(9806);let C=l.MouseService=class{constructor(w,g){this._renderService=w,this._charSizeService=g}getCoords(w,g,a,o,s){return(0,m.getCoords)(window,w,g,a,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(w,g){const a=(0,m.getCoordsRelativeToElement)(window,w,g);if(this._charSizeService.hasValidSize)return a[0]=Math.min(Math.max(a[0],0),this._renderService.dimensions.css.canvas.width-1),a[1]=Math.min(Math.max(a[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(a[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(a[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(a[0]),y:Math.floor(a[1])}}};l.MouseService=C=f([S(0,d.IRenderService),S(1,d.ICharSizeService)],C)},3230:function(_,l,u){var f=this&&this.__decorate||function(p,v,x,b){var y,k=arguments.length,R=k<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,v,x,b);else for(var O=p.length-1;O>=0;O--)(y=p[O])&&(R=(k<3?y(R):k>3?y(v,x,R):y(v,x))||R);return k>3&&R&&Object.defineProperty(v,x,R),R},S=this&&this.__param||function(p,v){return function(x,b){v(x,b,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const d=u(3656),m=u(6193),C=u(5596),w=u(4725),g=u(8460),a=u(844),o=u(7226),s=u(2585);let c=l.RenderService=class extends a.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,v,x,b,y,k,R,O){if(super(),this._rowCount=p,this._charSizeService=b,this._renderer=this.register(new a.MutableDisposable),this._pausedResizeTask=new o.DebouncedIdleTask,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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer(R.window,(T,B)=>this._renderRows(T,B)),this.register(this._renderDebouncer),this._screenDprMonitor=new C.ScreenDprMonitor(R.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)===null||T===void 0?void 0:T.clear()})),this.register(x.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(y.onDecorationRegistered(()=>this._fullRefresh())),this.register(y.onDecorationRemoved(()=>this._fullRefresh())),this.register(x.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()})),this.register(x.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(k.buffer.y,k.buffer.y,!0))),this.register((0,d.addDisposableDomListener)(R.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(O.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in R.window){const T=new R.window.IntersectionObserver(B=>this._handleIntersectionChange(B[B.length-1]),{threshold:0});T.observe(v),this.register({dispose:()=>T.disconnect()})}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,v,x=!1){this._isPaused?this._needsFullRefresh=!0:(x||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,v,this._rowCount))}_renderRows(p,v){this._renderer.value&&(p=Math.min(p,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(p,v),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:v}),this._onRender.fire({start:p,end:v}),this._isNextRenderRedrawOnly=!0)}resize(p,v){this._rowCount=v,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(p){this._renderer.value=p,this._renderer.value.onRequestRedraw(v=>this.refreshRows(v.start,v.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var p,v;this._renderer.value&&((v=(p=this._renderer.value).clearTextureAtlas)===null||v===void 0||v.call(p),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(p,v)):this._renderer.value.handleResize(p,v),this._fullRefresh())}handleCharSizeChanged(){var p;(p=this._renderer.value)===null||p===void 0||p.handleCharSizeChanged()}handleBlur(){var p;(p=this._renderer.value)===null||p===void 0||p.handleBlur()}handleFocus(){var p;(p=this._renderer.value)===null||p===void 0||p.handleFocus()}handleSelectionChanged(p,v,x){var b;this._selectionState.start=p,this._selectionState.end=v,this._selectionState.columnSelectMode=x,(b=this._renderer.value)===null||b===void 0||b.handleSelectionChanged(p,v,x)}handleCursorMove(){var p;(p=this._renderer.value)===null||p===void 0||p.handleCursorMove()}clear(){var p;(p=this._renderer.value)===null||p===void 0||p.clear()}};l.RenderService=c=f([S(2,s.IOptionsService),S(3,w.ICharSizeService),S(4,s.IDecorationService),S(5,s.IBufferService),S(6,w.ICoreBrowserService),S(7,w.IThemeService)],c)},9312:function(_,l,u){var f=this&&this.__decorate||function(y,k,R,O){var T,B=arguments.length,z=B<3?k:O===null?O=Object.getOwnPropertyDescriptor(k,R):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(y,k,R,O);else for(var I=y.length-1;I>=0;I--)(T=y[I])&&(z=(B<3?T(z):B>3?T(k,R,z):T(k,R))||z);return B>3&&z&&Object.defineProperty(k,R,z),z},S=this&&this.__param||function(y,k){return function(R,O){k(R,O,y)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=u(9806),m=u(9504),C=u(456),w=u(4725),g=u(8460),a=u(844),o=u(6114),s=u(4841),c=u(511),p=u(2585),v=" ",x=new RegExp(v,"g");let b=l.SelectionService=class extends a.Disposable{constructor(y,k,R,O,T,B,z,I,j){super(),this._element=y,this._screenElement=k,this._linkifier=R,this._bufferService=O,this._coreService=T,this._mouseService=B,this._optionsService=z,this._renderService=I,this._coreBrowserService=j,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new g.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new g.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new g.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 C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,a.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!y||!k||y[0]===k[0]&&y[1]===k[1])}get selectionText(){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!y||!k)return"";const R=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(y[0]===k[0])return"";const T=y[0]<k[0]?y[0]:k[0],B=y[0]<k[0]?k[0]:y[0];for(let z=y[1];z<=k[1];z++){const I=R.translateBufferLineToString(z,!0,T,B);O.push(I)}}else{const T=y[1]===k[1]?k[0]:void 0;O.push(R.translateBufferLineToString(y[1],!0,y[0],T));for(let B=y[1]+1;B<=k[1]-1;B++){const z=R.lines.get(B),I=R.translateBufferLineToString(B,!0);z!=null&&z.isWrapped?O[O.length-1]+=I:O.push(I)}if(y[1]!==k[1]){const B=R.lines.get(k[1]),z=R.translateBufferLineToString(k[1],!0,0,k[0]);B&&B.isWrapped?O[O.length-1]+=z:O.push(z)}}return O.map(T=>T.replace(x," ")).join(o.isWindows?`\r
44
+ WARNING: This link could potentially be dangerous`)){const o=window.open();if(o){try{o.opener=null}catch{}o.location.href=a}else console.warn("Opening link blocked as opener could not be cleared")}}l.OscLinkProvider=C=f([y(0,m.IBufferService),y(1,m.IOptionsService),y(2,m.IOscLinkService)],C)},6193:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.RenderDebouncer=void 0,l.RenderDebouncer=class{constructor(u,f){this._parentWindow=u,this._renderCallback=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(u,f,y){this._rowCount=y,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},5596:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ScreenDprMonitor=void 0;const f=u(844);class y extends f.Disposable{constructor(m){super(),this._parentWindow=m,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,f.toDisposable)(()=>{this.clearListener()}))}setListener(m){this._listener&&this.clearListener(),this._listener=m,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)===null||m===void 0||m.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}l.ScreenDprMonitor=y},3236:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Terminal=void 0;const f=u(3614),y=u(3656),d=u(6465),m=u(9042),C=u(3730),w=u(1680),g=u(3107),a=u(5744),o=u(2950),s=u(1296),c=u(428),p=u(4269),v=u(5114),x=u(8934),b=u(3230),S=u(9312),k=u(4725),R=u(6731),O=u(8055),T=u(8969),B=u(8460),z=u(844),I=u(6114),j=u(8437),$=u(2584),E=u(7399),A=u(5941),P=u(9074),M=u(2585),H=u(5435),K=u(4567),X=typeof window<"u"?window.document:null;class q extends T.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(D={}){super(D),this.browser=I,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new z.MutableDisposable),this._onCursorMove=this.register(new B.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new B.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new B.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new B.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new B.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new B.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new B.EventEmitter),this._onBlur=this.register(new B.EventEmitter),this._onA11yCharEmitter=this.register(new B.EventEmitter),this._onA11yTabEmitter=this.register(new B.EventEmitter),this._onWillOpen=this.register(new B.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(d.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(C.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(P.DecorationService),this._instantiationService.setService(M.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((F,W)=>this.refresh(F,W))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(F=>this._reportWindowsOptions(F))),this.register(this._inputHandler.onColor(F=>this._handleColorEvent(F))),this.register((0,B.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,B.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,B.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(F=>this._afterResize(F.cols,F.rows))),this.register((0,z.toDisposable)(()=>{var F,W;this._customKeyEventHandler=void 0,(W=(F=this.element)===null||F===void 0?void 0:F.parentNode)===null||W===void 0||W.removeChild(this.element)}))}_handleColorEvent(D){if(this._themeService)for(const F of D){let W,U="";switch(F.index){case 256:W="foreground",U="10";break;case 257:W="background",U="11";break;case 258:W="cursor",U="12";break;default:W="ansi",U="4;"+F.index}switch(F.type){case 0:const re=O.color.toColorRGB(W==="ansi"?this._themeService.colors.ansi[F.index]:this._themeService.colors[W]);this.coreService.triggerDataEvent(`${$.C0.ESC}]${U};${(0,A.toRgbString)(re)}${$.C1_ESCAPED.ST}`);break;case 1:if(W==="ansi")this._themeService.modifyColors(Q=>Q.ansi[F.index]=O.rgba.toColor(...F.color));else{const Q=W;this._themeService.modifyColors(ae=>ae[Q]=O.rgba.toColor(...F.color))}break;case 2:this._themeService.restoreColor(F.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(D){D?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(K.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(D){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.C0.ESC+"[I"),this.updateCursorStyle(D),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var D;return(D=this.textarea)===null||D===void 0?void 0:D.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 D=this.buffer.ybase+this.buffer.y,F=this.buffer.lines.get(D);if(!F)return;const W=Math.min(this.buffer.x,this.cols-1),U=this._renderService.dimensions.css.cell.height,re=F.getWidth(W),Q=this._renderService.dimensions.css.cell.width*re,ae=this.buffer.y*this._renderService.dimensions.css.cell.height,we=W*this._renderService.dimensions.css.cell.width;this.textarea.style.left=we+"px",this.textarea.style.top=ae+"px",this.textarea.style.width=Q+"px",this.textarea.style.height=U+"px",this.textarea.style.lineHeight=U+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,y.addDisposableDomListener)(this.element,"copy",F=>{this.hasSelection()&&(0,f.copyHandler)(F,this._selectionService)}));const D=F=>(0,f.handlePasteEvent)(F,this.textarea,this.coreService,this.optionsService);this.register((0,y.addDisposableDomListener)(this.textarea,"paste",D)),this.register((0,y.addDisposableDomListener)(this.element,"paste",D)),I.isFirefox?this.register((0,y.addDisposableDomListener)(this.element,"mousedown",F=>{F.button===2&&(0,f.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,y.addDisposableDomListener)(this.element,"contextmenu",F=>{(0,f.rightClickHandler)(F,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),I.isLinux&&this.register((0,y.addDisposableDomListener)(this.element,"auxclick",F=>{F.button===1&&(0,f.moveTextAreaUnderMouseCursor)(F,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,y.addDisposableDomListener)(this.textarea,"keyup",D=>this._keyUp(D),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keydown",D=>this._keyDown(D),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"keypress",D=>this._keyPress(D),!0)),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionupdate",D=>this._compositionHelper.compositionupdate(D))),this.register((0,y.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,y.addDisposableDomListener)(this.textarea,"input",D=>this._inputEvent(D),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(D){var F;if(!D)throw new Error("Terminal requires a parent element.");D.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=D.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),D.appendChild(this.element);const W=X.createDocumentFragment();this._viewportElement=X.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),W.appendChild(this._viewportElement),this._viewportScrollArea=X.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=X.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=X.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),W.appendChild(this.screenElement),this.textarea=X.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",m.promptLabel),I.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._instantiationService.createInstance(v.CoreBrowserService,this.textarea,(F=this._document.defaultView)!==null&&F!==void 0?F:window),this._instantiationService.setService(k.ICoreBrowserService,this._coreBrowserService),this.register((0,y.addDisposableDomListener)(this.textarea,"focus",U=>this._handleTextAreaFocus(U))),this.register((0,y.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(c.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(R.ThemeService),this._instantiationService.setService(k.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(p.CharacterJoinerService),this._instantiationService.setService(k.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(b.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(k.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(U=>this._onRender.fire(U))),this.onResize(U=>this._renderService.resize(U.cols,U.rows)),this._compositionView=X.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(o.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(W);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(x.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(w.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(U=>this.scrollLines(U.amount,U.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(S.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(k.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(U=>this.scrollLines(U.amount,U.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(U=>this._renderService.handleSelectionChanged(U.start,U.end,U.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(U=>{this.textarea.value=U,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(U=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,y.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(g.BufferDecorationRenderer,this.screenElement)),this.register((0,y.addDisposableDomListener)(this.element,"mousedown",U=>this._selectionService.handleMouseDown(U))),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",U=>this._handleScreenReaderModeOptionChange(U))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",U=>{!this._overviewRulerRenderer&&U&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(a.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(s.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const D=this,F=this.element;function W(Q){const ae=D._mouseService.getMouseReportCoords(Q,D.screenElement);if(!ae)return!1;let we,fe;switch(Q.overrideType||Q.type){case"mousemove":fe=32,Q.buttons===void 0?(we=3,Q.button!==void 0&&(we=Q.button<3?Q.button:3)):we=1&Q.buttons?0:4&Q.buttons?1:2&Q.buttons?2:3;break;case"mouseup":fe=0,we=Q.button<3?Q.button:3;break;case"mousedown":fe=1,we=Q.button<3?Q.button:3;break;case"wheel":if(D.viewport.getLinesScrolled(Q)===0)return!1;fe=Q.deltaY<0?0:1,we=4;break;default:return!1}return!(fe===void 0||we===void 0||we>4)&&D.coreMouseService.triggerMouseEvent({col:ae.col,row:ae.row,x:ae.x,y:ae.y,button:we,action:fe,ctrl:Q.ctrlKey,alt:Q.altKey,shift:Q.shiftKey})}const U={mouseup:null,wheel:null,mousedrag:null,mousemove:null},re={mouseup:Q=>(W(Q),Q.buttons||(this._document.removeEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.removeEventListener("mousemove",U.mousedrag)),this.cancel(Q)),wheel:Q=>(W(Q),this.cancel(Q,!0)),mousedrag:Q=>{Q.buttons&&W(Q)},mousemove:Q=>{Q.buttons||W(Q)}};this.register(this.coreMouseService.onProtocolChange(Q=>{Q?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Q)),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&Q?U.mousemove||(F.addEventListener("mousemove",re.mousemove),U.mousemove=re.mousemove):(F.removeEventListener("mousemove",U.mousemove),U.mousemove=null),16&Q?U.wheel||(F.addEventListener("wheel",re.wheel,{passive:!1}),U.wheel=re.wheel):(F.removeEventListener("wheel",U.wheel),U.wheel=null),2&Q?U.mouseup||(F.addEventListener("mouseup",re.mouseup),U.mouseup=re.mouseup):(this._document.removeEventListener("mouseup",U.mouseup),F.removeEventListener("mouseup",U.mouseup),U.mouseup=null),4&Q?U.mousedrag||(U.mousedrag=re.mousedrag):(this._document.removeEventListener("mousemove",U.mousedrag),U.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,y.addDisposableDomListener)(F,"mousedown",Q=>{if(Q.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Q))return W(Q),U.mouseup&&this._document.addEventListener("mouseup",U.mouseup),U.mousedrag&&this._document.addEventListener("mousemove",U.mousedrag),this.cancel(Q)})),this.register((0,y.addDisposableDomListener)(F,"wheel",Q=>{if(!U.wheel){if(!this.buffer.hasScrollback){const ae=this.viewport.getLinesScrolled(Q);if(ae===0)return;const we=$.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Q.deltaY<0?"A":"B");let fe="";for(let ut=0;ut<Math.abs(ae);ut++)fe+=we;return this.coreService.triggerDataEvent(fe,!0),this.cancel(Q,!0)}return this.viewport.handleWheel(Q)?this.cancel(Q):void 0}},{passive:!1})),this.register((0,y.addDisposableDomListener)(F,"touchstart",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Q),this.cancel(Q)},{passive:!0})),this.register((0,y.addDisposableDomListener)(F,"touchmove",Q=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Q)?void 0:this.cancel(Q)},{passive:!1}))}refresh(D,F){var W;(W=this._renderService)===null||W===void 0||W.refreshRows(D,F)}updateCursorStyle(D){var F;!((F=this._selectionService)===null||F===void 0)&&F.shouldColumnSelect(D)?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(D,F,W=0){var U;W===1?(super.scrollLines(D,F,W),this.refresh(0,this.rows-1)):(U=this.viewport)===null||U===void 0||U.scrollLines(D)}paste(D){(0,f.paste)(D,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(D){this._customKeyEventHandler=D}registerLinkProvider(D){return this.linkifier2.registerLinkProvider(D)}registerCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const F=this._characterJoinerService.register(D);return this.refresh(0,this.rows-1),F}deregisterCharacterJoiner(D){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(D)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(D){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+D)}registerDecoration(D){return this._decorationService.registerDecoration(D)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(D,F,W){this._selectionService.setSelection(D,F,W)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var D;(D=this._selectionService)===null||D===void 0||D.clearSelection()}selectAll(){var D;(D=this._selectionService)===null||D===void 0||D.selectAll()}selectLines(D,F){var W;(W=this._selectionService)===null||W===void 0||W.selectLines(D,F)}_keyDown(D){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;const F=this.browser.isMac&&this.options.macOptionIsMeta&&D.altKey;if(!F&&!this._compositionHelper.keydown(D))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;F||D.key!=="Dead"&&D.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const W=(0,E.evaluateKeyboardEvent)(D,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(D),W.type===3||W.type===2){const U=this.rows-1;return this.scrollLines(W.type===2?-U:U),this.cancel(D,!0)}return W.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,D)||(W.cancel&&this.cancel(D,!0),!W.key||!!(D.key&&!D.ctrlKey&&!D.altKey&&!D.metaKey&&D.key.length===1&&D.key.charCodeAt(0)>=65&&D.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(W.key!==$.C0.ETX&&W.key!==$.C0.CR||(this.textarea.value=""),this._onKey.fire({key:W.key,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(W.key,!0),!this.optionsService.rawOptions.screenReaderMode||D.altKey||D.ctrlKey?this.cancel(D,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(D,F){const W=D.isMac&&!this.options.macOptionIsMeta&&F.altKey&&!F.ctrlKey&&!F.metaKey||D.isWindows&&F.altKey&&F.ctrlKey&&!F.metaKey||D.isWindows&&F.getModifierState("AltGraph");return F.type==="keypress"?W:W&&(!F.keyCode||F.keyCode>47)}_keyUp(D){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1||(function(F){return F.keyCode===16||F.keyCode===17||F.keyCode===18}(D)||this.focus(),this.updateCursorStyle(D),this._keyPressHandled=!1)}_keyPress(D){let F;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(D)===!1)return!1;if(this.cancel(D),D.charCode)F=D.charCode;else if(D.which===null||D.which===void 0)F=D.keyCode;else{if(D.which===0||D.charCode===0)return!1;F=D.which}return!(!F||(D.altKey||D.ctrlKey||D.metaKey)&&!this._isThirdLevelShift(this.browser,D)||(F=String.fromCharCode(F),this._onKey.fire({key:F,domEvent:D}),this._showCursor(),this.coreService.triggerDataEvent(F,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(D){if(D.data&&D.inputType==="insertText"&&(!D.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const F=D.data;return this.coreService.triggerDataEvent(F,!0),this.cancel(D),!0}return!1}resize(D,F){D!==this.cols||F!==this.rows?super.resize(D,F):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(D,F){var W,U;(W=this._charSizeService)===null||W===void 0||W.measure(),(U=this.viewport)===null||U===void 0||U.syncScrollArea(!0)}clear(){var D;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(j.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(D=this.viewport)===null||D===void 0||D.reset(),this.refresh(0,this.rows-1)}}reset(){var D,F;this.options.rows=this.rows,this.options.cols=this.cols;const W=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)===null||D===void 0||D.reset(),this._decorationService.reset(),(F=this.viewport)===null||F===void 0||F.reset(),this._customKeyEventHandler=W,this.refresh(0,this.rows-1)}clearTextureAtlas(){var D;(D=this._renderService)===null||D===void 0||D.clearTextureAtlas()}_reportFocus(){var D;!((D=this.element)===null||D===void 0)&&D.classList.contains("focus")?this.coreService.triggerDataEvent($.C0.ESC+"[I"):this.coreService.triggerDataEvent($.C0.ESC+"[O")}_reportWindowsOptions(D){if(this._renderService)switch(D){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const F=this._renderService.dimensions.css.canvas.width.toFixed(0),W=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[4;${W};${F}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const U=this._renderService.dimensions.css.cell.width.toFixed(0),re=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.C0.ESC}[6;${re};${U}t`)}}cancel(D,F){if(this.options.cancelEvents||F)return D.preventDefault(),D.stopPropagation(),!1}}l.Terminal=q},9924:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TimeBasedDebouncer=void 0,l.TimeBasedDebouncer=class{constructor(u,f=1e3){this._renderCallback=u,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,f,y){this._rowCount=y,u=u!==void 0?u:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f;const d=Date.now();if(d-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=d,this._innerRefresh();else if(!this._additionalRefreshRequested){const m=d-this._lastRefreshMs,C=this._debounceThresholdMS-m;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},C)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,f)}}},1680:function(_,l,u){var f=this&&this.__decorate||function(o,s,c,p){var v,x=arguments.length,b=x<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,s,c,p);else for(var S=o.length-1;S>=0;S--)(v=o[S])&&(b=(x<3?v(b):x>3?v(s,c,b):v(s,c))||b);return x>3&&b&&Object.defineProperty(s,c,b),b},y=this&&this.__param||function(o,s){return function(c,p){s(c,p,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.Viewport=void 0;const d=u(3656),m=u(4725),C=u(8460),w=u(844),g=u(2585);let a=l.Viewport=class extends w.Disposable{constructor(o,s,c,p,v,x,b,S){super(),this._viewportElement=o,this._scrollArea=s,this._bufferService=c,this._optionsService=p,this._charSizeService=v,this._renderService=x,this._coreBrowserService=b,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 C.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,d.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(k=>this._activeBuffer=k.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(k=>this._renderDimensions=k)),this._handleThemeChange(S.colors),this.register(S.onChangeColors(k=>this._handleThemeChange(k))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(o){this._viewportElement.style.backgroundColor=o.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(o){if(o)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._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const o=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==o&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=o),this._refreshAnimationFrame=null}syncScrollArea(o=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(o);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(o)}_handleScroll(o){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 s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:s,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const o=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(o*(this._smoothScrollState.target-this._smoothScrollState.origin)),o<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(o,s){const c=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&c<this._lastRecordedBufferHeight)||(o.cancelable&&o.preventDefault(),!1)}handleWheel(o){const s=this._getPixelsScrolled(o);return s!==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+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}scrollLines(o){if(o!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const s=o*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:o,suppressScrollEvent:!1})}_getPixelsScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getBufferElements(o,s){var c;let p,v="";const x=[],b=s??this._bufferService.buffer.lines.length,S=this._bufferService.buffer.lines;for(let k=o;k<b;k++){const R=S.get(k);if(!R)continue;const O=(c=S.get(k+1))===null||c===void 0?void 0:c.isWrapped;if(v+=R.translateToString(!O),!O||k===S.length-1){const T=document.createElement("div");T.textContent=v,x.push(T),v.length>0&&(p=T),v=""}}return{bufferElements:x,cursorElement:p}}getLinesScrolled(o){if(o.deltaY===0||o.shiftKey)return 0;let s=this._applyScrollModifier(o.deltaY,o);return o.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):o.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(o,s){const c=this._optionsService.rawOptions.fastScrollModifier;return c==="alt"&&s.altKey||c==="ctrl"&&s.ctrlKey||c==="shift"&&s.shiftKey?o*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:o*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(o){this._lastTouchY=o.touches[0].pageY}handleTouchMove(o){const s=this._lastTouchY-o.touches[0].pageY;return this._lastTouchY=o.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(o,s))}};l.Viewport=a=f([y(2,g.IBufferService),y(3,g.IOptionsService),y(4,m.ICharSizeService),y(5,m.IRenderService),y(6,m.ICoreBrowserService),y(7,m.IThemeService)],a)},3107:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},y=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferDecorationRenderer=void 0;const d=u(3656),m=u(4725),C=u(844),w=u(2585);let g=l.BufferDecorationRenderer=class extends C.Disposable{constructor(a,o,s,c){super(),this._screenElement=a,this._bufferService=o,this._decorationService=s,this._renderService=c,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,d.addDisposableDomListener)(window,"resize",()=>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(p=>this._removeDecoration(p))),this.register((0,C.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 a of this._decorationService.decorations)this._renderDecoration(a);this._dimensionsChanged=!1}_renderDecoration(a){this._refreshStyle(a),this._dimensionsChanged&&this._refreshXPosition(a)}_createElement(a){var o,s;const c=document.createElement("div");c.classList.add("xterm-decoration"),c.classList.toggle("xterm-decoration-top-layer",((o=a==null?void 0:a.options)===null||o===void 0?void 0:o.layer)==="top"),c.style.width=`${Math.round((a.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,c.style.height=(a.options.height||1)*this._renderService.dimensions.css.cell.height+"px",c.style.top=(a.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",c.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const p=(s=a.options.x)!==null&&s!==void 0?s:0;return p&&p>this._bufferService.cols&&(c.style.display="none"),this._refreshXPosition(a,c),c}_refreshStyle(a){const o=a.marker.line-this._bufferService.buffers.active.ydisp;if(o<0||o>=this._bufferService.rows)a.element&&(a.element.style.display="none",a.onRenderEmitter.fire(a.element));else{let s=this._decorationElements.get(a);s||(s=this._createElement(a),a.element=s,this._decorationElements.set(a,s),this._container.appendChild(s),a.onDispose(()=>{this._decorationElements.delete(a),s.remove()})),s.style.top=o*this._renderService.dimensions.css.cell.height+"px",s.style.display=this._altBufferIsActive?"none":"block",a.onRenderEmitter.fire(s)}}_refreshXPosition(a,o=a.element){var s;if(!o)return;const c=(s=a.options.x)!==null&&s!==void 0?s:0;(a.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(a){var o;(o=this._decorationElements.get(a))===null||o===void 0||o.remove(),this._decorationElements.delete(a),a.dispose()}};l.BufferDecorationRenderer=g=f([y(1,w.IBufferService),y(2,w.IDecorationService),y(3,m.IRenderService)],g)},5871:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ColorZoneStore=void 0,l.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(u){if(u.options.overviewRulerOptions){for(const f of this._zones)if(f.color===u.options.overviewRulerOptions.color&&f.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,u.marker.line))return;if(this._lineAdjacentToZone(f,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(f,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,f){return f>=u.startBufferLine&&f<=u.endBufferLine}_lineAdjacentToZone(u,f,y){return f>=u.startBufferLine-this._linePadding[y||"full"]&&f<=u.endBufferLine+this._linePadding[y||"full"]}_addLineToZone(u,f){u.startBufferLine=Math.min(u.startBufferLine,f),u.endBufferLine=Math.max(u.endBufferLine,f)}}},5744:function(_,l,u){var f=this&&this.__decorate||function(p,v,x,b){var S,k=arguments.length,R=k<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,v,x,b);else for(var O=p.length-1;O>=0;O--)(S=p[O])&&(R=(k<3?S(R):k>3?S(v,x,R):S(v,x))||R);return k>3&&R&&Object.defineProperty(v,x,R),R},y=this&&this.__param||function(p,v){return function(x,b){v(x,b,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OverviewRulerRenderer=void 0;const d=u(5871),m=u(3656),C=u(4725),w=u(844),g=u(2585),a={full:0,left:0,center:0,right:0},o={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0};let c=l.OverviewRulerRenderer=class extends w.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(p,v,x,b,S,k,R){var O;super(),this._viewportElement=p,this._screenElement=v,this._bufferService=x,this._decorationService=b,this._renderService=S,this._optionsService=k,this._coreBrowseService=R,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)===null||O===void 0||O.insertBefore(this._canvas,this._viewportElement);const T=this._canvas.getContext("2d");if(!T)throw new Error("Ctx cannot be null");this._ctx=T,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,w.toDisposable)(()=>{var B;(B=this._canvas)===null||B===void 0||B.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,m.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const p=Math.floor(this._canvas.width/3),v=Math.ceil(this._canvas.width/3);o.full=this._canvas.width,o.left=p,o.center=v,o.right=p,this._refreshDrawHeightConstants(),s.full=0,s.left=0,s.center=o.left,s.right=o.left+o.center}_refreshDrawHeightConstants(){a.full=Math.round(2*this._coreBrowseService.dpr);const p=this._canvas.height/this._bufferService.buffer.lines.length,v=Math.round(Math.max(Math.min(p,12),6)*this._coreBrowseService.dpr);a.left=v,a.center=v,a.right=v}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*a.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.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 v of this._decorationService.decorations)this._colorZoneStore.addDecoration(v);this._ctx.lineWidth=1;const p=this._colorZoneStore.zones;for(const v of p)v.position!=="full"&&this._renderColorZone(v);for(const v of p)v.position==="full"&&this._renderColorZone(v);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(p){this._ctx.fillStyle=p.color,this._ctx.fillRect(s[p.position||"full"],Math.round((this._canvas.height-1)*(p.startBufferLine/this._bufferService.buffers.active.lines.length)-a[p.position||"full"]/2),o[p.position||"full"],Math.round((this._canvas.height-1)*((p.endBufferLine-p.startBufferLine)/this._bufferService.buffers.active.lines.length)+a[p.position||"full"]))}_queueRefresh(p,v){this._shouldUpdateDimensions=p||this._shouldUpdateDimensions,this._shouldUpdateAnchor=v||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};l.OverviewRulerRenderer=c=f([y(2,g.IBufferService),y(3,g.IDecorationService),y(4,C.IRenderService),y(5,g.IOptionsService),y(6,C.ICoreBrowserService)],c)},2950:function(_,l,u){var f=this&&this.__decorate||function(g,a,o,s){var c,p=arguments.length,v=p<3?a:s===null?s=Object.getOwnPropertyDescriptor(a,o):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(g,a,o,s);else for(var x=g.length-1;x>=0;x--)(c=g[x])&&(v=(p<3?c(v):p>3?c(a,o,v):c(a,o))||v);return p>3&&v&&Object.defineProperty(a,o,v),v},y=this&&this.__param||function(g,a){return function(o,s){a(o,s,g)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CompositionHelper=void 0;const d=u(4725),m=u(2585),C=u(2584);let w=l.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(g,a,o,s,c,p){this._textarea=g,this._compositionView=a,this._bufferService=o,this._optionsService=s,this._coreService=c,this._renderService=p,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(g){this._compositionView.textContent=g.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(g){if(this._isComposing||this._isSendingComposition){if(g.keyCode===229||g.keyCode===16||g.keyCode===17||g.keyCode===18)return!1;this._finalizeComposition(!1)}return g.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(g){if(this._compositionView.classList.remove("active"),this._isComposing=!1,g){const a={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let o;this._isSendingComposition=!1,a.start+=this._dataAlreadySent.length,o=this._isComposing?this._textarea.value.substring(a.start,a.end):this._textarea.value.substring(a.start),o.length>0&&this._coreService.triggerDataEvent(o,!0)}},0)}else{this._isSendingComposition=!1;const a=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(a,!0)}}_handleAnyTextareaChanges(){const g=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const a=this._textarea.value,o=a.replace(g,"");this._dataAlreadySent=o,a.length>g.length?this._coreService.triggerDataEvent(o,!0):a.length<g.length?this._coreService.triggerDataEvent(`${C.C0.DEL}`,!0):a.length===g.length&&a!==g&&this._coreService.triggerDataEvent(a,!0)}},0)}updateCompositionElements(g){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const a=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),o=this._renderService.dimensions.css.cell.height,s=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,c=a*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=c+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=o+"px",this._compositionView.style.lineHeight=o+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const p=this._compositionView.getBoundingClientRect();this._textarea.style.left=c+"px",this._textarea.style.top=s+"px",this._textarea.style.width=Math.max(p.width,1)+"px",this._textarea.style.height=Math.max(p.height,1)+"px",this._textarea.style.lineHeight=p.height+"px"}g||setTimeout(()=>this.updateCompositionElements(!0),0)}}};l.CompositionHelper=w=f([y(2,m.IBufferService),y(3,m.IOptionsService),y(4,m.ICoreService),y(5,d.IRenderService)],w)},9806:(_,l)=>{function u(f,y,d){const m=d.getBoundingClientRect(),C=f.getComputedStyle(d),w=parseInt(C.getPropertyValue("padding-left")),g=parseInt(C.getPropertyValue("padding-top"));return[y.clientX-m.left-w,y.clientY-m.top-g]}Object.defineProperty(l,"__esModule",{value:!0}),l.getCoords=l.getCoordsRelativeToElement=void 0,l.getCoordsRelativeToElement=u,l.getCoords=function(f,y,d,m,C,w,g,a,o){if(!w)return;const s=u(f,y,d);return s?(s[0]=Math.ceil((s[0]+(o?g/2:0))/g),s[1]=Math.ceil(s[1]/a),s[0]=Math.min(Math.max(s[0],1),m+(o?1:0)),s[1]=Math.min(Math.max(s[1],1),C),s):void 0}},9504:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.moveToCellSequence=void 0;const f=u(2584);function y(a,o,s,c){const p=a-d(a,s),v=o-d(o,s),x=Math.abs(p-v)-function(b,S,k){let R=0;const O=b-d(b,k),T=S-d(S,k);for(let B=0;B<Math.abs(O-T);B++){const z=m(b,S)==="A"?-1:1,I=k.buffer.lines.get(O+z*B);I!=null&&I.isWrapped&&R++}return R}(a,o,s);return g(x,w(m(a,o),c))}function d(a,o){let s=0,c=o.buffer.lines.get(a),p=c==null?void 0:c.isWrapped;for(;p&&a>=0&&a<o.rows;)s++,c=o.buffer.lines.get(--a),p=c==null?void 0:c.isWrapped;return s}function m(a,o){return a>o?"A":"B"}function C(a,o,s,c,p,v){let x=a,b=o,S="";for(;x!==s||b!==c;)x+=p?1:-1,p&&x>v.cols-1?(S+=v.buffer.translateBufferLineToString(b,!1,a,x),x=0,a=0,b++):!p&&x<0&&(S+=v.buffer.translateBufferLineToString(b,!1,0,a+1),x=v.cols-1,a=x,b--);return S+v.buffer.translateBufferLineToString(b,!1,a,x)}function w(a,o){const s=o?"O":"[";return f.C0.ESC+s+a}function g(a,o){a=Math.floor(a);let s="";for(let c=0;c<a;c++)s+=o;return s}l.moveToCellSequence=function(a,o,s,c){const p=s.buffer.x,v=s.buffer.y;if(!s.buffer.hasScrollback)return function(S,k,R,O,T,B){return y(k,O,T,B).length===0?"":g(C(S,k,S,k-d(k,T),!1,T).length,w("D",B))}(p,v,0,o,s,c)+y(v,o,s,c)+function(S,k,R,O,T,B){let z;z=y(k,O,T,B).length>0?O-d(O,T):k;const I=O,j=function($,E,A,P,M,H){let K;return K=y(A,P,M,H).length>0?P-d(P,M):E,$<A&&K<=P||$>=A&&K<P?"C":"D"}(S,k,R,O,T,B);return g(C(S,z,R,I,j==="C",T).length,w(j,B))}(p,v,a,o,s,c);let x;if(v===o)return x=p>a?"D":"C",g(Math.abs(p-a),w(x,c));x=v>o?"D":"C";const b=Math.abs(v-o);return g(function(S,k){return k.cols-S}(v>o?a:p,s)+(b-1)*s.cols+1+((v>o?p:a)-1),w(x,c))}},1296:function(_,l,u){var f=this&&this.__decorate||function(T,B,z,I){var j,$=arguments.length,E=$<3?B:I===null?I=Object.getOwnPropertyDescriptor(B,z):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(T,B,z,I);else for(var A=T.length-1;A>=0;A--)(j=T[A])&&(E=($<3?j(E):$>3?j(B,z,E):j(B,z))||E);return $>3&&E&&Object.defineProperty(B,z,E),E},y=this&&this.__param||function(T,B){return function(z,I){B(z,I,T)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRenderer=void 0;const d=u(3787),m=u(2550),C=u(2223),w=u(6171),g=u(4725),a=u(8055),o=u(8460),s=u(844),c=u(2585),p="xterm-dom-renderer-owner-",v="xterm-rows",x="xterm-fg-",b="xterm-bg-",S="xterm-focus",k="xterm-selection";let R=1,O=l.DomRenderer=class extends s.Disposable{constructor(T,B,z,I,j,$,E,A,P,M){super(),this._element=T,this._screenElement=B,this._viewportElement=z,this._linkifier2=I,this._charSizeService=$,this._optionsService=E,this._bufferService=A,this._coreBrowserService=P,this._themeService=M,this._terminalClass=R++,this._rowElements=[],this.onRequestRedraw=this.register(new o.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(v),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(k),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(H=>this._injectCss(H))),this._injectCss(this._themeService.colors),this._rowFactory=j.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(p+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(H=>this._handleLinkHover(H))),this.register(this._linkifier2.onHideLinkUnderline(H=>this._handleLinkLeave(H))),this.register((0,s.toDisposable)(()=>{this._element.classList.remove(p+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new m.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const T=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*T,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*T),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/T),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/T),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 z of this._rowElements)z.style.width=`${this.dimensions.css.canvas.width}px`,z.style.height=`${this.dimensions.css.cell.height}px`,z.style.lineHeight=`${this.dimensions.css.cell.height}px`,z.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const B=`${this._terminalSelector} .${v} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=B,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(T){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let B=`${this._terminalSelector} .${v} { color: ${T.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;B+=`${this._terminalSelector} .${v} .xterm-dim { color: ${a.color.multiplyOpacity(T.foreground,.5).css};}`,B+=`${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;}`,B+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",B+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css}; } 50% { background-color: inherit; color: ${T.cursor.css}; }}`,B+=`${this._terminalSelector} .${v}.${S} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${v}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block { background-color: ${T.cursor.css}; color: ${T.cursorAccent.css};}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${T.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${T.cursor.css} inset;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${T.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,B+=`${this._terminalSelector} .${k} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${k} div { position: absolute; background-color: ${T.selectionBackgroundOpaque.css};}${this._terminalSelector} .${k} div { position: absolute; background-color: ${T.selectionInactiveBackgroundOpaque.css};}`;for(const[z,I]of T.ansi.entries())B+=`${this._terminalSelector} .${x}${z} { color: ${I.css}; }${this._terminalSelector} .${x}${z}.xterm-dim { color: ${a.color.multiplyOpacity(I,.5).css}; }${this._terminalSelector} .${b}${z} { background-color: ${I.css}; }`;B+=`${this._terminalSelector} .${x}${C.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(T.background).css}; }${this._terminalSelector} .${x}${C.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(T.background),.5).css}; }${this._terminalSelector} .${b}${C.INVERTED_DEFAULT_COLOR} { background-color: ${T.foreground.css}; }`,this._themeStyleElement.textContent=B}_setDefaultSpacing(){const T=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${T}px`,this._rowFactory.defaultSpacing=T}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(T,B){for(let z=this._rowElements.length;z<=B;z++){const I=document.createElement("div");this._rowContainer.appendChild(I),this._rowElements.push(I)}for(;this._rowElements.length>B;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(T,B){this._refreshRowElements(T,B),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(T,B,z){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(T,B,z),this.renderRows(0,this._bufferService.rows-1),!T||!B)return;const I=T[1]-this._bufferService.buffer.ydisp,j=B[1]-this._bufferService.buffer.ydisp,$=Math.max(I,0),E=Math.min(j,this._bufferService.rows-1);if($>=this._bufferService.rows||E<0)return;const A=document.createDocumentFragment();if(z){const P=T[0]>B[0];A.appendChild(this._createSelectionElement($,P?B[0]:T[0],P?T[0]:B[0],E-$+1))}else{const P=I===$?T[0]:0,M=$===j?B[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement($,P,M));const H=E-$-1;if(A.appendChild(this._createSelectionElement($+1,0,this._bufferService.cols,H)),$!==E){const K=j===E?B[0]:this._bufferService.cols;A.appendChild(this._createSelectionElement(E,0,K))}}this._selectionContainer.appendChild(A)}_createSelectionElement(T,B,z,I=1){const j=document.createElement("div");return j.style.height=I*this.dimensions.css.cell.height+"px",j.style.top=T*this.dimensions.css.cell.height+"px",j.style.left=B*this.dimensions.css.cell.width+"px",j.style.width=this.dimensions.css.cell.width*(z-B)+"px",j}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 T of this._rowElements)T.replaceChildren()}renderRows(T,B){const z=this._bufferService.buffer,I=z.ybase+z.y,j=Math.min(z.x,this._bufferService.cols-1),$=this._optionsService.rawOptions.cursorBlink,E=this._optionsService.rawOptions.cursorStyle,A=this._optionsService.rawOptions.cursorInactiveStyle;for(let P=T;P<=B;P++){const M=P+z.ydisp,H=this._rowElements[P],K=z.lines.get(M);if(!H||!K)break;H.replaceChildren(...this._rowFactory.createRow(K,M,M===I,E,A,j,$,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${p}${this._terminalClass}`}_handleLinkHover(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!0)}_handleLinkLeave(T){this._setCellUnderline(T.x1,T.x2,T.y1,T.y2,T.cols,!1)}_setCellUnderline(T,B,z,I,j,$){z<0&&(T=0),I<0&&(B=0);const E=this._bufferService.rows-1;z=Math.max(Math.min(z,E),0),I=Math.max(Math.min(I,E),0),j=Math.min(j,this._bufferService.cols);const A=this._bufferService.buffer,P=A.ybase+A.y,M=Math.min(A.x,j-1),H=this._optionsService.rawOptions.cursorBlink,K=this._optionsService.rawOptions.cursorStyle,X=this._optionsService.rawOptions.cursorInactiveStyle;for(let q=z;q<=I;++q){const se=q+A.ydisp,D=this._rowElements[q],F=A.lines.get(se);if(!D||!F)break;D.replaceChildren(...this._rowFactory.createRow(F,se,se===P,K,X,M,H,this.dimensions.css.cell.width,this._widthCache,$?q===z?T:0:-1,$?(q===I?B:j)-1:-1))}}};l.DomRenderer=O=f([y(4,c.IInstantiationService),y(5,g.ICharSizeService),y(6,c.IOptionsService),y(7,c.IBufferService),y(8,g.ICoreBrowserService),y(9,g.IThemeService)],O)},3787:function(_,l,u){var f=this&&this.__decorate||function(x,b,S,k){var R,O=arguments.length,T=O<3?b:k===null?k=Object.getOwnPropertyDescriptor(b,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(x,b,S,k);else for(var B=x.length-1;B>=0;B--)(R=x[B])&&(T=(O<3?R(T):O>3?R(b,S,T):R(b,S))||T);return O>3&&T&&Object.defineProperty(b,S,T),T},y=this&&this.__param||function(x,b){return function(S,k){b(S,k,x)}};Object.defineProperty(l,"__esModule",{value:!0}),l.DomRendererRowFactory=void 0;const d=u(2223),m=u(643),C=u(511),w=u(2585),g=u(8055),a=u(4725),o=u(4269),s=u(6171),c=u(3734);let p=l.DomRendererRowFactory=class{constructor(x,b,S,k,R,O,T){this._document=x,this._characterJoinerService=b,this._optionsService=S,this._coreBrowserService=k,this._coreService=R,this._decorationService=O,this._themeService=T,this._workCell=new C.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(x,b,S){this._selectionStart=x,this._selectionEnd=b,this._columnSelectMode=S}createRow(x,b,S,k,R,O,T,B,z,I,j){const $=[],E=this._characterJoinerService.getJoinedCharacters(b),A=this._themeService.colors;let P,M=x.getNoBgTrimmedLength();S&&M<O+1&&(M=O+1);let H=0,K="",X=0,q=0,se=0,D=!1,F=0,W=!1,U=0;const re=[],Q=I!==-1&&j!==-1;for(let ae=0;ae<M;ae++){x.loadCell(ae,this._workCell);let we=this._workCell.getWidth();if(we===0)continue;let fe=!1,ut=ae,ne=this._workCell;if(E.length>0&&ae===E[0][0]){fe=!0;const pe=E.shift();ne=new o.JoinedCellData(this._workCell,x.translateToString(!0,pe[0],pe[1]),pe[1]-pe[0]),ut=pe[1]-1,we=ne.getWidth()}const ht=this._isCellInSelection(ae,b),Ye=S&&ae===O,Ut=Q&&ae>=I&&ae<=j;let J=!1;this._decorationService.forEachDecorationAtCell(ae,b,void 0,pe=>{J=!0});let Y=ne.getChars()||m.WHITESPACE_CELL_CHAR;if(Y===" "&&(ne.isUnderline()||ne.isOverline())&&(Y=" "),U=we*B-z.get(Y,ne.isBold(),ne.isItalic()),P){if(H&&(ht&&W||!ht&&!W&&ne.bg===X)&&(ht&&W&&A.selectionForeground||ne.fg===q)&&ne.extended.ext===se&&Ut===D&&U===F&&!Ye&&!fe&&!J){K+=Y,H++;continue}H&&(P.textContent=K),P=this._document.createElement("span"),H=0,K=""}else P=this._document.createElement("span");if(X=ne.bg,q=ne.fg,se=ne.extended.ext,D=Ut,F=U,W=ht,fe&&O>=ae&&O<=ut&&(O=ae),!this._coreService.isCursorHidden&&Ye){if(re.push("xterm-cursor"),this._coreBrowserService.isFocused)T&&re.push("xterm-cursor-blink"),re.push(k==="bar"?"xterm-cursor-bar":k==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(R)switch(R){case"outline":re.push("xterm-cursor-outline");break;case"block":re.push("xterm-cursor-block");break;case"bar":re.push("xterm-cursor-bar");break;case"underline":re.push("xterm-cursor-underline")}}if(ne.isBold()&&re.push("xterm-bold"),ne.isItalic()&&re.push("xterm-italic"),ne.isDim()&&re.push("xterm-dim"),K=ne.isInvisible()?m.WHITESPACE_CELL_CHAR:ne.getChars()||m.WHITESPACE_CELL_CHAR,ne.isUnderline()&&(re.push(`xterm-underline-${ne.extended.underlineStyle}`),K===" "&&(K=" "),!ne.isUnderlineColorDefault()))if(ne.isUnderlineColorRGB())P.style.textDecorationColor=`rgb(${c.AttributeData.toColorRGB(ne.getUnderlineColor()).join(",")})`;else{let pe=ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&ne.isBold()&&pe<8&&(pe+=8),P.style.textDecorationColor=A.ansi[pe].css}ne.isOverline()&&(re.push("xterm-overline"),K===" "&&(K=" ")),ne.isStrikethrough()&&re.push("xterm-strikethrough"),Ut&&(P.style.textDecoration="underline");let te=ne.getFgColor(),ie=ne.getFgColorMode(),oe=ne.getBgColor(),ce=ne.getBgColorMode();const Be=!!ne.isInverse();if(Be){const pe=te;te=oe,oe=pe;const ni=ie;ie=ce,ce=ni}let me,Tt,Ve,At=!1;switch(this._decorationService.forEachDecorationAtCell(ae,b,void 0,pe=>{pe.options.layer!=="top"&&At||(pe.backgroundColorRGB&&(ce=50331648,oe=pe.backgroundColorRGB.rgba>>8&16777215,me=pe.backgroundColorRGB),pe.foregroundColorRGB&&(ie=50331648,te=pe.foregroundColorRGB.rgba>>8&16777215,Tt=pe.foregroundColorRGB),At=pe.options.layer==="top")}),!At&&ht&&(me=this._coreBrowserService.isFocused?A.selectionBackgroundOpaque:A.selectionInactiveBackgroundOpaque,oe=me.rgba>>8&16777215,ce=50331648,At=!0,A.selectionForeground&&(ie=50331648,te=A.selectionForeground.rgba>>8&16777215,Tt=A.selectionForeground)),At&&re.push("xterm-decoration-top"),ce){case 16777216:case 33554432:Ve=A.ansi[oe],re.push(`xterm-bg-${oe}`);break;case 50331648:Ve=g.rgba.toColor(oe>>16,oe>>8&255,255&oe),this._addStyle(P,`background-color:#${v((oe>>>0).toString(16),"0",6)}`);break;default:Be?(Ve=A.foreground,re.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):Ve=A.background}switch(me||ne.isDim()&&(me=g.color.multiplyOpacity(Ve,.5)),ie){case 16777216:case 33554432:ne.isBold()&&te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(te+=8),this._applyMinimumContrast(P,Ve,A.ansi[te],ne,me,void 0)||re.push(`xterm-fg-${te}`);break;case 50331648:const pe=g.rgba.toColor(te>>16&255,te>>8&255,255&te);this._applyMinimumContrast(P,Ve,pe,ne,me,Tt)||this._addStyle(P,`color:#${v(te.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(P,Ve,A.foreground,ne,me,void 0)||Be&&re.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}re.length&&(P.className=re.join(" "),re.length=0),Ye||fe||J?P.textContent=K:H++,U!==this.defaultSpacing&&(P.style.letterSpacing=`${U}px`),$.push(P),ae=ut}return P&&H&&(P.textContent=K),$}_applyMinimumContrast(x,b,S,k,R,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,s.excludeFromContrastRatioDemands)(k.getCode()))return!1;const T=this._getContrastCache(k);let B;if(R||O||(B=T.getColor(b.rgba,S.rgba)),B===void 0){const z=this._optionsService.rawOptions.minimumContrastRatio/(k.isDim()?2:1);B=g.color.ensureContrastRatio(R||b,O||S,z),T.setColor((R||b).rgba,(O||S).rgba,B??null)}return!!B&&(this._addStyle(x,`color:${B.css}`),!0)}_getContrastCache(x){return x.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(x,b){x.setAttribute("style",`${x.getAttribute("style")||""}${b};`)}_isCellInSelection(x,b){const S=this._selectionStart,k=this._selectionEnd;return!(!S||!k)&&(this._columnSelectMode?S[0]<=k[0]?x>=S[0]&&b>=S[1]&&x<k[0]&&b<=k[1]:x<S[0]&&b>=S[1]&&x>=k[0]&&b<=k[1]:b>S[1]&&b<k[1]||S[1]===k[1]&&b===S[1]&&x>=S[0]&&x<k[0]||S[1]<k[1]&&b===k[1]&&x<k[0]||S[1]<k[1]&&b===S[1]&&x>=S[0])}};function v(x,b,S){for(;x.length<S;)x=b+x;return x}l.DomRendererRowFactory=p=f([y(1,a.ICharacterJoinerService),y(2,w.IOptionsService),y(3,a.ICoreBrowserService),y(4,w.ICoreService),y(5,w.IDecorationService),y(6,a.IThemeService)],p)},2550:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WidthCache=void 0,l.WidthCache=class{constructor(u){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const f=u.createElement("span"),y=u.createElement("span");y.style.fontWeight="bold";const d=u.createElement("span");d.style.fontStyle="italic";const m=u.createElement("span");m.style.fontWeight="bold",m.style.fontStyle="italic",this._measureElements=[f,y,d,m],this._container.appendChild(f),this._container.appendChild(y),this._container.appendChild(d),this._container.appendChild(m),u.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(u,f,y,d){u===this._font&&f===this._fontSize&&y===this._weight&&d===this._weightBold||(this._font=u,this._fontSize=f,this._weight=y,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${y}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${y}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(u,f,y){let d=0;if(!f&&!y&&u.length===1&&(d=u.charCodeAt(0))<256)return this._flat[d]!==-9999?this._flat[d]:this._flat[d]=this._measure(u,0);let m=u;f&&(m+="B"),y&&(m+="I");let C=this._holey.get(m);if(C===void 0){let w=0;f&&(w|=1),y&&(w|=2),C=this._measure(u,w),this._holey.set(m,C)}return C}_measure(u,f){const y=this._measureElements[f];return y.textContent=u.repeat(32),y.offsetWidth/32}}},2223:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.TEXT_BASELINE=l.DIM_OPACITY=l.INVERTED_DEFAULT_COLOR=void 0;const f=u(6114);l.INVERTED_DEFAULT_COLOR=257,l.DIM_OPACITY=.5,l.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(_,l)=>{function u(f){return 57508<=f&&f<=57558}Object.defineProperty(l,"__esModule",{value:!0}),l.createRenderDimensions=l.excludeFromContrastRatioDemands=l.isRestrictedPowerlineGlyph=l.isPowerlineGlyph=l.throwIfFalsy=void 0,l.throwIfFalsy=function(f){if(!f)throw new Error("value must not be falsy");return f},l.isPowerlineGlyph=u,l.isRestrictedPowerlineGlyph=function(f){return 57520<=f&&f<=57527},l.excludeFromContrastRatioDemands=function(f){return u(f)||function(y){return 9472<=y&&y<=9631}(f)},l.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}}}}},456:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionModel=void 0,l.SelectionModel=class{constructor(u){this._bufferService=u,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,f=this.selectionEnd;return!(!u||!f)&&(u[1]>f[1]||u[1]===f[1]&&u[0]>f[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},y=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharSizeService=void 0;const d=u(2585),m=u(8460),C=u(844);let w=l.CharSizeService=class extends C.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(a,o,s){super(),this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=this.register(new m.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new g(a,o,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())}};l.CharSizeService=w=f([y(2,d.IOptionsService)],w);class g{constructor(o,s,c){this._document=o,this._parentElement=s,this._optionsService=c,this._result={width:0,height:0},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(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const o={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return o.width!==0&&o.height!==0&&(this._result.width=o.width/32,this._result.height=Math.ceil(o.height)),this._result}}},4269:function(_,l,u){var f=this&&this.__decorate||function(o,s,c,p){var v,x=arguments.length,b=x<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,c):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(o,s,c,p);else for(var S=o.length-1;S>=0;S--)(v=o[S])&&(b=(x<3?v(b):x>3?v(s,c,b):v(s,c))||b);return x>3&&b&&Object.defineProperty(s,c,b),b},y=this&&this.__param||function(o,s){return function(c,p){s(c,p,o)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CharacterJoinerService=l.JoinedCellData=void 0;const d=u(3734),m=u(643),C=u(511),w=u(2585);class g extends d.AttributeData{constructor(s,c,p){super(),this.content=0,this.combinedData="",this.fg=s.fg,this.bg=s.bg,this.combinedData=c,this._width=p}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(s){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.JoinedCellData=g;let a=l.CharacterJoinerService=class Gh{constructor(s){this._bufferService=s,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new C.CellData}register(s){const c={id:this._nextCharacterJoinerId++,handler:s};return this._characterJoiners.push(c),c.id}deregister(s){for(let c=0;c<this._characterJoiners.length;c++)if(this._characterJoiners[c].id===s)return this._characterJoiners.splice(c,1),!0;return!1}getJoinedCharacters(s){if(this._characterJoiners.length===0)return[];const c=this._bufferService.buffer.lines.get(s);if(!c||c.length===0)return[];const p=[],v=c.translateToString(!0);let x=0,b=0,S=0,k=c.getFg(0),R=c.getBg(0);for(let O=0;O<c.getTrimmedLength();O++)if(c.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==k||this._workCell.bg!==R){if(O-x>1){const T=this._getJoinedRanges(v,S,b,c,x);for(let B=0;B<T.length;B++)p.push(T[B])}x=O,S=b,k=this._workCell.fg,R=this._workCell.bg}b+=this._workCell.getChars().length||m.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-x>1){const O=this._getJoinedRanges(v,S,b,c,x);for(let T=0;T<O.length;T++)p.push(O[T])}return p}_getJoinedRanges(s,c,p,v,x){const b=s.substring(c,p);let S=[];try{S=this._characterJoiners[0].handler(b)}catch(k){console.error(k)}for(let k=1;k<this._characterJoiners.length;k++)try{const R=this._characterJoiners[k].handler(b);for(let O=0;O<R.length;O++)Gh._mergeRanges(S,R[O])}catch(R){console.error(R)}return this._stringRangesToCellRanges(S,v,x),S}_stringRangesToCellRanges(s,c,p){let v=0,x=!1,b=0,S=s[v];if(S){for(let k=p;k<this._bufferService.cols;k++){const R=c.getWidth(k),O=c.getString(k).length||m.WHITESPACE_CELL_CHAR.length;if(R!==0){if(!x&&S[0]<=b&&(S[0]=k,x=!0),S[1]<=b){if(S[1]=k,S=s[++v],!S)break;S[0]<=b?(S[0]=k,x=!0):x=!1}b+=O}}S&&(S[1]=this._bufferService.cols)}}static _mergeRanges(s,c){let p=!1;for(let v=0;v<s.length;v++){const x=s[v];if(p){if(c[1]<=x[0])return s[v-1][1]=c[1],s;if(c[1]<=x[1])return s[v-1][1]=Math.max(c[1],x[1]),s.splice(v,1),s;s.splice(v,1),v--}else{if(c[1]<=x[0])return s.splice(v,0,c),s;if(c[1]<=x[1])return x[0]=Math.min(c[0],x[0]),s;c[0]<x[1]&&(x[0]=Math.min(c[0],x[0]),p=!0)}}return p?s[s.length-1][1]=c[1]:s.push(c),s}};l.CharacterJoinerService=a=f([y(0,w.IBufferService)],a)},5114:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreBrowserService=void 0,l.CoreBrowserService=class{constructor(u,f){this._textarea=u,this.window=f,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}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}}},8934:function(_,l,u){var f=this&&this.__decorate||function(w,g,a,o){var s,c=arguments.length,p=c<3?g:o===null?o=Object.getOwnPropertyDescriptor(g,a):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(w,g,a,o);else for(var v=w.length-1;v>=0;v--)(s=w[v])&&(p=(c<3?s(p):c>3?s(g,a,p):s(g,a))||p);return c>3&&p&&Object.defineProperty(g,a,p),p},y=this&&this.__param||function(w,g){return function(a,o){g(a,o,w)}};Object.defineProperty(l,"__esModule",{value:!0}),l.MouseService=void 0;const d=u(4725),m=u(9806);let C=l.MouseService=class{constructor(w,g){this._renderService=w,this._charSizeService=g}getCoords(w,g,a,o,s){return(0,m.getCoords)(window,w,g,a,o,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,s)}getMouseReportCoords(w,g){const a=(0,m.getCoordsRelativeToElement)(window,w,g);if(this._charSizeService.hasValidSize)return a[0]=Math.min(Math.max(a[0],0),this._renderService.dimensions.css.canvas.width-1),a[1]=Math.min(Math.max(a[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(a[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(a[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(a[0]),y:Math.floor(a[1])}}};l.MouseService=C=f([y(0,d.IRenderService),y(1,d.ICharSizeService)],C)},3230:function(_,l,u){var f=this&&this.__decorate||function(p,v,x,b){var S,k=arguments.length,R=k<3?v:b===null?b=Object.getOwnPropertyDescriptor(v,x):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(p,v,x,b);else for(var O=p.length-1;O>=0;O--)(S=p[O])&&(R=(k<3?S(R):k>3?S(v,x,R):S(v,x))||R);return k>3&&R&&Object.defineProperty(v,x,R),R},y=this&&this.__param||function(p,v){return function(x,b){v(x,b,p)}};Object.defineProperty(l,"__esModule",{value:!0}),l.RenderService=void 0;const d=u(3656),m=u(6193),C=u(5596),w=u(4725),g=u(8460),a=u(844),o=u(7226),s=u(2585);let c=l.RenderService=class extends a.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(p,v,x,b,S,k,R,O){if(super(),this._rowCount=p,this._charSizeService=b,this._renderer=this.register(new a.MutableDisposable),this._pausedResizeTask=new o.DebouncedIdleTask,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 g.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new g.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new g.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new g.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new m.RenderDebouncer(R.window,(T,B)=>this._renderRows(T,B)),this.register(this._renderDebouncer),this._screenDprMonitor=new C.ScreenDprMonitor(R.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(k.onResize(()=>this._fullRefresh())),this.register(k.buffers.onBufferActivate(()=>{var T;return(T=this._renderer.value)===null||T===void 0?void 0:T.clear()})),this.register(x.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(S.onDecorationRegistered(()=>this._fullRefresh())),this.register(S.onDecorationRemoved(()=>this._fullRefresh())),this.register(x.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(k.cols,k.rows),this._fullRefresh()})),this.register(x.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(k.buffer.y,k.buffer.y,!0))),this.register((0,d.addDisposableDomListener)(R.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(O.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in R.window){const T=new R.window.IntersectionObserver(B=>this._handleIntersectionChange(B[B.length-1]),{threshold:0});T.observe(v),this.register({dispose:()=>T.disconnect()})}}_handleIntersectionChange(p){this._isPaused=p.isIntersecting===void 0?p.intersectionRatio===0:!p.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(p,v,x=!1){this._isPaused?this._needsFullRefresh=!0:(x||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(p,v,this._rowCount))}_renderRows(p,v){this._renderer.value&&(p=Math.min(p,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(p,v),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:p,end:v}),this._onRender.fire({start:p,end:v}),this._isNextRenderRedrawOnly=!0)}resize(p,v){this._rowCount=v,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(p){this._renderer.value=p,this._renderer.value.onRequestRedraw(v=>this.refreshRows(v.start,v.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(p){return this._renderDebouncer.addRefreshCallback(p)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var p,v;this._renderer.value&&((v=(p=this._renderer.value).clearTextureAtlas)===null||v===void 0||v.call(p),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(p,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(p,v)):this._renderer.value.handleResize(p,v),this._fullRefresh())}handleCharSizeChanged(){var p;(p=this._renderer.value)===null||p===void 0||p.handleCharSizeChanged()}handleBlur(){var p;(p=this._renderer.value)===null||p===void 0||p.handleBlur()}handleFocus(){var p;(p=this._renderer.value)===null||p===void 0||p.handleFocus()}handleSelectionChanged(p,v,x){var b;this._selectionState.start=p,this._selectionState.end=v,this._selectionState.columnSelectMode=x,(b=this._renderer.value)===null||b===void 0||b.handleSelectionChanged(p,v,x)}handleCursorMove(){var p;(p=this._renderer.value)===null||p===void 0||p.handleCursorMove()}clear(){var p;(p=this._renderer.value)===null||p===void 0||p.clear()}};l.RenderService=c=f([y(2,s.IOptionsService),y(3,w.ICharSizeService),y(4,s.IDecorationService),y(5,s.IBufferService),y(6,w.ICoreBrowserService),y(7,w.IThemeService)],c)},9312:function(_,l,u){var f=this&&this.__decorate||function(S,k,R,O){var T,B=arguments.length,z=B<3?k:O===null?O=Object.getOwnPropertyDescriptor(k,R):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(S,k,R,O);else for(var I=S.length-1;I>=0;I--)(T=S[I])&&(z=(B<3?T(z):B>3?T(k,R,z):T(k,R))||z);return B>3&&z&&Object.defineProperty(k,R,z),z},y=this&&this.__param||function(S,k){return function(R,O){k(R,O,S)}};Object.defineProperty(l,"__esModule",{value:!0}),l.SelectionService=void 0;const d=u(9806),m=u(9504),C=u(456),w=u(4725),g=u(8460),a=u(844),o=u(6114),s=u(4841),c=u(511),p=u(2585),v=" ",x=new RegExp(v,"g");let b=l.SelectionService=class extends a.Disposable{constructor(S,k,R,O,T,B,z,I,j){super(),this._element=S,this._screenElement=k,this._linkifier=R,this._bufferService=O,this._coreService=T,this._mouseService=B,this._optionsService=z,this._renderService=I,this._coreBrowserService=j,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new c.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new g.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new g.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new g.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 C.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,a.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 S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;return!(!S||!k||S[0]===k[0]&&S[1]===k[1])}get selectionText(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd;if(!S||!k)return"";const R=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(S[0]===k[0])return"";const T=S[0]<k[0]?S[0]:k[0],B=S[0]<k[0]?k[0]:S[0];for(let z=S[1];z<=k[1];z++){const I=R.translateBufferLineToString(z,!0,T,B);O.push(I)}}else{const T=S[1]===k[1]?k[0]:void 0;O.push(R.translateBufferLineToString(S[1],!0,S[0],T));for(let B=S[1]+1;B<=k[1]-1;B++){const z=R.lines.get(B),I=R.translateBufferLineToString(B,!0);z!=null&&z.isWrapped?O[O.length-1]+=I:O.push(I)}if(S[1]!==k[1]){const B=R.lines.get(k[1]),z=R.translateBufferLineToString(k[1],!0,0,k[0]);B&&B.isWrapped?O[O.length-1]+=z:O.push(z)}}return O.map(T=>T.replace(x," ")).join(o.isWindows?`\r
45
45
  `:`
46
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(y){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o.isLinux&&y&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(y){const k=this._getMouseBufferCoords(y),R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(R&&O&&k)&&this._areCoordsInSelection(k,R,O)}isCellInSelection(y,k){const R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!R||!O)&&this._areCoordsInSelection([y,k],R,O)}_areCoordsInSelection(y,k,R){return y[1]>k[1]&&y[1]<R[1]||k[1]===R[1]&&y[1]===k[1]&&y[0]>=k[0]&&y[0]<R[0]||k[1]<R[1]&&y[1]===R[1]&&y[0]<R[0]||k[1]<R[1]&&y[1]===k[1]&&y[0]>=k[0]}_selectWordAtCursor(y,k){var R,O;const T=(O=(R=this._linkifier.currentLink)===null||R===void 0?void 0:R.link)===null||O===void 0?void 0:O.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(y);return!!B&&(this._selectWordAt(B,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(y,k){this._model.clearSelection(),y=Math.max(y,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,y],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(y){this._model.handleTrim(y)&&this.refresh()}_getMouseBufferCoords(y){const k=this._mouseService.getCoords(y,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(y){let k=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,y,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=R?0:(k>R&&(k-=R),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(y){return o.isMac?y.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:y.shiftKey}handleMouseDown(y){if(this._mouseDownTimeStamp=y.timeStamp,(y.button!==2||!this.hasSelection)&&y.button===0){if(!this._enabled){if(!this.shouldForceSelection(y))return;y.stopPropagation()}y.preventDefault(),this._dragScrollAmount=0,this._enabled&&y.shiftKey?this._handleIncrementalClick(y):y.detail===1?this._handleSingleClick(y):y.detail===2?this._handleDoubleClick(y):y.detail===3&&this._handleTripleClick(y),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(y){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(y))}_handleSingleClick(y){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(y)?3:0,this._model.selectionStart=this._getMouseBufferCoords(y),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(y){this._selectWordAtCursor(y,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(y){const k=this._getMouseBufferCoords(y);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(y){return y.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(y){if(y.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(y),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(y),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const O=R.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});const y=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(y.ydisp+this._bufferService.rows,y.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=y.ydisp),this.refresh()}}_handleMouseUp(y){const k=y.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&y.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(y,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const O=(0,m.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const y=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,R=!(!y||!k||y[0]===k[0]&&y[1]===k[1]);R?y&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&y[0]===this._oldSelectionStart[0]&&y[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(y,k,R)):this._oldHasSelection&&this._fireOnSelectionChange(y,k,R)}_fireOnSelectionChange(y,k,R){this._oldSelectionStart=y,this._oldSelectionEnd=k,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(y){this.clearSelection(),this._trimListener.dispose(),this._trimListener=y.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(y,k){let R=k;for(let O=0;k>=O;O++){const T=y.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:T>1&&k!==O&&(R+=T-1)}return R}setSelection(y,k,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[y,k],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(y){this._isClickInSelection(y)||(this._selectWordAtCursor(y,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(y,k,R=!0,O=!0){if(y[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,B=T.lines.get(y[1]);if(!B)return;const z=T.translateBufferLineToString(y[1],!1);let I=this._convertViewportColToCharacterIndex(B,y[0]),j=I;const $=y[0]-I;let E=0,A=0,P=0,M=0;if(z.charAt(I)===" "){for(;I>0&&z.charAt(I-1)===" ";)I--;for(;j<z.length&&z.charAt(j+1)===" ";)j++}else{let X=y[0],q=y[0];B.getWidth(X)===0&&(E++,X--),B.getWidth(q)===2&&(A++,q++);const se=B.getString(q).length;for(se>1&&(M+=se-1,j+=se-1);X>0&&I>0&&!this._isCharWordSeparator(B.loadCell(X-1,this._workCell));){B.loadCell(X-1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===0?(E++,X--):D>1&&(P+=D-1,I-=D-1),I--,X--}for(;q<B.length&&j+1<z.length&&!this._isCharWordSeparator(B.loadCell(q+1,this._workCell));){B.loadCell(q+1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,q++):D>1&&(M+=D-1,j+=D-1),j++,q++}}j++;let H=I+$-E+P,K=Math.min(this._bufferService.cols,j-I+E+A-P-M);if(k||z.slice(I,j).trim()!==""){if(R&&H===0&&B.getCodePoint(0)!==32){const X=T.lines.get(y[1]-1);if(X&&B.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){const q=this._getWordAt([this._bufferService.cols-1,y[1]-1],!1,!0,!1);if(q){const se=this._bufferService.cols-q.start;H-=se,K+=se}}}if(O&&H+K===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const X=T.lines.get(y[1]+1);if(X!=null&&X.isWrapped&&X.getCodePoint(0)!==32){const q=this._getWordAt([0,y[1]+1],!1,!1,!0);q&&(K+=q.length)}}return{start:H,length:K}}}_selectWordAt(y,k){const R=this._getWordAt(y,k);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,y[1]--;this._model.selectionStart=[R.start,y[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(y){const k=this._getWordAt(y,!0);if(k){let R=y[1];for(;k.start<0;)k.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,R]}}_isCharWordSeparator(y){return y.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(y.getChars())>=0}_selectLineAt(y){const k=this._bufferService.buffer.getWrappedRangeForLine(y),R={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(R,this._bufferService.cols)}};l.SelectionService=b=f([S(3,p.IBufferService),S(4,p.ICoreService),S(5,w.IMouseService),S(6,p.IOptionsService),S(7,w.IRenderService),S(8,w.ICoreBrowserService)],b)},4725:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const f=u(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService")},6731:function(_,l,u){var f=this&&this.__decorate||function(b,y,k,R){var O,T=arguments.length,B=T<3?y:R===null?R=Object.getOwnPropertyDescriptor(y,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,y,k,R);else for(var z=b.length-1;z>=0;z--)(O=b[z])&&(B=(T<3?O(B):T>3?O(y,k,B):O(y,k))||B);return T>3&&B&&Object.defineProperty(y,k,B),B},S=this&&this.__param||function(b,y){return function(k,R){y(k,R,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),m=u(8055),C=u(8460),w=u(844),g=u(2585),a=m.css.toColor("#ffffff"),o=m.css.toColor("#000000"),s=m.css.toColor("#ffffff"),c=m.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const b=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],y=[0,95,135,175,215,255];for(let k=0;k<216;k++){const R=y[k/36%6|0],O=y[k/6%6|0],T=y[k%6];b.push({css:m.channels.toCss(R,O,T),rgba:m.channels.toRgba(R,O,T)})}for(let k=0;k<24;k++){const R=8+10*k;b.push({css:m.channels.toCss(R,R,R),rgba:m.channels.toRgba(R,R,R)})}return b})());let v=l.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(b){super(),this._optionsService=b,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:a,background:o,cursor:s,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:m.color.blend(o,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:m.color.blend(o,p),ansi:l.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(b={}){const y=this._colors;if(y.foreground=x(b.foreground,a),y.background=x(b.background,o),y.cursor=x(b.cursor,s),y.cursorAccent=x(b.cursorAccent,c),y.selectionBackgroundTransparent=x(b.selectionBackground,p),y.selectionBackgroundOpaque=m.color.blend(y.background,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundTransparent=x(b.selectionInactiveBackground,y.selectionBackgroundTransparent),y.selectionInactiveBackgroundOpaque=m.color.blend(y.background,y.selectionInactiveBackgroundTransparent),y.selectionForeground=b.selectionForeground?x(b.selectionForeground,m.NULL_COLOR):void 0,y.selectionForeground===m.NULL_COLOR&&(y.selectionForeground=void 0),m.color.isOpaque(y.selectionBackgroundTransparent)&&(y.selectionBackgroundTransparent=m.color.opacity(y.selectionBackgroundTransparent,.3)),m.color.isOpaque(y.selectionInactiveBackgroundTransparent)&&(y.selectionInactiveBackgroundTransparent=m.color.opacity(y.selectionInactiveBackgroundTransparent,.3)),y.ansi=l.DEFAULT_ANSI_COLORS.slice(),y.ansi[0]=x(b.black,l.DEFAULT_ANSI_COLORS[0]),y.ansi[1]=x(b.red,l.DEFAULT_ANSI_COLORS[1]),y.ansi[2]=x(b.green,l.DEFAULT_ANSI_COLORS[2]),y.ansi[3]=x(b.yellow,l.DEFAULT_ANSI_COLORS[3]),y.ansi[4]=x(b.blue,l.DEFAULT_ANSI_COLORS[4]),y.ansi[5]=x(b.magenta,l.DEFAULT_ANSI_COLORS[5]),y.ansi[6]=x(b.cyan,l.DEFAULT_ANSI_COLORS[6]),y.ansi[7]=x(b.white,l.DEFAULT_ANSI_COLORS[7]),y.ansi[8]=x(b.brightBlack,l.DEFAULT_ANSI_COLORS[8]),y.ansi[9]=x(b.brightRed,l.DEFAULT_ANSI_COLORS[9]),y.ansi[10]=x(b.brightGreen,l.DEFAULT_ANSI_COLORS[10]),y.ansi[11]=x(b.brightYellow,l.DEFAULT_ANSI_COLORS[11]),y.ansi[12]=x(b.brightBlue,l.DEFAULT_ANSI_COLORS[12]),y.ansi[13]=x(b.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),y.ansi[14]=x(b.brightCyan,l.DEFAULT_ANSI_COLORS[14]),y.ansi[15]=x(b.brightWhite,l.DEFAULT_ANSI_COLORS[15]),b.extendedAnsi){const k=Math.min(y.ansi.length-16,b.extendedAnsi.length);for(let R=0;R<k;R++)y.ansi[R+16]=x(b.extendedAnsi[R],l.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(b){this._restoreColor(b),this._onChangeColors.fire(this.colors)}_restoreColor(b){if(b!==void 0)switch(b){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[b]=this._restoreColors.ansi[b]}else for(let y=0;y<this._restoreColors.ansi.length;++y)this._colors.ansi[y]=this._restoreColors.ansi[y]}modifyColors(b){b(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 x(b,y){if(b!==void 0)try{return m.css.toColor(b)}catch{}return y}l.ThemeService=v=f([S(0,g.IOptionsService)],v)},6349:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=u(8460),S=u(844);class d extends S.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.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(C){if(this._maxLength===C)return;const w=new Array(C);for(let g=0;g<Math.min(C,this.length);g++)w[g]=this._array[this._getCyclicIndex(g)];this._array=w,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let w=this._length;w<C;w++)this._array[w]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,w){this._array[this._getCyclicIndex(C)]=w}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,w,...g){if(w){for(let a=C;a<this._length-w;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+w)];this._length-=w,this.onDeleteEmitter.fire({index:C,amount:w})}for(let a=this._length-1;a>=C;a--)this._array[this._getCyclicIndex(a+g.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<g.length;a++)this._array[this._getCyclicIndex(C+a)]=g[a];if(g.length&&this.onInsertEmitter.fire({index:C,amount:g.length}),this._length+g.length>this._maxLength){const a=this._length+g.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=g.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,w,g){if(!(w<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(let o=w-1;o>=0;o--)this.set(C+o+g,this.get(C+o));const a=C+w+g-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<w;a++)this.set(C+a+g,this.get(C+a))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}l.CircularList=d},1439:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(f,S=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const m in f)d[m]=S<=1?f[m]:f[m]&&u(f[m],S-1);return d}},8055:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;const f=u(6114);let S=0,d=0,m=0,C=0;var w,g,a,o,s;function c(v){const x=v.toString(16);return x.length<2?"0"+x:x}function p(v,x){return v<x?(x+.05)/(v+.05):(v+.05)/(x+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},function(v){v.toCss=function(x,b,y,k){return k!==void 0?`#${c(x)}${c(b)}${c(y)}${c(k)}`:`#${c(x)}${c(b)}${c(y)}`},v.toRgba=function(x,b,y,k=255){return(x<<24|b<<16|y<<8|k)>>>0}}(w||(l.channels=w={})),function(v){function x(b,y){return C=Math.round(255*y),[S,d,m]=s.toChannels(b.rgba),{css:w.toCss(S,d,m,C),rgba:w.toRgba(S,d,m,C)}}v.blend=function(b,y){if(C=(255&y.rgba)/255,C===1)return{css:y.css,rgba:y.rgba};const k=y.rgba>>24&255,R=y.rgba>>16&255,O=y.rgba>>8&255,T=b.rgba>>24&255,B=b.rgba>>16&255,z=b.rgba>>8&255;return S=T+Math.round((k-T)*C),d=B+Math.round((R-B)*C),m=z+Math.round((O-z)*C),{css:w.toCss(S,d,m),rgba:w.toRgba(S,d,m)}},v.isOpaque=function(b){return(255&b.rgba)==255},v.ensureContrastRatio=function(b,y,k){const R=s.ensureContrastRatio(b.rgba,y.rgba,k);if(R)return s.toColor(R>>24&255,R>>16&255,R>>8&255)},v.opaque=function(b){const y=(255|b.rgba)>>>0;return[S,d,m]=s.toChannels(y),{css:w.toCss(S,d,m),rgba:y}},v.opacity=x,v.multiplyOpacity=function(b,y){return C=255&b.rgba,x(b,C*y/255)},v.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}}(g||(l.color=g={})),function(v){let x,b;if(!f.isNode){const y=document.createElement("canvas");y.width=1,y.height=1;const k=y.getContext("2d",{willReadFrequently:!0});k&&(x=k,x.globalCompositeOperation="copy",b=x.createLinearGradient(0,0,1,1))}v.toColor=function(y){if(y.match(/#[\da-f]{3,8}/i))switch(y.length){case 4:return S=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),m=parseInt(y.slice(3,4).repeat(2),16),s.toColor(S,d,m);case 5:return S=parseInt(y.slice(1,2).repeat(2),16),d=parseInt(y.slice(2,3).repeat(2),16),m=parseInt(y.slice(3,4).repeat(2),16),C=parseInt(y.slice(4,5).repeat(2),16),s.toColor(S,d,m,C);case 7:return{css:y,rgba:(parseInt(y.slice(1),16)<<8|255)>>>0};case 9:return{css:y,rgba:parseInt(y.slice(1),16)>>>0}}const k=y.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return S=parseInt(k[1]),d=parseInt(k[2]),m=parseInt(k[3]),C=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),s.toColor(S,d,m,C);if(!x||!b)throw new Error("css.toColor: Unsupported css format");if(x.fillStyle=b,x.fillStyle=y,typeof x.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(x.fillRect(0,0,1,1),[S,d,m,C]=x.getImageData(0,0,1,1).data,C!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:w.toRgba(S,d,m,C),css:y}}}(a||(l.css=a={})),function(v){function x(b,y,k){const R=b/255,O=y/255,T=k/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}v.relativeLuminance=function(b){return x(b>>16&255,b>>8&255,255&b)},v.relativeLuminance2=x}(o||(l.rgb=o={})),function(v){function x(y,k,R){const O=y>>24&255,T=y>>16&255,B=y>>8&255;let z=k>>24&255,I=k>>16&255,j=k>>8&255,$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));for(;$<R&&(z>0||I>0||j>0);)z-=Math.max(0,Math.ceil(.1*z)),I-=Math.max(0,Math.ceil(.1*I)),j-=Math.max(0,Math.ceil(.1*j)),$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));return(z<<24|I<<16|j<<8|255)>>>0}function b(y,k,R){const O=y>>24&255,T=y>>16&255,B=y>>8&255;let z=k>>24&255,I=k>>16&255,j=k>>8&255,$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));for(;$<R&&(z<255||I<255||j<255);)z=Math.min(255,z+Math.ceil(.1*(255-z))),I=Math.min(255,I+Math.ceil(.1*(255-I))),j=Math.min(255,j+Math.ceil(.1*(255-j))),$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));return(z<<24|I<<16|j<<8|255)>>>0}v.ensureContrastRatio=function(y,k,R){const O=o.relativeLuminance(y>>8),T=o.relativeLuminance(k>>8);if(p(O,T)<R){if(T<O){const I=x(y,k,R),j=p(O,o.relativeLuminance(I>>8));if(j<R){const $=b(y,k,R);return j>p(O,o.relativeLuminance($>>8))?I:$}return I}const B=b(y,k,R),z=p(O,o.relativeLuminance(B>>8));if(z<R){const I=x(y,k,R);return z>p(O,o.relativeLuminance(I>>8))?B:I}return B}},v.reduceLuminance=x,v.increaseLuminance=b,v.toChannels=function(y){return[y>>24&255,y>>16&255,y>>8&255,255&y]},v.toColor=function(y,k,R,O){return{css:w.toCss(y,k,R,O),rgba:w.toRgba(y,k,R,O)}}}(s||(l.rgba=s={})),l.toPaddedHex=c,l.contrastRatio=p},8969:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=u(844),S=u(2585),d=u(4348),m=u(7866),C=u(744),w=u(7302),g=u(6975),a=u(8460),o=u(1753),s=u(1480),c=u(7994),p=u(9282),v=u(5435),x=u(5981),b=u(2660);let y=!1;class k extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new a.EventEmitter),this._onScroll.event(O=>{var T;(T=this._onScrollApi)===null||T===void 0||T.fire(O.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(O){for(const T in O)this.optionsService.options[T]=O[T]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new a.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new a.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new a.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(O)),this._instantiationService.setService(S.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(S.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(S.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(S.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(S.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(S.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(S.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(b.OscLinkService),this._instantiationService.setService(S.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new v.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,a.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,a.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,a.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,a.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(T=>{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(T=>{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 x.WriteBuffer((T,B)=>this._inputHandler.parse(T,B))),this.register((0,a.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,T){this._writeBuffer.write(O,T)}writeSync(O,T){this._logService.logLevel<=S.LogLevelEnum.WARN&&!y&&(this._logService.warn("writeSync is unreliable and will be removed soon."),y=!0),this._writeBuffer.writeSync(O,T)}resize(O,T){isNaN(O)||isNaN(T)||(O=Math.max(O,C.MINIMUM_COLS),T=Math.max(T,C.MINIMUM_ROWS),this._bufferService.resize(O,T))}scroll(O,T=!1){this._bufferService.scroll(O,T)}scrollLines(O,T,B){this._bufferService.scrollLines(O,T,B)}scrollPages(O){this.scrollLines(O*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(O){const T=O-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(O,T){return this._inputHandler.registerEscHandler(O,T)}registerDcsHandler(O,T){return this._inputHandler.registerDcsHandler(O,T)}registerCsiHandler(O,T){return this._inputHandler.registerCsiHandler(O,T)}registerOscHandler(O,T){return this._inputHandler.registerOscHandler(O,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?O=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(O=!0),O?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const O=[];O.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const T of O)T.dispose()})}}}l.CoreTerminal=k},8460:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const S=[];for(let d=0;d<this._listeners.length;d++)S.push(this._listeners[d]);for(let d=0;d<S.length;d++)S[d].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,f){return u(S=>f.fire(S))}},5435:function(_,l,u){var f=this&&this.__decorate||function($,E,A,P){var M,H=arguments.length,K=H<3?E:P===null?P=Object.getOwnPropertyDescriptor(E,A):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate($,E,A,P);else for(var X=$.length-1;X>=0;X--)(M=$[X])&&(K=(H<3?M(K):H>3?M(E,A,K):M(E,A))||K);return H>3&&K&&Object.defineProperty(E,A,K),K},S=this&&this.__param||function($,E){return function(A,P){E(A,P,$)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=u(2584),m=u(7116),C=u(2015),w=u(844),g=u(482),a=u(8437),o=u(8460),s=u(643),c=u(511),p=u(3734),v=u(2585),x=u(6242),b=u(6351),y=u(5941),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function O($,E){if($>24)return E.setWinLines||!1;switch($){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var T;(function($){$[$.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",$[$.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(l.WindowsOptionsReportType=T={}));let B=0;class z extends w.Disposable{getAttrData(){return this._curAttrData}constructor(E,A,P,M,H,K,X,q,se=new C.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=A,this._coreService=P,this._logService=M,this._optionsService=H,this._oscLinkService=K,this._coreMouseService=X,this._unicodeService=q,this._parser=se,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new g.StringToUtf32,this._utf8Decoder=new g.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.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 I(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(D=>this._activeBuffer=D.activeBuffer)),this._parser.setCsiHandlerFallback((D,F)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:F.toArray()})}),this._parser.setEscHandlerFallback(D=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(D)})}),this._parser.setExecuteHandlerFallback(D=>{this._logService.debug("Unknown EXECUTE code: ",{code:D})}),this._parser.setOscHandlerFallback((D,F,W)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:F,data:W})}),this._parser.setDcsHandlerFallback((D,F,W)=>{F==="HOOK"&&(W=W.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:F,payload:W})}),this._parser.setPrintHandler((D,F,W)=>this.print(D,F,W)),this._parser.registerCsiHandler({final:"@"},D=>this.insertChars(D)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},D=>this.scrollLeft(D)),this._parser.registerCsiHandler({final:"A"},D=>this.cursorUp(D)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},D=>this.scrollRight(D)),this._parser.registerCsiHandler({final:"B"},D=>this.cursorDown(D)),this._parser.registerCsiHandler({final:"C"},D=>this.cursorForward(D)),this._parser.registerCsiHandler({final:"D"},D=>this.cursorBackward(D)),this._parser.registerCsiHandler({final:"E"},D=>this.cursorNextLine(D)),this._parser.registerCsiHandler({final:"F"},D=>this.cursorPrecedingLine(D)),this._parser.registerCsiHandler({final:"G"},D=>this.cursorCharAbsolute(D)),this._parser.registerCsiHandler({final:"H"},D=>this.cursorPosition(D)),this._parser.registerCsiHandler({final:"I"},D=>this.cursorForwardTab(D)),this._parser.registerCsiHandler({final:"J"},D=>this.eraseInDisplay(D,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},D=>this.eraseInDisplay(D,!0)),this._parser.registerCsiHandler({final:"K"},D=>this.eraseInLine(D,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},D=>this.eraseInLine(D,!0)),this._parser.registerCsiHandler({final:"L"},D=>this.insertLines(D)),this._parser.registerCsiHandler({final:"M"},D=>this.deleteLines(D)),this._parser.registerCsiHandler({final:"P"},D=>this.deleteChars(D)),this._parser.registerCsiHandler({final:"S"},D=>this.scrollUp(D)),this._parser.registerCsiHandler({final:"T"},D=>this.scrollDown(D)),this._parser.registerCsiHandler({final:"X"},D=>this.eraseChars(D)),this._parser.registerCsiHandler({final:"Z"},D=>this.cursorBackwardTab(D)),this._parser.registerCsiHandler({final:"`"},D=>this.charPosAbsolute(D)),this._parser.registerCsiHandler({final:"a"},D=>this.hPositionRelative(D)),this._parser.registerCsiHandler({final:"b"},D=>this.repeatPrecedingCharacter(D)),this._parser.registerCsiHandler({final:"c"},D=>this.sendDeviceAttributesPrimary(D)),this._parser.registerCsiHandler({prefix:">",final:"c"},D=>this.sendDeviceAttributesSecondary(D)),this._parser.registerCsiHandler({final:"d"},D=>this.linePosAbsolute(D)),this._parser.registerCsiHandler({final:"e"},D=>this.vPositionRelative(D)),this._parser.registerCsiHandler({final:"f"},D=>this.hVPosition(D)),this._parser.registerCsiHandler({final:"g"},D=>this.tabClear(D)),this._parser.registerCsiHandler({final:"h"},D=>this.setMode(D)),this._parser.registerCsiHandler({prefix:"?",final:"h"},D=>this.setModePrivate(D)),this._parser.registerCsiHandler({final:"l"},D=>this.resetMode(D)),this._parser.registerCsiHandler({prefix:"?",final:"l"},D=>this.resetModePrivate(D)),this._parser.registerCsiHandler({final:"m"},D=>this.charAttributes(D)),this._parser.registerCsiHandler({final:"n"},D=>this.deviceStatus(D)),this._parser.registerCsiHandler({prefix:"?",final:"n"},D=>this.deviceStatusPrivate(D)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},D=>this.softReset(D)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},D=>this.setCursorStyle(D)),this._parser.registerCsiHandler({final:"r"},D=>this.setScrollRegion(D)),this._parser.registerCsiHandler({final:"s"},D=>this.saveCursor(D)),this._parser.registerCsiHandler({final:"t"},D=>this.windowOptions(D)),this._parser.registerCsiHandler({final:"u"},D=>this.restoreCursor(D)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},D=>this.insertColumns(D)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},D=>this.deleteColumns(D)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},D=>this.selectProtected(D)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},D=>this.requestMode(D,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},D=>this.requestMode(D,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new x.OscHandler(D=>(this.setTitle(D),this.setIconName(D),!0))),this._parser.registerOscHandler(1,new x.OscHandler(D=>this.setIconName(D))),this._parser.registerOscHandler(2,new x.OscHandler(D=>this.setTitle(D))),this._parser.registerOscHandler(4,new x.OscHandler(D=>this.setOrReportIndexedColor(D))),this._parser.registerOscHandler(8,new x.OscHandler(D=>this.setHyperlink(D))),this._parser.registerOscHandler(10,new x.OscHandler(D=>this.setOrReportFgColor(D))),this._parser.registerOscHandler(11,new x.OscHandler(D=>this.setOrReportBgColor(D))),this._parser.registerOscHandler(12,new x.OscHandler(D=>this.setOrReportCursorColor(D))),this._parser.registerOscHandler(104,new x.OscHandler(D=>this.restoreIndexedColor(D))),this._parser.registerOscHandler(110,new x.OscHandler(D=>this.restoreFgColor(D))),this._parser.registerOscHandler(111,new x.OscHandler(D=>this.restoreBgColor(D))),this._parser.registerOscHandler(112,new x.OscHandler(D=>this.restoreCursorColor(D))),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 D in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:D},()=>this.selectCharset("("+D)),this._parser.registerEscHandler({intermediates:")",final:D},()=>this.selectCharset(")"+D)),this._parser.registerEscHandler({intermediates:"*",final:D},()=>this.selectCharset("*"+D)),this._parser.registerEscHandler({intermediates:"+",final:D},()=>this.selectCharset("+"+D)),this._parser.registerEscHandler({intermediates:"-",final:D},()=>this.selectCharset("-"+D)),this._parser.registerEscHandler({intermediates:".",final:D},()=>this.selectCharset("."+D)),this._parser.registerEscHandler({intermediates:"/",final:D},()=>this.selectCharset("/"+D));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(D=>(this._logService.error("Parsing error: ",D),D)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler((D,F)=>this.requestStatusString(D,F)))}_preserveStack(E,A,P,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=A,this._parseStack.decodedLength=P,this._parseStack.position=M}_logSlowResolvingAsync(E){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([E,new Promise((A,P)=>setTimeout(()=>P("#SLOW_TIMEOUT"),5e3))]).catch(A=>{if(A!=="#SLOW_TIMEOUT")throw A;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,A){let P,M=this._activeBuffer.x,H=this._activeBuffer.y,K=0;const X=this._parseStack.paused;if(X){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,A))return this._logSlowResolvingAsync(P),P;M=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>R&&(K=this._parseStack.position+R)}if(this._logService.logLevel<=v.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,q=>String.fromCharCode(q)).join("")}"`),typeof E=="string"?E.split("").map(q=>q.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(E.length,R))),X||this._dirtyRowTracker.clearRange(),E.length>R)for(let q=K;q<E.length;q+=R){const se=q+R<E.length?q+R:E.length,D=typeof E=="string"?this._stringDecoder.decode(E.substring(q,se),this._parseBuffer):this._utf8Decoder.decode(E.subarray(q,se),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,D))return this._preserveStack(M,H,D,q),this._logSlowResolvingAsync(P),P}else if(!X){const q=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,q))return this._preserveStack(M,H,q,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===M&&this._activeBuffer.y===H||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(E,A,P){let M,H;const K=this._charsetService.charset,X=this._optionsService.rawOptions.screenReaderMode,q=this._bufferService.cols,se=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,F=this._curAttrData;let W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-A>0&&W.getWidth(this._activeBuffer.x-1)===2&&W.setCellFromCodePoint(this._activeBuffer.x-1,0,1,F.fg,F.bg,F.extended);for(let U=A;U<P;++U){if(M=E[U],H=this._unicodeService.wcwidth(M),M<127&&K){const re=K[String.fromCharCode(M)];re&&(M=re.charCodeAt(0))}if(X&&this._onA11yChar.fire((0,g.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),H||!this._activeBuffer.x){if(this._activeBuffer.x+H-1>=q){if(se){for(;this._activeBuffer.x<q;)W.setCellFromCodePoint(this._activeBuffer.x++,0,1,F.fg,F.bg,F.extended);this._activeBuffer.x=0,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),W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=q-1,H===2)continue}if(D&&(W.insertCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(F),F),W.getWidth(q-1)===2&&W.setCellFromCodePoint(q-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,F.fg,F.bg,F.extended)),W.setCellFromCodePoint(this._activeBuffer.x++,M,H,F.fg,F.bg,F.extended),H>0)for(;--H;)W.setCellFromCodePoint(this._activeBuffer.x++,0,0,F.fg,F.bg,F.extended)}else W.getWidth(this._activeBuffer.x-1)?W.addCodepointToCell(this._activeBuffer.x-1,M):W.addCodepointToCell(this._activeBuffer.x-2,M)}P-A>0&&(W.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<q&&P-A>0&&W.getWidth(this._activeBuffer.x)===0&&!W.hasContent(this._activeBuffer.x)&&W.setCellFromCodePoint(this._activeBuffer.x,0,1,F.fg,F.bg,F.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,A){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,A):this._parser.registerCsiHandler(E,P=>!O(P.params[0],this._optionsService.rawOptions.windowOptions)||A(P))}registerDcsHandler(E,A){return this._parser.registerDcsHandler(E,new b.DcsHandler(A))}registerEscHandler(E,A){return this._parser.registerEscHandler(E,A)}registerOscHandler(E,A){return this._parser.registerOscHandler(E,new x.OscHandler(A))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var E;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||E===void 0)&&E.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);A.hasWidth(this._activeBuffer.x)&&!A.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const E=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-E),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(E=this._bufferService.cols-1){this._activeBuffer.x=Math.min(E,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(E,A){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+A):(this._activeBuffer.x=E,this._activeBuffer.y=A),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,A){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+A)}cursorUp(E){const A=this._activeBuffer.y-this._activeBuffer.scrollTop;return A>=0?this._moveCursor(0,-Math.min(A,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const A=this._activeBuffer.scrollBottom-this._activeBuffer.y;return A>=0?this._moveCursor(0,Math.min(A,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0}cursorForward(E){return this._moveCursor(E.params[0]||1,0),!0}cursorBackward(E){return this._moveCursor(-(E.params[0]||1),0),!0}cursorNextLine(E){return this.cursorDown(E),this._activeBuffer.x=0,!0}cursorPrecedingLine(E){return this.cursorUp(E),this._activeBuffer.x=0,!0}cursorCharAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0}charPosAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(E){return this._moveCursor(E.params[0]||1,0),!0}linePosAbsolute(E){return this._setCursor(this._activeBuffer.x,(E.params[0]||1)-1),!0}vPositionRelative(E){return this._moveCursor(0,E.params[0]||1),!0}hVPosition(E){return this.cursorPosition(E),!0}tabClear(E){const A=E.params[0];return A===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:A===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=E.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=E.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const A=E.params[0];return A===1&&(this._curAttrData.bg|=536870912),A!==2&&A!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,A,P,M=!1,H=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);K.replaceCells(A,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),H),M&&(K.isWrapped=!1)}_resetBufferLine(E,A=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),A),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),P.isWrapped=!1)}eraseInDisplay(E,A=!1){let P;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);P<this._bufferService.rows;P++)this._resetBufferLine(P,A);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,A),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,A);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,A);this._dirtyRowTracker.markDirty(0);break;case 3:const M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,0),this._onScroll.fire(0))}return!0}eraseInLine(E,A=!1){switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,A);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,A)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let A=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-M+1;for(;A--;)this._activeBuffer.lines.splice(H-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(E){this._restrictCursor();let A=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;A--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(E){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let A=E.params[0]||1;for(;A--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(E){let A=E.params[0]||1;for(;A--;)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(a.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.deleteCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.insertCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.insertCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.deleteCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){if(!this._parser.precedingCodepoint)return!0;const A=E.params[0]||1,P=new Uint32Array(A);for(let M=0;M<A;++M)P[M]=this._parser.precedingCodepoint;return this.print(P,0,P.length),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let A=0;A<E.length;A++)switch(E.params[A]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let A=0;A<E.length;A++)switch(E.params[A]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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(E){for(let A=0;A<E.length;A++)switch(E.params[A]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let A=0;A<E.length;A++)switch(E.params[A]){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(),E.params[A]===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(E,A){const P=this._coreService.decPrivateModes,{activeProtocol:M,activeEncoding:H}=this._coreMouseService,K=this._coreService,{buffers:X,cols:q}=this._bufferService,{active:se,alt:D}=X,F=this._optionsService.rawOptions,W=ae=>ae?1:2,U=E.params[0];return re=U,J=A?U===2?4:U===4?W(K.modes.insertMode):U===12?3:U===20?W(F.convertEol):0:U===1?W(P.applicationCursorKeys):U===3?F.windowOptions.setWinLines?q===80?2:q===132?1:0:0:U===6?W(P.origin):U===7?W(P.wraparound):U===8?3:U===9?W(M==="X10"):U===12?W(F.cursorBlink):U===25?W(!K.isCursorHidden):U===45?W(P.reverseWraparound):U===66?W(P.applicationKeypad):U===67?4:U===1e3?W(M==="VT200"):U===1002?W(M==="DRAG"):U===1003?W(M==="ANY"):U===1004?W(P.sendFocus):U===1005?4:U===1006?W(H==="SGR"):U===1015?4:U===1016?W(H==="SGR_PIXELS"):U===1048?1:U===47||U===1047||U===1049?W(se===D):U===2004?W(P.bracketedPasteMode):0,K.triggerDataEvent(`${d.C0.ESC}[${A?"":"?"}${re};${J}$y`),!0;var re,J}_updateAttrColor(E,A,P,M,H){return A===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([P,M,H])):A===5&&(E&=-50331904,E|=33554432|255&P),E}_extractColor(E,A,P){const M=[0,0,-1,0,0,0];let H=0,K=0;do{if(M[K+H]=E.params[A+K],E.hasSubParams(A+K)){const X=E.getSubParams(A+K);let q=0;do M[1]===5&&(H=1),M[K+q+1+H]=X[q];while(++q<X.length&&q+K+1+H<M.length);break}if(M[1]===5&&K+H>=2||M[1]===2&&K+H>=5)break;M[1]&&(H=1)}while(++K+A<E.length&&K+H<M.length);for(let X=2;X<M.length;++X)M[X]===-1&&(M[X]=0);switch(M[0]){case 38:P.fg=this._updateAttrColor(P.fg,M[1],M[3],M[4],M[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,M[1],M[3],M[4],M[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,M[1],M[3],M[4],M[5])}return K}_processUnderline(E,A){A.extended=A.extended.clone(),(!~E||E>5)&&(E=1),A.extended.underlineStyle=E,A.fg|=268435456,E===0&&(A.fg&=-268435457),A.updateExtended()}_processSGR0(E){E.fg=a.DEFAULT_ATTR_DATA.fg,E.bg=a.DEFAULT_ATTR_DATA.bg,E.extended=E.extended.clone(),E.extended.underlineStyle=0,E.extended.underlineColor&=-67108864,E.updateExtended()}charAttributes(E){if(E.length===1&&E.params[0]===0)return this._processSGR0(this._curAttrData),!0;const A=E.length;let P;const M=this._curAttrData;for(let H=0;H<A;H++)P=E.params[H],P>=30&&P<=37?(M.fg&=-50331904,M.fg|=16777216|P-30):P>=40&&P<=47?(M.bg&=-50331904,M.bg|=16777216|P-40):P>=90&&P<=97?(M.fg&=-50331904,M.fg|=16777224|P-90):P>=100&&P<=107?(M.bg&=-50331904,M.bg|=16777224|P-100):P===0?this._processSGR0(M):P===1?M.fg|=134217728:P===3?M.bg|=67108864:P===4?(M.fg|=268435456,this._processUnderline(E.hasSubParams(H)?E.getSubParams(H)[0]:1,M)):P===5?M.fg|=536870912:P===7?M.fg|=67108864:P===8?M.fg|=1073741824:P===9?M.fg|=2147483648:P===2?M.bg|=134217728:P===21?this._processUnderline(2,M):P===22?(M.fg&=-134217729,M.bg&=-134217729):P===23?M.bg&=-67108865:P===24?(M.fg&=-268435457,this._processUnderline(0,M)):P===25?M.fg&=-536870913:P===27?M.fg&=-67108865:P===28?M.fg&=-1073741825:P===29?M.fg&=2147483647:P===39?(M.fg&=-67108864,M.fg|=16777215&a.DEFAULT_ATTR_DATA.fg):P===49?(M.bg&=-67108864,M.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?H+=this._extractColor(E,H,M):P===53?M.bg|=1073741824:P===55?M.bg&=-1073741825:P===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):P===100?(M.fg&=-67108864,M.fg|=16777215&a.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const A=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${A};${P}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const A=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${A};${P}R`)}return!0}softReset(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=a.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(E){const A=E.params[0]||1;switch(A){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 P=A%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(E){const A=E.params[0]||1;let P;return(E.length<2||(P=E.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>A&&(this._activeBuffer.scrollTop=A-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(E){if(!O(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const A=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:A!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:A!==0&&A!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),A!==0&&A!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:A!==0&&A!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),A!==0&&A!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(E){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(E){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0}setIconName(E){return this._iconName=E,!0}setOrReportIndexedColor(E){const A=[],P=E.split(";");for(;P.length>1;){const M=P.shift(),H=P.shift();if(/^\d+$/.exec(M)){const K=parseInt(M);if(j(K))if(H==="?")A.push({type:0,index:K});else{const X=(0,y.parseColor)(H);X&&A.push({type:1,index:K,color:X})}}}return A.length&&this._onColor.fire(A),!0}setHyperlink(E){const A=E.split(";");return!(A.length<2)&&(A[1]?this._createHyperlink(A[0],A[1]):!A[0]&&this._finishHyperlink())}_createHyperlink(E,A){this._getCurrentLinkId()&&this._finishHyperlink();const P=E.split(":");let M;const H=P.findIndex(K=>K.startsWith("id="));return H!==-1&&(M=P[H].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,uri:A}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,A){const P=E.split(";");for(let M=0;M<P.length&&!(A>=this._specialColors.length);++M,++A)if(P[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[A]}]);else{const H=(0,y.parseColor)(P[M]);H&&this._onColor.fire([{type:1,index:this._specialColors[A],color:H}])}return!0}setOrReportFgColor(E){return this._setOrReportSpecialColor(E,0)}setOrReportBgColor(E){return this._setOrReportSpecialColor(E,1)}setOrReportCursorColor(E){return this._setOrReportSpecialColor(E,2)}restoreIndexedColor(E){if(!E)return this._onColor.fire([{type:2}]),!0;const A=[],P=E.split(";");for(let M=0;M<P.length;++M)if(/^\d+$/.exec(P[M])){const H=parseInt(P[M]);j(H)&&A.push({type:2,index:H})}return A.length&&this._onColor.fire(A),!0}restoreFgColor(E){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(E){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(E){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(k[E[0]],m.CHARSETS[E[1]]||m.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 E=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,E,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new c.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let A=0;A<this._bufferService.rows;++A){const P=this._activeBuffer.ybase+this._activeBuffer.y+A,M=this._activeBuffer.lines.get(P);M&&(M.fill(E),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,A){const P=this._bufferService.buffer,M=this._optionsService.rawOptions;return(H=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${H}${d.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,A){this._dirtyRowTracker.markRangeDirty(E,A)}}l.InputHandler=z;let I=class{constructor($){this._bufferService=$,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty($){$<this.start?this.start=$:$>this.end&&(this.end=$)}markRangeDirty($,E){$>E&&(B=$,$=E,E=B),$<this.start&&(this.start=$),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function j($){return 0<=$&&$<256}I=f([S(0,v.IBufferService)],I)},844:(_,l)=>{function u(f){for(const S of f)S.dispose();f.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const S=this._disposables.indexOf(f);S!==-1&&this._disposables.splice(S,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var S;this._isDisposed||f===this._value||((S=this._value)===null||S===void 0||S.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)===null||f===void 0||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=u,l.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},1505:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(S,d,m){this._data[S]||(this._data[S]={}),this._data[S][d]=m}get(S,d){return this._data[S]?this._data[S][d]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(f,S,d,m,C){this._data.get(f,S)||this._data.set(f,S,new u),this._data.get(f,S).set(d,m,C)}get(f,S,d,m){var C;return(C=this._data.get(f,S))===null||C===void 0?void 0:C.get(d,m)}clear(){this._data.clear()}}},6114:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof navigator>"u";const u=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const S=u.match(/Version\/(\d+)/);return S===null||S.length<2?0:parseInt(S[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(u=this._search(this._getKey(f)),this._array.splice(u,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const S=this._getKey(f);if(S===void 0||(u=this._search(S),u===-1)||this._getKey(this._array[u])!==S)return!1;do if(this._array[u]===f)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===S);return!1}*getKeyIterator(f){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===f)}forEachByKey(f,S){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do S(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===f)}values(){return[...this._array].values()}_search(f){let S=0,d=this._array.length-1;for(;d>=S;){let m=S+d>>1;const C=this._getKey(this._array[m]);if(C>f)d=m-1;else{if(!(C<f)){for(;m>0&&this._getKey(this._array[m-1])===f;)m--;return m}S=m+1}}return S}}},7226:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=u(6114);class S{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let w=0,g=0,a=C.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),g=Math.max(w,g),o=C.timeRemaining(),1.5*g>o)return a-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-w))}ms`),void this._start();a=o}this.clear()}}class d extends S{_requestCallback(C){return setTimeout(()=>C(this._createDeadline(16)))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const w=Date.now()+C;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}l.PriorityTaskQueue=d,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends S{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=u(643);l.updateWindowsModeWrappedState=function(S){const d=S.buffer.lines.get(S.buffer.ybase+S.buffer.y-1),m=d==null?void 0:d.get(S.cols-1),C=S.buffer.lines.get(S.buffer.ybase+S.buffer.y);C&&m&&(C.isWrapped=m[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&m[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new u;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}l.AttributeData=u;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}constructor(d=0,m=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=m}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=u(6349),S=u(7226),d=u(3734),m=u(8437),C=u(4634),w=u(511),g=u(643),a=u(4863),o=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(s,c,p){this._hasScrollback=s,this._optionsService=c,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,g.WHITESPACE_CELL_CHAR,g.WHITESPACE_CELL_WIDTH,g.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new S.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,c){return new m.BufferLine(this._bufferService.cols,this.getNullCell(s),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const c=s+this._optionsService.rawOptions.scrollback;return c>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:c}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=m.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,c){const p=this.getNullCell(m.DEFAULT_ATTR_DATA);let v=0;const x=this._getCorrectBufferLength(c);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<s)for(let y=0;y<this.lines.length;y++)v+=+this.lines.get(y).resize(s,p);let b=0;if(this._rows<c)for(let y=this._rows;y<c;y++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(s,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+b+1?(this.ybase--,b++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(s,p)));else for(let y=this._rows;y>c;y--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const y=this.lines.length-x;y>0&&(this.lines.trimStart(y),this.ybase=Math.max(this.ybase-y,0),this.ydisp=Math.max(this.ydisp-y,0),this.savedY=Math.max(this.savedY-y,0)),this.lines.maxLength=x}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,c-1),b&&(this.y+=b),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(s,c),this._cols>s))for(let b=0;b<this.lines.length;b++)v+=+this.lines.get(b).resize(s,p);this._cols=s,this._rows=c,this._memoryCleanupQueue.clear(),v>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,c){this._cols!==s&&(s>this._cols?this._reflowLarger(s,c):this._reflowSmaller(s,c))}_reflowLarger(s,c){const p=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(p.length>0){const v=(0,C.reflowLargerCreateNewLayout)(this.lines,p);(0,C.reflowLargerApplyNewLayout)(this.lines,v.layout),this._reflowLargerAdjustViewport(s,c,v.countRemoved)}}_reflowLargerAdjustViewport(s,c,p){const v=this.getNullCell(m.DEFAULT_ATTR_DATA);let x=p;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new m.BufferLine(s,v))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,c){const p=this.getNullCell(m.DEFAULT_ATTR_DATA),v=[];let x=0;for(let b=this.lines.length-1;b>=0;b--){let y=this.lines.get(b);if(!y||!y.isWrapped&&y.getTrimmedLength()<=s)continue;const k=[y];for(;y.isWrapped&&b>0;)y=this.lines.get(--b),k.unshift(y);const R=this.ybase+this.y;if(R>=b&&R<b+k.length)continue;const O=k[k.length-1].getTrimmedLength(),T=(0,C.reflowSmallerGetNewLineLengths)(k,this._cols,s),B=T.length-k.length;let z;z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const I=[];for(let M=0;M<B;M++){const H=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);I.push(H)}I.length>0&&(v.push({start:b+k.length+x,newLines:I}),x+=I.length),k.push(...I);let j=T.length-1,$=T[j];$===0&&(j--,$=T[j]);let E=k.length-B-1,A=O;for(;E>=0;){const M=Math.min(A,$);if(k[j]===void 0)break;if(k[j].copyCellsFrom(k[E],A-M,$-M,M,!0),$-=M,$===0&&(j--,$=T[j]),A-=M,A===0){E--;const H=Math.max(E,0);A=(0,C.getWrappedLineTrimmedLength)(k,H,this._cols)}}for(let M=0;M<k.length;M++)T[M]<s&&k[M].setCell(T[M],p);let P=B-z;for(;P-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+c-1)}if(v.length>0){const b=[],y=[];for(let j=0;j<this.lines.length;j++)y.push(this.lines.get(j));const k=this.lines.length;let R=k-1,O=0,T=v[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let B=0;for(let j=Math.min(this.lines.maxLength-1,k+x-1);j>=0;j--)if(T&&T.start>R+B){for(let $=T.newLines.length-1;$>=0;$--)this.lines.set(j--,T.newLines[$]);j++,b.push({index:R+1,amount:T.newLines.length}),B+=T.newLines.length,T=v[++O]}else this.lines.set(j,y[R--]);let z=0;for(let j=b.length-1;j>=0;j--)b[j].index+=z,this.lines.onInsertEmitter.fire(b[j]),z+=b[j].amount;const I=Math.max(0,k+x-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(s,c,p=0,v){const x=this.lines.get(s);return x?x.translateToString(c,p,v):""}getWrappedRangeForLine(s){let c=s,p=s;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:c,last:p}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===s&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const c=new a.Marker(s);return this.markers.push(c),c.register(this.lines.onTrim(p=>{c.line-=p,c.line<0&&c.dispose()})),c.register(this.lines.onInsert(p=>{c.line>=p.index&&(c.line+=p.amount)})),c.register(this.lines.onDelete(p=>{c.line>=p.index&&c.line<p.index+p.amount&&c.dispose(),c.line>p.index&&(c.line-=p.amount)})),c.register(c.onDispose(()=>this._removeMarker(c))),c}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=u(3734),S=u(511),d=u(643),m=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let C=0;class w{constructor(a,o,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*a);const c=o||S.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let p=0;p<a;++p)this.setCell(p,c);this.length=a}get(a){const o=this._data[3*a+0],s=2097151&o;return[this._data[3*a+1],2097152&o?this._combined[a]:s?(0,m.stringFromCodePoint)(s):"",o>>22,2097152&o?this._combined[a].charCodeAt(this._combined[a].length-1):s]}set(a,o){this._data[3*a+1]=o[d.CHAR_DATA_ATTR_INDEX],o[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[a]=o[1],this._data[3*a+0]=2097152|a|o[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*a+0]=o[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(a){return this._data[3*a+0]>>22}hasWidth(a){return 12582912&this._data[3*a+0]}getFg(a){return this._data[3*a+1]}getBg(a){return this._data[3*a+2]}hasContent(a){return 4194303&this._data[3*a+0]}getCodePoint(a){const o=this._data[3*a+0];return 2097152&o?this._combined[a].charCodeAt(this._combined[a].length-1):2097151&o}isCombined(a){return 2097152&this._data[3*a+0]}getString(a){const o=this._data[3*a+0];return 2097152&o?this._combined[a]:2097151&o?(0,m.stringFromCodePoint)(2097151&o):""}isProtected(a){return 536870912&this._data[3*a+2]}loadCell(a,o){return C=3*a,o.content=this._data[C+0],o.fg=this._data[C+1],o.bg=this._data[C+2],2097152&o.content&&(o.combinedData=this._combined[a]),268435456&o.bg&&(o.extended=this._extendedAttrs[a]),o}setCell(a,o){2097152&o.content&&(this._combined[a]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[a]=o.extended),this._data[3*a+0]=o.content,this._data[3*a+1]=o.fg,this._data[3*a+2]=o.bg}setCellFromCodePoint(a,o,s,c,p,v){268435456&p&&(this._extendedAttrs[a]=v),this._data[3*a+0]=o|s<<22,this._data[3*a+1]=c,this._data[3*a+2]=p}addCodepointToCell(a,o){let s=this._data[3*a+0];2097152&s?this._combined[a]+=(0,m.stringFromCodePoint)(o):(2097151&s?(this._combined[a]=(0,m.stringFromCodePoint)(2097151&s)+(0,m.stringFromCodePoint)(o),s&=-2097152,s|=2097152):s=o|4194304,this._data[3*a+0]=s)}insertCells(a,o,s,c){if((a%=this.length)&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),o<this.length-a){const p=new S.CellData;for(let v=this.length-a-o-1;v>=0;--v)this.setCell(a+o+v,this.loadCell(a+v,p));for(let v=0;v<o;++v)this.setCell(a+v,s)}else for(let p=a;p<this.length;++p)this.setCell(p,s);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs)}deleteCells(a,o,s,c){if(a%=this.length,o<this.length-a){const p=new S.CellData;for(let v=0;v<this.length-a-o;++v)this.setCell(a+v,this.loadCell(a+o+v,p));for(let v=this.length-o;v<this.length;++v)this.setCell(v,s)}else for(let p=a;p<this.length;++p)this.setCell(p,s);a&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),this.getWidth(a)!==0||this.hasContent(a)||this.setCellFromCodePoint(a,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs)}replaceCells(a,o,s,c,p=!1){if(p)for(a&&this.getWidth(a-1)===2&&!this.isProtected(a-1)&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodePoint(o,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs);a<o&&a<this.length;)this.isProtected(a)||this.setCell(a,s),a++;else for(a&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs);a<o&&a<this.length;)this.setCell(a++,s)}resize(a,o){if(a===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*a;if(a>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const c=new Uint32Array(s);c.set(this._data),this._data=c}for(let c=this.length;c<a;++c)this.setCell(c,o)}else{this._data=this._data.subarray(0,s);const c=Object.keys(this._combined);for(let v=0;v<c.length;v++){const x=parseInt(c[v],10);x>=a&&delete this._combined[x]}const p=Object.keys(this._extendedAttrs);for(let v=0;v<p.length;v++){const x=parseInt(p[v],10);x>=a&&delete this._extendedAttrs[x]}}return this.length=a,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const a=new Uint32Array(this._data.length);return a.set(this._data),this._data=a,1}return 0}fill(a,o=!1){if(o)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,a);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,a)}}copyFrom(a){this.length!==a.length?this._data=new Uint32Array(a._data):this._data.set(a._data),this.length=a.length,this._combined={};for(const o in a._combined)this._combined[o]=a._combined[o];this._extendedAttrs={};for(const o in a._extendedAttrs)this._extendedAttrs[o]=a._extendedAttrs[o];this.isWrapped=a.isWrapped}clone(){const a=new w(0);a._data=new Uint32Array(this._data),a.length=this.length;for(const o in this._combined)a._combined[o]=this._combined[o];for(const o in this._extendedAttrs)a._extendedAttrs[o]=this._extendedAttrs[o];return a.isWrapped=this.isWrapped,a}getTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0])return a+(this._data[3*a+0]>>22);return 0}getNoBgTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0]||50331648&this._data[3*a+2])return a+(this._data[3*a+0]>>22);return 0}copyCellsFrom(a,o,s,c,p){const v=a._data;if(p)for(let b=c-1;b>=0;b--){for(let y=0;y<3;y++)this._data[3*(s+b)+y]=v[3*(o+b)+y];268435456&v[3*(o+b)+2]&&(this._extendedAttrs[s+b]=a._extendedAttrs[o+b])}else for(let b=0;b<c;b++){for(let y=0;y<3;y++)this._data[3*(s+b)+y]=v[3*(o+b)+y];268435456&v[3*(o+b)+2]&&(this._extendedAttrs[s+b]=a._extendedAttrs[o+b])}const x=Object.keys(a._combined);for(let b=0;b<x.length;b++){const y=parseInt(x[b],10);y>=o&&(this._combined[y-o+s]=a._combined[y])}}translateToString(a=!1,o=0,s=this.length){a&&(s=Math.min(s,this.getTrimmedLength()));let c="";for(;o<s;){const p=this._data[3*o+0],v=2097151&p;c+=2097152&p?this._combined[o]:v?(0,m.stringFromCodePoint)(v):d.WHITESPACE_CELL_CHAR,o+=p>>22||1}return c}}l.BufferLine=w},4841:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,f){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return f*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(_,l)=>{function u(f,S,d){if(S===f.length-1)return f[S].getTrimmedLength();const m=!f[S].hasContent(d-1)&&f[S].getWidth(d-1)===1,C=f[S+1].getWidth(0)===2;return m&&C?d-1:d}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,S,d,m,C){const w=[];for(let g=0;g<f.length-1;g++){let a=g,o=f.get(++a);if(!o.isWrapped)continue;const s=[f.get(g)];for(;a<f.length&&o.isWrapped;)s.push(o),o=f.get(++a);if(m>=g&&m<a){g+=s.length-1;continue}let c=0,p=u(s,c,S),v=1,x=0;for(;v<s.length;){const y=u(s,v,S),k=y-x,R=d-p,O=Math.min(k,R);s[c].copyCellsFrom(s[v],x,p,O,!1),p+=O,p===d&&(c++,p=0),x+=O,x===y&&(v++,x=0),p===0&&c!==0&&s[c-1].getWidth(d-1)===2&&(s[c].copyCellsFrom(s[c-1],d-1,p++,1,!1),s[c-1].setCell(d-1,C))}s[c].replaceCells(p,d,C);let b=0;for(let y=s.length-1;y>0&&(y>c||s[y].getTrimmedLength()===0);y--)b++;b>0&&(w.push(g+s.length-b),w.push(b)),g+=s.length-1}return w},l.reflowLargerCreateNewLayout=function(f,S){const d=[];let m=0,C=S[m],w=0;for(let g=0;g<f.length;g++)if(C===g){const a=S[++m];f.onDeleteEmitter.fire({index:g-w,amount:a}),g+=a-1,w+=a,C=S[++m]}else d.push(g);return{layout:d,countRemoved:w}},l.reflowLargerApplyNewLayout=function(f,S){const d=[];for(let m=0;m<S.length;m++)d.push(f.get(S[m]));for(let m=0;m<d.length;m++)f.set(m,d[m]);f.length=S.length},l.reflowSmallerGetNewLineLengths=function(f,S,d){const m=[],C=f.map((o,s)=>u(f,s,S)).reduce((o,s)=>o+s);let w=0,g=0,a=0;for(;a<C;){if(C-a<d){m.push(C-a);break}w+=d;const o=u(f,g,S);w>o&&(w-=o,g++);const s=f[g].getWidth(w-1)===2;s&&w--;const c=s?d-1:d;m.push(c),a+=c}return m},l.getWrappedLineTrimmedLength=u},5295:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=u(8460),S=u(844),d=u(9092);class m extends S.Disposable{constructor(w,g){super(),this._optionsService=w,this._bufferService=g,this._onBufferActivate=this.register(new f.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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,g){this._normal.resize(w,g),this._alt.resize(w,g),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}l.BufferSet=m},511:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=u(482),S=u(643),d=u(3734);class m extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const g=new m;return g.setFromCharData(w),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(w){this.fg=w[S.CHAR_DATA_ATTR_INDEX],this.bg=0;let g=!1;if(w[S.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(w[S.CHAR_DATA_CHAR_INDEX].length===2){const a=w[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const o=w[S.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(a-55296)+o-56320+65536|w[S.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=w[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[S.CHAR_DATA_WIDTH_INDEX]<<22;g&&(this.combinedData=w[S.CHAR_DATA_CHAR_INDEX],this.content=2097152|w[S.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}l.CellData=m},643:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=u(8460),S=u(844);class d{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,S.disposeArray)(this._disposables),this._disposables.length=0)}register(C){return this._disposables.push(C),C}}l.Marker=d,d._nextId=1},7116:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(_,l)=>{var u,f,S;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
47
- `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(u||(l.C0=u={})),function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"}(f||(l.C1=f={})),function(d){d.ST=`${u.ESC}\\`}(S||(l.C1_ESCAPED=S={}))},7399:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const f=u(2584),S={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:["'",'"']};l.evaluateKeyboardEvent=function(d,m,C,w){const g={type:0,cancel:!1,key:void 0},a=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?g.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?g.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?g.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(g.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:if(d.altKey){g.key=f.C0.ESC+f.C0.DEL;break}g.key=f.C0.DEL;break;case 9:if(d.shiftKey){g.key=f.C0.ESC+"[Z";break}g.key=f.C0.HT,g.cancel=!0;break;case 13:g.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,g.cancel=!0;break;case 27:g.key=f.C0.ESC,d.altKey&&(g.key=f.C0.ESC+f.C0.ESC),g.cancel=!0;break;case 37:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"D",g.key===f.C0.ESC+"[1;3D"&&(g.key=f.C0.ESC+(C?"b":"[1;5D"))):g.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"C",g.key===f.C0.ESC+"[1;3C"&&(g.key=f.C0.ESC+(C?"f":"[1;5C"))):g.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"A",C||g.key!==f.C0.ESC+"[1;3A"||(g.key=f.C0.ESC+"[1;5A")):g.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"B",C||g.key!==f.C0.ESC+"[1;3B"||(g.key=f.C0.ESC+"[1;5B")):g.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(g.key=f.C0.ESC+"[2~");break;case 46:g.key=a?f.C0.ESC+"[3;"+(a+1)+"~":f.C0.ESC+"[3~";break;case 36:g.key=a?f.C0.ESC+"[1;"+(a+1)+"H":m?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:g.key=a?f.C0.ESC+"[1;"+(a+1)+"F":m?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?g.type=2:d.ctrlKey?g.key=f.C0.ESC+"[5;"+(a+1)+"~":g.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?g.type=3:d.ctrlKey?g.key=f.C0.ESC+"[6;"+(a+1)+"~":g.key=f.C0.ESC+"[6~";break;case 112:g.key=a?f.C0.ESC+"[1;"+(a+1)+"P":f.C0.ESC+"OP";break;case 113:g.key=a?f.C0.ESC+"[1;"+(a+1)+"Q":f.C0.ESC+"OQ";break;case 114:g.key=a?f.C0.ESC+"[1;"+(a+1)+"R":f.C0.ESC+"OR";break;case 115:g.key=a?f.C0.ESC+"[1;"+(a+1)+"S":f.C0.ESC+"OS";break;case 116:g.key=a?f.C0.ESC+"[15;"+(a+1)+"~":f.C0.ESC+"[15~";break;case 117:g.key=a?f.C0.ESC+"[17;"+(a+1)+"~":f.C0.ESC+"[17~";break;case 118:g.key=a?f.C0.ESC+"[18;"+(a+1)+"~":f.C0.ESC+"[18~";break;case 119:g.key=a?f.C0.ESC+"[19;"+(a+1)+"~":f.C0.ESC+"[19~";break;case 120:g.key=a?f.C0.ESC+"[20;"+(a+1)+"~":f.C0.ESC+"[20~";break;case 121:g.key=a?f.C0.ESC+"[21;"+(a+1)+"~":f.C0.ESC+"[21~";break;case 122:g.key=a?f.C0.ESC+"[23;"+(a+1)+"~":f.C0.ESC+"[23~";break;case 123:g.key=a?f.C0.ESC+"[24;"+(a+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(C&&!w||!d.altKey||d.metaKey)!C||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?g.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(g.key=f.C0.US),d.key==="@"&&(g.key=f.C0.NUL)):d.keyCode===65&&(g.type=1);else{const o=S[d.keyCode],s=o==null?void 0:o[d.shiftKey?1:0];if(s)g.key=f.C0.ESC+s;else if(d.keyCode>=65&&d.keyCode<=90){const c=d.ctrlKey?d.keyCode-64:d.keyCode+32;let p=String.fromCharCode(c);d.shiftKey&&(p=p.toUpperCase()),g.key=f.C0.ESC+p}else if(d.keyCode===32)g.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let c=d.code.slice(3,4);d.shiftKey||(c=c.toLowerCase()),g.key=f.C0.ESC+c,g.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?g.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?g.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?g.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?g.key=f.C0.DEL:d.keyCode===219?g.key=f.C0.ESC:d.keyCode===220?g.key=f.C0.FS:d.keyCode===221&&(g.key=f.C0.GS)}return g}},482:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,f=0,S=u.length){let d="";for(let m=f;m<S;++m){let C=u[m];C>65535?(C-=65536,d+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):d+=String.fromCharCode(C)}return d},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const S=u.length;if(!S)return 0;let d=0,m=0;if(this._interim){const C=u.charCodeAt(m++);56320<=C&&C<=57343?f[d++]=1024*(this._interim-55296)+C-56320+65536:(f[d++]=this._interim,f[d++]=C),this._interim=0}for(let C=m;C<S;++C){const w=u.charCodeAt(C);if(55296<=w&&w<=56319){if(++C>=S)return this._interim=w,d;const g=u.charCodeAt(C);56320<=g&&g<=57343?f[d++]=1024*(w-55296)+g-56320+65536:(f[d++]=w,f[d++]=g)}else w!==65279&&(f[d++]=w)}return d}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const S=u.length;if(!S)return 0;let d,m,C,w,g=0,a=0,o=0;if(this.interim[0]){let p=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let x,b=0;for(;(x=63&this.interim[++b])&&b<4;)v<<=6,v|=x;const y=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=y-b;for(;o<k;){if(o>=S)return 0;if(x=u[o++],(192&x)!=128){o--,p=!0;break}this.interim[b++]=x,v<<=6,v|=63&x}p||(y===2?v<128?o--:f[g++]=v:y===3?v<2048||v>=55296&&v<=57343||v===65279||(f[g++]=v):v<65536||v>1114111||(f[g++]=v)),this.interim.fill(0)}const s=S-4;let c=o;for(;c<S;){for(;!(!(c<s)||128&(d=u[c])||128&(m=u[c+1])||128&(C=u[c+2])||128&(w=u[c+3]));)f[g++]=d,f[g++]=m,f[g++]=C,f[g++]=w,c+=4;if(d=u[c++],d<128)f[g++]=d;else if((224&d)==192){if(c>=S)return this.interim[0]=d,g;if(m=u[c++],(192&m)!=128){c--;continue}if(a=(31&d)<<6|63&m,a<128){c--;continue}f[g++]=a}else if((240&d)==224){if(c>=S)return this.interim[0]=d,g;if(m=u[c++],(192&m)!=128){c--;continue}if(c>=S)return this.interim[0]=d,this.interim[1]=m,g;if(C=u[c++],(192&C)!=128){c--;continue}if(a=(15&d)<<12|(63&m)<<6|63&C,a<2048||a>=55296&&a<=57343||a===65279)continue;f[g++]=a}else if((248&d)==240){if(c>=S)return this.interim[0]=d,g;if(m=u[c++],(192&m)!=128){c--;continue}if(c>=S)return this.interim[0]=d,this.interim[1]=m,g;if(C=u[c++],(192&C)!=128){c--;continue}if(c>=S)return this.interim[0]=d,this.interim[1]=m,this.interim[2]=C,g;if(w=u[c++],(192&w)!=128){c--;continue}if(a=(7&d)<<18|(63&m)<<12|(63&C)<<6|63&w,a<65536||a>1114111)continue;f[g++]=a}}return g}}},225:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const u=[[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]],f=[[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 S;l.UnicodeV6=class{constructor(){if(this.version="6",!S){S=new Uint8Array(65536),S.fill(1),S[0]=0,S.fill(0,1,32),S.fill(0,127,160),S.fill(2,4352,4448),S[9001]=2,S[9002]=2,S.fill(2,11904,42192),S[12351]=1,S.fill(2,44032,55204),S.fill(2,63744,64256),S.fill(2,65040,65050),S.fill(2,65072,65136),S.fill(2,65280,65377),S.fill(2,65504,65511);for(let d=0;d<u.length;++d)S.fill(0,u[d][0],u[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?S[d]:function(m,C){let w,g=0,a=C.length-1;if(m<C[0][0]||m>C[a][1])return!1;for(;a>=g;)if(w=g+a>>1,m>C[w][1])g=w+1;else{if(!(m<C[w][0]))return!0;a=w-1}return!1}(d,f)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const f=u(8460),S=u(844);class d extends S.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let g;for(this._isSyncWriting=!0;g=this._writeBuffer.shift();){this._action(g);const a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,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+=C.length,this._writeBuffer.push(C),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(w)}_innerWrite(C=0,w=!0){const g=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const a=this._writeBuffer[this._bufferOffset],o=this._action(a,w);if(o){const c=p=>Date.now()-g>=12?setTimeout(()=>this._innerWrite(0,p)):this._innerWrite(g,p);return void o.catch(p=>(queueMicrotask(()=>{throw p}),Promise.resolve(!1))).then(c)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=a.length,Date.now()-g>=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()}}l.WriteBuffer=d},5941:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function S(d,m){const C=d.toString(16),w=C.length<2?"0"+C:C;switch(m){case 4:return C[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}l.parseColor=function(d){if(!d)return;let m=d.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const C=u.exec(m);if(C){const w=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/w*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/w*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/w*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),f.exec(m)&&[3,6,9,12].includes(m.length))){const C=m.length/3,w=[0,0,0];for(let g=0;g<3;++g){const a=parseInt(m.slice(C*g,C*g+C),16);w[g]=C===1?a<<4:C===2?a:C===3?a>>4:a>>8}return w}},l.toRgbString=function(d,m=16){const[C,w,g]=d;return`rgb:${S(C,m)}/${S(w,m)}/${S(g,m)}`}},5770:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const f=u(482),S=u(8742),d=u(5770),m=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(w,g){this._handlers[w]===void 0&&(this._handlers[w]=[]);const a=this._handlers[w];return a.push(g),{dispose:()=>{const o=a.indexOf(g);o!==-1&&a.splice(o,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=m,this._ident=0}hook(w,g){if(this.reset(),this._ident=w,this._active=this._handlers[w]||m,this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].hook(g);else this._handlerFb(this._ident,"HOOK",g)}put(w,g,a){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(w,g,a);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,g,a))}unhook(w,g=!0){if(this._active.length){let a=!1,o=this._active.length-1,s=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,a=g,s=this._stack.fallThrough,this._stack.paused=!1),!s&&a===!1){for(;o>=0&&(a=this._active[o].unhook(w),a!==!0);o--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,a;o--}for(;o>=0;o--)if(a=this._active[o].unhook(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,a}else this._handlerFb(this._ident,"UNHOOK",w);this._active=m,this._ident=0}};const C=new S.Params;C.addParam(0),l.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=C,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():C,this._data="",this._hitLimit=!1}put(w,g,a){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,g,a),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let g=!1;if(this._hitLimit)g=!1;else if(w&&(g=this._handler(this._data,this._params),g instanceof Promise))return g.then(a=>(this._params=C,this._data="",this._hitLimit=!1,a));return this._params=C,this._data="",this._hitLimit=!1,g}}},2015:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const f=u(844),S=u(8742),d=u(6242),m=u(6351);class C{constructor(o){this.table=new Uint8Array(o)}setDefault(o,s){this.table.fill(o<<4|s)}add(o,s,c,p){this.table[s<<8|o]=c<<4|p}addMany(o,s,c,p){for(let v=0;v<o.length;v++)this.table[s<<8|o[v]]=c<<4|p}}l.TransitionTable=C;const w=160;l.VT500_TRANSITION_TABLE=function(){const a=new C(4095),o=Array.apply(null,Array(256)).map((b,y)=>y),s=(b,y)=>o.slice(b,y),c=s(32,127),p=s(0,24);p.push(25),p.push.apply(p,s(28,32));const v=s(0,14);let x;for(x in a.setDefault(1,0),a.addMany(c,0,2,0),v)a.addMany([24,26,153,154],x,3,0),a.addMany(s(128,144),x,3,0),a.addMany(s(144,152),x,3,0),a.add(156,x,0,0),a.add(27,x,11,1),a.add(157,x,4,8),a.addMany([152,158,159],x,0,7),a.add(155,x,11,3),a.add(144,x,11,9);return a.addMany(p,0,3,0),a.addMany(p,1,3,1),a.add(127,1,0,1),a.addMany(p,8,0,8),a.addMany(p,3,3,3),a.add(127,3,0,3),a.addMany(p,4,3,4),a.add(127,4,0,4),a.addMany(p,6,3,6),a.addMany(p,5,3,5),a.add(127,5,0,5),a.addMany(p,2,3,2),a.add(127,2,0,2),a.add(93,1,4,8),a.addMany(c,8,5,8),a.add(127,8,5,8),a.addMany([156,27,24,26,7],8,6,0),a.addMany(s(28,32),8,0,8),a.addMany([88,94,95],1,0,7),a.addMany(c,7,0,7),a.addMany(p,7,0,7),a.add(156,7,0,0),a.add(127,7,0,7),a.add(91,1,11,3),a.addMany(s(64,127),3,7,0),a.addMany(s(48,60),3,8,4),a.addMany([60,61,62,63],3,9,4),a.addMany(s(48,60),4,8,4),a.addMany(s(64,127),4,7,0),a.addMany([60,61,62,63],4,0,6),a.addMany(s(32,64),6,0,6),a.add(127,6,0,6),a.addMany(s(64,127),6,0,0),a.addMany(s(32,48),3,9,5),a.addMany(s(32,48),5,9,5),a.addMany(s(48,64),5,0,6),a.addMany(s(64,127),5,7,0),a.addMany(s(32,48),4,9,5),a.addMany(s(32,48),1,9,2),a.addMany(s(32,48),2,9,2),a.addMany(s(48,127),2,10,0),a.addMany(s(48,80),1,10,0),a.addMany(s(81,88),1,10,0),a.addMany([89,90,92],1,10,0),a.addMany(s(96,127),1,10,0),a.add(80,1,11,9),a.addMany(p,9,0,9),a.add(127,9,0,9),a.addMany(s(28,32),9,0,9),a.addMany(s(32,48),9,9,12),a.addMany(s(48,60),9,8,10),a.addMany([60,61,62,63],9,9,10),a.addMany(p,11,0,11),a.addMany(s(32,128),11,0,11),a.addMany(s(28,32),11,0,11),a.addMany(p,10,0,10),a.add(127,10,0,10),a.addMany(s(28,32),10,0,10),a.addMany(s(48,60),10,8,10),a.addMany([60,61,62,63],10,0,11),a.addMany(s(32,48),10,9,12),a.addMany(p,12,0,12),a.add(127,12,0,12),a.addMany(s(28,32),12,0,12),a.addMany(s(32,48),12,9,12),a.addMany(s(48,64),12,0,11),a.addMany(s(64,127),12,12,13),a.addMany(s(64,127),10,12,13),a.addMany(s(64,127),9,12,13),a.addMany(p,13,13,13),a.addMany(c,13,13,13),a.add(127,13,0,13),a.addMany([27,156,24,26],13,14,0),a.add(w,0,2,0),a.add(w,8,5,8),a.add(w,6,0,6),a.add(w,11,0,11),a.add(w,13,13,13),a}();class g extends f.Disposable{constructor(o=l.VT500_TRANSITION_TABLE){super(),this._transitions=o,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new S.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(s,c,p)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,c)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,s=[64,126]){let c=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=o.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(o.intermediates){if(o.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let v=0;v<o.intermediates.length;++v){const x=o.intermediates.charCodeAt(v);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=x}}if(o.final.length!==1)throw new Error("final must be a single byte");const p=o.final.charCodeAt(0);if(s[0]>p||p>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return c<<=8,c|=p,c}identToString(o){const s=[];for(;o;)s.push(String.fromCharCode(255&o)),o>>=8;return s.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,s){const c=this._identifier(o,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const p=this._escHandlers[c];return p.push(s),{dispose:()=>{const v=p.indexOf(s);v!==-1&&p.splice(v,1)}}}clearEscHandler(o){this._escHandlers[this._identifier(o,[48,126])]&&delete this._escHandlers[this._identifier(o,[48,126])]}setEscHandlerFallback(o){this._escHandlerFb=o}setExecuteHandler(o,s){this._executeHandlers[o.charCodeAt(0)]=s}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,s){const c=this._identifier(o);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const p=this._csiHandlers[c];return p.push(s),{dispose:()=>{const v=p.indexOf(s);v!==-1&&p.splice(v,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,s){return this._dcsParser.registerHandler(this._identifier(o),s)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,s){return this._oscParser.registerHandler(o,s)}clearOscHandler(o){this._oscParser.clearHandler(o)}setOscHandlerFallback(o){this._oscParser.setHandlerFallback(o)}setErrorHandler(o){this._errorHandler=o}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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(o,s,c,p,v){this._parseStack.state=o,this._parseStack.handlers=s,this._parseStack.handlerPos=c,this._parseStack.transition=p,this._parseStack.chunkPos=v}parse(o,s,c){let p,v=0,x=0,b=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,b=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const y=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&k>-1){for(;k>=0&&(p=y[k](this._params),p!==!0);k--)if(p instanceof Promise)return this._parseStack.handlerPos=k,p}this._parseStack.handlers=[];break;case 4:if(c===!1&&k>-1){for(;k>=0&&(p=y[k](),p!==!0);k--)if(p instanceof Promise)return this._parseStack.handlerPos=k,p}this._parseStack.handlers=[];break;case 6:if(v=o[this._parseStack.chunkPos],p=this._dcsParser.unhook(v!==24&&v!==26,c),p)return p;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(v=o[this._parseStack.chunkPos],p=this._oscParser.end(v!==24&&v!==26,c),p)return p;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,b=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let y=b;y<s;++y){switch(v=o[y],x=this._transitions.table[this.currentState<<8|(v<160?v:w)],x>>4){case 2:for(let B=y+1;;++B){if(B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,y,B),y=B-1;break}if(++B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,y,B),y=B-1;break}if(++B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,y,B),y=B-1;break}if(++B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,y,B),y=B-1;break}}break;case 3:this._executeHandlers[v]?this._executeHandlers[v]():this._executeHandlerFb(v),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:y,code:v,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|v];let R=k?k.length-1:-1;for(;R>=0&&(p=k[R](this._params),p!==!0);R--)if(p instanceof Promise)return this._preserveStack(3,k,R,x,y),p;R<0&&this._csiHandlerFb(this._collect<<8|v,this._params),this.precedingCodepoint=0;break;case 8:do switch(v){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(v-48)}while(++y<s&&(v=o[y])>47&&v<60);y--;break;case 9:this._collect<<=8,this._collect|=v;break;case 10:const O=this._escHandlers[this._collect<<8|v];let T=O?O.length-1:-1;for(;T>=0&&(p=O[T](),p!==!0);T--)if(p instanceof Promise)return this._preserveStack(4,O,T,x,y),p;T<0&&this._escHandlerFb(this._collect<<8|v),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|v,this._params);break;case 13:for(let B=y+1;;++B)if(B>=s||(v=o[B])===24||v===26||v===27||v>127&&v<w){this._dcsParser.put(o,y,B),y=B-1;break}break;case 14:if(p=this._dcsParser.unhook(v!==24&&v!==26),p)return this._preserveStack(6,[],0,x,y),p;v===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let B=y+1;;B++)if(B>=s||(v=o[B])<32||v>127&&v<w){this._oscParser.put(o,y,B),y=B-1;break}break;case 6:if(p=this._oscParser.end(v!==24&&v!==26),p)return this._preserveStack(5,[],0,x,y),p;v===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&x}}}l.EscapeSequenceParser=g},6242:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const f=u(5770),S=u(482),d=[];l.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,C){this._handlers[m]===void 0&&(this._handlers[m]=[]);const w=this._handlers[m];return w.push(C),{dispose:()=>{const g=w.indexOf(C);g!==-1&&w.splice(g,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,C,w){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(m,C,w);else this._handlerFb(this._id,"PUT",(0,S.utf32ToString)(m,C,w))}start(){this.reset(),this._state=1}put(m,C,w){if(this._state!==3){if(this._state===1)for(;C<w;){const g=m[C++];if(g===59){this._state=2,this._start();break}if(g<48||57<g)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+g-48}this._state===2&&w-C>0&&this._put(m,C,w)}}end(m,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,g=this._active.length-1,a=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,w=C,a=this._stack.fallThrough,this._stack.paused=!1),!a&&w===!1){for(;g>=0&&(w=this._active[g].end(m),w!==!0);g--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,w;g--}for(;g>=0;g--)if(w=this._active[g].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",m);this._active=d,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,C,w){this._hitLimit||(this._data+=(0,S.utf32ToString)(m,C,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let C=!1;if(this._hitLimit)C=!1;else if(m&&(C=this._handler(this._data),C instanceof Promise))return C.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,C}}},8742:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class f{static fromArray(d){const m=new f;if(!d.length)return m;for(let C=Array.isArray(d[0])?1:0;C<d.length;++C){const w=d[C];if(Array.isArray(w))for(let g=0;g<w.length;++g)m.addSubParam(w[g]);else m.addParam(w)}return m}constructor(d=32,m=32){if(this.maxLength=d,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let m=0;m<this.length;++m){d.push(this.params[m]);const C=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];w-C>0&&d.push(Array.prototype.slice.call(this._subParams,C,w))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>u?u:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>u?u:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const m=this._subParamsIdx[d]>>8,C=255&this._subParamsIdx[d];return C-m>0?this._subParams.subarray(m,C):null}getSubParamsAll(){const d={};for(let m=0;m<this.length;++m){const C=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];w-C>0&&(d[m]=this._subParams.slice(C,w))}return d}addDigit(d){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,w=C[m-1];C[m-1]=~w?Math.min(10*w+d,u):d}}l.Params=f},5741:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,f){const S={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(S),f.dispose=()=>this._wrappedAddonDispose(S),f.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let f=-1;for(let S=0;S<this._addons.length;S++)if(this._addons[S]===u){f=S;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(f,1)}}},8771:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const f=u(3785),S=u(511);l.BufferApiView=class{constructor(d,m){this._buffer=d,this.type=m}init(d){return this._buffer=d,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(d){const m=this._buffer.lines.get(d);if(m)return new f.BufferLineApiView(m)}getNullCell(){return new S.CellData}}},3785:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const f=u(511);l.BufferLineApiView=class{constructor(S){this._line=S}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(S,d){if(!(S<0||S>=this._line.length))return d?(this._line.loadCell(S,d),d):this._line.loadCell(S,new f.CellData)}translateToString(S,d,m){return this._line.translateToString(S,d,m)}}},8285:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const f=u(8771),S=u(8460),d=u(844);class m extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new S.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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)}}l.BufferNamespaceApi=m},7975:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,f){return this._core.registerCsiHandler(u,S=>f(S.toArray()))}addCsiHandler(u,f){return this.registerCsiHandler(u,f)}registerDcsHandler(u,f){return this._core.registerDcsHandler(u,(S,d)=>f(S,d.toArray()))}addDcsHandler(u,f){return this.registerDcsHandler(u,f)}registerEscHandler(u,f){return this._core.registerEscHandler(u,f)}addEscHandler(u,f){return this.registerEscHandler(u,f)}registerOscHandler(u,f){return this._core.registerOscHandler(u,f)}addOscHandler(u,f){return this.registerOscHandler(u,f)}}},7090:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},S=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const d=u(8460),m=u(844),C=u(5295),w=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let g=l.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(a){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(a.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(a.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(a,this))}resize(a,o){this.cols=a,this.rows=o,this.buffers.resize(a,o),this._onResize.fire({cols:a,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(a,o=!1){const s=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===a.fg&&c.getBg(0)===a.bg||(c=s.getBlankLine(a,o),this._cachedBlankLine=c),c.isWrapped=o;const p=s.ybase+s.scrollTop,v=s.ybase+s.scrollBottom;if(s.scrollTop===0){const x=s.lines.isFull;v===s.lines.length-1?x?s.lines.recycle().copyFrom(c):s.lines.push(c.clone()):s.lines.splice(v+1,0,c.clone()),x?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const x=v-p+1;s.lines.shiftElements(p+1,x-1,-1),s.lines.set(v,c.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(a,o,s){const c=this.buffer;if(a<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else a+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const p=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+a,c.ybase),0),p!==c.ydisp&&(o||this._onScroll.fire(c.ydisp))}};l.BufferService=g=f([S(0,w.IOptionsService)],g)},7994:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,f){this._charsets[u]=f,this.glevel===u&&(this.charset=f)}}},1753:function(_,l,u){var f=this&&this.__decorate||function(c,p,v,x){var b,y=arguments.length,k=y<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(c,p,v,x);else for(var R=c.length-1;R>=0;R--)(b=c[R])&&(k=(y<3?b(k):y>3?b(p,v,k):b(p,v))||k);return y>3&&k&&Object.defineProperty(p,v,k),k},S=this&&this.__param||function(c,p){return function(v,x){p(v,x,c)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const d=u(2585),m=u(8460),C=u(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function g(c,p){let v=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(v|=64,v|=c.action):(v|=3&c.button,4&c.button&&(v|=64),8&c.button&&(v|=128),c.action===32?v|=32:c.action!==0||p||(v|=3)),v}const a=String.fromCharCode,o={DEFAULT:c=>{const p=[g(c,!1)+32,c.col+32,c.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${a(p[0])}${a(p[1])}${a(p[2])}`},SGR:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${g(c,!0)};${c.col};${c.row}${p}`},SGR_PIXELS:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${g(c,!0)};${c.x};${c.y}${p}`}};let s=l.CoreMouseService=class extends C.Disposable{constructor(c,p){super(),this._bufferService=c,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const v of Object.keys(w))this.addProtocol(v,w[v]);for(const v of Object.keys(o))this.addEncoding(v,o[v]);this.reset()}addProtocol(c,p){this._protocols[c]=p}addEncoding(c,p){this._encodings[c]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const p=this._encodings[this._activeEncoding](c);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,p,v){if(v){if(c.x!==p.x||c.y!==p.y)return!1}else if(c.col!==p.col||c.row!==p.row)return!1;return c.button===p.button&&c.action===p.action&&c.ctrl===p.ctrl&&c.alt===p.alt&&c.shift===p.shift}};l.CoreMouseService=s=f([S(0,d.IBufferService),S(1,d.ICoreService)],s)},6975:function(_,l,u){var f=this&&this.__decorate||function(s,c,p,v){var x,b=arguments.length,y=b<3?c:v===null?v=Object.getOwnPropertyDescriptor(c,p):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(s,c,p,v);else for(var k=s.length-1;k>=0;k--)(x=s[k])&&(y=(b<3?x(y):b>3?x(c,p,y):x(c,p))||y);return b>3&&y&&Object.defineProperty(c,p,y),y},S=this&&this.__param||function(s,c){return function(p,v){c(p,v,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=u(1439),m=u(8460),C=u(844),w=u(2585),g=Object.freeze({insertMode:!1}),a=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=l.CoreService=class extends C.Disposable{constructor(s,c,p){super(),this._bufferService=s,this._logService=c,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(g),this.decPrivateModes=(0,d.clone)(a)}reset(){this.modes=(0,d.clone)(g),this.decPrivateModes=(0,d.clone)(a)}triggerDataEvent(s,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(v=>v.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(c=>c.charCodeAt(0))),this._onBinary.fire(s))}};l.CoreService=o=f([S(0,w.IBufferService),S(1,w.ILogService),S(2,w.IOptionsService)],o)},9074:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const f=u(8055),S=u(8460),d=u(844),m=u(6106);let C=0,w=0;class g extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList(s=>s==null?void 0:s.marker.line),this._onDecorationRegistered=this.register(new S.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new S.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const c=new a(s);if(c){const p=c.marker.onDispose(()=>c.dispose());c.onDispose(()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),p.dispose())}),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,c,p){var v,x,b;let y=0,k=0;for(const R of this._decorations.getKeyIterator(c))y=(v=R.options.x)!==null&&v!==void 0?v:0,k=y+((x=R.options.width)!==null&&x!==void 0?x:1),s>=y&&s<k&&(!p||((b=R.options.layer)!==null&&b!==void 0?b:"bottom")===p)&&(yield R)}forEachDecorationAtCell(s,c,p,v){this._decorations.forEachByKey(c,x=>{var b,y,k;C=(b=x.options.x)!==null&&b!==void 0?b:0,w=C+((y=x.options.width)!==null&&y!==void 0?y:1),s>=C&&s<w&&(!p||((k=x.options.layer)!==null&&k!==void 0?k:"bottom")===p)&&v(x)})}}l.DecorationService=g;class a extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,this.onRenderEmitter=this.register(new S.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new S.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const f=u(2585),S=u(8343);class d{constructor(...C){this._entries=new Map;for(const[w,g]of C)this.set(w,g)}set(C,w){const g=this._entries.get(C);return this._entries.set(C,w),g}forEach(C){for(const[w,g]of this._entries.entries())C(w,g)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}l.ServiceCollection=d,l.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(m,C){this._services.set(m,C)}getService(m){return this._services.get(m)}createInstance(m,...C){const w=(0,S.getServiceDependencies)(m).sort((o,s)=>o.index-s.index),g=[];for(const o of w){const s=this._services.get(o.id);if(!s)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${o.id}.`);g.push(s)}const a=w.length>0?w[0].index:C.length;if(C.length!==a)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${a+1} conflicts with ${C.length} static arguments`);return new m(...C,...g)}}},7866:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},S=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const d=u(844),m=u(2585),C={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let w,g=l.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let o=0;o<a.length;o++)typeof a[o]=="function"&&(a[o]=a[o]())}_log(a,o,s){this._evalLazyOptionalParams(s),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.TRACE&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,a,o)}debug(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,a,o)}info(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.INFO&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,a,o)}warn(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.WARN&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,a,o)}error(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.ERROR&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,a,o)}};l.LogService=g=f([S(0,m.IOptionsService)],g),l.setTraceLogger=function(a){w=a},l.traceCall=function(a,o,s){if(typeof s.value!="function")throw new Error("not supported");const c=s.value;s.value=function(...p){if(w.logLevel!==m.LogLevelEnum.TRACE)return c.apply(this,p);w.trace(`GlyphRenderer#${c.name}(${p.map(x=>JSON.stringify(x)).join(", ")})`);const v=c.apply(this,p);return w.trace(`GlyphRenderer#${c.name} return`,v),v}}},7302:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const f=u(8460),S=u(844),d=u(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,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:{},rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends S.Disposable{constructor(g){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const a=Object.assign({},l.DEFAULT_OPTIONS);for(const o in g)if(o in a)try{const s=g[o];a[o]=this._sanitizeAndValidateOption(o,s)}catch(s){console.error(s)}this.rawOptions=a,this.options=Object.assign({},a),this._setupOptions()}onSpecificOptionChange(g,a){return this.onOptionChange(o=>{o===g&&a(this.rawOptions[g])})}onMultipleOptionChange(g,a){return this.onOptionChange(o=>{g.indexOf(o)!==-1&&a()})}_setupOptions(){const g=o=>{if(!(o in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},a=(o,s)=>{if(!(o in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);s=this._sanitizeAndValidateOption(o,s),this.rawOptions[o]!==s&&(this.rawOptions[o]=s,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const s={get:g.bind(this,o),set:a.bind(this,o)};Object.defineProperty(this.options,o,s)}}_sanitizeAndValidateOption(g,a){switch(g){case"cursorStyle":if(a||(a=l.DEFAULT_OPTIONS[g]),!function(o){return o==="block"||o==="underline"||o==="bar"}(a))throw new Error(`"${a}" is not a valid value for ${g}`);break;case"wordSeparator":a||(a=l.DEFAULT_OPTIONS[g]);break;case"fontWeight":case"fontWeightBold":if(typeof a=="number"&&1<=a&&a<=1e3)break;a=m.includes(a)?a:l.DEFAULT_OPTIONS[g];break;case"cursorWidth":a=Math.floor(a);case"lineHeight":case"tabStopWidth":if(a<1)throw new Error(`${g} cannot be less than 1, value: ${a}`);break;case"minimumContrastRatio":a=Math.max(1,Math.min(21,Math.round(10*a)/10));break;case"scrollback":if((a=Math.min(a,4294967295))<0)throw new Error(`${g} cannot be less than 0, value: ${a}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(a<=0)throw new Error(`${g} cannot be less than or equal to 0, value: ${a}`);break;case"rows":case"cols":if(!a&&a!==0)throw new Error(`${g} must be numeric, value: ${a}`);break;case"windowsPty":a=a??{}}return a}}l.OptionsService=C},2660:function(_,l,u){var f=this&&this.__decorate||function(C,w,g,a){var o,s=arguments.length,c=s<3?w:a===null?a=Object.getOwnPropertyDescriptor(w,g):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(C,w,g,a);else for(var p=C.length-1;p>=0;p--)(o=C[p])&&(c=(s<3?o(c):s>3?o(w,g,c):o(w,g))||c);return s>3&&c&&Object.defineProperty(w,g,c),c},S=this&&this.__param||function(C,w){return function(g,a){w(g,a,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const d=u(2585);let m=l.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const w=this._bufferService.buffer;if(C.id===void 0){const p=w.addMarker(w.ybase+w.y),v={data:C,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(v,p)),this._dataByLinkId.set(v.id,v),v.id}const g=C,a=this._getEntryIdKey(g),o=this._entriesWithId.get(a);if(o)return this.addLineToLink(o.id,w.ybase+w.y),o.id;const s=w.addMarker(w.ybase+w.y),c={id:this._nextId++,key:this._getEntryIdKey(g),data:g,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(c,s)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(C,w){const g=this._dataByLinkId.get(C);if(g&&g.lines.every(a=>a.line!==w)){const a=this._bufferService.buffer.addMarker(w);g.lines.push(a),a.onDispose(()=>this._removeMarkerFromLink(g,a))}}getLinkData(C){var w;return(w=this._dataByLinkId.get(C))===null||w===void 0?void 0:w.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,w){const g=C.lines.indexOf(w);g!==-1&&(C.lines.splice(g,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};l.OscLinkService=m=f([S(0,d.IBufferService)],m)},8343:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",f="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(S){return S[f]||[]},l.createDecorator=function(S){if(l.serviceRegistry.has(S))return l.serviceRegistry.get(S);const d=function(m,C,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,a,o){a[u]===a?a[f].push({id:g,index:o}):(a[f]=[{id:g,index:o}],a[u]=a)})(d,m,w)};return d.toString=()=>S,l.serviceRegistry.set(S,d),d}},2585:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const f=u(8343);var S;l.IBufferService=(0,f.createDecorator)("BufferService"),l.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),l.ICoreService=(0,f.createDecorator)("CoreService"),l.ICharsetService=(0,f.createDecorator)("CharsetService"),l.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(S||(l.LogLevelEnum=S={})),l.ILogService=(0,f.createDecorator)("LogService"),l.IOptionsService=(0,f.createDecorator)("OptionsService"),l.IOscLinkService=(0,f.createDecorator)("OscLinkService"),l.IUnicodeService=(0,f.createDecorator)("UnicodeService"),l.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const f=u(8460),S=u(225);l.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const d=new S.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let m=0;const C=d.length;for(let w=0;w<C;++w){let g=d.charCodeAt(w);if(55296<=g&&g<=56319){if(++w>=C)return m+this.wcwidth(g);const a=d.charCodeAt(w);56320<=a&&a<=57343?g=1024*(g-55296)+a-56320+65536:m+=this.wcwidth(a)}m+=this.wcwidth(g)}return m}}}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_].call(u.exports,u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const l=n(9042),u=n(3236),f=n(844),S=n(5741),d=n(8285),m=n(7975),C=n(7090),w=["cols","rows"];class g extends f.Disposable{constructor(o){super(),this._core=this.register(new u.Terminal(o)),this._addonManager=this.register(new S.AddonManager),this._publicOptions=Object.assign({},this._core.options);const s=p=>this._core.options[p],c=(p,v)=>{this._checkReadonlyOptions(p),this._core.options[p]=v};for(const p in this._core.options){const v={get:s.bind(this,p),set:c.bind(this,p)};Object.defineProperty(this._publicOptions,p,v)}}_checkReadonlyOptions(o){if(w.includes(o))throw new Error(`Option "${o}" 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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const o=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const s in o)this._publicOptions[s]=o[s]}blur(){this._core.blur()}focus(){this._core.focus()}resize(o,s){this._verifyIntegers(o,s),this._core.resize(o,s)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(o)}registerLinkProvider(o){return this._core.registerLinkProvider(o)}registerCharacterJoiner(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)}deregisterCharacterJoiner(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)}registerMarker(o=0){return this._verifyIntegers(o),this._core.registerMarker(o)}registerDecoration(o){var s,c,p;return this._checkProposedApi(),this._verifyPositiveIntegers((s=o.x)!==null&&s!==void 0?s:0,(c=o.width)!==null&&c!==void 0?c:0,(p=o.height)!==null&&p!==void 0?p:0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,s,c){this._verifyIntegers(o,s,c),this._core.select(o,s,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,s){this._verifyIntegers(o,s),this._core.selectLines(o,s)}dispose(){super.dispose()}scrollLines(o){this._verifyIntegers(o),this._core.scrollLines(o)}scrollPages(o){this._verifyIntegers(o),this._core.scrollPages(o)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(o){this._verifyIntegers(o),this._core.scrollToLine(o)}clear(){this._core.clear()}write(o,s){this._core.write(o,s)}writeln(o,s){this._core.write(o),this._core.write(`\r
48
- `,s)}paste(o){this._core.paste(o)}refresh(o,s){this._verifyIntegers(o,s),this._core.refresh(o,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return l}_verifyIntegers(...o){for(const s of o)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const s of o)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}_.Terminal=g})(),h})())})(qh);var $_=qh.exports,Xh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(n){this._terminal=n}dispose(){}fit(){const n=this.proposeDimensions();if(!n||!this._terminal||isNaN(n.cols)||isNaN(n.rows))return;const h=this._terminal._core;this._terminal.rows===n.rows&&this._terminal.cols===n.cols||(h._renderService.clear(),this._terminal.resize(n.cols,n.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const n=this._terminal._core,h=n._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const _=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),S=window.getComputedStyle(this._terminal.element),d=u-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),m=f-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-_;return{cols:Math.max(2,Math.floor(m/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(Xh);var U_=Xh.exports,Yh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(hf,()=>(()=>{var r={433:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV11=void 0;const u=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],f=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],S=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],d=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let m;function C(w,g){let a,o=0,s=g.length-1;if(w<g[0][0]||w>g[s][1])return!1;for(;s>=o;)if(a=o+s>>1,w>g[a][1])o=a+1;else{if(!(w<g[a][0]))return!0;s=a-1}return!1}l.UnicodeV11=class{constructor(){if(this.version="11",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160);for(let w=0;w<u.length;++w)m.fill(0,u[w][0],u[w][1]+1);for(let w=0;w<S.length;++w)m.fill(2,S[w][0],S[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?m[w]:C(w,f)?0:C(w,d)?2:1}}}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_](u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.Unicode11Addon=void 0;const l=n(433);_.Unicode11Addon=class{activate(u){u.unicode.register(new l.UnicodeV11)}dispose(){}}})(),h})())})(Yh);var W_=Yh.exports,Qh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(f,S,d,m={}){this._terminal=f,this._regex=S,this._handler=d,this._options=m}provideLinks(f,S){const d=u.computeLink(f,this._regex,this._terminal,this._handler);S(this._addCallbacks(d))}_addCallbacks(f){return f.map(S=>(S.leave=this._options.leave,S.hover=(d,m)=>{if(this._options.hover){const{range:C}=S;this._options.hover(d,m,C)}},S))}};class u{static computeLink(S,d,m,C){const w=new RegExp(d.source,(d.flags||"")+"g"),[g,a]=u._getWindowedLineStrings(S-1,m),o=g.join("");let s;const c=[];for(;s=w.exec(o);){const p=s[0];try{const R=new URL(p),O=decodeURI(R.toString());if(p!==O&&p+"/"!==O)continue}catch{continue}const[v,x]=u._mapStrIdx(m,a,0,s.index),[b,y]=u._mapStrIdx(m,v,x,p.length);if(v===-1||x===-1||b===-1||y===-1)continue;const k={start:{x:x+1,y:v+1},end:{x:y,y:b+1}};c.push({range:k,text:p,activate:C})}return c}static _getWindowedLineStrings(S,d){let m,C=S,w=S,g=0,a="";const o=[];if(m=d.buffer.active.getLine(S)){const s=m.translateToString(!0);if(m.isWrapped&&s[0]!==" "){for(g=0;(m=d.buffer.active.getLine(--C))&&g<2048&&(a=m.translateToString(!0),g+=a.length,o.push(a),m.isWrapped&&a.indexOf(" ")===-1););o.reverse()}for(o.push(s),g=0;(m=d.buffer.active.getLine(++w))&&m.isWrapped&&g<2048&&(a=m.translateToString(!0),g+=a.length,o.push(a),a.indexOf(" ")===-1););}return[o,C]}static _mapStrIdx(S,d,m,C){const w=S.buffer.active,g=w.getNullCell();let a=m;for(;C;){const o=w.getLine(d);if(!o)return[-1,-1];for(let s=a;s<o.length;++s){o.getCell(s,g);const c=g.getChars();if(g.getWidth()&&(C-=c.length||1,s===o.length-1&&c==="")){const p=w.getLine(d+1);p&&p.isWrapped&&(p.getCell(0,g),g.getWidth()===2&&(C+=1))}if(C<0)return[d,s]}d++,a=0}return[d,a]}}l.LinkComputer=u}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_](u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.WebLinksAddon=void 0;const l=n(6),u=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(S,d){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}_.WebLinksAddon=class{constructor(S=f,d={}){this._handler=S,this._options=d}activate(S){this._terminal=S;const d=this._options,m=d.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,m,this._handler,d))}dispose(){var S;(S=this._linkProvider)===null||S===void 0||S.dispose()}}})(),h})())})(Qh);var V_=Qh.exports;const K_="",q_="",Jh="保存しました。",G_="デッキを作成する前にワークスペースを追加してください。",X_="ワークスペースを選択してください。",Y_=2e3,Zh='"JetBrains Mono", monospace',ed=14,Q_='"Cascadia Code", "JetBrains Mono", "Consolas", "Menlo", monospace',J_=13,cc="#000000",uc="#ffffff",td="deck-theme",Z_=204;async function ue(e,t={}){const r=await fetch(`${K_}${e}`,{...t,credentials:"include"});if(!r.ok){const i=await r.text();throw new Error(i||`Request failed (${r.status})`)}return r.status===Z_?null:r.json()}const Ue="application/json",rt="POST",rd="PUT",Zi="DELETE";function ev(){return window.location.origin.replace(/^http/,"ws")}function tv(){return ue("/api/ws-token")}function rv(){return ue("/api/workspaces")}function iv(){return ue("/api/config")}function nv(e){return ue("/api/workspaces",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({path:e})})}function sv(e){return ue(`/api/workspaces/${e}`,{method:Zi})}function ov(){return ue("/api/decks")}function lv(e,t){return ue("/api/decks",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({name:e,workspaceId:t})})}function av(e){return ue(`/api/decks/${e}`,{method:Zi})}function cv(e){return ue("/api/decks/order",{method:rd,headers:{"Content-Type":Ue},body:JSON.stringify({deckIds:e})})}function hc(e,t=""){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/files?${r.toString()}`)}function dc(e,t=""){const r=new URLSearchParams({path:e,subpath:t});return ue(`/api/preview?${r.toString()}`)}function uv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/file?${r.toString()}`)}function hv(e,t,r){return ue("/api/file",{method:rd,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function dv(e,t,r=""){return ue("/api/file",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function fv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/file?${r.toString()}`,{method:Zi})}function pv(e,t){return ue("/api/dir",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,path:t})})}function _v(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/dir?${r.toString()}`,{method:Zi})}function vv(e,t,r){return ue("/api/terminals",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({deckId:e,title:t,command:r})})}function mv(e){const t=new URLSearchParams({deckId:e});return ue(`/api/terminals?${t.toString()}`)}function gv(e){return ue(`/api/terminals/${e}`,{method:Zi})}function id(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/status?${i.toString()}`)}function yv(e){const t=new URLSearchParams({workspaceId:e});return ue(`/api/git/repos?${t.toString()}`)}function nd(e,t,r){return ue("/api/git/stage",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function sd(e,t,r){return ue("/api/git/unstage",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function Sv(e,t,r){return ue("/api/git/commit",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,message:t,repoPath:r})})}function Cv(e,t,r){return ue("/api/git/discard",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function wv(e,t,r,i){const n={workspaceId:e,path:t,staged:r.toString()};i!==void 0&&(n.repoPath=i);const h=new URLSearchParams(n);return ue(`/api/git/diff?${h.toString()}`)}function xv(e,t){return ue("/api/git/push",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,repoPath:t})})}function bv(e,t){return ue("/api/git/pull",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,repoPath:t})})}function Ev(e,t){return ue("/api/git/fetch",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,repoPath:t})})}function od(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/branch-status?${i.toString()}`)}function ld(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/remotes?${i.toString()}`)}function kv(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/branches?${i.toString()}`)}function Lv(e,t,r){return ue("/api/git/checkout",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,branchName:t,repoPath:r})})}function Dv(e,t,r=!0,i){return ue("/api/git/create-branch",{method:rt,headers:{"Content-Type":Ue},body:JSON.stringify({workspaceId:e,branchName:t,checkout:r,repoPath:i})})}function Rv(e,t=50,r){const i={workspaceId:e,limit:String(t)};r!==void 0&&(i.repoPath=r);const n=new URLSearchParams(i);return ue(`/api/git/log?${n.toString()}`)}const Tv="接続が終了しました。",fc=5,pc=1e3,Av=new Set(["Deck deleted","Terminal deleted","Terminal exited","Terminal not found"]),_c=new TextEncoder;function Pv(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r)&255;return t}function Mv({session:e,wsUrl:t,onDelete:r,onExit:i}){const n=N.useRef(null),h=N.useRef(null),_=N.useRef(null),l=N.useRef(0),u=N.useRef(i);return N.useEffect(()=>{u.current=i},[i]),N.useEffect(()=>{var Xe,Ut;if(!n.current)return;l.current=0,n.current.innerHTML="";const f=new $_.Terminal({cursorBlink:!0,fontFamily:Q_,fontSize:J_,allowProposedApi:!0,scrollback:3e3,convertEol:!1,windowsMode:!1,rightClickSelectsWord:!0,theme:{background:cc,foreground:uc},windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0}}),S=new U_.FitAddon,d=new W_.Unicode11Addon,m=new V_.WebLinksAddon;f.loadAddon(S),f.loadAddon(d),f.loadAddon(m),f.unicode.activeVersion="11",h.current=S,f.open(n.current);let C=!0,w=!1,g=0,a=!1;const o=()=>{C=!1,a&&(a=!1,E(!0)),window.requestAnimationFrame(()=>{f.scrollToBottom()})},s=Q=>{const Y=_.current;Y&&Y.readyState===WebSocket.OPEN&&Y.send(JSON.stringify(Q))},c=Q=>{if(C)return;const Y=_.current;Y&&Y.readyState===WebSocket.OPEN&&Y.send(_c.encode(Q))};f.parser.registerCsiHandler({final:"n"},Q=>{const Y=Q.length>0?Q[0]:0;if(Y===6){const te=f.buffer.active,ie=te.cursorY+te.baseY+1,oe=te.cursorX+1;return c(`\x1B[${ie};${oe}R`),!0}else if(Y===5)return c("\x1B[0n"),!0;return!1}),f.parser.registerCsiHandler({final:"c"},Q=>(c("\x1B[?62;1;6;22c"),!0)),f.parser.registerCsiHandler({prefix:">",final:"c"},Q=>(c("\x1B[>1;500;0c"),!0)),f.parser.registerCsiHandler({prefix:"?",final:"p",intermediates:"$"},Q=>{const Y=Q[0]||0,te=f.modes;let ie=0;return Y===1?ie=te.applicationCursorKeysMode?1:2:Y===25?ie=1:Y===1e3?ie=te.mouseTrackingMode==="x10"?1:2:Y===1002?ie=te.mouseTrackingMode==="drag"?1:2:Y===1003?ie=te.mouseTrackingMode==="any"?1:2:Y===1004?ie=te.sendFocusMode?1:2:Y===1006?ie=te.mouseTrackingMode!=="none"?1:2:Y===1049?ie=f.buffer.active.type==="alternate"?1:2:Y===2004?ie=te.bracketedPasteMode?1:2:Y===2026&&(ie=2),c(`\x1B[?${Y};${ie}$y`),!0});const p=Q=>(Q*257).toString(16).padStart(4,"0");f.parser.registerOscHandler(10,Q=>{if(Q==="?"){const Y=uc,te=parseInt(Y.slice(1,3),16),ie=parseInt(Y.slice(3,5),16),oe=parseInt(Y.slice(5,7),16);return c(`\x1B]10;rgb:${p(te)}/${p(ie)}/${p(oe)}\x07`),!0}return!1}),f.parser.registerOscHandler(11,Q=>{if(Q==="?"){const Y=cc,te=parseInt(Y.slice(1,3),16),ie=parseInt(Y.slice(3,5),16),oe=parseInt(Y.slice(5,7),16);return c(`\x1B]11;rgb:${p(te)}/${p(ie)}/${p(oe)}\x07`),!0}return!1}),f.parser.registerOscHandler(12,Q=>Q==="?"?(c("\x1B]12;rgb:ffff/ffff/ffff\x07"),!0):!1),f.parser.registerOscHandler(4,Q=>{const Y=Q.match(/^(\d+);?\?$/);if(Y){const te=parseInt(Y[1]),ie=["0000/0000/0000","cdcb/0000/0000","0000/cdcb/0000","cdcb/cdcb/0000","1e1e/9090/ffff","cdcb/0000/cdcb","0000/cdcb/cdcb","e5e5/e5e5/e5e5"],oe=te<8?ie[te]:"0000/0000/0000";return c(`\x1B]4;${te};rgb:${oe}\x07`),!0}return!1}),f.parser.registerOscHandler(52,Q=>!!Q.includes("?")),f.parser.registerCsiHandler({prefix:">",final:"q"},Q=>(c("\x1BP>|xterm.js(5.0.0)\x1B\\"),!0)),f.parser.registerCsiHandler({prefix:"?",final:"u"},Q=>!0),f.parser.registerCsiHandler({prefix:"?",final:"m"},Q=>Q[0]===4?(c("\x1B[>4;0m"),!0):!1),f.parser.registerCsiHandler({final:"t"},Q=>{const Y=Q[0];return Y===19?(c(`\x1B[9;${f.rows};${f.cols}t`),!0):Y===20?(c("\x1B]LTerminal\x1B\\"),!0):Y===21?(c("\x1B]lTerminal\x1B\\"),!0):!1}),f.parser.registerCsiHandler({prefix:"?",final:"S"},Q=>!0),f.parser.registerDcsHandler({intermediates:"$",final:"q"},(Q,Y)=>Q==="m"?(c("\x1BP1$rm\x1B\\"),!0):Q==='"p'?(c('\x1BP1$r62;1"p\x1B\\'),!0):Q==="r"?(c(`\x1BP1$r1;${f.rows}r\x1B\\`),!0):(c("\x1BP0$r\x1B\\"),!0)),f.parser.registerDcsHandler({intermediates:"+",final:"q"},(Q,Y)=>{try{const ie=(Q.match(/.{2}/g)||[]).map(ce=>String.fromCharCode(parseInt(ce,16))).join(""),oe={TN:"xterm-256color",Co:"256",RGB:"",Tc:"",colors:"256",setrgbf:"\x1B[38;2;%p1%d;%p2%d;%p3%dm",setrgbb:"\x1B[48;2;%p1%d;%p2%d;%p3%dm"};if(ie in oe){const Be=oe[ie].split("").map(me=>me.charCodeAt(0).toString(16).padStart(2,"0")).join("");return c(`\x1BP1+r${Be}\x1B\\`),!0}}catch(te){console.error("[XTGETTCAP] Failed to decode:",te)}return c("\x1BP0+r\x1B\\"),!0}),f.parser.registerCsiHandler({final:"b"},Q=>{const Y=Q[0]||1;return Y>65535?(console.warn(`[REP] Large repeat count ${Y} clamped to 65535 for security`),!0):!1});let v=0,x=0,b=null,y=f.cols,k=f.rows,R=0,O=0,T=((Xe=window.visualViewport)==null?void 0:Xe.scale)??1;const B=(Q,Y)=>{f.cols>0&&(R=Q/f.cols),f.rows>0&&(O=Y/f.rows)},z=n.current.querySelector(".xterm-helper-textarea");z instanceof HTMLTextAreaElement&&(z.setAttribute("spellcheck","false"),z.setAttribute("autocapitalize","off"),z.setAttribute("autocomplete","off"),z.setAttribute("autocorrect","off"));const I=()=>{const Q=f.cols,Y=f.rows;!Q||!Y||Q===y&&Y===k||(y=Q,k=Y,s({type:"resize",cols:Q,rows:Y}))},j=()=>{s({type:"claim"})},$=(Q=!1)=>{var ce;if(a)return;const Y=n.current;if(!Y)return;const te=Y.clientWidth,ie=Y.clientHeight;if(!te||!ie||!Q&&te===v&&ie===x)return;const oe=((ce=window.visualViewport)==null?void 0:ce.scale)??1;if(!Q&&R>0&&O>0){const Be=Math.max(2,Math.floor(te/R)),me=Math.max(1,Math.floor(ie/O)),Tt=Math.abs(te-v),We=Math.abs(ie-x),At=Math.max(R*.75,2),pe=Math.max(O*.75,2),ni=Math.abs(oe-T)>.001;if(Be===y&&me===k){v=te,x=ie,T=oe;return}if(ni&&Tt<At&&We<pe){v=te,x=ie,T=oe;return}}v=te,x=ie,S.fit(),B(te,ie),T=oe,I()},E=(Q=!1)=>{if(b!==null){if(!Q)return;cancelAnimationFrame(b)}b=window.requestAnimationFrame(()=>{b=null,$(Q)})},A=new ResizeObserver(()=>{E()});A.observe(n.current),E();const P=typeof document<"u"?document.fonts:null,M=()=>{D||E(!0)};P==null||P.ready.then(M).catch(()=>{}),(Ut=P==null?void 0:P.addEventListener)==null||Ut.call(P,"loadingdone",M);let H=null,K=null,X=null,q=null,se=null,D=!1,F=0,W=null,U=!1,re=!1;const J=n.current.closest(".terminal-pane"),ae=Q=>{J instanceof HTMLElement&&(Q?J.dataset.terminalFocus="true":delete J.dataset.terminalFocus)},we=()=>{var Y;const Q=(Y=n.current)==null?void 0:Y.querySelector(".xterm-helper-textarea");if(Q instanceof HTMLTextAreaElement)try{Q.focus({preventScroll:!0})}catch{Q.focus()}},fe=()=>{D||we()},ut=()=>{D||(ae(!0),we())},ne=()=>{window.setTimeout(()=>{if(D)return;const Q=n.current;Q&&(Q.contains(document.activeElement)||ae(!1))},0)};n.current.addEventListener("pointerdown",fe,{passive:!0,capture:!0}),n.current.addEventListener("mousedown",fe,{passive:!0,capture:!0}),n.current.addEventListener("touchstart",fe,{passive:!0,capture:!0}),n.current.addEventListener("focusin",ut,!0),n.current.addEventListener("focusout",ne,!0),se=()=>{var Q,Y,te,ie,oe;(Q=n.current)==null||Q.removeEventListener("pointerdown",fe,!0),(Y=n.current)==null||Y.removeEventListener("mousedown",fe,!0),(te=n.current)==null||te.removeEventListener("touchstart",fe,!0),(ie=n.current)==null||ie.removeEventListener("focusin",ut,!0),(oe=n.current)==null||oe.removeEventListener("focusout",ne,!0)};const ht=async(Q=!1)=>{if(!D){C=!0,w=!1,g=0;try{const{token:Y,authEnabled:te}=await tv();if(D)return;const ie=te?`${t}?token=${Y}`:t;let oe=ie;if(Q&&l.current>0){const ce=ie.includes("?")?"&":"?";oe=`${ie}${ce}bufferOffset=${l.current}`}if(Q){const ce=oe.includes("?")?"&":"?";oe=`${oe}${ce}reconnect=1`}if(H=new WebSocket(oe),H.binaryType="arraybuffer",_.current=H,H.addEventListener("open",()=>{var ce;F=0,re=!0,v=0,x=0,R=0,O=0,y=-1,k=-1,T=((ce=window.visualViewport)==null?void 0:ce.scale)??1,E()}),H.addEventListener("message",ce=>{if(typeof ce.data=="string"){let me=null;try{me=JSON.parse(ce.data)}catch{return}if((me==null?void 0:me.type)==="sync"){C=!0,w=!1,g=0,a=!1,l.current=me.offsetBase,me.reset&&(f.reset(),$(!0),a=!0);return}if((me==null?void 0:me.type)==="ready"){w=!0,g===0&&o();return}return}if(ce.data instanceof Blob){ce.data.arrayBuffer().then(Tt=>{if(D)return;const We=new Uint8Array(Tt);g++,f.write(We,()=>{l.current+=We.byteLength,g=Math.max(0,g-1),w&&g===0&&o()})});return}const Be=new Uint8Array(ce.data);g++,f.write(Be,()=>{l.current+=Be.byteLength,g=Math.max(0,g-1),w&&g===0&&o()})}),H.addEventListener("close",ce=>{if(!(D||U)){if(ce.code===1e3&&Av.has(ce.reason)){u.current();return}if(F<fc){F++;const Be=pc*Math.pow(2,F-1);W=setTimeout(()=>ht(!0),Be)}else f.write(`\r
46
+ `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(S){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),o.isLinux&&S&&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(S){const k=this._getMouseBufferCoords(S),R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(R&&O&&k)&&this._areCoordsInSelection(k,R,O)}isCellInSelection(S,k){const R=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!R||!O)&&this._areCoordsInSelection([S,k],R,O)}_areCoordsInSelection(S,k,R){return S[1]>k[1]&&S[1]<R[1]||k[1]===R[1]&&S[1]===k[1]&&S[0]>=k[0]&&S[0]<R[0]||k[1]<R[1]&&S[1]===R[1]&&S[0]<R[0]||k[1]<R[1]&&S[1]===k[1]&&S[0]>=k[0]}_selectWordAtCursor(S,k){var R,O;const T=(O=(R=this._linkifier.currentLink)===null||R===void 0?void 0:R.link)===null||O===void 0?void 0:O.range;if(T)return this._model.selectionStart=[T.start.x-1,T.start.y-1],this._model.selectionStartLength=(0,s.getRangeLength)(T,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const B=this._getMouseBufferCoords(S);return!!B&&(this._selectWordAt(B,k),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(S,k){this._model.clearSelection(),S=Math.max(S,0),k=Math.min(k,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,S],this._model.selectionEnd=[this._bufferService.cols,k],this.refresh(),this._onSelectionChange.fire()}_handleTrim(S){this._model.handleTrim(S)&&this.refresh()}_getMouseBufferCoords(S){const k=this._mouseService.getCoords(S,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(k)return k[0]--,k[1]--,k[1]+=this._bufferService.buffer.ydisp,k}_getMouseEventScrollAmount(S){let k=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,S,this._screenElement)[1];const R=this._renderService.dimensions.css.canvas.height;return k>=0&&k<=R?0:(k>R&&(k-=R),k=Math.min(Math.max(k,-50),50),k/=50,k/Math.abs(k)+Math.round(14*k))}shouldForceSelection(S){return o.isMac?S.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:S.shiftKey}handleMouseDown(S){if(this._mouseDownTimeStamp=S.timeStamp,(S.button!==2||!this.hasSelection)&&S.button===0){if(!this._enabled){if(!this.shouldForceSelection(S))return;S.stopPropagation()}S.preventDefault(),this._dragScrollAmount=0,this._enabled&&S.shiftKey?this._handleIncrementalClick(S):S.detail===1?this._handleSingleClick(S):S.detail===2?this._handleDoubleClick(S):S.detail===3&&this._handleTripleClick(S),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(S){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(S))}_handleSingleClick(S){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(S)?3:0,this._model.selectionStart=this._getMouseBufferCoords(S),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const k=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);k&&k.length!==this._model.selectionStart[0]&&k.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(S){this._selectWordAtCursor(S,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(S){const k=this._getMouseBufferCoords(S);k&&(this._activeSelectionMode=2,this._selectLineAt(k[1]))}shouldColumnSelect(S){return S.altKey&&!(o.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(S){if(S.stopImmediatePropagation(),!this._model.selectionStart)return;const k=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(S),!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(S),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const R=this._bufferService.buffer;if(this._model.selectionEnd[1]<R.lines.length){const O=R.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}k&&k[0]===this._model.selectionEnd[0]&&k[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 S=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(S.ydisp+this._bufferService.rows,S.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=S.ydisp),this.refresh()}}_handleMouseUp(S){const k=S.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&k<500&&S.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const R=this._mouseService.getCoords(S,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(R&&R[0]!==void 0&&R[1]!==void 0){const O=(0,m.moveToCellSequence)(R[0]-1,R[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const S=this._model.finalSelectionStart,k=this._model.finalSelectionEnd,R=!(!S||!k||S[0]===k[0]&&S[1]===k[1]);R?S&&k&&(this._oldSelectionStart&&this._oldSelectionEnd&&S[0]===this._oldSelectionStart[0]&&S[1]===this._oldSelectionStart[1]&&k[0]===this._oldSelectionEnd[0]&&k[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(S,k,R)):this._oldHasSelection&&this._fireOnSelectionChange(S,k,R)}_fireOnSelectionChange(S,k,R){this._oldSelectionStart=S,this._oldSelectionEnd=k,this._oldHasSelection=R,this._onSelectionChange.fire()}_handleBufferActivate(S){this.clearSelection(),this._trimListener.dispose(),this._trimListener=S.activeBuffer.lines.onTrim(k=>this._handleTrim(k))}_convertViewportColToCharacterIndex(S,k){let R=k;for(let O=0;k>=O;O++){const T=S.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?R--:T>1&&k!==O&&(R+=T-1)}return R}setSelection(S,k,R){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[S,k],this._model.selectionStartLength=R,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(S){this._isClickInSelection(S)||(this._selectWordAtCursor(S,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(S,k,R=!0,O=!0){if(S[0]>=this._bufferService.cols)return;const T=this._bufferService.buffer,B=T.lines.get(S[1]);if(!B)return;const z=T.translateBufferLineToString(S[1],!1);let I=this._convertViewportColToCharacterIndex(B,S[0]),j=I;const $=S[0]-I;let E=0,A=0,P=0,M=0;if(z.charAt(I)===" "){for(;I>0&&z.charAt(I-1)===" ";)I--;for(;j<z.length&&z.charAt(j+1)===" ";)j++}else{let X=S[0],q=S[0];B.getWidth(X)===0&&(E++,X--),B.getWidth(q)===2&&(A++,q++);const se=B.getString(q).length;for(se>1&&(M+=se-1,j+=se-1);X>0&&I>0&&!this._isCharWordSeparator(B.loadCell(X-1,this._workCell));){B.loadCell(X-1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===0?(E++,X--):D>1&&(P+=D-1,I-=D-1),I--,X--}for(;q<B.length&&j+1<z.length&&!this._isCharWordSeparator(B.loadCell(q+1,this._workCell));){B.loadCell(q+1,this._workCell);const D=this._workCell.getChars().length;this._workCell.getWidth()===2?(A++,q++):D>1&&(M+=D-1,j+=D-1),j++,q++}}j++;let H=I+$-E+P,K=Math.min(this._bufferService.cols,j-I+E+A-P-M);if(k||z.slice(I,j).trim()!==""){if(R&&H===0&&B.getCodePoint(0)!==32){const X=T.lines.get(S[1]-1);if(X&&B.isWrapped&&X.getCodePoint(this._bufferService.cols-1)!==32){const q=this._getWordAt([this._bufferService.cols-1,S[1]-1],!1,!0,!1);if(q){const se=this._bufferService.cols-q.start;H-=se,K+=se}}}if(O&&H+K===this._bufferService.cols&&B.getCodePoint(this._bufferService.cols-1)!==32){const X=T.lines.get(S[1]+1);if(X!=null&&X.isWrapped&&X.getCodePoint(0)!==32){const q=this._getWordAt([0,S[1]+1],!1,!1,!0);q&&(K+=q.length)}}return{start:H,length:K}}}_selectWordAt(S,k){const R=this._getWordAt(S,k);if(R){for(;R.start<0;)R.start+=this._bufferService.cols,S[1]--;this._model.selectionStart=[R.start,S[1]],this._model.selectionStartLength=R.length}}_selectToWordAt(S){const k=this._getWordAt(S,!0);if(k){let R=S[1];for(;k.start<0;)k.start+=this._bufferService.cols,R--;if(!this._model.areSelectionValuesReversed())for(;k.start+k.length>this._bufferService.cols;)k.length-=this._bufferService.cols,R++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?k.start:k.start+k.length,R]}}_isCharWordSeparator(S){return S.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(S.getChars())>=0}_selectLineAt(S){const k=this._bufferService.buffer.getWrappedRangeForLine(S),R={start:{x:0,y:k.first},end:{x:this._bufferService.cols-1,y:k.last}};this._model.selectionStart=[0,k.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,s.getRangeLength)(R,this._bufferService.cols)}};l.SelectionService=b=f([y(3,p.IBufferService),y(4,p.ICoreService),y(5,w.IMouseService),y(6,p.IOptionsService),y(7,w.IRenderService),y(8,w.ICoreBrowserService)],b)},4725:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IThemeService=l.ICharacterJoinerService=l.ISelectionService=l.IRenderService=l.IMouseService=l.ICoreBrowserService=l.ICharSizeService=void 0;const f=u(8343);l.ICharSizeService=(0,f.createDecorator)("CharSizeService"),l.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),l.IMouseService=(0,f.createDecorator)("MouseService"),l.IRenderService=(0,f.createDecorator)("RenderService"),l.ISelectionService=(0,f.createDecorator)("SelectionService"),l.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),l.IThemeService=(0,f.createDecorator)("ThemeService")},6731:function(_,l,u){var f=this&&this.__decorate||function(b,S,k,R){var O,T=arguments.length,B=T<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,k):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(b,S,k,R);else for(var z=b.length-1;z>=0;z--)(O=b[z])&&(B=(T<3?O(B):T>3?O(S,k,B):O(S,k))||B);return T>3&&B&&Object.defineProperty(S,k,B),B},y=this&&this.__param||function(b,S){return function(k,R){S(k,R,b)}};Object.defineProperty(l,"__esModule",{value:!0}),l.ThemeService=l.DEFAULT_ANSI_COLORS=void 0;const d=u(7239),m=u(8055),C=u(8460),w=u(844),g=u(2585),a=m.css.toColor("#ffffff"),o=m.css.toColor("#000000"),s=m.css.toColor("#ffffff"),c=m.css.toColor("#000000"),p={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};l.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const b=[m.css.toColor("#2e3436"),m.css.toColor("#cc0000"),m.css.toColor("#4e9a06"),m.css.toColor("#c4a000"),m.css.toColor("#3465a4"),m.css.toColor("#75507b"),m.css.toColor("#06989a"),m.css.toColor("#d3d7cf"),m.css.toColor("#555753"),m.css.toColor("#ef2929"),m.css.toColor("#8ae234"),m.css.toColor("#fce94f"),m.css.toColor("#729fcf"),m.css.toColor("#ad7fa8"),m.css.toColor("#34e2e2"),m.css.toColor("#eeeeec")],S=[0,95,135,175,215,255];for(let k=0;k<216;k++){const R=S[k/36%6|0],O=S[k/6%6|0],T=S[k%6];b.push({css:m.channels.toCss(R,O,T),rgba:m.channels.toRgba(R,O,T)})}for(let k=0;k<24;k++){const R=8+10*k;b.push({css:m.channels.toCss(R,R,R),rgba:m.channels.toRgba(R,R,R)})}return b})());let v=l.ThemeService=class extends w.Disposable{get colors(){return this._colors}constructor(b){super(),this._optionsService=b,this._contrastCache=new d.ColorContrastCache,this._halfContrastCache=new d.ColorContrastCache,this._onChangeColors=this.register(new C.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:a,background:o,cursor:s,cursorAccent:c,selectionForeground:void 0,selectionBackgroundTransparent:p,selectionBackgroundOpaque:m.color.blend(o,p),selectionInactiveBackgroundTransparent:p,selectionInactiveBackgroundOpaque:m.color.blend(o,p),ansi:l.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(b={}){const S=this._colors;if(S.foreground=x(b.foreground,a),S.background=x(b.background,o),S.cursor=x(b.cursor,s),S.cursorAccent=x(b.cursorAccent,c),S.selectionBackgroundTransparent=x(b.selectionBackground,p),S.selectionBackgroundOpaque=m.color.blend(S.background,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundTransparent=x(b.selectionInactiveBackground,S.selectionBackgroundTransparent),S.selectionInactiveBackgroundOpaque=m.color.blend(S.background,S.selectionInactiveBackgroundTransparent),S.selectionForeground=b.selectionForeground?x(b.selectionForeground,m.NULL_COLOR):void 0,S.selectionForeground===m.NULL_COLOR&&(S.selectionForeground=void 0),m.color.isOpaque(S.selectionBackgroundTransparent)&&(S.selectionBackgroundTransparent=m.color.opacity(S.selectionBackgroundTransparent,.3)),m.color.isOpaque(S.selectionInactiveBackgroundTransparent)&&(S.selectionInactiveBackgroundTransparent=m.color.opacity(S.selectionInactiveBackgroundTransparent,.3)),S.ansi=l.DEFAULT_ANSI_COLORS.slice(),S.ansi[0]=x(b.black,l.DEFAULT_ANSI_COLORS[0]),S.ansi[1]=x(b.red,l.DEFAULT_ANSI_COLORS[1]),S.ansi[2]=x(b.green,l.DEFAULT_ANSI_COLORS[2]),S.ansi[3]=x(b.yellow,l.DEFAULT_ANSI_COLORS[3]),S.ansi[4]=x(b.blue,l.DEFAULT_ANSI_COLORS[4]),S.ansi[5]=x(b.magenta,l.DEFAULT_ANSI_COLORS[5]),S.ansi[6]=x(b.cyan,l.DEFAULT_ANSI_COLORS[6]),S.ansi[7]=x(b.white,l.DEFAULT_ANSI_COLORS[7]),S.ansi[8]=x(b.brightBlack,l.DEFAULT_ANSI_COLORS[8]),S.ansi[9]=x(b.brightRed,l.DEFAULT_ANSI_COLORS[9]),S.ansi[10]=x(b.brightGreen,l.DEFAULT_ANSI_COLORS[10]),S.ansi[11]=x(b.brightYellow,l.DEFAULT_ANSI_COLORS[11]),S.ansi[12]=x(b.brightBlue,l.DEFAULT_ANSI_COLORS[12]),S.ansi[13]=x(b.brightMagenta,l.DEFAULT_ANSI_COLORS[13]),S.ansi[14]=x(b.brightCyan,l.DEFAULT_ANSI_COLORS[14]),S.ansi[15]=x(b.brightWhite,l.DEFAULT_ANSI_COLORS[15]),b.extendedAnsi){const k=Math.min(S.ansi.length-16,b.extendedAnsi.length);for(let R=0;R<k;R++)S.ansi[R+16]=x(b.extendedAnsi[R],l.DEFAULT_ANSI_COLORS[R+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(b){this._restoreColor(b),this._onChangeColors.fire(this.colors)}_restoreColor(b){if(b!==void 0)switch(b){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[b]=this._restoreColors.ansi[b]}else for(let S=0;S<this._restoreColors.ansi.length;++S)this._colors.ansi[S]=this._restoreColors.ansi[S]}modifyColors(b){b(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 x(b,S){if(b!==void 0)try{return m.css.toColor(b)}catch{}return S}l.ThemeService=v=f([y(0,g.IOptionsService)],v)},6349:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CircularList=void 0;const f=u(8460),y=u(844);class d extends y.Disposable{constructor(C){super(),this._maxLength=C,this.onDeleteEmitter=this.register(new f.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new f.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new f.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(C){if(this._maxLength===C)return;const w=new Array(C);for(let g=0;g<Math.min(C,this.length);g++)w[g]=this._array[this._getCyclicIndex(g)];this._array=w,this._maxLength=C,this._startIndex=0}get length(){return this._length}set length(C){if(C>this._length)for(let w=this._length;w<C;w++)this._array[w]=void 0;this._length=C}get(C){return this._array[this._getCyclicIndex(C)]}set(C,w){this._array[this._getCyclicIndex(C)]=w}push(C){this._array[this._getCyclicIndex(this._length)]=C,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(C,w,...g){if(w){for(let a=C;a<this._length-w;a++)this._array[this._getCyclicIndex(a)]=this._array[this._getCyclicIndex(a+w)];this._length-=w,this.onDeleteEmitter.fire({index:C,amount:w})}for(let a=this._length-1;a>=C;a--)this._array[this._getCyclicIndex(a+g.length)]=this._array[this._getCyclicIndex(a)];for(let a=0;a<g.length;a++)this._array[this._getCyclicIndex(C+a)]=g[a];if(g.length&&this.onInsertEmitter.fire({index:C,amount:g.length}),this._length+g.length>this._maxLength){const a=this._length+g.length-this._maxLength;this._startIndex+=a,this._length=this._maxLength,this.onTrimEmitter.fire(a)}else this._length+=g.length}trimStart(C){C>this._length&&(C=this._length),this._startIndex+=C,this._length-=C,this.onTrimEmitter.fire(C)}shiftElements(C,w,g){if(!(w<=0)){if(C<0||C>=this._length)throw new Error("start argument out of range");if(C+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(let o=w-1;o>=0;o--)this.set(C+o+g,this.get(C+o));const a=C+w+g-this._length;if(a>0)for(this._length+=a;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let a=0;a<w;a++)this.set(C+a+g,this.get(C+a))}}_getCyclicIndex(C){return(this._startIndex+C)%this._maxLength}}l.CircularList=d},1439:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.clone=void 0,l.clone=function u(f,y=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const m in f)d[m]=y<=1?f[m]:f[m]&&u(f[m],y-1);return d}},8055:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.contrastRatio=l.toPaddedHex=l.rgba=l.rgb=l.css=l.color=l.channels=l.NULL_COLOR=void 0;const f=u(6114);let y=0,d=0,m=0,C=0;var w,g,a,o,s;function c(v){const x=v.toString(16);return x.length<2?"0"+x:x}function p(v,x){return v<x?(x+.05)/(v+.05):(v+.05)/(x+.05)}l.NULL_COLOR={css:"#00000000",rgba:0},function(v){v.toCss=function(x,b,S,k){return k!==void 0?`#${c(x)}${c(b)}${c(S)}${c(k)}`:`#${c(x)}${c(b)}${c(S)}`},v.toRgba=function(x,b,S,k=255){return(x<<24|b<<16|S<<8|k)>>>0}}(w||(l.channels=w={})),function(v){function x(b,S){return C=Math.round(255*S),[y,d,m]=s.toChannels(b.rgba),{css:w.toCss(y,d,m,C),rgba:w.toRgba(y,d,m,C)}}v.blend=function(b,S){if(C=(255&S.rgba)/255,C===1)return{css:S.css,rgba:S.rgba};const k=S.rgba>>24&255,R=S.rgba>>16&255,O=S.rgba>>8&255,T=b.rgba>>24&255,B=b.rgba>>16&255,z=b.rgba>>8&255;return y=T+Math.round((k-T)*C),d=B+Math.round((R-B)*C),m=z+Math.round((O-z)*C),{css:w.toCss(y,d,m),rgba:w.toRgba(y,d,m)}},v.isOpaque=function(b){return(255&b.rgba)==255},v.ensureContrastRatio=function(b,S,k){const R=s.ensureContrastRatio(b.rgba,S.rgba,k);if(R)return s.toColor(R>>24&255,R>>16&255,R>>8&255)},v.opaque=function(b){const S=(255|b.rgba)>>>0;return[y,d,m]=s.toChannels(S),{css:w.toCss(y,d,m),rgba:S}},v.opacity=x,v.multiplyOpacity=function(b,S){return C=255&b.rgba,x(b,C*S/255)},v.toColorRGB=function(b){return[b.rgba>>24&255,b.rgba>>16&255,b.rgba>>8&255]}}(g||(l.color=g={})),function(v){let x,b;if(!f.isNode){const S=document.createElement("canvas");S.width=1,S.height=1;const k=S.getContext("2d",{willReadFrequently:!0});k&&(x=k,x.globalCompositeOperation="copy",b=x.createLinearGradient(0,0,1,1))}v.toColor=function(S){if(S.match(/#[\da-f]{3,8}/i))switch(S.length){case 4:return y=parseInt(S.slice(1,2).repeat(2),16),d=parseInt(S.slice(2,3).repeat(2),16),m=parseInt(S.slice(3,4).repeat(2),16),s.toColor(y,d,m);case 5:return y=parseInt(S.slice(1,2).repeat(2),16),d=parseInt(S.slice(2,3).repeat(2),16),m=parseInt(S.slice(3,4).repeat(2),16),C=parseInt(S.slice(4,5).repeat(2),16),s.toColor(y,d,m,C);case 7:return{css:S,rgba:(parseInt(S.slice(1),16)<<8|255)>>>0};case 9:return{css:S,rgba:parseInt(S.slice(1),16)>>>0}}const k=S.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(k)return y=parseInt(k[1]),d=parseInt(k[2]),m=parseInt(k[3]),C=Math.round(255*(k[5]===void 0?1:parseFloat(k[5]))),s.toColor(y,d,m,C);if(!x||!b)throw new Error("css.toColor: Unsupported css format");if(x.fillStyle=b,x.fillStyle=S,typeof x.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(x.fillRect(0,0,1,1),[y,d,m,C]=x.getImageData(0,0,1,1).data,C!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:w.toRgba(y,d,m,C),css:S}}}(a||(l.css=a={})),function(v){function x(b,S,k){const R=b/255,O=S/255,T=k/255;return .2126*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))+.7152*(O<=.03928?O/12.92:Math.pow((O+.055)/1.055,2.4))+.0722*(T<=.03928?T/12.92:Math.pow((T+.055)/1.055,2.4))}v.relativeLuminance=function(b){return x(b>>16&255,b>>8&255,255&b)},v.relativeLuminance2=x}(o||(l.rgb=o={})),function(v){function x(S,k,R){const O=S>>24&255,T=S>>16&255,B=S>>8&255;let z=k>>24&255,I=k>>16&255,j=k>>8&255,$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));for(;$<R&&(z>0||I>0||j>0);)z-=Math.max(0,Math.ceil(.1*z)),I-=Math.max(0,Math.ceil(.1*I)),j-=Math.max(0,Math.ceil(.1*j)),$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));return(z<<24|I<<16|j<<8|255)>>>0}function b(S,k,R){const O=S>>24&255,T=S>>16&255,B=S>>8&255;let z=k>>24&255,I=k>>16&255,j=k>>8&255,$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));for(;$<R&&(z<255||I<255||j<255);)z=Math.min(255,z+Math.ceil(.1*(255-z))),I=Math.min(255,I+Math.ceil(.1*(255-I))),j=Math.min(255,j+Math.ceil(.1*(255-j))),$=p(o.relativeLuminance2(z,I,j),o.relativeLuminance2(O,T,B));return(z<<24|I<<16|j<<8|255)>>>0}v.ensureContrastRatio=function(S,k,R){const O=o.relativeLuminance(S>>8),T=o.relativeLuminance(k>>8);if(p(O,T)<R){if(T<O){const I=x(S,k,R),j=p(O,o.relativeLuminance(I>>8));if(j<R){const $=b(S,k,R);return j>p(O,o.relativeLuminance($>>8))?I:$}return I}const B=b(S,k,R),z=p(O,o.relativeLuminance(B>>8));if(z<R){const I=x(S,k,R);return z>p(O,o.relativeLuminance(I>>8))?B:I}return B}},v.reduceLuminance=x,v.increaseLuminance=b,v.toChannels=function(S){return[S>>24&255,S>>16&255,S>>8&255,255&S]},v.toColor=function(S,k,R,O){return{css:w.toCss(S,k,R,O),rgba:w.toRgba(S,k,R,O)}}}(s||(l.rgba=s={})),l.toPaddedHex=c,l.contrastRatio=p},8969:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CoreTerminal=void 0;const f=u(844),y=u(2585),d=u(4348),m=u(7866),C=u(744),w=u(7302),g=u(6975),a=u(8460),o=u(1753),s=u(1480),c=u(7994),p=u(9282),v=u(5435),x=u(5981),b=u(2660);let S=!1;class k extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new a.EventEmitter),this._onScroll.event(O=>{var T;(T=this._onScrollApi)===null||T===void 0||T.fire(O.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(O){for(const T in O)this.optionsService.options[T]=O[T]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new a.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new a.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new a.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new a.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new w.OptionsService(O)),this._instantiationService.setService(y.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(C.BufferService)),this._instantiationService.setService(y.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(m.LogService)),this._instantiationService.setService(y.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(g.CoreService)),this._instantiationService.setService(y.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(o.CoreMouseService)),this._instantiationService.setService(y.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(s.UnicodeService)),this._instantiationService.setService(y.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(y.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(b.OscLinkService),this._instantiationService.setService(y.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new v.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,a.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,a.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,a.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,a.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(T=>{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(T=>{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 x.WriteBuffer((T,B)=>this._inputHandler.parse(T,B))),this.register((0,a.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,T){this._writeBuffer.write(O,T)}writeSync(O,T){this._logService.logLevel<=y.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(O,T)}resize(O,T){isNaN(O)||isNaN(T)||(O=Math.max(O,C.MINIMUM_COLS),T=Math.max(T,C.MINIMUM_ROWS),this._bufferService.resize(O,T))}scroll(O,T=!1){this._bufferService.scroll(O,T)}scrollLines(O,T,B){this._bufferService.scrollLines(O,T,B)}scrollPages(O){this.scrollLines(O*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(O){const T=O-this._bufferService.buffer.ydisp;T!==0&&this.scrollLines(T)}registerEscHandler(O,T){return this._inputHandler.registerEscHandler(O,T)}registerDcsHandler(O,T){return this._inputHandler.registerDcsHandler(O,T)}registerCsiHandler(O,T){return this._inputHandler.registerCsiHandler(O,T)}registerOscHandler(O,T){return this._inputHandler.registerOscHandler(O,T)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const T=this.optionsService.rawOptions.windowsPty;T&&T.buildNumber!==void 0&&T.buildNumber!==void 0?O=T.backend==="conpty"&&T.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(O=!0),O?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const O=[];O.push(this.onLineFeed(p.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},()=>((0,p.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const T of O)T.dispose()})}}}l.CoreTerminal=k},8460:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.forwardEvent=l.EventEmitter=void 0,l.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===u)return void this._listeners.splice(f,1)}}})),this._event}fire(u,f){const y=[];for(let d=0;d<this._listeners.length;d++)y.push(this._listeners[d]);for(let d=0;d<y.length;d++)y[d].call(void 0,u,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},l.forwardEvent=function(u,f){return u(y=>f.fire(y))}},5435:function(_,l,u){var f=this&&this.__decorate||function($,E,A,P){var M,H=arguments.length,K=H<3?E:P===null?P=Object.getOwnPropertyDescriptor(E,A):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate($,E,A,P);else for(var X=$.length-1;X>=0;X--)(M=$[X])&&(K=(H<3?M(K):H>3?M(E,A,K):M(E,A))||K);return H>3&&K&&Object.defineProperty(E,A,K),K},y=this&&this.__param||function($,E){return function(A,P){E(A,P,$)}};Object.defineProperty(l,"__esModule",{value:!0}),l.InputHandler=l.WindowsOptionsReportType=void 0;const d=u(2584),m=u(7116),C=u(2015),w=u(844),g=u(482),a=u(8437),o=u(8460),s=u(643),c=u(511),p=u(3734),v=u(2585),x=u(6242),b=u(6351),S=u(5941),k={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function O($,E){if($>24)return E.setWinLines||!1;switch($){case 1:return!!E.restoreWin;case 2:return!!E.minimizeWin;case 3:return!!E.setWinPosition;case 4:return!!E.setWinSizePixels;case 5:return!!E.raiseWin;case 6:return!!E.lowerWin;case 7:return!!E.refreshWin;case 8:return!!E.setWinSizeChars;case 9:return!!E.maximizeWin;case 10:return!!E.fullscreenWin;case 11:return!!E.getWinState;case 13:return!!E.getWinPosition;case 14:return!!E.getWinSizePixels;case 15:return!!E.getScreenSizePixels;case 16:return!!E.getCellSizePixels;case 18:return!!E.getWinSizeChars;case 19:return!!E.getScreenSizeChars;case 20:return!!E.getIconTitle;case 21:return!!E.getWinTitle;case 22:return!!E.pushTitle;case 23:return!!E.popTitle;case 24:return!!E.setWinLines}return!1}var T;(function($){$[$.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",$[$.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(T||(l.WindowsOptionsReportType=T={}));let B=0;class z extends w.Disposable{getAttrData(){return this._curAttrData}constructor(E,A,P,M,H,K,X,q,se=new C.EscapeSequenceParser){super(),this._bufferService=E,this._charsetService=A,this._coreService=P,this._logService=M,this._optionsService=H,this._oscLinkService=K,this._coreMouseService=X,this._unicodeService=q,this._parser=se,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new g.StringToUtf32,this._utf8Decoder=new g.Utf8ToUtf32,this._workCell=new c.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new o.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new o.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new o.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new o.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new o.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new o.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new o.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new o.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new o.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new o.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new o.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new o.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new o.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 I(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(D=>this._activeBuffer=D.activeBuffer)),this._parser.setCsiHandlerFallback((D,F)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:F.toArray()})}),this._parser.setEscHandlerFallback(D=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(D)})}),this._parser.setExecuteHandlerFallback(D=>{this._logService.debug("Unknown EXECUTE code: ",{code:D})}),this._parser.setOscHandlerFallback((D,F,W)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:F,data:W})}),this._parser.setDcsHandlerFallback((D,F,W)=>{F==="HOOK"&&(W=W.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:F,payload:W})}),this._parser.setPrintHandler((D,F,W)=>this.print(D,F,W)),this._parser.registerCsiHandler({final:"@"},D=>this.insertChars(D)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},D=>this.scrollLeft(D)),this._parser.registerCsiHandler({final:"A"},D=>this.cursorUp(D)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},D=>this.scrollRight(D)),this._parser.registerCsiHandler({final:"B"},D=>this.cursorDown(D)),this._parser.registerCsiHandler({final:"C"},D=>this.cursorForward(D)),this._parser.registerCsiHandler({final:"D"},D=>this.cursorBackward(D)),this._parser.registerCsiHandler({final:"E"},D=>this.cursorNextLine(D)),this._parser.registerCsiHandler({final:"F"},D=>this.cursorPrecedingLine(D)),this._parser.registerCsiHandler({final:"G"},D=>this.cursorCharAbsolute(D)),this._parser.registerCsiHandler({final:"H"},D=>this.cursorPosition(D)),this._parser.registerCsiHandler({final:"I"},D=>this.cursorForwardTab(D)),this._parser.registerCsiHandler({final:"J"},D=>this.eraseInDisplay(D,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},D=>this.eraseInDisplay(D,!0)),this._parser.registerCsiHandler({final:"K"},D=>this.eraseInLine(D,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},D=>this.eraseInLine(D,!0)),this._parser.registerCsiHandler({final:"L"},D=>this.insertLines(D)),this._parser.registerCsiHandler({final:"M"},D=>this.deleteLines(D)),this._parser.registerCsiHandler({final:"P"},D=>this.deleteChars(D)),this._parser.registerCsiHandler({final:"S"},D=>this.scrollUp(D)),this._parser.registerCsiHandler({final:"T"},D=>this.scrollDown(D)),this._parser.registerCsiHandler({final:"X"},D=>this.eraseChars(D)),this._parser.registerCsiHandler({final:"Z"},D=>this.cursorBackwardTab(D)),this._parser.registerCsiHandler({final:"`"},D=>this.charPosAbsolute(D)),this._parser.registerCsiHandler({final:"a"},D=>this.hPositionRelative(D)),this._parser.registerCsiHandler({final:"b"},D=>this.repeatPrecedingCharacter(D)),this._parser.registerCsiHandler({final:"c"},D=>this.sendDeviceAttributesPrimary(D)),this._parser.registerCsiHandler({prefix:">",final:"c"},D=>this.sendDeviceAttributesSecondary(D)),this._parser.registerCsiHandler({final:"d"},D=>this.linePosAbsolute(D)),this._parser.registerCsiHandler({final:"e"},D=>this.vPositionRelative(D)),this._parser.registerCsiHandler({final:"f"},D=>this.hVPosition(D)),this._parser.registerCsiHandler({final:"g"},D=>this.tabClear(D)),this._parser.registerCsiHandler({final:"h"},D=>this.setMode(D)),this._parser.registerCsiHandler({prefix:"?",final:"h"},D=>this.setModePrivate(D)),this._parser.registerCsiHandler({final:"l"},D=>this.resetMode(D)),this._parser.registerCsiHandler({prefix:"?",final:"l"},D=>this.resetModePrivate(D)),this._parser.registerCsiHandler({final:"m"},D=>this.charAttributes(D)),this._parser.registerCsiHandler({final:"n"},D=>this.deviceStatus(D)),this._parser.registerCsiHandler({prefix:"?",final:"n"},D=>this.deviceStatusPrivate(D)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},D=>this.softReset(D)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},D=>this.setCursorStyle(D)),this._parser.registerCsiHandler({final:"r"},D=>this.setScrollRegion(D)),this._parser.registerCsiHandler({final:"s"},D=>this.saveCursor(D)),this._parser.registerCsiHandler({final:"t"},D=>this.windowOptions(D)),this._parser.registerCsiHandler({final:"u"},D=>this.restoreCursor(D)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},D=>this.insertColumns(D)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},D=>this.deleteColumns(D)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},D=>this.selectProtected(D)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},D=>this.requestMode(D,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},D=>this.requestMode(D,!1)),this._parser.setExecuteHandler(d.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(d.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(d.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(d.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(d.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(d.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(d.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(d.C1.IND,()=>this.index()),this._parser.setExecuteHandler(d.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(d.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new x.OscHandler(D=>(this.setTitle(D),this.setIconName(D),!0))),this._parser.registerOscHandler(1,new x.OscHandler(D=>this.setIconName(D))),this._parser.registerOscHandler(2,new x.OscHandler(D=>this.setTitle(D))),this._parser.registerOscHandler(4,new x.OscHandler(D=>this.setOrReportIndexedColor(D))),this._parser.registerOscHandler(8,new x.OscHandler(D=>this.setHyperlink(D))),this._parser.registerOscHandler(10,new x.OscHandler(D=>this.setOrReportFgColor(D))),this._parser.registerOscHandler(11,new x.OscHandler(D=>this.setOrReportBgColor(D))),this._parser.registerOscHandler(12,new x.OscHandler(D=>this.setOrReportCursorColor(D))),this._parser.registerOscHandler(104,new x.OscHandler(D=>this.restoreIndexedColor(D))),this._parser.registerOscHandler(110,new x.OscHandler(D=>this.restoreFgColor(D))),this._parser.registerOscHandler(111,new x.OscHandler(D=>this.restoreBgColor(D))),this._parser.registerOscHandler(112,new x.OscHandler(D=>this.restoreCursorColor(D))),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 D in m.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:D},()=>this.selectCharset("("+D)),this._parser.registerEscHandler({intermediates:")",final:D},()=>this.selectCharset(")"+D)),this._parser.registerEscHandler({intermediates:"*",final:D},()=>this.selectCharset("*"+D)),this._parser.registerEscHandler({intermediates:"+",final:D},()=>this.selectCharset("+"+D)),this._parser.registerEscHandler({intermediates:"-",final:D},()=>this.selectCharset("-"+D)),this._parser.registerEscHandler({intermediates:".",final:D},()=>this.selectCharset("."+D)),this._parser.registerEscHandler({intermediates:"/",final:D},()=>this.selectCharset("/"+D));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(D=>(this._logService.error("Parsing error: ",D),D)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new b.DcsHandler((D,F)=>this.requestStatusString(D,F)))}_preserveStack(E,A,P,M){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=A,this._parseStack.decodedLength=P,this._parseStack.position=M}_logSlowResolvingAsync(E){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([E,new Promise((A,P)=>setTimeout(()=>P("#SLOW_TIMEOUT"),5e3))]).catch(A=>{if(A!=="#SLOW_TIMEOUT")throw A;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(E,A){let P,M=this._activeBuffer.x,H=this._activeBuffer.y,K=0;const X=this._parseStack.paused;if(X){if(P=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,A))return this._logSlowResolvingAsync(P),P;M=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>R&&(K=this._parseStack.position+R)}if(this._logService.logLevel<=v.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof E=="string"?` "${E}"`:` "${Array.prototype.map.call(E,q=>String.fromCharCode(q)).join("")}"`),typeof E=="string"?E.split("").map(q=>q.charCodeAt(0)):E),this._parseBuffer.length<E.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(E.length,R))),X||this._dirtyRowTracker.clearRange(),E.length>R)for(let q=K;q<E.length;q+=R){const se=q+R<E.length?q+R:E.length,D=typeof E=="string"?this._stringDecoder.decode(E.substring(q,se),this._parseBuffer):this._utf8Decoder.decode(E.subarray(q,se),this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,D))return this._preserveStack(M,H,D,q),this._logSlowResolvingAsync(P),P}else if(!X){const q=typeof E=="string"?this._stringDecoder.decode(E,this._parseBuffer):this._utf8Decoder.decode(E,this._parseBuffer);if(P=this._parser.parse(this._parseBuffer,q))return this._preserveStack(M,H,q,0),this._logSlowResolvingAsync(P),P}this._activeBuffer.x===M&&this._activeBuffer.y===H||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowTracker.start,this._dirtyRowTracker.end)}print(E,A,P){let M,H;const K=this._charsetService.charset,X=this._optionsService.rawOptions.screenReaderMode,q=this._bufferService.cols,se=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,F=this._curAttrData;let W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&P-A>0&&W.getWidth(this._activeBuffer.x-1)===2&&W.setCellFromCodePoint(this._activeBuffer.x-1,0,1,F.fg,F.bg,F.extended);for(let U=A;U<P;++U){if(M=E[U],H=this._unicodeService.wcwidth(M),M<127&&K){const re=K[String.fromCharCode(M)];re&&(M=re.charCodeAt(0))}if(X&&this._onA11yChar.fire((0,g.stringFromCodePoint)(M)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),H||!this._activeBuffer.x){if(this._activeBuffer.x+H-1>=q){if(se){for(;this._activeBuffer.x<q;)W.setCellFromCodePoint(this._activeBuffer.x++,0,1,F.fg,F.bg,F.extended);this._activeBuffer.x=0,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),W=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=q-1,H===2)continue}if(D&&(W.insertCells(this._activeBuffer.x,H,this._activeBuffer.getNullCell(F),F),W.getWidth(q-1)===2&&W.setCellFromCodePoint(q-1,s.NULL_CELL_CODE,s.NULL_CELL_WIDTH,F.fg,F.bg,F.extended)),W.setCellFromCodePoint(this._activeBuffer.x++,M,H,F.fg,F.bg,F.extended),H>0)for(;--H;)W.setCellFromCodePoint(this._activeBuffer.x++,0,0,F.fg,F.bg,F.extended)}else W.getWidth(this._activeBuffer.x-1)?W.addCodepointToCell(this._activeBuffer.x-1,M):W.addCodepointToCell(this._activeBuffer.x-2,M)}P-A>0&&(W.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<q&&P-A>0&&W.getWidth(this._activeBuffer.x)===0&&!W.hasContent(this._activeBuffer.x)&&W.setCellFromCodePoint(this._activeBuffer.x,0,1,F.fg,F.bg,F.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(E,A){return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,A):this._parser.registerCsiHandler(E,P=>!O(P.params[0],this._optionsService.rawOptions.windowOptions)||A(P))}registerDcsHandler(E,A){return this._parser.registerDcsHandler(E,new b.DcsHandler(A))}registerEscHandler(E,A){return this._parser.registerEscHandler(E,A)}registerOscHandler(E,A){return this._parser.registerOscHandler(E,new x.OscHandler(A))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var E;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((E=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||E===void 0)&&E.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);A.hasWidth(this._activeBuffer.x)&&!A.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const E=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-E),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(E=this._bufferService.cols-1){this._activeBuffer.x=Math.min(E,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(E,A){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=E,this._activeBuffer.y=this._activeBuffer.scrollTop+A):(this._activeBuffer.x=E,this._activeBuffer.y=A),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(E,A){this._restrictCursor(),this._setCursor(this._activeBuffer.x+E,this._activeBuffer.y+A)}cursorUp(E){const A=this._activeBuffer.y-this._activeBuffer.scrollTop;return A>=0?this._moveCursor(0,-Math.min(A,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0}cursorDown(E){const A=this._activeBuffer.scrollBottom-this._activeBuffer.y;return A>=0?this._moveCursor(0,Math.min(A,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0}cursorForward(E){return this._moveCursor(E.params[0]||1,0),!0}cursorBackward(E){return this._moveCursor(-(E.params[0]||1),0),!0}cursorNextLine(E){return this.cursorDown(E),this._activeBuffer.x=0,!0}cursorPrecedingLine(E){return this.cursorUp(E),this._activeBuffer.x=0,!0}cursorCharAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0}charPosAbsolute(E){return this._setCursor((E.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(E){return this._moveCursor(E.params[0]||1,0),!0}linePosAbsolute(E){return this._setCursor(this._activeBuffer.x,(E.params[0]||1)-1),!0}vPositionRelative(E){return this._moveCursor(0,E.params[0]||1),!0}hVPosition(E){return this.cursorPosition(E),!0}tabClear(E){const A=E.params[0];return A===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:A===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=E.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(E){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let A=E.params[0]||1;for(;A--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(E){const A=E.params[0];return A===1&&(this._curAttrData.bg|=536870912),A!==2&&A!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(E,A,P,M=!1,H=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);K.replaceCells(A,P,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),H),M&&(K.isWrapped=!1)}_resetBufferLine(E,A=!1){const P=this._activeBuffer.lines.get(this._activeBuffer.ybase+E);P&&(P.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),A),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+E),P.isWrapped=!1)}eraseInDisplay(E,A=!1){let P;switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);P<this._bufferService.rows;P++)this._resetBufferLine(P,A);this._dirtyRowTracker.markDirty(P);break;case 1:for(P=this._activeBuffer.y,this._dirtyRowTracker.markDirty(P),this._eraseInBufferLine(P,0,this._activeBuffer.x+1,!0,A),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(P+1).isWrapped=!1);P--;)this._resetBufferLine(P,A);this._dirtyRowTracker.markDirty(0);break;case 2:for(P=this._bufferService.rows,this._dirtyRowTracker.markDirty(P-1);P--;)this._resetBufferLine(P,A);this._dirtyRowTracker.markDirty(0);break;case 3:const M=this._activeBuffer.lines.length-this._bufferService.rows;M>0&&(this._activeBuffer.lines.trimStart(M),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-M,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-M,0),this._onScroll.fire(0))}return!0}eraseInLine(E,A=!1){switch(this._restrictCursor(this._bufferService.cols),E.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,A);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,A);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,A)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(E){this._restrictCursor();let A=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y,M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-M+1;for(;A--;)this._activeBuffer.lines.splice(H-1,1),this._activeBuffer.lines.splice(P,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(E){this._restrictCursor();let A=E.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const P=this._activeBuffer.ybase+this._activeBuffer.y;let M;for(M=this._bufferService.rows-1-this._activeBuffer.scrollBottom,M=this._bufferService.rows-1+this._activeBuffer.ybase-M;A--;)this._activeBuffer.lines.splice(P,1),this._activeBuffer.lines.splice(M,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(E){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.insertCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(E){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.deleteCells(this._activeBuffer.x,E.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(E){let A=E.params[0]||1;for(;A--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(E){let A=E.params[0]||1;for(;A--;)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(a.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.deleteCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.insertCells(0,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.insertCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(E){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=E.params[0]||1;for(let P=this._activeBuffer.scrollTop;P<=this._activeBuffer.scrollBottom;++P){const M=this._activeBuffer.lines.get(this._activeBuffer.ybase+P);M.deleteCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),M.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(E){this._restrictCursor();const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return A&&(A.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(E.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(E){if(!this._parser.precedingCodepoint)return!0;const A=E.params[0]||1,P=new Uint32Array(A);for(let M=0;M<A;++M)P[M]=this._parser.precedingCodepoint;return this.print(P,0,P.length),!0}sendDeviceAttributesPrimary(E){return E.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(E){return(this._optionsService.rawOptions.termName+"").indexOf(E)===0}setMode(E){for(let A=0;A<E.length;A++)switch(E.params[A]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(E){for(let A=0;A<E.length;A++)switch(E.params[A]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),this._charsetService.setgCharset(1,m.DEFAULT_CHARSET),this._charsetService.setgCharset(2,m.DEFAULT_CHARSET),this._charsetService.setgCharset(3,m.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(E){for(let A=0;A<E.length;A++)switch(E.params[A]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(E){for(let A=0;A<E.length;A++)switch(E.params[A]){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(),E.params[A]===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(E,A){const P=this._coreService.decPrivateModes,{activeProtocol:M,activeEncoding:H}=this._coreMouseService,K=this._coreService,{buffers:X,cols:q}=this._bufferService,{active:se,alt:D}=X,F=this._optionsService.rawOptions,W=ae=>ae?1:2,U=E.params[0];return re=U,Q=A?U===2?4:U===4?W(K.modes.insertMode):U===12?3:U===20?W(F.convertEol):0:U===1?W(P.applicationCursorKeys):U===3?F.windowOptions.setWinLines?q===80?2:q===132?1:0:0:U===6?W(P.origin):U===7?W(P.wraparound):U===8?3:U===9?W(M==="X10"):U===12?W(F.cursorBlink):U===25?W(!K.isCursorHidden):U===45?W(P.reverseWraparound):U===66?W(P.applicationKeypad):U===67?4:U===1e3?W(M==="VT200"):U===1002?W(M==="DRAG"):U===1003?W(M==="ANY"):U===1004?W(P.sendFocus):U===1005?4:U===1006?W(H==="SGR"):U===1015?4:U===1016?W(H==="SGR_PIXELS"):U===1048?1:U===47||U===1047||U===1049?W(se===D):U===2004?W(P.bracketedPasteMode):0,K.triggerDataEvent(`${d.C0.ESC}[${A?"":"?"}${re};${Q}$y`),!0;var re,Q}_updateAttrColor(E,A,P,M,H){return A===2?(E|=50331648,E&=-16777216,E|=p.AttributeData.fromColorRGB([P,M,H])):A===5&&(E&=-50331904,E|=33554432|255&P),E}_extractColor(E,A,P){const M=[0,0,-1,0,0,0];let H=0,K=0;do{if(M[K+H]=E.params[A+K],E.hasSubParams(A+K)){const X=E.getSubParams(A+K);let q=0;do M[1]===5&&(H=1),M[K+q+1+H]=X[q];while(++q<X.length&&q+K+1+H<M.length);break}if(M[1]===5&&K+H>=2||M[1]===2&&K+H>=5)break;M[1]&&(H=1)}while(++K+A<E.length&&K+H<M.length);for(let X=2;X<M.length;++X)M[X]===-1&&(M[X]=0);switch(M[0]){case 38:P.fg=this._updateAttrColor(P.fg,M[1],M[3],M[4],M[5]);break;case 48:P.bg=this._updateAttrColor(P.bg,M[1],M[3],M[4],M[5]);break;case 58:P.extended=P.extended.clone(),P.extended.underlineColor=this._updateAttrColor(P.extended.underlineColor,M[1],M[3],M[4],M[5])}return K}_processUnderline(E,A){A.extended=A.extended.clone(),(!~E||E>5)&&(E=1),A.extended.underlineStyle=E,A.fg|=268435456,E===0&&(A.fg&=-268435457),A.updateExtended()}_processSGR0(E){E.fg=a.DEFAULT_ATTR_DATA.fg,E.bg=a.DEFAULT_ATTR_DATA.bg,E.extended=E.extended.clone(),E.extended.underlineStyle=0,E.extended.underlineColor&=-67108864,E.updateExtended()}charAttributes(E){if(E.length===1&&E.params[0]===0)return this._processSGR0(this._curAttrData),!0;const A=E.length;let P;const M=this._curAttrData;for(let H=0;H<A;H++)P=E.params[H],P>=30&&P<=37?(M.fg&=-50331904,M.fg|=16777216|P-30):P>=40&&P<=47?(M.bg&=-50331904,M.bg|=16777216|P-40):P>=90&&P<=97?(M.fg&=-50331904,M.fg|=16777224|P-90):P>=100&&P<=107?(M.bg&=-50331904,M.bg|=16777224|P-100):P===0?this._processSGR0(M):P===1?M.fg|=134217728:P===3?M.bg|=67108864:P===4?(M.fg|=268435456,this._processUnderline(E.hasSubParams(H)?E.getSubParams(H)[0]:1,M)):P===5?M.fg|=536870912:P===7?M.fg|=67108864:P===8?M.fg|=1073741824:P===9?M.fg|=2147483648:P===2?M.bg|=134217728:P===21?this._processUnderline(2,M):P===22?(M.fg&=-134217729,M.bg&=-134217729):P===23?M.bg&=-67108865:P===24?(M.fg&=-268435457,this._processUnderline(0,M)):P===25?M.fg&=-536870913:P===27?M.fg&=-67108865:P===28?M.fg&=-1073741825:P===29?M.fg&=2147483647:P===39?(M.fg&=-67108864,M.fg|=16777215&a.DEFAULT_ATTR_DATA.fg):P===49?(M.bg&=-67108864,M.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):P===38||P===48||P===58?H+=this._extractColor(E,H,M):P===53?M.bg|=1073741824:P===55?M.bg&=-1073741825:P===59?(M.extended=M.extended.clone(),M.extended.underlineColor=-1,M.updateExtended()):P===100?(M.fg&=-67108864,M.fg|=16777215&a.DEFAULT_ATTR_DATA.fg,M.bg&=-67108864,M.bg|=16777215&a.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",P);return!0}deviceStatus(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const A=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${A};${P}R`)}return!0}deviceStatusPrivate(E){if(E.params[0]===6){const A=this._activeBuffer.y+1,P=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${A};${P}R`)}return!0}softReset(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=a.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(E){const A=E.params[0]||1;switch(A){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 P=A%2==1;return this._optionsService.options.cursorBlink=P,!0}setScrollRegion(E){const A=E.params[0]||1;let P;return(E.length<2||(P=E.params[1])>this._bufferService.rows||P===0)&&(P=this._bufferService.rows),P>A&&(this._activeBuffer.scrollTop=A-1,this._activeBuffer.scrollBottom=P-1,this._setCursor(0,0)),!0}windowOptions(E){if(!O(E.params[0],this._optionsService.rawOptions.windowOptions))return!0;const A=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:A!==2&&this._onRequestWindowsOptionsReport.fire(T.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(T.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${d.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:A!==0&&A!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),A!==0&&A!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:A!==0&&A!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),A!==0&&A!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(E){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(E){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0}setIconName(E){return this._iconName=E,!0}setOrReportIndexedColor(E){const A=[],P=E.split(";");for(;P.length>1;){const M=P.shift(),H=P.shift();if(/^\d+$/.exec(M)){const K=parseInt(M);if(j(K))if(H==="?")A.push({type:0,index:K});else{const X=(0,S.parseColor)(H);X&&A.push({type:1,index:K,color:X})}}}return A.length&&this._onColor.fire(A),!0}setHyperlink(E){const A=E.split(";");return!(A.length<2)&&(A[1]?this._createHyperlink(A[0],A[1]):!A[0]&&this._finishHyperlink())}_createHyperlink(E,A){this._getCurrentLinkId()&&this._finishHyperlink();const P=E.split(":");let M;const H=P.findIndex(K=>K.startsWith("id="));return H!==-1&&(M=P[H].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:M,uri:A}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(E,A){const P=E.split(";");for(let M=0;M<P.length&&!(A>=this._specialColors.length);++M,++A)if(P[M]==="?")this._onColor.fire([{type:0,index:this._specialColors[A]}]);else{const H=(0,S.parseColor)(P[M]);H&&this._onColor.fire([{type:1,index:this._specialColors[A],color:H}])}return!0}setOrReportFgColor(E){return this._setOrReportSpecialColor(E,0)}setOrReportBgColor(E){return this._setOrReportSpecialColor(E,1)}setOrReportCursorColor(E){return this._setOrReportSpecialColor(E,2)}restoreIndexedColor(E){if(!E)return this._onColor.fire([{type:2}]),!0;const A=[],P=E.split(";");for(let M=0;M<P.length;++M)if(/^\d+$/.exec(P[M])){const H=parseInt(P[M]);j(H)&&A.push({type:2,index:H})}return A.length&&this._onColor.fire(A),!0}restoreFgColor(E){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(E){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(E){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,m.DEFAULT_CHARSET),!0}selectCharset(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(k[E[0]],m.CHARSETS[E[1]]||m.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 E=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,E,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=a.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=a.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(E){return this._charsetService.setgLevel(E),!0}screenAlignmentPattern(){const E=new c.CellData;E.content=4194373,E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg,this._setCursor(0,0);for(let A=0;A<this._bufferService.rows;++A){const P=this._activeBuffer.ybase+this._activeBuffer.y+A,M=this._activeBuffer.lines.get(P);M&&(M.fill(E),M.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(E,A){const P=this._bufferService.buffer,M=this._optionsService.rawOptions;return(H=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${H}${d.C0.ESC}\\`),!0))(E==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:E==='"p'?'P1$r61;1"p':E==="r"?`P1$r${P.scrollTop+1};${P.scrollBottom+1}r`:E==="m"?"P1$r0m":E===" q"?`P1$r${{block:2,underline:4,bar:6}[M.cursorStyle]-(M.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(E,A){this._dirtyRowTracker.markRangeDirty(E,A)}}l.InputHandler=z;let I=class{constructor($){this._bufferService=$,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty($){$<this.start?this.start=$:$>this.end&&(this.end=$)}markRangeDirty($,E){$>E&&(B=$,$=E,E=B),$<this.start&&(this.start=$),E>this.end&&(this.end=E)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function j($){return 0<=$&&$<256}I=f([y(0,v.IBufferService)],I)},844:(_,l)=>{function u(f){for(const y of f)y.dispose();f.length=0}Object.defineProperty(l,"__esModule",{value:!0}),l.getDisposeArrayDisposable=l.disposeArray=l.toDisposable=l.MutableDisposable=l.Disposable=void 0,l.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const f of this._disposables)f.dispose();this._disposables.length=0}register(f){return this._disposables.push(f),f}unregister(f){const y=this._disposables.indexOf(f);y!==-1&&this._disposables.splice(y,1)}},l.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var y;this._isDisposed||f===this._value||((y=this._value)===null||y===void 0||y.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)===null||f===void 0||f.dispose(),this._value=void 0}},l.toDisposable=function(f){return{dispose:f}},l.disposeArray=u,l.getDisposeArrayDisposable=function(f){return{dispose:()=>u(f)}}},1505:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.FourKeyMap=l.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(y,d,m){this._data[y]||(this._data[y]={}),this._data[y][d]=m}get(y,d){return this._data[y]?this._data[y][d]:void 0}clear(){this._data={}}}l.TwoKeyMap=u,l.FourKeyMap=class{constructor(){this._data=new u}set(f,y,d,m,C){this._data.get(f,y)||this._data.set(f,y,new u),this._data.get(f,y).set(d,m,C)}get(f,y,d,m){var C;return(C=this._data.get(f,y))===null||C===void 0?void 0:C.get(d,m)}clear(){this._data.clear()}}},6114:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.isChromeOS=l.isLinux=l.isWindows=l.isIphone=l.isIpad=l.isMac=l.getSafariVersion=l.isSafari=l.isLegacyEdge=l.isFirefox=l.isNode=void 0,l.isNode=typeof navigator>"u";const u=l.isNode?"node":navigator.userAgent,f=l.isNode?"node":navigator.platform;l.isFirefox=u.includes("Firefox"),l.isLegacyEdge=u.includes("Edge"),l.isSafari=/^((?!chrome|android).)*safari/i.test(u),l.getSafariVersion=function(){if(!l.isSafari)return 0;const y=u.match(/Version\/(\d+)/);return y===null||y.length<2?0:parseInt(y[1])},l.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),l.isIpad=f==="iPad",l.isIphone=f==="iPhone",l.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),l.isLinux=f.indexOf("Linux")>=0,l.isChromeOS=/\bCrOS\b/.test(u)},6106:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.SortedList=void 0;let u=0;l.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(u=this._search(this._getKey(f)),this._array.splice(u,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const y=this._getKey(f);if(y===void 0||(u=this._search(y),u===-1)||this._getKey(this._array[u])!==y)return!1;do if(this._array[u]===f)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===y);return!1}*getKeyIterator(f){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===f)}forEachByKey(f,y){if(this._array.length!==0&&(u=this._search(f),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===f))do y(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===f)}values(){return[...this._array].values()}_search(f){let y=0,d=this._array.length-1;for(;d>=y;){let m=y+d>>1;const C=this._getKey(this._array[m]);if(C>f)d=m-1;else{if(!(C<f)){for(;m>0&&this._getKey(this._array[m-1])===f;)m--;return m}y=m+1}}return y}}},7226:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DebouncedIdleTask=l.IdleTaskQueue=l.PriorityTaskQueue=void 0;const f=u(6114);class y{constructor(){this._tasks=[],this._i=0}enqueue(C){this._tasks.push(C),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(C){this._idleCallback=void 0;let w=0,g=0,a=C.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(w=Date.now(),this._tasks[this._i]()||this._i++,w=Math.max(1,Date.now()-w),g=Math.max(w,g),o=C.timeRemaining(),1.5*g>o)return a-w<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-w))}ms`),void this._start();a=o}this.clear()}}class d extends y{_requestCallback(C){return setTimeout(()=>C(this._createDeadline(16)))}_cancelCallback(C){clearTimeout(C)}_createDeadline(C){const w=Date.now()+C;return{timeRemaining:()=>Math.max(0,w-Date.now())}}}l.PriorityTaskQueue=d,l.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends y{_requestCallback(m){return requestIdleCallback(m)}_cancelCallback(m){cancelIdleCallback(m)}}:d,l.DebouncedIdleTask=class{constructor(){this._queue=new l.IdleTaskQueue}set(m){this._queue.clear(),this._queue.enqueue(m)}flush(){this._queue.flush()}}},9282:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.updateWindowsModeWrappedState=void 0;const f=u(643);l.updateWindowsModeWrappedState=function(y){const d=y.buffer.lines.get(y.buffer.ybase+y.buffer.y-1),m=d==null?void 0:d.get(y.cols-1),C=y.buffer.lines.get(y.buffer.ybase+y.buffer.y);C&&m&&(C.isWrapped=m[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&m[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ExtendedAttrs=l.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new f}static toColorRGB(d){return[d>>>16&255,d>>>8&255,255&d]}static fromColorRGB(d){return(255&d[0])<<16|(255&d[1])<<8|255&d[2]}clone(){const d=new u;return d.fg=this.fg,d.bg=this.bg,d.extended=this.extended.clone(),d}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}}l.AttributeData=u;class f{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(d){this._ext=d}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(d){this._ext&=-469762049,this._ext|=d<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(d){this._ext&=-67108864,this._ext|=67108863&d}get urlId(){return this._urlId}set urlId(d){this._urlId=d}constructor(d=0,m=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=m}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}l.ExtendedAttrs=f},9092:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Buffer=l.MAX_BUFFER_SIZE=void 0;const f=u(6349),y=u(7226),d=u(3734),m=u(8437),C=u(4634),w=u(511),g=u(643),a=u(4863),o=u(7116);l.MAX_BUFFER_SIZE=4294967295,l.Buffer=class{constructor(s,c,p){this._hasScrollback=s,this._optionsService=c,this._bufferService=p,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=m.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=w.CellData.fromCharData([0,g.NULL_CELL_CHAR,g.NULL_CELL_WIDTH,g.NULL_CELL_CODE]),this._whitespaceCell=w.CellData.fromCharData([0,g.WHITESPACE_CELL_CHAR,g.WHITESPACE_CELL_WIDTH,g.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 f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(s){return s?(this._nullCell.fg=s.fg,this._nullCell.bg=s.bg,this._nullCell.extended=s.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(s){return s?(this._whitespaceCell.fg=s.fg,this._whitespaceCell.bg=s.bg,this._whitespaceCell.extended=s.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(s,c){return new m.BufferLine(this._bufferService.cols,this.getNullCell(s),c)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const s=this.ybase+this.y-this.ydisp;return s>=0&&s<this._rows}_getCorrectBufferLength(s){if(!this._hasScrollback)return s;const c=s+this._optionsService.rawOptions.scrollback;return c>l.MAX_BUFFER_SIZE?l.MAX_BUFFER_SIZE:c}fillViewportRows(s){if(this.lines.length===0){s===void 0&&(s=m.DEFAULT_ATTR_DATA);let c=this._rows;for(;c--;)this.lines.push(this.getBlankLine(s))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(s,c){const p=this.getNullCell(m.DEFAULT_ATTR_DATA);let v=0;const x=this._getCorrectBufferLength(c);if(x>this.lines.maxLength&&(this.lines.maxLength=x),this.lines.length>0){if(this._cols<s)for(let S=0;S<this.lines.length;S++)v+=+this.lines.get(S).resize(s,p);let b=0;if(this._rows<c)for(let S=this._rows;S<c;S++)this.lines.length<c+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new m.BufferLine(s,p)):this.ybase>0&&this.lines.length<=this.ybase+this.y+b+1?(this.ybase--,b++,this.ydisp>0&&this.ydisp--):this.lines.push(new m.BufferLine(s,p)));else for(let S=this._rows;S>c;S--)this.lines.length>c+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(x<this.lines.maxLength){const S=this.lines.length-x;S>0&&(this.lines.trimStart(S),this.ybase=Math.max(this.ybase-S,0),this.ydisp=Math.max(this.ydisp-S,0),this.savedY=Math.max(this.savedY-S,0)),this.lines.maxLength=x}this.x=Math.min(this.x,s-1),this.y=Math.min(this.y,c-1),b&&(this.y+=b),this.savedX=Math.min(this.savedX,s-1),this.scrollTop=0}if(this.scrollBottom=c-1,this._isReflowEnabled&&(this._reflow(s,c),this._cols>s))for(let b=0;b<this.lines.length;b++)v+=+this.lines.get(b).resize(s,p);this._cols=s,this._rows=c,this._memoryCleanupQueue.clear(),v>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let s=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,s=!1);let c=0;for(;this._memoryCleanupPosition<this.lines.length;)if(c+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),c>100)return!0;return s}get _isReflowEnabled(){const s=this._optionsService.rawOptions.windowsPty;return s&&s.buildNumber?this._hasScrollback&&s.backend==="conpty"&&s.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(s,c){this._cols!==s&&(s>this._cols?this._reflowLarger(s,c):this._reflowSmaller(s,c))}_reflowLarger(s,c){const p=(0,C.reflowLargerGetLinesToRemove)(this.lines,this._cols,s,this.ybase+this.y,this.getNullCell(m.DEFAULT_ATTR_DATA));if(p.length>0){const v=(0,C.reflowLargerCreateNewLayout)(this.lines,p);(0,C.reflowLargerApplyNewLayout)(this.lines,v.layout),this._reflowLargerAdjustViewport(s,c,v.countRemoved)}}_reflowLargerAdjustViewport(s,c,p){const v=this.getNullCell(m.DEFAULT_ATTR_DATA);let x=p;for(;x-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<c&&this.lines.push(new m.BufferLine(s,v))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-p,0)}_reflowSmaller(s,c){const p=this.getNullCell(m.DEFAULT_ATTR_DATA),v=[];let x=0;for(let b=this.lines.length-1;b>=0;b--){let S=this.lines.get(b);if(!S||!S.isWrapped&&S.getTrimmedLength()<=s)continue;const k=[S];for(;S.isWrapped&&b>0;)S=this.lines.get(--b),k.unshift(S);const R=this.ybase+this.y;if(R>=b&&R<b+k.length)continue;const O=k[k.length-1].getTrimmedLength(),T=(0,C.reflowSmallerGetNewLineLengths)(k,this._cols,s),B=T.length-k.length;let z;z=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);const I=[];for(let M=0;M<B;M++){const H=this.getBlankLine(m.DEFAULT_ATTR_DATA,!0);I.push(H)}I.length>0&&(v.push({start:b+k.length+x,newLines:I}),x+=I.length),k.push(...I);let j=T.length-1,$=T[j];$===0&&(j--,$=T[j]);let E=k.length-B-1,A=O;for(;E>=0;){const M=Math.min(A,$);if(k[j]===void 0)break;if(k[j].copyCellsFrom(k[E],A-M,$-M,M,!0),$-=M,$===0&&(j--,$=T[j]),A-=M,A===0){E--;const H=Math.max(E,0);A=(0,C.getWrappedLineTrimmedLength)(k,H,this._cols)}}for(let M=0;M<k.length;M++)T[M]<s&&k[M].setCell(T[M],p);let P=B-z;for(;P-- >0;)this.ybase===0?this.y<c-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+x)-c&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+B,this.ybase+c-1)}if(v.length>0){const b=[],S=[];for(let j=0;j<this.lines.length;j++)S.push(this.lines.get(j));const k=this.lines.length;let R=k-1,O=0,T=v[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+x);let B=0;for(let j=Math.min(this.lines.maxLength-1,k+x-1);j>=0;j--)if(T&&T.start>R+B){for(let $=T.newLines.length-1;$>=0;$--)this.lines.set(j--,T.newLines[$]);j++,b.push({index:R+1,amount:T.newLines.length}),B+=T.newLines.length,T=v[++O]}else this.lines.set(j,S[R--]);let z=0;for(let j=b.length-1;j>=0;j--)b[j].index+=z,this.lines.onInsertEmitter.fire(b[j]),z+=b[j].amount;const I=Math.max(0,k+x-this.lines.maxLength);I>0&&this.lines.onTrimEmitter.fire(I)}}translateBufferLineToString(s,c,p=0,v){const x=this.lines.get(s);return x?x.translateToString(c,p,v):""}getWrappedRangeForLine(s){let c=s,p=s;for(;c>0&&this.lines.get(c).isWrapped;)c--;for(;p+1<this.lines.length&&this.lines.get(p+1).isWrapped;)p++;return{first:c,last:p}}setupTabStops(s){for(s!=null?this.tabs[s]||(s=this.prevStop(s)):(this.tabs={},s=0);s<this._cols;s+=this._optionsService.rawOptions.tabStopWidth)this.tabs[s]=!0}prevStop(s){for(s==null&&(s=this.x);!this.tabs[--s]&&s>0;);return s>=this._cols?this._cols-1:s<0?0:s}nextStop(s){for(s==null&&(s=this.x);!this.tabs[++s]&&s<this._cols;);return s>=this._cols?this._cols-1:s<0?0:s}clearMarkers(s){this._isClearing=!0;for(let c=0;c<this.markers.length;c++)this.markers[c].line===s&&(this.markers[c].dispose(),this.markers.splice(c--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let s=0;s<this.markers.length;s++)this.markers[s].dispose(),this.markers.splice(s--,1);this._isClearing=!1}addMarker(s){const c=new a.Marker(s);return this.markers.push(c),c.register(this.lines.onTrim(p=>{c.line-=p,c.line<0&&c.dispose()})),c.register(this.lines.onInsert(p=>{c.line>=p.index&&(c.line+=p.amount)})),c.register(this.lines.onDelete(p=>{c.line>=p.index&&c.line<p.index+p.amount&&c.dispose(),c.line>p.index&&(c.line-=p.amount)})),c.register(c.onDispose(()=>this._removeMarker(c))),c}_removeMarker(s){this._isClearing||this.markers.splice(this.markers.indexOf(s),1)}}},8437:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLine=l.DEFAULT_ATTR_DATA=void 0;const f=u(3734),y=u(511),d=u(643),m=u(482);l.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let C=0;class w{constructor(a,o,s=!1){this.isWrapped=s,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*a);const c=o||y.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let p=0;p<a;++p)this.setCell(p,c);this.length=a}get(a){const o=this._data[3*a+0],s=2097151&o;return[this._data[3*a+1],2097152&o?this._combined[a]:s?(0,m.stringFromCodePoint)(s):"",o>>22,2097152&o?this._combined[a].charCodeAt(this._combined[a].length-1):s]}set(a,o){this._data[3*a+1]=o[d.CHAR_DATA_ATTR_INDEX],o[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[a]=o[1],this._data[3*a+0]=2097152|a|o[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*a+0]=o[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|o[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(a){return this._data[3*a+0]>>22}hasWidth(a){return 12582912&this._data[3*a+0]}getFg(a){return this._data[3*a+1]}getBg(a){return this._data[3*a+2]}hasContent(a){return 4194303&this._data[3*a+0]}getCodePoint(a){const o=this._data[3*a+0];return 2097152&o?this._combined[a].charCodeAt(this._combined[a].length-1):2097151&o}isCombined(a){return 2097152&this._data[3*a+0]}getString(a){const o=this._data[3*a+0];return 2097152&o?this._combined[a]:2097151&o?(0,m.stringFromCodePoint)(2097151&o):""}isProtected(a){return 536870912&this._data[3*a+2]}loadCell(a,o){return C=3*a,o.content=this._data[C+0],o.fg=this._data[C+1],o.bg=this._data[C+2],2097152&o.content&&(o.combinedData=this._combined[a]),268435456&o.bg&&(o.extended=this._extendedAttrs[a]),o}setCell(a,o){2097152&o.content&&(this._combined[a]=o.combinedData),268435456&o.bg&&(this._extendedAttrs[a]=o.extended),this._data[3*a+0]=o.content,this._data[3*a+1]=o.fg,this._data[3*a+2]=o.bg}setCellFromCodePoint(a,o,s,c,p,v){268435456&p&&(this._extendedAttrs[a]=v),this._data[3*a+0]=o|s<<22,this._data[3*a+1]=c,this._data[3*a+2]=p}addCodepointToCell(a,o){let s=this._data[3*a+0];2097152&s?this._combined[a]+=(0,m.stringFromCodePoint)(o):(2097151&s?(this._combined[a]=(0,m.stringFromCodePoint)(2097151&s)+(0,m.stringFromCodePoint)(o),s&=-2097152,s|=2097152):s=o|4194304,this._data[3*a+0]=s)}insertCells(a,o,s,c){if((a%=this.length)&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),o<this.length-a){const p=new y.CellData;for(let v=this.length-a-o-1;v>=0;--v)this.setCell(a+o+v,this.loadCell(a+v,p));for(let v=0;v<o;++v)this.setCell(a+v,s)}else for(let p=a;p<this.length;++p)this.setCell(p,s);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs)}deleteCells(a,o,s,c){if(a%=this.length,o<this.length-a){const p=new y.CellData;for(let v=0;v<this.length-a-o;++v)this.setCell(a+v,this.loadCell(a+o+v,p));for(let v=this.length-o;v<this.length;++v)this.setCell(v,s)}else for(let p=a;p<this.length;++p)this.setCell(p,s);a&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),this.getWidth(a)!==0||this.hasContent(a)||this.setCellFromCodePoint(a,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs)}replaceCells(a,o,s,c,p=!1){if(p)for(a&&this.getWidth(a-1)===2&&!this.isProtected(a-1)&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&!this.isProtected(o)&&this.setCellFromCodePoint(o,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs);a<o&&a<this.length;)this.isProtected(a)||this.setCell(a,s),a++;else for(a&&this.getWidth(a-1)===2&&this.setCellFromCodePoint(a-1,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs),o<this.length&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o,0,1,(c==null?void 0:c.fg)||0,(c==null?void 0:c.bg)||0,(c==null?void 0:c.extended)||new f.ExtendedAttrs);a<o&&a<this.length;)this.setCell(a++,s)}resize(a,o){if(a===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const s=3*a;if(a>this.length){if(this._data.buffer.byteLength>=4*s)this._data=new Uint32Array(this._data.buffer,0,s);else{const c=new Uint32Array(s);c.set(this._data),this._data=c}for(let c=this.length;c<a;++c)this.setCell(c,o)}else{this._data=this._data.subarray(0,s);const c=Object.keys(this._combined);for(let v=0;v<c.length;v++){const x=parseInt(c[v],10);x>=a&&delete this._combined[x]}const p=Object.keys(this._extendedAttrs);for(let v=0;v<p.length;v++){const x=parseInt(p[v],10);x>=a&&delete this._extendedAttrs[x]}}return this.length=a,4*s*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const a=new Uint32Array(this._data.length);return a.set(this._data),this._data=a,1}return 0}fill(a,o=!1){if(o)for(let s=0;s<this.length;++s)this.isProtected(s)||this.setCell(s,a);else{this._combined={},this._extendedAttrs={};for(let s=0;s<this.length;++s)this.setCell(s,a)}}copyFrom(a){this.length!==a.length?this._data=new Uint32Array(a._data):this._data.set(a._data),this.length=a.length,this._combined={};for(const o in a._combined)this._combined[o]=a._combined[o];this._extendedAttrs={};for(const o in a._extendedAttrs)this._extendedAttrs[o]=a._extendedAttrs[o];this.isWrapped=a.isWrapped}clone(){const a=new w(0);a._data=new Uint32Array(this._data),a.length=this.length;for(const o in this._combined)a._combined[o]=this._combined[o];for(const o in this._extendedAttrs)a._extendedAttrs[o]=this._extendedAttrs[o];return a.isWrapped=this.isWrapped,a}getTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0])return a+(this._data[3*a+0]>>22);return 0}getNoBgTrimmedLength(){for(let a=this.length-1;a>=0;--a)if(4194303&this._data[3*a+0]||50331648&this._data[3*a+2])return a+(this._data[3*a+0]>>22);return 0}copyCellsFrom(a,o,s,c,p){const v=a._data;if(p)for(let b=c-1;b>=0;b--){for(let S=0;S<3;S++)this._data[3*(s+b)+S]=v[3*(o+b)+S];268435456&v[3*(o+b)+2]&&(this._extendedAttrs[s+b]=a._extendedAttrs[o+b])}else for(let b=0;b<c;b++){for(let S=0;S<3;S++)this._data[3*(s+b)+S]=v[3*(o+b)+S];268435456&v[3*(o+b)+2]&&(this._extendedAttrs[s+b]=a._extendedAttrs[o+b])}const x=Object.keys(a._combined);for(let b=0;b<x.length;b++){const S=parseInt(x[b],10);S>=o&&(this._combined[S-o+s]=a._combined[S])}}translateToString(a=!1,o=0,s=this.length){a&&(s=Math.min(s,this.getTrimmedLength()));let c="";for(;o<s;){const p=this._data[3*o+0],v=2097151&p;c+=2097152&p?this._combined[o]:v?(0,m.stringFromCodePoint)(v):d.WHITESPACE_CELL_CHAR,o+=p>>22||1}return c}}l.BufferLine=w},4841:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.getRangeLength=void 0,l.getRangeLength=function(u,f){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return f*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(_,l)=>{function u(f,y,d){if(y===f.length-1)return f[y].getTrimmedLength();const m=!f[y].hasContent(d-1)&&f[y].getWidth(d-1)===1,C=f[y+1].getWidth(0)===2;return m&&C?d-1:d}Object.defineProperty(l,"__esModule",{value:!0}),l.getWrappedLineTrimmedLength=l.reflowSmallerGetNewLineLengths=l.reflowLargerApplyNewLayout=l.reflowLargerCreateNewLayout=l.reflowLargerGetLinesToRemove=void 0,l.reflowLargerGetLinesToRemove=function(f,y,d,m,C){const w=[];for(let g=0;g<f.length-1;g++){let a=g,o=f.get(++a);if(!o.isWrapped)continue;const s=[f.get(g)];for(;a<f.length&&o.isWrapped;)s.push(o),o=f.get(++a);if(m>=g&&m<a){g+=s.length-1;continue}let c=0,p=u(s,c,y),v=1,x=0;for(;v<s.length;){const S=u(s,v,y),k=S-x,R=d-p,O=Math.min(k,R);s[c].copyCellsFrom(s[v],x,p,O,!1),p+=O,p===d&&(c++,p=0),x+=O,x===S&&(v++,x=0),p===0&&c!==0&&s[c-1].getWidth(d-1)===2&&(s[c].copyCellsFrom(s[c-1],d-1,p++,1,!1),s[c-1].setCell(d-1,C))}s[c].replaceCells(p,d,C);let b=0;for(let S=s.length-1;S>0&&(S>c||s[S].getTrimmedLength()===0);S--)b++;b>0&&(w.push(g+s.length-b),w.push(b)),g+=s.length-1}return w},l.reflowLargerCreateNewLayout=function(f,y){const d=[];let m=0,C=y[m],w=0;for(let g=0;g<f.length;g++)if(C===g){const a=y[++m];f.onDeleteEmitter.fire({index:g-w,amount:a}),g+=a-1,w+=a,C=y[++m]}else d.push(g);return{layout:d,countRemoved:w}},l.reflowLargerApplyNewLayout=function(f,y){const d=[];for(let m=0;m<y.length;m++)d.push(f.get(y[m]));for(let m=0;m<d.length;m++)f.set(m,d[m]);f.length=y.length},l.reflowSmallerGetNewLineLengths=function(f,y,d){const m=[],C=f.map((o,s)=>u(f,s,y)).reduce((o,s)=>o+s);let w=0,g=0,a=0;for(;a<C;){if(C-a<d){m.push(C-a);break}w+=d;const o=u(f,g,y);w>o&&(w-=o,g++);const s=f[g].getWidth(w-1)===2;s&&w--;const c=s?d-1:d;m.push(c),a+=c}return m},l.getWrappedLineTrimmedLength=u},5295:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferSet=void 0;const f=u(8460),y=u(844),d=u(9092);class m extends y.Disposable{constructor(w,g){super(),this._optionsService=w,this._bufferService=g,this._onBufferActivate=this.register(new f.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 d.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new d.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,g){this._normal.resize(w,g),this._alt.resize(w,g),this.setupTabStops(w)}setupTabStops(w){this._normal.setupTabStops(w),this._alt.setupTabStops(w)}}l.BufferSet=m},511:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CellData=void 0;const f=u(482),y=u(643),d=u(3734);class m extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(w){const g=new m;return g.setFromCharData(w),g}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,f.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 g=!1;if(w[y.CHAR_DATA_CHAR_INDEX].length>2)g=!0;else if(w[y.CHAR_DATA_CHAR_INDEX].length===2){const a=w[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=a&&a<=56319){const o=w[y.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=o&&o<=57343?this.content=1024*(a-55296)+o-56320+65536|w[y.CHAR_DATA_WIDTH_INDEX]<<22:g=!0}else g=!0}else this.content=w[y.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|w[y.CHAR_DATA_WIDTH_INDEX]<<22;g&&(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()]}}l.CellData=m},643:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WHITESPACE_CELL_CODE=l.WHITESPACE_CELL_WIDTH=l.WHITESPACE_CELL_CHAR=l.NULL_CELL_CODE=l.NULL_CELL_WIDTH=l.NULL_CELL_CHAR=l.CHAR_DATA_CODE_INDEX=l.CHAR_DATA_WIDTH_INDEX=l.CHAR_DATA_CHAR_INDEX=l.CHAR_DATA_ATTR_INDEX=l.DEFAULT_EXT=l.DEFAULT_ATTR=l.DEFAULT_COLOR=void 0,l.DEFAULT_COLOR=0,l.DEFAULT_ATTR=256|l.DEFAULT_COLOR<<9,l.DEFAULT_EXT=0,l.CHAR_DATA_ATTR_INDEX=0,l.CHAR_DATA_CHAR_INDEX=1,l.CHAR_DATA_WIDTH_INDEX=2,l.CHAR_DATA_CODE_INDEX=3,l.NULL_CELL_CHAR="",l.NULL_CELL_WIDTH=1,l.NULL_CELL_CODE=0,l.WHITESPACE_CELL_CHAR=" ",l.WHITESPACE_CELL_WIDTH=1,l.WHITESPACE_CELL_CODE=32},4863:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Marker=void 0;const f=u(8460),y=u(844);class d{get id(){return this._id}constructor(C){this.line=C,this.isDisposed=!1,this._disposables=[],this._id=d._nextId++,this._onDispose=this.register(new f.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(C){return this._disposables.push(C),C}}l.Marker=d,d._nextId=1},7116:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DEFAULT_CHARSET=l.CHARSETS=void 0,l.CHARSETS={},l.DEFAULT_CHARSET=l.CHARSETS.B,l.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:"≥","{":"π","|":"≠","}":"£","~":"·"},l.CHARSETS.A={"#":"£"},l.CHARSETS.B=void 0,l.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},l.CHARSETS.C=l.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},l.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},l.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},l.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},l.CHARSETS.E=l.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},l.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},l.CHARSETS.H=l.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},l.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(_,l)=>{var u,f,y;Object.defineProperty(l,"__esModule",{value:!0}),l.C1_ESCAPED=l.C1=l.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
47
+ `,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL=""}(u||(l.C0=u={})),function(d){d.PAD="€",d.HOP="",d.BPH="‚",d.NBH="ƒ",d.IND="„",d.NEL="…",d.SSA="†",d.ESA="‡",d.HTS="ˆ",d.HTJ="‰",d.VTS="Š",d.PLD="‹",d.PLU="Œ",d.RI="",d.SS2="Ž",d.SS3="",d.DCS="",d.PU1="‘",d.PU2="’",d.STS="“",d.CCH="”",d.MW="•",d.SPA="–",d.EPA="—",d.SOS="˜",d.SGCI="™",d.SCI="š",d.CSI="›",d.ST="œ",d.OSC="",d.PM="ž",d.APC="Ÿ"}(f||(l.C1=f={})),function(d){d.ST=`${u.ESC}\\`}(y||(l.C1_ESCAPED=y={}))},7399:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.evaluateKeyboardEvent=void 0;const f=u(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:["'",'"']};l.evaluateKeyboardEvent=function(d,m,C,w){const g={type:0,cancel:!1,key:void 0},a=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?g.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?g.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?g.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(g.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:if(d.altKey){g.key=f.C0.ESC+f.C0.DEL;break}g.key=f.C0.DEL;break;case 9:if(d.shiftKey){g.key=f.C0.ESC+"[Z";break}g.key=f.C0.HT,g.cancel=!0;break;case 13:g.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,g.cancel=!0;break;case 27:g.key=f.C0.ESC,d.altKey&&(g.key=f.C0.ESC+f.C0.ESC),g.cancel=!0;break;case 37:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"D",g.key===f.C0.ESC+"[1;3D"&&(g.key=f.C0.ESC+(C?"b":"[1;5D"))):g.key=m?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"C",g.key===f.C0.ESC+"[1;3C"&&(g.key=f.C0.ESC+(C?"f":"[1;5C"))):g.key=m?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"A",C||g.key!==f.C0.ESC+"[1;3A"||(g.key=f.C0.ESC+"[1;5A")):g.key=m?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;a?(g.key=f.C0.ESC+"[1;"+(a+1)+"B",C||g.key!==f.C0.ESC+"[1;3B"||(g.key=f.C0.ESC+"[1;5B")):g.key=m?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(g.key=f.C0.ESC+"[2~");break;case 46:g.key=a?f.C0.ESC+"[3;"+(a+1)+"~":f.C0.ESC+"[3~";break;case 36:g.key=a?f.C0.ESC+"[1;"+(a+1)+"H":m?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:g.key=a?f.C0.ESC+"[1;"+(a+1)+"F":m?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?g.type=2:d.ctrlKey?g.key=f.C0.ESC+"[5;"+(a+1)+"~":g.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?g.type=3:d.ctrlKey?g.key=f.C0.ESC+"[6;"+(a+1)+"~":g.key=f.C0.ESC+"[6~";break;case 112:g.key=a?f.C0.ESC+"[1;"+(a+1)+"P":f.C0.ESC+"OP";break;case 113:g.key=a?f.C0.ESC+"[1;"+(a+1)+"Q":f.C0.ESC+"OQ";break;case 114:g.key=a?f.C0.ESC+"[1;"+(a+1)+"R":f.C0.ESC+"OR";break;case 115:g.key=a?f.C0.ESC+"[1;"+(a+1)+"S":f.C0.ESC+"OS";break;case 116:g.key=a?f.C0.ESC+"[15;"+(a+1)+"~":f.C0.ESC+"[15~";break;case 117:g.key=a?f.C0.ESC+"[17;"+(a+1)+"~":f.C0.ESC+"[17~";break;case 118:g.key=a?f.C0.ESC+"[18;"+(a+1)+"~":f.C0.ESC+"[18~";break;case 119:g.key=a?f.C0.ESC+"[19;"+(a+1)+"~":f.C0.ESC+"[19~";break;case 120:g.key=a?f.C0.ESC+"[20;"+(a+1)+"~":f.C0.ESC+"[20~";break;case 121:g.key=a?f.C0.ESC+"[21;"+(a+1)+"~":f.C0.ESC+"[21~";break;case 122:g.key=a?f.C0.ESC+"[23;"+(a+1)+"~":f.C0.ESC+"[23~";break;case 123:g.key=a?f.C0.ESC+"[24;"+(a+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(C&&!w||!d.altKey||d.metaKey)!C||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?g.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(g.key=f.C0.US),d.key==="@"&&(g.key=f.C0.NUL)):d.keyCode===65&&(g.type=1);else{const o=y[d.keyCode],s=o==null?void 0:o[d.shiftKey?1:0];if(s)g.key=f.C0.ESC+s;else if(d.keyCode>=65&&d.keyCode<=90){const c=d.ctrlKey?d.keyCode-64:d.keyCode+32;let p=String.fromCharCode(c);d.shiftKey&&(p=p.toUpperCase()),g.key=f.C0.ESC+p}else if(d.keyCode===32)g.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let c=d.code.slice(3,4);d.shiftKey||(c=c.toLowerCase()),g.key=f.C0.ESC+c,g.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?g.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?g.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?g.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?g.key=f.C0.DEL:d.keyCode===219?g.key=f.C0.ESC:d.keyCode===220?g.key=f.C0.FS:d.keyCode===221&&(g.key=f.C0.GS)}return g}},482:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Utf8ToUtf32=l.StringToUtf32=l.utf32ToString=l.stringFromCodePoint=void 0,l.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},l.utf32ToString=function(u,f=0,y=u.length){let d="";for(let m=f;m<y;++m){let C=u[m];C>65535?(C-=65536,d+=String.fromCharCode(55296+(C>>10))+String.fromCharCode(C%1024+56320)):d+=String.fromCharCode(C)}return d},l.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,f){const y=u.length;if(!y)return 0;let d=0,m=0;if(this._interim){const C=u.charCodeAt(m++);56320<=C&&C<=57343?f[d++]=1024*(this._interim-55296)+C-56320+65536:(f[d++]=this._interim,f[d++]=C),this._interim=0}for(let C=m;C<y;++C){const w=u.charCodeAt(C);if(55296<=w&&w<=56319){if(++C>=y)return this._interim=w,d;const g=u.charCodeAt(C);56320<=g&&g<=57343?f[d++]=1024*(w-55296)+g-56320+65536:(f[d++]=w,f[d++]=g)}else w!==65279&&(f[d++]=w)}return d}},l.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,f){const y=u.length;if(!y)return 0;let d,m,C,w,g=0,a=0,o=0;if(this.interim[0]){let p=!1,v=this.interim[0];v&=(224&v)==192?31:(240&v)==224?15:7;let x,b=0;for(;(x=63&this.interim[++b])&&b<4;)v<<=6,v|=x;const S=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,k=S-b;for(;o<k;){if(o>=y)return 0;if(x=u[o++],(192&x)!=128){o--,p=!0;break}this.interim[b++]=x,v<<=6,v|=63&x}p||(S===2?v<128?o--:f[g++]=v:S===3?v<2048||v>=55296&&v<=57343||v===65279||(f[g++]=v):v<65536||v>1114111||(f[g++]=v)),this.interim.fill(0)}const s=y-4;let c=o;for(;c<y;){for(;!(!(c<s)||128&(d=u[c])||128&(m=u[c+1])||128&(C=u[c+2])||128&(w=u[c+3]));)f[g++]=d,f[g++]=m,f[g++]=C,f[g++]=w,c+=4;if(d=u[c++],d<128)f[g++]=d;else if((224&d)==192){if(c>=y)return this.interim[0]=d,g;if(m=u[c++],(192&m)!=128){c--;continue}if(a=(31&d)<<6|63&m,a<128){c--;continue}f[g++]=a}else if((240&d)==224){if(c>=y)return this.interim[0]=d,g;if(m=u[c++],(192&m)!=128){c--;continue}if(c>=y)return this.interim[0]=d,this.interim[1]=m,g;if(C=u[c++],(192&C)!=128){c--;continue}if(a=(15&d)<<12|(63&m)<<6|63&C,a<2048||a>=55296&&a<=57343||a===65279)continue;f[g++]=a}else if((248&d)==240){if(c>=y)return this.interim[0]=d,g;if(m=u[c++],(192&m)!=128){c--;continue}if(c>=y)return this.interim[0]=d,this.interim[1]=m,g;if(C=u[c++],(192&C)!=128){c--;continue}if(c>=y)return this.interim[0]=d,this.interim[1]=m,this.interim[2]=C,g;if(w=u[c++],(192&w)!=128){c--;continue}if(a=(7&d)<<18|(63&m)<<12|(63&C)<<6|63&w,a<65536||a>1114111)continue;f[g++]=a}}return g}}},225:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV6=void 0;const u=[[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]],f=[[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 y;l.UnicodeV6=class{constructor(){if(this.version="6",!y){y=new Uint8Array(65536),y.fill(1),y[0]=0,y.fill(0,1,32),y.fill(0,127,160),y.fill(2,4352,4448),y[9001]=2,y[9002]=2,y.fill(2,11904,42192),y[12351]=1,y.fill(2,44032,55204),y.fill(2,63744,64256),y.fill(2,65040,65050),y.fill(2,65072,65136),y.fill(2,65280,65377),y.fill(2,65504,65511);for(let d=0;d<u.length;++d)y.fill(0,u[d][0],u[d][1]+1)}}wcwidth(d){return d<32?0:d<127?1:d<65536?y[d]:function(m,C){let w,g=0,a=C.length-1;if(m<C[0][0]||m>C[a][1])return!1;for(;a>=g;)if(w=g+a>>1,m>C[w][1])g=w+1;else{if(!(m<C[w][0]))return!0;a=w-1}return!1}(d,f)?0:d>=131072&&d<=196605||d>=196608&&d<=262141?2:1}}},5981:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.WriteBuffer=void 0;const f=u(8460),y=u(844);class d extends y.Disposable{constructor(C){super(),this._action=C,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(C,w){if(w!==void 0&&this._syncCalls>w)return void(this._syncCalls=0);if(this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let g;for(this._isSyncWriting=!0;g=this._writeBuffer.shift();){this._action(g);const a=this._callbacks.shift();a&&a()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(C,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+=C.length,this._writeBuffer.push(C),this._callbacks.push(w),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=C.length,this._writeBuffer.push(C),this._callbacks.push(w)}_innerWrite(C=0,w=!0){const g=C||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const a=this._writeBuffer[this._bufferOffset],o=this._action(a,w);if(o){const c=p=>Date.now()-g>=12?setTimeout(()=>this._innerWrite(0,p)):this._innerWrite(g,p);return void o.catch(p=>(queueMicrotask(()=>{throw p}),Promise.resolve(!1))).then(c)}const s=this._callbacks[this._bufferOffset];if(s&&s(),this._bufferOffset++,this._pendingData-=a.length,Date.now()-g>=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()}}l.WriteBuffer=d},5941:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.toRgbString=l.parseColor=void 0;const u=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,f=/^[\da-f]+$/;function y(d,m){const C=d.toString(16),w=C.length<2?"0"+C:C;switch(m){case 4:return C[0];case 8:return w;case 12:return(w+w).slice(0,3);default:return w+w}}l.parseColor=function(d){if(!d)return;let m=d.toLowerCase();if(m.indexOf("rgb:")===0){m=m.slice(4);const C=u.exec(m);if(C){const w=C[1]?15:C[4]?255:C[7]?4095:65535;return[Math.round(parseInt(C[1]||C[4]||C[7]||C[10],16)/w*255),Math.round(parseInt(C[2]||C[5]||C[8]||C[11],16)/w*255),Math.round(parseInt(C[3]||C[6]||C[9]||C[12],16)/w*255)]}}else if(m.indexOf("#")===0&&(m=m.slice(1),f.exec(m)&&[3,6,9,12].includes(m.length))){const C=m.length/3,w=[0,0,0];for(let g=0;g<3;++g){const a=parseInt(m.slice(C*g,C*g+C),16);w[g]=C===1?a<<4:C===2?a:C===3?a>>4:a>>8}return w}},l.toRgbString=function(d,m=16){const[C,w,g]=d;return`rgb:${y(C,m)}/${y(w,m)}/${y(g,m)}`}},5770:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.PAYLOAD_LIMIT=void 0,l.PAYLOAD_LIMIT=1e7},6351:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DcsHandler=l.DcsParser=void 0;const f=u(482),y=u(8742),d=u(5770),m=[];l.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=m,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=m}registerHandler(w,g){this._handlers[w]===void 0&&(this._handlers[w]=[]);const a=this._handlers[w];return a.push(g),{dispose:()=>{const o=a.indexOf(g);o!==-1&&a.splice(o,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=m,this._ident=0}hook(w,g){if(this.reset(),this._ident=w,this._active=this._handlers[w]||m,this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].hook(g);else this._handlerFb(this._ident,"HOOK",g)}put(w,g,a){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(w,g,a);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(w,g,a))}unhook(w,g=!0){if(this._active.length){let a=!1,o=this._active.length-1,s=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,a=g,s=this._stack.fallThrough,this._stack.paused=!1),!s&&a===!1){for(;o>=0&&(a=this._active[o].unhook(w),a!==!0);o--)if(a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,a;o--}for(;o>=0;o--)if(a=this._active[o].unhook(!1),a instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,a}else this._handlerFb(this._ident,"UNHOOK",w);this._active=m,this._ident=0}};const C=new y.Params;C.addParam(0),l.DcsHandler=class{constructor(w){this._handler=w,this._data="",this._params=C,this._hitLimit=!1}hook(w){this._params=w.length>1||w.params[0]?w.clone():C,this._data="",this._hitLimit=!1}put(w,g,a){this._hitLimit||(this._data+=(0,f.utf32ToString)(w,g,a),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(w){let g=!1;if(this._hitLimit)g=!1;else if(w&&(g=this._handler(this._data,this._params),g instanceof Promise))return g.then(a=>(this._params=C,this._data="",this._hitLimit=!1,a));return this._params=C,this._data="",this._hitLimit=!1,g}}},2015:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.EscapeSequenceParser=l.VT500_TRANSITION_TABLE=l.TransitionTable=void 0;const f=u(844),y=u(8742),d=u(6242),m=u(6351);class C{constructor(o){this.table=new Uint8Array(o)}setDefault(o,s){this.table.fill(o<<4|s)}add(o,s,c,p){this.table[s<<8|o]=c<<4|p}addMany(o,s,c,p){for(let v=0;v<o.length;v++)this.table[s<<8|o[v]]=c<<4|p}}l.TransitionTable=C;const w=160;l.VT500_TRANSITION_TABLE=function(){const a=new C(4095),o=Array.apply(null,Array(256)).map((b,S)=>S),s=(b,S)=>o.slice(b,S),c=s(32,127),p=s(0,24);p.push(25),p.push.apply(p,s(28,32));const v=s(0,14);let x;for(x in a.setDefault(1,0),a.addMany(c,0,2,0),v)a.addMany([24,26,153,154],x,3,0),a.addMany(s(128,144),x,3,0),a.addMany(s(144,152),x,3,0),a.add(156,x,0,0),a.add(27,x,11,1),a.add(157,x,4,8),a.addMany([152,158,159],x,0,7),a.add(155,x,11,3),a.add(144,x,11,9);return a.addMany(p,0,3,0),a.addMany(p,1,3,1),a.add(127,1,0,1),a.addMany(p,8,0,8),a.addMany(p,3,3,3),a.add(127,3,0,3),a.addMany(p,4,3,4),a.add(127,4,0,4),a.addMany(p,6,3,6),a.addMany(p,5,3,5),a.add(127,5,0,5),a.addMany(p,2,3,2),a.add(127,2,0,2),a.add(93,1,4,8),a.addMany(c,8,5,8),a.add(127,8,5,8),a.addMany([156,27,24,26,7],8,6,0),a.addMany(s(28,32),8,0,8),a.addMany([88,94,95],1,0,7),a.addMany(c,7,0,7),a.addMany(p,7,0,7),a.add(156,7,0,0),a.add(127,7,0,7),a.add(91,1,11,3),a.addMany(s(64,127),3,7,0),a.addMany(s(48,60),3,8,4),a.addMany([60,61,62,63],3,9,4),a.addMany(s(48,60),4,8,4),a.addMany(s(64,127),4,7,0),a.addMany([60,61,62,63],4,0,6),a.addMany(s(32,64),6,0,6),a.add(127,6,0,6),a.addMany(s(64,127),6,0,0),a.addMany(s(32,48),3,9,5),a.addMany(s(32,48),5,9,5),a.addMany(s(48,64),5,0,6),a.addMany(s(64,127),5,7,0),a.addMany(s(32,48),4,9,5),a.addMany(s(32,48),1,9,2),a.addMany(s(32,48),2,9,2),a.addMany(s(48,127),2,10,0),a.addMany(s(48,80),1,10,0),a.addMany(s(81,88),1,10,0),a.addMany([89,90,92],1,10,0),a.addMany(s(96,127),1,10,0),a.add(80,1,11,9),a.addMany(p,9,0,9),a.add(127,9,0,9),a.addMany(s(28,32),9,0,9),a.addMany(s(32,48),9,9,12),a.addMany(s(48,60),9,8,10),a.addMany([60,61,62,63],9,9,10),a.addMany(p,11,0,11),a.addMany(s(32,128),11,0,11),a.addMany(s(28,32),11,0,11),a.addMany(p,10,0,10),a.add(127,10,0,10),a.addMany(s(28,32),10,0,10),a.addMany(s(48,60),10,8,10),a.addMany([60,61,62,63],10,0,11),a.addMany(s(32,48),10,9,12),a.addMany(p,12,0,12),a.add(127,12,0,12),a.addMany(s(28,32),12,0,12),a.addMany(s(32,48),12,9,12),a.addMany(s(48,64),12,0,11),a.addMany(s(64,127),12,12,13),a.addMany(s(64,127),10,12,13),a.addMany(s(64,127),9,12,13),a.addMany(p,13,13,13),a.addMany(c,13,13,13),a.add(127,13,0,13),a.addMany([27,156,24,26],13,14,0),a.add(w,0,2,0),a.add(w,8,5,8),a.add(w,6,0,6),a.add(w,11,0,11),a.add(w,13,13,13),a}();class g extends f.Disposable{constructor(o=l.VT500_TRANSITION_TABLE){super(),this._transitions=o,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.precedingCodepoint=0,this._printHandlerFb=(s,c,p)=>{},this._executeHandlerFb=s=>{},this._csiHandlerFb=(s,c)=>{},this._escHandlerFb=s=>{},this._errorHandlerFb=s=>s,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,f.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new d.OscParser),this._dcsParser=this.register(new m.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(o,s=[64,126]){let c=0;if(o.prefix){if(o.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=o.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(o.intermediates){if(o.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let v=0;v<o.intermediates.length;++v){const x=o.intermediates.charCodeAt(v);if(32>x||x>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=x}}if(o.final.length!==1)throw new Error("final must be a single byte");const p=o.final.charCodeAt(0);if(s[0]>p||p>s[1])throw new Error(`final must be in range ${s[0]} .. ${s[1]}`);return c<<=8,c|=p,c}identToString(o){const s=[];for(;o;)s.push(String.fromCharCode(255&o)),o>>=8;return s.reverse().join("")}setPrintHandler(o){this._printHandler=o}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(o,s){const c=this._identifier(o,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);const p=this._escHandlers[c];return p.push(s),{dispose:()=>{const v=p.indexOf(s);v!==-1&&p.splice(v,1)}}}clearEscHandler(o){this._escHandlers[this._identifier(o,[48,126])]&&delete this._escHandlers[this._identifier(o,[48,126])]}setEscHandlerFallback(o){this._escHandlerFb=o}setExecuteHandler(o,s){this._executeHandlers[o.charCodeAt(0)]=s}clearExecuteHandler(o){this._executeHandlers[o.charCodeAt(0)]&&delete this._executeHandlers[o.charCodeAt(0)]}setExecuteHandlerFallback(o){this._executeHandlerFb=o}registerCsiHandler(o,s){const c=this._identifier(o);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);const p=this._csiHandlers[c];return p.push(s),{dispose:()=>{const v=p.indexOf(s);v!==-1&&p.splice(v,1)}}}clearCsiHandler(o){this._csiHandlers[this._identifier(o)]&&delete this._csiHandlers[this._identifier(o)]}setCsiHandlerFallback(o){this._csiHandlerFb=o}registerDcsHandler(o,s){return this._dcsParser.registerHandler(this._identifier(o),s)}clearDcsHandler(o){this._dcsParser.clearHandler(this._identifier(o))}setDcsHandlerFallback(o){this._dcsParser.setHandlerFallback(o)}registerOscHandler(o,s){return this._oscParser.registerHandler(o,s)}clearOscHandler(o){this._oscParser.clearHandler(o)}setOscHandlerFallback(o){this._oscParser.setHandlerFallback(o)}setErrorHandler(o){this._errorHandler=o}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.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(o,s,c,p,v){this._parseStack.state=o,this._parseStack.handlers=s,this._parseStack.handlerPos=c,this._parseStack.transition=p,this._parseStack.chunkPos=v}parse(o,s,c){let p,v=0,x=0,b=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,b=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const S=this._parseStack.handlers;let k=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&k>-1){for(;k>=0&&(p=S[k](this._params),p!==!0);k--)if(p instanceof Promise)return this._parseStack.handlerPos=k,p}this._parseStack.handlers=[];break;case 4:if(c===!1&&k>-1){for(;k>=0&&(p=S[k](),p!==!0);k--)if(p instanceof Promise)return this._parseStack.handlerPos=k,p}this._parseStack.handlers=[];break;case 6:if(v=o[this._parseStack.chunkPos],p=this._dcsParser.unhook(v!==24&&v!==26,c),p)return p;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(v=o[this._parseStack.chunkPos],p=this._oscParser.end(v!==24&&v!==26,c),p)return p;v===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,b=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let S=b;S<s;++S){switch(v=o[S],x=this._transitions.table[this.currentState<<8|(v<160?v:w)],x>>4){case 2:for(let B=S+1;;++B){if(B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,S,B),S=B-1;break}if(++B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,S,B),S=B-1;break}if(++B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,S,B),S=B-1;break}if(++B>=s||(v=o[B])<32||v>126&&v<w){this._printHandler(o,S,B),S=B-1;break}}break;case 3:this._executeHandlers[v]?this._executeHandlers[v]():this._executeHandlerFb(v),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:v,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const k=this._csiHandlers[this._collect<<8|v];let R=k?k.length-1:-1;for(;R>=0&&(p=k[R](this._params),p!==!0);R--)if(p instanceof Promise)return this._preserveStack(3,k,R,x,S),p;R<0&&this._csiHandlerFb(this._collect<<8|v,this._params),this.precedingCodepoint=0;break;case 8:do switch(v){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(v-48)}while(++S<s&&(v=o[S])>47&&v<60);S--;break;case 9:this._collect<<=8,this._collect|=v;break;case 10:const O=this._escHandlers[this._collect<<8|v];let T=O?O.length-1:-1;for(;T>=0&&(p=O[T](),p!==!0);T--)if(p instanceof Promise)return this._preserveStack(4,O,T,x,S),p;T<0&&this._escHandlerFb(this._collect<<8|v),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|v,this._params);break;case 13:for(let B=S+1;;++B)if(B>=s||(v=o[B])===24||v===26||v===27||v>127&&v<w){this._dcsParser.put(o,S,B),S=B-1;break}break;case 14:if(p=this._dcsParser.unhook(v!==24&&v!==26),p)return this._preserveStack(6,[],0,x,S),p;v===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let B=S+1;;B++)if(B>=s||(v=o[B])<32||v>127&&v<w){this._oscParser.put(o,S,B),S=B-1;break}break;case 6:if(p=this._oscParser.end(v!==24&&v!==26),p)return this._preserveStack(5,[],0,x,S),p;v===27&&(x|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&x}}}l.EscapeSequenceParser=g},6242:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OscHandler=l.OscParser=void 0;const f=u(5770),y=u(482),d=[];l.OscParser=class{constructor(){this._state=0,this._active=d,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(m,C){this._handlers[m]===void 0&&(this._handlers[m]=[]);const w=this._handlers[m];return w.push(C),{dispose:()=>{const g=w.indexOf(C);g!==-1&&w.splice(g,1)}}}clearHandler(m){this._handlers[m]&&delete this._handlers[m]}setHandlerFallback(m){this._handlerFb=m}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let m=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;m>=0;--m)this._active[m].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].start();else this._handlerFb(this._id,"START")}_put(m,C,w){if(this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].put(m,C,w);else this._handlerFb(this._id,"PUT",(0,y.utf32ToString)(m,C,w))}start(){this.reset(),this._state=1}put(m,C,w){if(this._state!==3){if(this._state===1)for(;C<w;){const g=m[C++];if(g===59){this._state=2,this._start();break}if(g<48||57<g)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+g-48}this._state===2&&w-C>0&&this._put(m,C,w)}}end(m,C=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let w=!1,g=this._active.length-1,a=!1;if(this._stack.paused&&(g=this._stack.loopPosition-1,w=C,a=this._stack.fallThrough,this._stack.paused=!1),!a&&w===!1){for(;g>=0&&(w=this._active[g].end(m),w!==!0);g--)if(w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!1,w;g--}for(;g>=0;g--)if(w=this._active[g].end(!1),w instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=g,this._stack.fallThrough=!0,w}else this._handlerFb(this._id,"END",m);this._active=d,this._id=-1,this._state=0}}},l.OscHandler=class{constructor(m){this._handler=m,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(m,C,w){this._hitLimit||(this._data+=(0,y.utf32ToString)(m,C,w),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(m){let C=!1;if(this._hitLimit)C=!1;else if(m&&(C=this._handler(this._data),C instanceof Promise))return C.then(w=>(this._data="",this._hitLimit=!1,w));return this._data="",this._hitLimit=!1,C}}},8742:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.Params=void 0;const u=2147483647;class f{static fromArray(d){const m=new f;if(!d.length)return m;for(let C=Array.isArray(d[0])?1:0;C<d.length;++C){const w=d[C];if(Array.isArray(w))for(let g=0;g<w.length;++g)m.addSubParam(w[g]);else m.addParam(w)}return m}constructor(d=32,m=32){if(this.maxLength=d,this.maxSubParamsLength=m,m>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(m),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(d),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const d=new f(this.maxLength,this.maxSubParamsLength);return d.params.set(this.params),d.length=this.length,d._subParams.set(this._subParams),d._subParamsLength=this._subParamsLength,d._subParamsIdx.set(this._subParamsIdx),d._rejectDigits=this._rejectDigits,d._rejectSubDigits=this._rejectSubDigits,d._digitIsSub=this._digitIsSub,d}toArray(){const d=[];for(let m=0;m<this.length;++m){d.push(this.params[m]);const C=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];w-C>0&&d.push(Array.prototype.slice.call(this._subParams,C,w))}return d}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(d){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=d>u?u:d}}addSubParam(d){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(d<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=d>u?u:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const m=this._subParamsIdx[d]>>8,C=255&this._subParamsIdx[d];return C-m>0?this._subParams.subarray(m,C):null}getSubParamsAll(){const d={};for(let m=0;m<this.length;++m){const C=this._subParamsIdx[m]>>8,w=255&this._subParamsIdx[m];w-C>0&&(d[m]=this._subParams.slice(C,w))}return d}addDigit(d){let m;if(this._rejectDigits||!(m=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const C=this._digitIsSub?this._subParams:this.params,w=C[m-1];C[m-1]=~w?Math.min(10*w+d,u):d}}l.Params=f},5741:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.AddonManager=void 0,l.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,f){const y={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(y),f.dispose=()=>this._wrappedAddonDispose(y),f.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let f=-1;for(let y=0;y<this._addons.length;y++)if(this._addons[y]===u){f=y;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(f,1)}}},8771:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferApiView=void 0;const f=u(3785),y=u(511);l.BufferApiView=class{constructor(d,m){this._buffer=d,this.type=m}init(d){return this._buffer=d,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(d){const m=this._buffer.lines.get(d);if(m)return new f.BufferLineApiView(m)}getNullCell(){return new y.CellData}}},3785:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferLineApiView=void 0;const f=u(511);l.BufferLineApiView=class{constructor(y){this._line=y}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(y,d){if(!(y<0||y>=this._line.length))return d?(this._line.loadCell(y,d),d):this._line.loadCell(y,new f.CellData)}translateToString(y,d,m){return this._line.translateToString(y,d,m)}}},8285:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.BufferNamespaceApi=void 0;const f=u(8771),y=u(8460),d=u(844);class m extends d.Disposable{constructor(w){super(),this._core=w,this._onBufferChange=this.register(new y.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new f.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new f.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)}}l.BufferNamespaceApi=m},7975:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.ParserApi=void 0,l.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,f){return this._core.registerCsiHandler(u,y=>f(y.toArray()))}addCsiHandler(u,f){return this.registerCsiHandler(u,f)}registerDcsHandler(u,f){return this._core.registerDcsHandler(u,(y,d)=>f(y,d.toArray()))}addDcsHandler(u,f){return this.registerDcsHandler(u,f)}registerEscHandler(u,f){return this._core.registerEscHandler(u,f)}addEscHandler(u,f){return this.registerEscHandler(u,f)}registerOscHandler(u,f){return this._core.registerOscHandler(u,f)}addOscHandler(u,f){return this.registerOscHandler(u,f)}}},7090:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeApi=void 0,l.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},y=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.BufferService=l.MINIMUM_ROWS=l.MINIMUM_COLS=void 0;const d=u(8460),m=u(844),C=u(5295),w=u(2585);l.MINIMUM_COLS=2,l.MINIMUM_ROWS=1;let g=l.BufferService=class extends m.Disposable{get buffer(){return this.buffers.active}constructor(a){super(),this.isUserScrolling=!1,this._onResize=this.register(new d.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(a.rawOptions.cols||0,l.MINIMUM_COLS),this.rows=Math.max(a.rawOptions.rows||0,l.MINIMUM_ROWS),this.buffers=this.register(new C.BufferSet(a,this))}resize(a,o){this.cols=a,this.rows=o,this.buffers.resize(a,o),this._onResize.fire({cols:a,rows:o})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(a,o=!1){const s=this.buffer;let c;c=this._cachedBlankLine,c&&c.length===this.cols&&c.getFg(0)===a.fg&&c.getBg(0)===a.bg||(c=s.getBlankLine(a,o),this._cachedBlankLine=c),c.isWrapped=o;const p=s.ybase+s.scrollTop,v=s.ybase+s.scrollBottom;if(s.scrollTop===0){const x=s.lines.isFull;v===s.lines.length-1?x?s.lines.recycle().copyFrom(c):s.lines.push(c.clone()):s.lines.splice(v+1,0,c.clone()),x?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{const x=v-p+1;s.lines.shiftElements(p+1,x-1,-1),s.lines.set(v,c.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)}scrollLines(a,o,s){const c=this.buffer;if(a<0){if(c.ydisp===0)return;this.isUserScrolling=!0}else a+c.ydisp>=c.ybase&&(this.isUserScrolling=!1);const p=c.ydisp;c.ydisp=Math.max(Math.min(c.ydisp+a,c.ybase),0),p!==c.ydisp&&(o||this._onScroll.fire(c.ydisp))}};l.BufferService=g=f([y(0,w.IOptionsService)],g)},7994:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.CharsetService=void 0,l.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,f){this._charsets[u]=f,this.glevel===u&&(this.charset=f)}}},1753:function(_,l,u){var f=this&&this.__decorate||function(c,p,v,x){var b,S=arguments.length,k=S<3?p:x===null?x=Object.getOwnPropertyDescriptor(p,v):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(c,p,v,x);else for(var R=c.length-1;R>=0;R--)(b=c[R])&&(k=(S<3?b(k):S>3?b(p,v,k):b(p,v))||k);return S>3&&k&&Object.defineProperty(p,v,k),k},y=this&&this.__param||function(c,p){return function(v,x){p(v,x,c)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreMouseService=void 0;const d=u(2585),m=u(8460),C=u(844),w={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:c=>c.button!==4&&c.action===1&&(c.ctrl=!1,c.alt=!1,c.shift=!1,!0)},VT200:{events:19,restrict:c=>c.action!==32},DRAG:{events:23,restrict:c=>c.action!==32||c.button!==3},ANY:{events:31,restrict:c=>!0}};function g(c,p){let v=(c.ctrl?16:0)|(c.shift?4:0)|(c.alt?8:0);return c.button===4?(v|=64,v|=c.action):(v|=3&c.button,4&c.button&&(v|=64),8&c.button&&(v|=128),c.action===32?v|=32:c.action!==0||p||(v|=3)),v}const a=String.fromCharCode,o={DEFAULT:c=>{const p=[g(c,!1)+32,c.col+32,c.row+32];return p[0]>255||p[1]>255||p[2]>255?"":`\x1B[M${a(p[0])}${a(p[1])}${a(p[2])}`},SGR:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${g(c,!0)};${c.col};${c.row}${p}`},SGR_PIXELS:c=>{const p=c.action===0&&c.button!==4?"m":"M";return`\x1B[<${g(c,!0)};${c.x};${c.y}${p}`}};let s=l.CoreMouseService=class extends C.Disposable{constructor(c,p){super(),this._bufferService=c,this._coreService=p,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new m.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const v of Object.keys(w))this.addProtocol(v,w[v]);for(const v of Object.keys(o))this.addEncoding(v,o[v]);this.reset()}addProtocol(c,p){this._protocols[c]=p}addEncoding(c,p){this._encodings[c]=p}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(c){if(!this._protocols[c])throw new Error(`unknown protocol "${c}"`);this._activeProtocol=c,this._onProtocolChange.fire(this._protocols[c].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(c){if(!this._encodings[c])throw new Error(`unknown encoding "${c}"`);this._activeEncoding=c}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(c){if(c.col<0||c.col>=this._bufferService.cols||c.row<0||c.row>=this._bufferService.rows||c.button===4&&c.action===32||c.button===3&&c.action!==32||c.button!==4&&(c.action===2||c.action===3)||(c.col++,c.row++,c.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,c,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(c))return!1;const p=this._encodings[this._activeEncoding](c);return p&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(p):this._coreService.triggerDataEvent(p,!0)),this._lastEvent=c,!0}explainEvents(c){return{down:!!(1&c),up:!!(2&c),drag:!!(4&c),move:!!(8&c),wheel:!!(16&c)}}_equalEvents(c,p,v){if(v){if(c.x!==p.x||c.y!==p.y)return!1}else if(c.col!==p.col||c.row!==p.row)return!1;return c.button===p.button&&c.action===p.action&&c.ctrl===p.ctrl&&c.alt===p.alt&&c.shift===p.shift}};l.CoreMouseService=s=f([y(0,d.IBufferService),y(1,d.ICoreService)],s)},6975:function(_,l,u){var f=this&&this.__decorate||function(s,c,p,v){var x,b=arguments.length,S=b<3?c:v===null?v=Object.getOwnPropertyDescriptor(c,p):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(s,c,p,v);else for(var k=s.length-1;k>=0;k--)(x=s[k])&&(S=(b<3?x(S):b>3?x(c,p,S):x(c,p))||S);return b>3&&S&&Object.defineProperty(c,p,S),S},y=this&&this.__param||function(s,c){return function(p,v){c(p,v,s)}};Object.defineProperty(l,"__esModule",{value:!0}),l.CoreService=void 0;const d=u(1439),m=u(8460),C=u(844),w=u(2585),g=Object.freeze({insertMode:!1}),a=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let o=l.CoreService=class extends C.Disposable{constructor(s,c,p){super(),this._bufferService=s,this._logService=c,this._optionsService=p,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new m.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new m.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new m.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new m.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(g),this.decPrivateModes=(0,d.clone)(a)}reset(){this.modes=(0,d.clone)(g),this.decPrivateModes=(0,d.clone)(a)}triggerDataEvent(s,c=!1){if(this._optionsService.rawOptions.disableStdin)return;const p=this._bufferService.buffer;c&&this._optionsService.rawOptions.scrollOnUserInput&&p.ybase!==p.ydisp&&this._onRequestScrollToBottom.fire(),c&&this._onUserInput.fire(),this._logService.debug(`sending data "${s}"`,()=>s.split("").map(v=>v.charCodeAt(0))),this._onData.fire(s)}triggerBinaryEvent(s){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${s}"`,()=>s.split("").map(c=>c.charCodeAt(0))),this._onBinary.fire(s))}};l.CoreService=o=f([y(0,w.IBufferService),y(1,w.ILogService),y(2,w.IOptionsService)],o)},9074:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.DecorationService=void 0;const f=u(8055),y=u(8460),d=u(844),m=u(6106);let C=0,w=0;class g extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new m.SortedList(s=>s==null?void 0:s.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,d.toDisposable)(()=>this.reset()))}registerDecoration(s){if(s.marker.isDisposed)return;const c=new a(s);if(c){const p=c.marker.onDispose(()=>c.dispose());c.onDispose(()=>{c&&(this._decorations.delete(c)&&this._onDecorationRemoved.fire(c),p.dispose())}),this._decorations.insert(c),this._onDecorationRegistered.fire(c)}return c}reset(){for(const s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,c,p){var v,x,b;let S=0,k=0;for(const R of this._decorations.getKeyIterator(c))S=(v=R.options.x)!==null&&v!==void 0?v:0,k=S+((x=R.options.width)!==null&&x!==void 0?x:1),s>=S&&s<k&&(!p||((b=R.options.layer)!==null&&b!==void 0?b:"bottom")===p)&&(yield R)}forEachDecorationAtCell(s,c,p,v){this._decorations.forEachByKey(c,x=>{var b,S,k;C=(b=x.options.x)!==null&&b!==void 0?b:0,w=C+((S=x.options.width)!==null&&S!==void 0?S:1),s>=C&&s<w&&(!p||((k=x.options.layer)!==null&&k!==void 0?k:"bottom")===p)&&v(x)})}}l.DecorationService=g;class a extends d.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=f.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=f.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(s){super(),this.options=s,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=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.InstantiationService=l.ServiceCollection=void 0;const f=u(2585),y=u(8343);class d{constructor(...C){this._entries=new Map;for(const[w,g]of C)this.set(w,g)}set(C,w){const g=this._entries.get(C);return this._entries.set(C,w),g}forEach(C){for(const[w,g]of this._entries.entries())C(w,g)}has(C){return this._entries.has(C)}get(C){return this._entries.get(C)}}l.ServiceCollection=d,l.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(m,C){this._services.set(m,C)}getService(m){return this._services.get(m)}createInstance(m,...C){const w=(0,y.getServiceDependencies)(m).sort((o,s)=>o.index-s.index),g=[];for(const o of w){const s=this._services.get(o.id);if(!s)throw new Error(`[createInstance] ${m.name} depends on UNKNOWN service ${o.id}.`);g.push(s)}const a=w.length>0?w[0].index:C.length;if(C.length!==a)throw new Error(`[createInstance] First service dependency of ${m.name} at position ${a+1} conflicts with ${C.length} static arguments`);return new m(...C,...g)}}},7866:function(_,l,u){var f=this&&this.__decorate||function(a,o,s,c){var p,v=arguments.length,x=v<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,s):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(a,o,s,c);else for(var b=a.length-1;b>=0;b--)(p=a[b])&&(x=(v<3?p(x):v>3?p(o,s,x):p(o,s))||x);return v>3&&x&&Object.defineProperty(o,s,x),x},y=this&&this.__param||function(a,o){return function(s,c){o(s,c,a)}};Object.defineProperty(l,"__esModule",{value:!0}),l.traceCall=l.setTraceLogger=l.LogService=void 0;const d=u(844),m=u(2585),C={trace:m.LogLevelEnum.TRACE,debug:m.LogLevelEnum.DEBUG,info:m.LogLevelEnum.INFO,warn:m.LogLevelEnum.WARN,error:m.LogLevelEnum.ERROR,off:m.LogLevelEnum.OFF};let w,g=l.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(a){super(),this._optionsService=a,this._logLevel=m.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),w=this}_updateLogLevel(){this._logLevel=C[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(a){for(let o=0;o<a.length;o++)typeof a[o]=="function"&&(a[o]=a[o]())}_log(a,o,s){this._evalLazyOptionalParams(s),a.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+o,...s)}trace(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.TRACE&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.trace.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,a,o)}debug(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.DEBUG&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.debug.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.log,a,o)}info(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.INFO&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.info.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.info,a,o)}warn(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.WARN&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.warn.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.warn,a,o)}error(a,...o){var s,c;this._logLevel<=m.LogLevelEnum.ERROR&&this._log((c=(s=this._optionsService.options.logger)===null||s===void 0?void 0:s.error.bind(this._optionsService.options.logger))!==null&&c!==void 0?c:console.error,a,o)}};l.LogService=g=f([y(0,m.IOptionsService)],g),l.setTraceLogger=function(a){w=a},l.traceCall=function(a,o,s){if(typeof s.value!="function")throw new Error("not supported");const c=s.value;s.value=function(...p){if(w.logLevel!==m.LogLevelEnum.TRACE)return c.apply(this,p);w.trace(`GlyphRenderer#${c.name}(${p.map(x=>JSON.stringify(x)).join(", ")})`);const v=c.apply(this,p);return w.trace(`GlyphRenderer#${c.name} return`,v),v}}},7302:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.OptionsService=l.DEFAULT_OPTIONS=void 0;const f=u(8460),y=u(844),d=u(6114);l.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,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:{},rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const m=["normal","bold","100","200","300","400","500","600","700","800","900"];class C extends y.Disposable{constructor(g){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const a=Object.assign({},l.DEFAULT_OPTIONS);for(const o in g)if(o in a)try{const s=g[o];a[o]=this._sanitizeAndValidateOption(o,s)}catch(s){console.error(s)}this.rawOptions=a,this.options=Object.assign({},a),this._setupOptions()}onSpecificOptionChange(g,a){return this.onOptionChange(o=>{o===g&&a(this.rawOptions[g])})}onMultipleOptionChange(g,a){return this.onOptionChange(o=>{g.indexOf(o)!==-1&&a()})}_setupOptions(){const g=o=>{if(!(o in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);return this.rawOptions[o]},a=(o,s)=>{if(!(o in l.DEFAULT_OPTIONS))throw new Error(`No option with key "${o}"`);s=this._sanitizeAndValidateOption(o,s),this.rawOptions[o]!==s&&(this.rawOptions[o]=s,this._onOptionChange.fire(o))};for(const o in this.rawOptions){const s={get:g.bind(this,o),set:a.bind(this,o)};Object.defineProperty(this.options,o,s)}}_sanitizeAndValidateOption(g,a){switch(g){case"cursorStyle":if(a||(a=l.DEFAULT_OPTIONS[g]),!function(o){return o==="block"||o==="underline"||o==="bar"}(a))throw new Error(`"${a}" is not a valid value for ${g}`);break;case"wordSeparator":a||(a=l.DEFAULT_OPTIONS[g]);break;case"fontWeight":case"fontWeightBold":if(typeof a=="number"&&1<=a&&a<=1e3)break;a=m.includes(a)?a:l.DEFAULT_OPTIONS[g];break;case"cursorWidth":a=Math.floor(a);case"lineHeight":case"tabStopWidth":if(a<1)throw new Error(`${g} cannot be less than 1, value: ${a}`);break;case"minimumContrastRatio":a=Math.max(1,Math.min(21,Math.round(10*a)/10));break;case"scrollback":if((a=Math.min(a,4294967295))<0)throw new Error(`${g} cannot be less than 0, value: ${a}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(a<=0)throw new Error(`${g} cannot be less than or equal to 0, value: ${a}`);break;case"rows":case"cols":if(!a&&a!==0)throw new Error(`${g} must be numeric, value: ${a}`);break;case"windowsPty":a=a??{}}return a}}l.OptionsService=C},2660:function(_,l,u){var f=this&&this.__decorate||function(C,w,g,a){var o,s=arguments.length,c=s<3?w:a===null?a=Object.getOwnPropertyDescriptor(w,g):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(C,w,g,a);else for(var p=C.length-1;p>=0;p--)(o=C[p])&&(c=(s<3?o(c):s>3?o(w,g,c):o(w,g))||c);return s>3&&c&&Object.defineProperty(w,g,c),c},y=this&&this.__param||function(C,w){return function(g,a){w(g,a,C)}};Object.defineProperty(l,"__esModule",{value:!0}),l.OscLinkService=void 0;const d=u(2585);let m=l.OscLinkService=class{constructor(C){this._bufferService=C,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(C){const w=this._bufferService.buffer;if(C.id===void 0){const p=w.addMarker(w.ybase+w.y),v={data:C,id:this._nextId++,lines:[p]};return p.onDispose(()=>this._removeMarkerFromLink(v,p)),this._dataByLinkId.set(v.id,v),v.id}const g=C,a=this._getEntryIdKey(g),o=this._entriesWithId.get(a);if(o)return this.addLineToLink(o.id,w.ybase+w.y),o.id;const s=w.addMarker(w.ybase+w.y),c={id:this._nextId++,key:this._getEntryIdKey(g),data:g,lines:[s]};return s.onDispose(()=>this._removeMarkerFromLink(c,s)),this._entriesWithId.set(c.key,c),this._dataByLinkId.set(c.id,c),c.id}addLineToLink(C,w){const g=this._dataByLinkId.get(C);if(g&&g.lines.every(a=>a.line!==w)){const a=this._bufferService.buffer.addMarker(w);g.lines.push(a),a.onDispose(()=>this._removeMarkerFromLink(g,a))}}getLinkData(C){var w;return(w=this._dataByLinkId.get(C))===null||w===void 0?void 0:w.data}_getEntryIdKey(C){return`${C.id};;${C.uri}`}_removeMarkerFromLink(C,w){const g=C.lines.indexOf(w);g!==-1&&(C.lines.splice(g,1),C.lines.length===0&&(C.data.id!==void 0&&this._entriesWithId.delete(C.key),this._dataByLinkId.delete(C.id)))}};l.OscLinkService=m=f([y(0,d.IBufferService)],m)},8343:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.createDecorator=l.getServiceDependencies=l.serviceRegistry=void 0;const u="di$target",f="di$dependencies";l.serviceRegistry=new Map,l.getServiceDependencies=function(y){return y[f]||[]},l.createDecorator=function(y){if(l.serviceRegistry.has(y))return l.serviceRegistry.get(y);const d=function(m,C,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(g,a,o){a[u]===a?a[f].push({id:g,index:o}):(a[f]=[{id:g,index:o}],a[u]=a)})(d,m,w)};return d.toString=()=>y,l.serviceRegistry.set(y,d),d}},2585:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.IDecorationService=l.IUnicodeService=l.IOscLinkService=l.IOptionsService=l.ILogService=l.LogLevelEnum=l.IInstantiationService=l.ICharsetService=l.ICoreService=l.ICoreMouseService=l.IBufferService=void 0;const f=u(8343);var y;l.IBufferService=(0,f.createDecorator)("BufferService"),l.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),l.ICoreService=(0,f.createDecorator)("CoreService"),l.ICharsetService=(0,f.createDecorator)("CharsetService"),l.IInstantiationService=(0,f.createDecorator)("InstantiationService"),function(d){d[d.TRACE=0]="TRACE",d[d.DEBUG=1]="DEBUG",d[d.INFO=2]="INFO",d[d.WARN=3]="WARN",d[d.ERROR=4]="ERROR",d[d.OFF=5]="OFF"}(y||(l.LogLevelEnum=y={})),l.ILogService=(0,f.createDecorator)("LogService"),l.IOptionsService=(0,f.createDecorator)("OptionsService"),l.IOscLinkService=(0,f.createDecorator)("OscLinkService"),l.IUnicodeService=(0,f.createDecorator)("UnicodeService"),l.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(_,l,u)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeService=void 0;const f=u(8460),y=u(225);l.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const d=new y.UnicodeV6;this.register(d),this._active=d.version,this._activeProvider=d}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(d){if(!this._providers[d])throw new Error(`unknown Unicode version "${d}"`);this._active=d,this._activeProvider=this._providers[d],this._onChange.fire(d)}register(d){this._providers[d.version]=d}wcwidth(d){return this._activeProvider.wcwidth(d)}getStringCellWidth(d){let m=0;const C=d.length;for(let w=0;w<C;++w){let g=d.charCodeAt(w);if(55296<=g&&g<=56319){if(++w>=C)return m+this.wcwidth(g);const a=d.charCodeAt(w);56320<=a&&a<=57343?g=1024*(g-55296)+a-56320+65536:m+=this.wcwidth(a)}m+=this.wcwidth(g)}return m}}}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_].call(u.exports,u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.Terminal=void 0;const l=n(9042),u=n(3236),f=n(844),y=n(5741),d=n(8285),m=n(7975),C=n(7090),w=["cols","rows"];class g extends f.Disposable{constructor(o){super(),this._core=this.register(new u.Terminal(o)),this._addonManager=this.register(new y.AddonManager),this._publicOptions=Object.assign({},this._core.options);const s=p=>this._core.options[p],c=(p,v)=>{this._checkReadonlyOptions(p),this._core.options[p]=v};for(const p in this._core.options){const v={get:s.bind(this,p),set:c.bind(this,p)};Object.defineProperty(this._publicOptions,p,v)}}_checkReadonlyOptions(o){if(w.includes(o))throw new Error(`Option "${o}" 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 m.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new C.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 d.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const o=this._core.coreService.decPrivateModes;let s="none";switch(this._core.coreMouseService.activeProtocol){case"X10":s="x10";break;case"VT200":s="vt200";break;case"DRAG":s="drag";break;case"ANY":s="any"}return{applicationCursorKeysMode:o.applicationCursorKeys,applicationKeypadMode:o.applicationKeypad,bracketedPasteMode:o.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:s,originMode:o.origin,reverseWraparoundMode:o.reverseWraparound,sendFocusMode:o.sendFocus,wraparoundMode:o.wraparound}}get options(){return this._publicOptions}set options(o){for(const s in o)this._publicOptions[s]=o[s]}blur(){this._core.blur()}focus(){this._core.focus()}resize(o,s){this._verifyIntegers(o,s),this._core.resize(o,s)}open(o){this._core.open(o)}attachCustomKeyEventHandler(o){this._core.attachCustomKeyEventHandler(o)}registerLinkProvider(o){return this._core.registerLinkProvider(o)}registerCharacterJoiner(o){return this._checkProposedApi(),this._core.registerCharacterJoiner(o)}deregisterCharacterJoiner(o){this._checkProposedApi(),this._core.deregisterCharacterJoiner(o)}registerMarker(o=0){return this._verifyIntegers(o),this._core.registerMarker(o)}registerDecoration(o){var s,c,p;return this._checkProposedApi(),this._verifyPositiveIntegers((s=o.x)!==null&&s!==void 0?s:0,(c=o.width)!==null&&c!==void 0?c:0,(p=o.height)!==null&&p!==void 0?p:0),this._core.registerDecoration(o)}hasSelection(){return this._core.hasSelection()}select(o,s,c){this._verifyIntegers(o,s,c),this._core.select(o,s,c)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(o,s){this._verifyIntegers(o,s),this._core.selectLines(o,s)}dispose(){super.dispose()}scrollLines(o){this._verifyIntegers(o),this._core.scrollLines(o)}scrollPages(o){this._verifyIntegers(o),this._core.scrollPages(o)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(o){this._verifyIntegers(o),this._core.scrollToLine(o)}clear(){this._core.clear()}write(o,s){this._core.write(o,s)}writeln(o,s){this._core.write(o),this._core.write(`\r
48
+ `,s)}paste(o){this._core.paste(o)}refresh(o,s){this._verifyIntegers(o,s),this._core.refresh(o,s)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(o){this._addonManager.loadAddon(this,o)}static get strings(){return l}_verifyIntegers(...o){for(const s of o)if(s===1/0||isNaN(s)||s%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...o){for(const s of o)if(s&&(s===1/0||isNaN(s)||s%1!=0||s<0))throw new Error("This API only accepts positive integers")}}_.Terminal=g})(),h})())})(qh);var $_=qh.exports,Xh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={};return(()=>{var i=r;Object.defineProperty(i,"__esModule",{value:!0}),i.FitAddon=void 0,i.FitAddon=class{activate(n){this._terminal=n}dispose(){}fit(){const n=this.proposeDimensions();if(!n||!this._terminal||isNaN(n.cols)||isNaN(n.rows))return;const h=this._terminal._core;this._terminal.rows===n.rows&&this._terminal.cols===n.cols||(h._renderService.clear(),this._terminal.resize(n.cols,n.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const n=this._terminal._core,h=n._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const _=this._terminal.options.scrollback===0?0:n.viewport.scrollBarWidth,l=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(l.getPropertyValue("height")),f=Math.max(0,parseInt(l.getPropertyValue("width"))),y=window.getComputedStyle(this._terminal.element),d=u-(parseInt(y.getPropertyValue("padding-top"))+parseInt(y.getPropertyValue("padding-bottom"))),m=f-(parseInt(y.getPropertyValue("padding-right"))+parseInt(y.getPropertyValue("padding-left")))-_;return{cols:Math.max(2,Math.floor(m/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(Xh);var U_=Xh.exports,Yh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(hf,()=>(()=>{var r={433:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.UnicodeV11=void 0;const u=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],f=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],y=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],d=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let m;function C(w,g){let a,o=0,s=g.length-1;if(w<g[0][0]||w>g[s][1])return!1;for(;s>=o;)if(a=o+s>>1,w>g[a][1])o=a+1;else{if(!(w<g[a][0]))return!0;s=a-1}return!1}l.UnicodeV11=class{constructor(){if(this.version="11",!m){m=new Uint8Array(65536),m.fill(1),m[0]=0,m.fill(0,1,32),m.fill(0,127,160);for(let w=0;w<u.length;++w)m.fill(0,u[w][0],u[w][1]+1);for(let w=0;w<y.length;++w)m.fill(2,y[w][0],y[w][1]+1)}}wcwidth(w){return w<32?0:w<127?1:w<65536?m[w]:C(w,f)?0:C(w,d)?2:1}}}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_](u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.Unicode11Addon=void 0;const l=n(433);_.Unicode11Addon=class{activate(u){u.unicode.register(new l.UnicodeV11)}dispose(){}}})(),h})())})(Yh);var W_=Yh.exports,Qh={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(_,l)=>{Object.defineProperty(l,"__esModule",{value:!0}),l.LinkComputer=l.WebLinkProvider=void 0,l.WebLinkProvider=class{constructor(f,y,d,m={}){this._terminal=f,this._regex=y,this._handler=d,this._options=m}provideLinks(f,y){const d=u.computeLink(f,this._regex,this._terminal,this._handler);y(this._addCallbacks(d))}_addCallbacks(f){return f.map(y=>(y.leave=this._options.leave,y.hover=(d,m)=>{if(this._options.hover){const{range:C}=y;this._options.hover(d,m,C)}},y))}};class u{static computeLink(y,d,m,C){const w=new RegExp(d.source,(d.flags||"")+"g"),[g,a]=u._getWindowedLineStrings(y-1,m),o=g.join("");let s;const c=[];for(;s=w.exec(o);){const p=s[0];try{const R=new URL(p),O=decodeURI(R.toString());if(p!==O&&p+"/"!==O)continue}catch{continue}const[v,x]=u._mapStrIdx(m,a,0,s.index),[b,S]=u._mapStrIdx(m,v,x,p.length);if(v===-1||x===-1||b===-1||S===-1)continue;const k={start:{x:x+1,y:v+1},end:{x:S,y:b+1}};c.push({range:k,text:p,activate:C})}return c}static _getWindowedLineStrings(y,d){let m,C=y,w=y,g=0,a="";const o=[];if(m=d.buffer.active.getLine(y)){const s=m.translateToString(!0);if(m.isWrapped&&s[0]!==" "){for(g=0;(m=d.buffer.active.getLine(--C))&&g<2048&&(a=m.translateToString(!0),g+=a.length,o.push(a),m.isWrapped&&a.indexOf(" ")===-1););o.reverse()}for(o.push(s),g=0;(m=d.buffer.active.getLine(++w))&&m.isWrapped&&g<2048&&(a=m.translateToString(!0),g+=a.length,o.push(a),a.indexOf(" ")===-1););}return[o,C]}static _mapStrIdx(y,d,m,C){const w=y.buffer.active,g=w.getNullCell();let a=m;for(;C;){const o=w.getLine(d);if(!o)return[-1,-1];for(let s=a;s<o.length;++s){o.getCell(s,g);const c=g.getChars();if(g.getWidth()&&(C-=c.length||1,s===o.length-1&&c==="")){const p=w.getLine(d+1);p&&p.isWrapped&&(p.getCell(0,g),g.getWidth()===2&&(C+=1))}if(C<0)return[d,s]}d++,a=0}return[d,a]}}l.LinkComputer=u}},i={};function n(_){var l=i[_];if(l!==void 0)return l.exports;var u=i[_]={exports:{}};return r[_](u,u.exports,n),u.exports}var h={};return(()=>{var _=h;Object.defineProperty(_,"__esModule",{value:!0}),_.WebLinksAddon=void 0;const l=n(6),u=/https?:[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(y,d){const m=window.open();if(m){try{m.opener=null}catch{}m.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}_.WebLinksAddon=class{constructor(y=f,d={}){this._handler=y,this._options=d}activate(y){this._terminal=y;const d=this._options,m=d.urlRegex||u;this._linkProvider=this._terminal.registerLinkProvider(new l.WebLinkProvider(this._terminal,m,this._handler,d))}dispose(){var y;(y=this._linkProvider)===null||y===void 0||y.dispose()}}})(),h})())})(Qh);var V_=Qh.exports;const K_="",q_="",Jh="保存しました。",G_="デッキを作成する前にワークスペースを追加してください。",X_="ワークスペースを選択してください。",Y_=2e3,Zh='"JetBrains Mono", monospace',ed=14,Q_='"Cascadia Code", "JetBrains Mono", "Consolas", "Menlo", monospace',J_=13,cc="#000000",uc="#ffffff",td="deck-theme",Z_=204;async function ue(e,t={}){const r=await fetch(`${K_}${e}`,{...t,credentials:"include"});if(!r.ok){const i=await r.text();throw new Error(i||`Request failed (${r.status})`)}return r.status===Z_?null:r.json()}const We="application/json",rt="POST",rd="PUT",Zi="DELETE";function ev(){return window.location.origin.replace(/^http/,"ws")}function tv(){return ue("/api/ws-token")}function rv(){return ue("/api/workspaces")}function iv(){return ue("/api/config")}function nv(e){return ue("/api/workspaces",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({path:e})})}function sv(e){return ue(`/api/workspaces/${e}`,{method:Zi})}function ov(){return ue("/api/decks")}function lv(e,t){return ue("/api/decks",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({name:e,workspaceId:t})})}function av(e){return ue(`/api/decks/${e}`,{method:Zi})}function cv(e){return ue("/api/decks/order",{method:rd,headers:{"Content-Type":We},body:JSON.stringify({deckIds:e})})}function hc(e,t=""){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/files?${r.toString()}`)}function dc(e,t=""){const r=new URLSearchParams({path:e,subpath:t});return ue(`/api/preview?${r.toString()}`)}function uv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/file?${r.toString()}`)}function hv(e,t,r){return ue("/api/file",{method:rd,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function dv(e,t,r=""){return ue("/api/file",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,path:t,contents:r})})}function fv(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/file?${r.toString()}`,{method:Zi})}function pv(e,t){return ue("/api/dir",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,path:t})})}function _v(e,t){const r=new URLSearchParams({workspaceId:e,path:t});return ue(`/api/dir?${r.toString()}`,{method:Zi})}function vv(e,t,r){return ue("/api/terminals",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({deckId:e,title:t,command:r})})}function mv(e){const t=new URLSearchParams({deckId:e});return ue(`/api/terminals?${t.toString()}`)}function gv(e){return ue(`/api/terminals/${e}`,{method:Zi})}function id(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/status?${i.toString()}`)}function yv(e){const t=new URLSearchParams({workspaceId:e});return ue(`/api/git/repos?${t.toString()}`)}function nd(e,t,r){return ue("/api/git/stage",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function sd(e,t,r){return ue("/api/git/unstage",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function Sv(e,t,r){return ue("/api/git/commit",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,message:t,repoPath:r})})}function Cv(e,t,r){return ue("/api/git/discard",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,paths:t,repoPath:r})})}function wv(e,t,r,i){const n={workspaceId:e,path:t,staged:r.toString()};i!==void 0&&(n.repoPath=i);const h=new URLSearchParams(n);return ue(`/api/git/diff?${h.toString()}`)}function xv(e,t){return ue("/api/git/push",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,repoPath:t})})}function bv(e,t){return ue("/api/git/pull",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,repoPath:t})})}function Ev(e,t){return ue("/api/git/fetch",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,repoPath:t})})}function od(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/branch-status?${i.toString()}`)}function ld(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/remotes?${i.toString()}`)}function kv(e,t){const r={workspaceId:e};t!==void 0&&(r.repoPath=t);const i=new URLSearchParams(r);return ue(`/api/git/branches?${i.toString()}`)}function Lv(e,t,r){return ue("/api/git/checkout",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,branchName:t,repoPath:r})})}function Dv(e,t,r=!0,i){return ue("/api/git/create-branch",{method:rt,headers:{"Content-Type":We},body:JSON.stringify({workspaceId:e,branchName:t,checkout:r,repoPath:i})})}function Rv(e,t=50,r){const i={workspaceId:e,limit:String(t)};r!==void 0&&(i.repoPath=r);const n=new URLSearchParams(i);return ue(`/api/git/log?${n.toString()}`)}const Tv="接続が終了しました。",fc=5,pc=1e3,Av=new Set(["Deck deleted","Terminal deleted","Terminal exited","Terminal not found"]),_c=new TextEncoder;function Pv(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r)&255;return t}function Mv({session:e,wsUrl:t,onDelete:r,onExit:i}){const n=N.useRef(null),h=N.useRef(null),_=N.useRef(null),l=N.useRef(0),u=N.useRef(i);return N.useEffect(()=>{u.current=i},[i]),N.useEffect(()=>{var Ye,Ut;if(!n.current)return;l.current=0,n.current.innerHTML="";const f=new $_.Terminal({cursorBlink:!0,fontFamily:Q_,fontSize:J_,allowProposedApi:!0,scrollback:3e3,convertEol:!1,windowsMode:!1,rightClickSelectsWord:!0,theme:{background:cc,foreground:uc},windowOptions:{getWinSizePixels:!0,getCellSizePixels:!0,getWinSizeChars:!0}}),y=new U_.FitAddon,d=new W_.Unicode11Addon,m=new V_.WebLinksAddon;f.loadAddon(y),f.loadAddon(d),f.loadAddon(m),f.unicode.activeVersion="11",h.current=y,f.open(n.current);let C=!0,w=!1,g=0,a=!1;const o=()=>{C=!1,a&&(a=!1,E(!0)),window.requestAnimationFrame(()=>{f.scrollToBottom()})},s=J=>{const Y=_.current;Y&&Y.readyState===WebSocket.OPEN&&Y.send(JSON.stringify(J))},c=J=>{if(C)return;const Y=_.current;Y&&Y.readyState===WebSocket.OPEN&&Y.send(_c.encode(J))};f.parser.registerCsiHandler({final:"n"},J=>{const Y=J.length>0?J[0]:0;if(Y===6){const te=f.buffer.active,ie=te.cursorY+te.baseY+1,oe=te.cursorX+1;return c(`\x1B[${ie};${oe}R`),!0}else if(Y===5)return c("\x1B[0n"),!0;return!1}),f.parser.registerCsiHandler({final:"c"},J=>(c("\x1B[?62;1;6;22c"),!0)),f.parser.registerCsiHandler({prefix:">",final:"c"},J=>(c("\x1B[>1;500;0c"),!0)),f.parser.registerCsiHandler({prefix:"?",final:"p",intermediates:"$"},J=>{const Y=J[0]||0,te=f.modes;let ie=0;return Y===1?ie=te.applicationCursorKeysMode?1:2:Y===25?ie=1:Y===1e3?ie=te.mouseTrackingMode==="x10"?1:2:Y===1002?ie=te.mouseTrackingMode==="drag"?1:2:Y===1003?ie=te.mouseTrackingMode==="any"?1:2:Y===1004?ie=te.sendFocusMode?1:2:Y===1006?ie=te.mouseTrackingMode!=="none"?1:2:Y===1049?ie=f.buffer.active.type==="alternate"?1:2:Y===2004?ie=te.bracketedPasteMode?1:2:Y===2026&&(ie=2),c(`\x1B[?${Y};${ie}$y`),!0});const p=J=>(J*257).toString(16).padStart(4,"0");f.parser.registerOscHandler(10,J=>{if(J==="?"){const Y=uc,te=parseInt(Y.slice(1,3),16),ie=parseInt(Y.slice(3,5),16),oe=parseInt(Y.slice(5,7),16);return c(`\x1B]10;rgb:${p(te)}/${p(ie)}/${p(oe)}\x07`),!0}return!1}),f.parser.registerOscHandler(11,J=>{if(J==="?"){const Y=cc,te=parseInt(Y.slice(1,3),16),ie=parseInt(Y.slice(3,5),16),oe=parseInt(Y.slice(5,7),16);return c(`\x1B]11;rgb:${p(te)}/${p(ie)}/${p(oe)}\x07`),!0}return!1}),f.parser.registerOscHandler(12,J=>J==="?"?(c("\x1B]12;rgb:ffff/ffff/ffff\x07"),!0):!1),f.parser.registerOscHandler(4,J=>{const Y=J.match(/^(\d+);?\?$/);if(Y){const te=parseInt(Y[1]),ie=["0000/0000/0000","cdcb/0000/0000","0000/cdcb/0000","cdcb/cdcb/0000","1e1e/9090/ffff","cdcb/0000/cdcb","0000/cdcb/cdcb","e5e5/e5e5/e5e5"],oe=te<8?ie[te]:"0000/0000/0000";return c(`\x1B]4;${te};rgb:${oe}\x07`),!0}return!1}),f.parser.registerOscHandler(52,J=>!!J.includes("?")),f.parser.registerCsiHandler({prefix:">",final:"q"},J=>(c("\x1BP>|xterm.js(5.0.0)\x1B\\"),!0)),f.parser.registerCsiHandler({prefix:"?",final:"u"},J=>!0),f.parser.registerCsiHandler({prefix:"?",final:"m"},J=>J[0]===4?(c("\x1B[>4;0m"),!0):!1),f.parser.registerCsiHandler({final:"t"},J=>{const Y=J[0];return Y===19?(c(`\x1B[9;${f.rows};${f.cols}t`),!0):Y===20?(c("\x1B]LTerminal\x1B\\"),!0):Y===21?(c("\x1B]lTerminal\x1B\\"),!0):!1}),f.parser.registerCsiHandler({prefix:"?",final:"S"},J=>!0),f.parser.registerDcsHandler({intermediates:"$",final:"q"},(J,Y)=>J==="m"?(c("\x1BP1$rm\x1B\\"),!0):J==='"p'?(c('\x1BP1$r62;1"p\x1B\\'),!0):J==="r"?(c(`\x1BP1$r1;${f.rows}r\x1B\\`),!0):(c("\x1BP0$r\x1B\\"),!0)),f.parser.registerDcsHandler({intermediates:"+",final:"q"},(J,Y)=>{try{const ie=(J.match(/.{2}/g)||[]).map(ce=>String.fromCharCode(parseInt(ce,16))).join(""),oe={TN:"xterm-256color",Co:"256",RGB:"",Tc:"",colors:"256",setrgbf:"\x1B[38;2;%p1%d;%p2%d;%p3%dm",setrgbb:"\x1B[48;2;%p1%d;%p2%d;%p3%dm"};if(ie in oe){const Be=oe[ie].split("").map(me=>me.charCodeAt(0).toString(16).padStart(2,"0")).join("");return c(`\x1BP1+r${Be}\x1B\\`),!0}}catch(te){console.error("[XTGETTCAP] Failed to decode:",te)}return c("\x1BP0+r\x1B\\"),!0}),f.parser.registerCsiHandler({final:"b"},J=>{const Y=J[0]||1;return Y>65535?(console.warn(`[REP] Large repeat count ${Y} clamped to 65535 for security`),!0):!1});let v=0,x=0,b=null,S=f.cols,k=f.rows,R=0,O=0,T=((Ye=window.visualViewport)==null?void 0:Ye.scale)??1;const B=(J,Y)=>{f.cols>0&&(R=J/f.cols),f.rows>0&&(O=Y/f.rows)},z=n.current.querySelector(".xterm-helper-textarea");z instanceof HTMLTextAreaElement&&(z.setAttribute("spellcheck","false"),z.setAttribute("autocapitalize","off"),z.setAttribute("autocomplete","off"),z.setAttribute("autocorrect","off"));const I=()=>{const J=f.cols,Y=f.rows;!J||!Y||J===S&&Y===k||(S=J,k=Y,s({type:"resize",cols:J,rows:Y}))},j=()=>{s({type:"claim"})},$=(J=!1)=>{var ce;if(a)return;const Y=n.current;if(!Y)return;const te=Y.clientWidth,ie=Y.clientHeight;if(!te||!ie||!J&&te===v&&ie===x)return;const oe=((ce=window.visualViewport)==null?void 0:ce.scale)??1;if(!J&&R>0&&O>0){const Be=Math.max(2,Math.floor(te/R)),me=Math.max(1,Math.floor(ie/O)),Tt=Math.abs(te-v),Ve=Math.abs(ie-x),At=Math.max(R*.75,2),pe=Math.max(O*.75,2),ni=Math.abs(oe-T)>.001;if(Be===S&&me===k){v=te,x=ie,T=oe;return}if(ni&&Tt<At&&Ve<pe){v=te,x=ie,T=oe;return}}v=te,x=ie,y.fit(),B(te,ie),T=oe,I()},E=(J=!1)=>{if(b!==null){if(!J)return;cancelAnimationFrame(b)}b=window.requestAnimationFrame(()=>{b=null,$(J)})},A=new ResizeObserver(()=>{E()});A.observe(n.current),E();const P=typeof document<"u"?document.fonts:null,M=()=>{D||E(!0)};P==null||P.ready.then(M).catch(()=>{}),(Ut=P==null?void 0:P.addEventListener)==null||Ut.call(P,"loadingdone",M);let H=null,K=null,X=null,q=null,se=null,D=!1,F=0,W=null,U=!1,re=!1;const Q=n.current.closest(".terminal-pane"),ae=J=>{Q instanceof HTMLElement&&(J?Q.dataset.terminalFocus="true":delete Q.dataset.terminalFocus)},we=()=>{var Y;const J=(Y=n.current)==null?void 0:Y.querySelector(".xterm-helper-textarea");if(J instanceof HTMLTextAreaElement)try{J.focus({preventScroll:!0})}catch{J.focus()}},fe=()=>{D||we()},ut=()=>{D||(ae(!0),we())},ne=()=>{window.setTimeout(()=>{D||Q&&Q.contains(document.activeElement)||ae(!1)},0)};n.current.addEventListener("pointerdown",fe,{passive:!0,capture:!0}),n.current.addEventListener("mousedown",fe,{passive:!0,capture:!0}),n.current.addEventListener("touchstart",fe,{passive:!0,capture:!0}),n.current.addEventListener("focusin",ut,!0),n.current.addEventListener("focusout",ne,!0),se=()=>{var J,Y,te,ie,oe;(J=n.current)==null||J.removeEventListener("pointerdown",fe,!0),(Y=n.current)==null||Y.removeEventListener("mousedown",fe,!0),(te=n.current)==null||te.removeEventListener("touchstart",fe,!0),(ie=n.current)==null||ie.removeEventListener("focusin",ut,!0),(oe=n.current)==null||oe.removeEventListener("focusout",ne,!0)};const ht=async(J=!1)=>{if(!D){C=!0,w=!1,g=0;try{const{token:Y,authEnabled:te}=await tv();if(D)return;const ie=te?`${t}?token=${Y}`:t;let oe=ie;if(J&&l.current>0){const ce=ie.includes("?")?"&":"?";oe=`${ie}${ce}bufferOffset=${l.current}`}if(J){const ce=oe.includes("?")?"&":"?";oe=`${oe}${ce}reconnect=1`}if(H=new WebSocket(oe),H.binaryType="arraybuffer",_.current=H,H.addEventListener("open",()=>{var ce;F=0,re=!0,v=0,x=0,R=0,O=0,S=-1,k=-1,T=((ce=window.visualViewport)==null?void 0:ce.scale)??1,E()}),H.addEventListener("message",ce=>{if(typeof ce.data=="string"){let me=null;try{me=JSON.parse(ce.data)}catch{return}if((me==null?void 0:me.type)==="sync"){C=!0,w=!1,g=0,a=!1,l.current=me.offsetBase,me.reset&&f.reset(),$(!0),a=!0;return}if((me==null?void 0:me.type)==="ready"){w=!0,g===0&&o();return}return}if(ce.data instanceof Blob){ce.data.arrayBuffer().then(Tt=>{if(D)return;const Ve=new Uint8Array(Tt);g++,f.write(Ve,()=>{l.current+=Ve.byteLength,g=Math.max(0,g-1),w&&g===0&&o()})});return}const Be=new Uint8Array(ce.data);g++,f.write(Be,()=>{l.current+=Be.byteLength,g=Math.max(0,g-1),w&&g===0&&o()})}),H.addEventListener("close",ce=>{if(!(D||U)){if(ce.code===1e3&&Av.has(ce.reason)){u.current();return}if(F<fc){F++;const Be=pc*Math.pow(2,F-1);W=setTimeout(()=>ht(!0),Be)}else f.write(`\r
49
49
  \x1B[31m${Tv}\x1B[0m\r
50
50
  `)}}),H.addEventListener("error",()=>{}),K&&K.dispose(),K=f.onData(ce=>{C||H&&H.readyState===WebSocket.OPEN&&(j(),H.send(_c.encode(ce)))}),X&&X.dispose(),X=f.onBinary(ce=>{C||H&&H.readyState===WebSocket.OPEN&&(j(),H.send(Pv(ce)))}),!q&&f.textarea){const ce=()=>{j()};f.textarea.addEventListener("focus",ce),q=()=>{var Be;(Be=f.textarea)==null||Be.removeEventListener("focus",ce)}}}catch(Y){if(console.error("[Terminal] Failed to connect:",Y),F<fc&&re){F++;const te=pc*Math.pow(2,F-1);W=setTimeout(()=>ht(!0),te)}else f.write(`\r
51
51
  \x1B[31m接続エラー: ${Y instanceof Error?Y.message:"Unknown error"}\x1B[0m\r
52
- `)}}};return ht(),()=>{var Q;D=!0,U=!0,W&&clearTimeout(W),b!==null&&cancelAnimationFrame(b),A.disconnect(),(Q=P==null?void 0:P.removeEventListener)==null||Q.call(P,"loadingdone",M),K&&K.dispose(),X&&X.dispose(),q&&q(),se&&se(),ae(!1),H&&H.close(),_.current=null,h.current=null,f.dispose()}},[e.id,t]),L.jsxs("div",{className:"terminal-tile",children:[L.jsxs("div",{className:"terminal-tile-header",children:[L.jsx("span",{children:e.title}),L.jsx("button",{type:"button",className:"terminal-close-btn",onClick:()=>{window.confirm("このターミナルを閉じますか?")&&r()},"aria-label":"ターミナルを閉じる",children:"×"})]}),L.jsx("div",{className:"terminal-tile-body",ref:n})]})}function Bv(e){if(e<=1)return{cols:1,rows:1};const t=Math.ceil(Math.sqrt(e)),r=Math.ceil(e/t);return{cols:t,rows:r}}function Ov({terminals:e,wsBase:t,onDeleteTerminal:r,onExitTerminal:i}){const{cols:n,rows:h}=Bv(e.length);return L.jsx("section",{className:"terminal-pane",children:e.length===0?L.jsx("div",{className:"terminal-empty",children:L.jsx("span",{className:"terminal-empty-text",children:"ターミナルを追加"})}):L.jsx("div",{className:"terminal-grid",style:{gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${h}, minmax(0, 1fr))`},children:e.map(_=>L.jsx(Mv,{session:_,wsUrl:`${t}/api/terminals/${_.id}`,onDelete:()=>r(_.id),onExit:()=>i(_.id)},_.id))})})}const Nv="ワークスペースがありません。";function jv({workspaces:e,selectedWorkspaceId:t,onSelect:r,onDelete:i}){return L.jsx("div",{className:"w-full grid gap-2",children:e.length===0?L.jsx("div",{className:"flex items-center justify-center text-muted text-[13px] p-8",children:Nv}):e.map(n=>L.jsxs("div",{className:tt("flex items-center gap-2 p-4 border border-border rounded bg-panel transition-colors hover:bg-list-hover",n.id===t&&"bg-list-active border-accent"),children:[L.jsxs("button",{type:"button",className:"flex-1 min-w-0 text-left bg-transparent border-0 p-0 cursor-pointer",onClick:()=>r(n.id),children:[L.jsx("div",{className:"font-semibold text-[15px] mb-1",children:n.name}),L.jsx("div",{className:"text-[12px] text-muted font-mono truncate",children:n.path})]}),L.jsx("button",{type:"button",className:"flex-shrink-0 w-7 h-7 flex items-center justify-center rounded bg-transparent border-0 text-muted cursor-pointer hover:bg-[rgba(0,0,0,0.08)] hover:text-ink transition-colors dark:hover:bg-[rgba(255,255,255,0.08)]",title:"\\u524a\\u9664",onClick:h=>{h.stopPropagation(),confirm(`「${n.name}」を削除しますか?`)&&i(n.id)},children:L.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[L.jsx("polyline",{points:"3 6 5 6 21 6"}),L.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]},n.id))})}function Iv({contextMenu:e,onNewFile:t,onNewFolder:r,onDelete:i}){var n;return L.jsxs("div",{className:"fixed z-[1000] min-w-[160px] py-1 bg-panel border border-border rounded-[6px] shadow-[0_4px_12px_rgba(0,0,0,0.15)]",style:{left:e.x,top:e.y},onClick:h=>h.stopPropagation(),children:[(e.isRoot||((n=e.node)==null?void 0:n.type)==="dir")&&L.jsxs(L.Fragment,{children:[L.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var h;return t(((h=e.node)==null?void 0:h.path)||"",e.node?1:0)},children:"新規ファイル"}),L.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var h;return r(((h=e.node)==null?void 0:h.path)||"",e.node?1:0)},children:"新規フォルダ"})]}),e.node&&!e.isRoot&&L.jsxs(L.Fragment,{children:[e.node.type==="dir"&&L.jsx("div",{className:"h-px my-1 bg-border"}),L.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-[#f14c4c] cursor-pointer hover:bg-[rgba(241,76,76,0.1)]",onClick:()=>i(e.node),children:"削除"})]})]})}const vc="読み込み中...",Fv="ファイル",Hv="更新",zv="ファイルが見つかりません。",$v="戻る";function Uv(e,t){if(!t)return"";const r=t.find(i=>i.path===e||e.endsWith(i.path));return r?`git-tree-${r.status}`:""}const Wv=()=>L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-chevron-icon",children:L.jsx("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),mc=()=>L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:L.jsx("path",{d:"M3.5 7.5h6l2 2h9a1 1 0 0 1 1 1V18a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V7.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})}),gc=()=>L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:[L.jsx("path",{d:"M6 3.5h8l4 4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V5A1.5 1.5 0 0 1 6 3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),L.jsx("path",{d:"M14 3.5V8h4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]});function ad({root:e,entries:t=[],loading:r,error:i,mode:n="tree",canBack:h,onBack:_,onToggleDir:l,onOpenFile:u,onRefresh:f,onCreateFile:S,onCreateDirectory:d,onDeleteFile:m,onDeleteDirectory:C,gitFiles:w}){const[g,a]=N.useState(null),[o,s]=N.useState(null),[c,p]=N.useState(""),v=N.useRef(null),x=N.useRef(null),b=t??[];N.useEffect(()=>{const j=()=>a(null);if(g)return document.addEventListener("click",j),()=>document.removeEventListener("click",j)},[g]),N.useEffect(()=>{o&&v.current&&v.current.focus()},[o]);const y=N.useCallback((j,$,E=!1)=>{j.preventDefault(),j.stopPropagation();const A=180,P=150,M=Math.min(j.clientX,window.innerWidth-A-4),H=Math.min(j.clientY,window.innerHeight-P-4);a({x:M,y:H,node:$,isRoot:E})},[]),k=N.useCallback((j,$)=>{a(null),s({parentPath:j,type:"file",depth:$}),p("")},[]),R=N.useCallback((j,$)=>{a(null),s({parentPath:j,type:"dir",depth:$}),p("")},[]),O=N.useCallback(j=>{a(null),j.type==="dir"?window.confirm(`フォルダ "${j.name}" を削除しますか?
53
- 中のファイルも全て削除されます。`)&&(C==null||C(j.path)):window.confirm(`ファイル "${j.name}" を削除しますか?`)&&(m==null||m(j.path))},[m,C]),T=N.useCallback(()=>{if(!o||!c.trim()){s(null);return}const j=c.trim();o.type==="file"?S==null||S(o.parentPath,j):d==null||d(o.parentPath,j),s(null),p("")},[o,c,S,d]),B=N.useCallback(j=>{j.key==="Enter"?T():j.key==="Escape"&&s(null)},[T]),z=j=>!o||o.depth!==j?null:L.jsxs("div",{className:"tree-row tree-input-row",style:{paddingLeft:12+j*16},children:[L.jsx("span",{className:"tree-icon","aria-hidden":"true",children:o.type==="dir"?L.jsx(mc,{}):L.jsx(gc,{})}),L.jsx("input",{ref:v,type:"text",className:"tree-input",value:c,onChange:$=>p($.target.value),onKeyDown:B,onBlur:T,placeholder:o.type==="dir"?"フォルダ名":"ファイル名"})]}),I=(j,$)=>j.map(E=>{const A=E.type==="file"?Uv(E.path,w):"";return L.jsxs("div",{children:[L.jsxs("button",{type:"button",className:tt("tree-row",E.type==="dir"&&"is-dir",n==="tree"&&E.expanded&&"is-open",A),style:{paddingLeft:12+$*16},onClick:()=>E.type==="dir"?l(E):u(E),onContextMenu:P=>y(P,E),"aria-expanded":E.type==="dir"&&n==="tree"?E.expanded:void 0,title:E.path,children:[L.jsx("span",{className:"tree-chevron","aria-hidden":"true",children:E.type==="dir"?L.jsx(Wv,{}):null}),L.jsx("span",{className:`tree-icon ${E.type}`,"aria-hidden":"true",children:E.type==="dir"?L.jsx(mc,{}):L.jsx(gc,{})}),L.jsx("span",{className:"tree-label",children:E.name}),E.loading?L.jsx("span",{className:"tree-meta",children:vc}):null]}),n==="tree"&&E.expanded&&E.type==="dir"&&L.jsxs(L.Fragment,{children:[(o==null?void 0:o.parentPath)===E.path&&z($+1),E.children&&E.children.length>0&&I(E.children,$+1)]})]},E.path)});return L.jsxs("section",{className:"panel file-tree",ref:x,children:[L.jsxs("div",{className:"panel-header",children:[L.jsxs("div",{children:[L.jsx("div",{className:"panel-title",children:Fv}),L.jsx("div",{className:"panel-subtitle",children:e})]}),L.jsxs("div",{className:"tree-actions",children:[_?L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:_,disabled:h===!1,children:$v}):null,L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:f,children:Hv})]})]}),L.jsxs("div",{className:"panel-body tree-body",onContextMenu:j=>y(j,null,!0),children:[r?L.jsx("div",{className:"tree-state",children:vc}):null,i?L.jsx("div",{className:"tree-state text-[#f14c4c]",children:i}):null,b.length===0&&!r?L.jsx("div",{className:"tree-state",children:zv}):null,(o==null?void 0:o.parentPath)===""&&z(0),I(b,0)]}),g&&L.jsx(Iv,{contextMenu:g,onNewFile:k,onNewFolder:R,onDelete:O})]})}function ss(){return{files:[],activeFileId:null,tree:[],treeLoading:!1,treeError:null}}function os(){return{terminals:[]}}function Vv(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.slice(t+1).toLowerCase()}function Kv(e){const t=Vv(e);return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",h:"c",hpp:"cpp",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sql:"sql",graphql:"graphql",vue:"vue",svelte:"svelte",php:"php",r:"r",swift:"swift",kt:"kotlin",dart:"dart",lua:"lua",dockerfile:"dockerfile"}[t]||"plaintext"}function Pe(e){return e instanceof Error?e.message:String(e)}function ls(e){return e.map(t=>({...t,expanded:!1,loading:!1,children:t.type==="dir"?[]:void 0}))}function cd(e){return Kv(e)}function tl(e,t,r){return t?e.map(i=>{if(i.path===t&&i.type==="dir"){const h=[...i.children||[],r].sort((_,l)=>_.type!==l.type?_.type==="dir"?-1:1:_.name.localeCompare(l.name));return{...i,children:h,expanded:!0}}return i.children?{...i,children:tl(i.children,t,r)}:i}):[...e,r].sort((n,h)=>n.type!==h.type?n.type==="dir"?-1:1:n.name.localeCompare(h.name))}function rl(e,t){return e.filter(r=>r.path===t?!1:(r.children&&(r.children=rl(r.children,t)),!0))}function Dr(e,t,r){return e.map(i=>i.path===t?r(i):i.children?{...i,children:Dr(i.children,t,r)}:i)}function yc(e){return e.trim().replace(/[\\/]+$/,"").replace(/\\/g,"/").toLowerCase()}function qv(e){return e.includes("\\")?"\\":"/"}function Gv(e,t){const r=qv(e),i=e.replace(/[\\/]+$/,"");return i?`${i}${r}${t}`:t}function Sc(e){const t=e.replace(/[\\/]+$/,"");if(!t)return e;if(/^[A-Za-z]:$/.test(t))return`${t}\\`;if(t==="/")return"/";const r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));if(t.startsWith("/")&&r===0)return"/";if(r<=0)return t;const i=t.slice(0,r);return/^[A-Za-z]:$/.test(i)?`${i}\\`:i}function ud(){if(typeof window>"u")return{view:"terminal",workspaceId:null,deckIds:[],workspaceMode:"list"};const e=new URLSearchParams(window.location.search),t=e.get("view"),r=e.get("mode"),i=e.get("decks")||e.get("deck"),n=i?i.split(",").filter(Boolean):[];return{view:t==="workspace"?"workspace":"terminal",workspaceId:e.get("workspace"),deckIds:n,workspaceMode:r==="editor"?"editor":"list"}}function Xv(){if(typeof window>"u")return"light";const e=window.localStorage.getItem(td);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ne(e,t=1e4){return Promise.race([e,new Promise((r,i)=>setTimeout(()=>i(new Error("Request timeout")),t))])}const Yv=({isOpen:e,defaultRoot:t,onSubmit:r,onClose:i})=>{const[n,h]=N.useState(""),[_,l]=N.useState([]),[u,f]=N.useState(!1),[S,d]=N.useState(null),[m,C]=N.useState(!1),w=Kh(e,i),g=n.trim()||t,a=N.useMemo(()=>g?Sc(g)!==g:!1,[g]);N.useEffect(()=>{if(!e){l([]),f(!1),d(null);return}let v=!0;return f(!0),d(null),dc(g,"").then(x=>{v&&(l(ls(x)),f(!1))}).catch(x=>{v&&(d(Pe(x)),f(!1))}),()=>{v=!1}},[e,g]),N.useEffect(()=>{e&&(n.trim()||t&&h(t))},[t,e,n]);const o=()=>{e&&(f(!0),d(null),dc(g,"").then(v=>{l(ls(v)),f(!1)}).catch(v=>{d(Pe(v)),f(!1)}))},s=v=>{if(v.type!=="dir")return;const x=Gv(g,v.name);h(x)},c=()=>{if(!g)return;const v=Sc(g);v&&v!==g&&h(v)},p=async v=>{if(v.preventDefault(),!m){C(!0);try{await r(n),h("")}finally{C(!1)}}};return e?L.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"workspace-modal-title",children:L.jsxs("form",{className:"modal flex flex-col !overflow-hidden",ref:w,onSubmit:p,children:[L.jsx("div",{className:"text-[14px] font-semibold mb-3 shrink-0",id:"workspace-modal-title",children:"ワークスペース追加"}),L.jsxs("label",{className:"grid gap-1 text-xs shrink-0",children:[L.jsx("span",{children:"パス"}),L.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:n,placeholder:t||"",required:!0,maxLength:500,onChange:v=>h(v.target.value)})]}),L.jsx("div",{className:"flex-1 min-h-0 mt-3",children:L.jsx(ad,{root:g,entries:_,loading:u,error:S,mode:"navigator",canBack:a,onBack:c,onToggleDir:s,onOpenFile:()=>{},onRefresh:o})}),L.jsxs("div",{className:"flex justify-end gap-2 mt-4 shrink-0",children:[L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:m,children:"キャンセル"}),L.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:m,children:m?"追加中...":"追加"})]})]})}):null},Qv="ステージ",Jv="アンステージ",Zv="変更を破棄",em="差分を表示",tm={modified:"M",staged:"A",untracked:"U",deleted:"D",renamed:"R",conflicted:"C"};function Cc({file:e,onStage:t,onUnstage:r,onDiscard:i,onShowDiff:n}){const h=`git-${e.status}`,_=tm[e.status];return L.jsxs("div",{className:"git-file-row",children:[L.jsxs("button",{type:"button",className:"git-file-main",onClick:()=>n(e),title:em,children:[L.jsx("span",{className:`git-status-badge ${h}`,children:_}),L.jsx("span",{className:"git-file-path",children:e.path})]}),L.jsx("div",{className:"git-file-actions",children:e.staged?L.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>r(e.path),title:Jv,children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13H5v-2h14v2z"})})}):L.jsxs(L.Fragment,{children:[L.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>i(e.path),title:Zv,children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})}),L.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>t(e.path),title:Qv,children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]})})]})}const rm="ステージ済みの変更",im="変更",nm="コミット",sm="コミットメッセージを入力...",om="変更はありません",lm="すべてステージ",am="すべてアンステージ",wc="Push",xc="Pull",cm="Pushing...",um="Pulling...";function hm({status:e,branchStatus:t,hasRemote:r,pushing:i,pulling:n,commitMessage:h,onCommitMessageChange:_,onCommit:l,onStageFile:u,onUnstageFile:f,onStageAll:S,onUnstageAll:d,onDiscardFile:m,onShowDiff:C,onPush:w,onPull:g}){const a=e.files.filter(v=>v.staged),o=e.files.filter(v=>!v.staged),s=e.files.length>0,c=a.length>0,p=N.useCallback(v=>{v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&(v.preventDefault(),l())},[l]);return L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"flex flex-col gap-2 px-3",children:[L.jsx("textarea",{className:"border border-border rounded-[2px] p-2 text-[13px] font-[inherit] bg-panel text-ink resize-y min-h-[50px] focus:outline-none focus:border-focus",placeholder:sm,value:h,onChange:v=>_(v.target.value),onKeyDown:p,rows:3}),L.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:l,disabled:!c||!h.trim(),children:nm})]}),r&&L.jsxs("div",{className:"flex gap-2 px-3 py-2 border-b border-border",children:[L.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:g,disabled:n||i,title:t!=null&&t.behind?`${t.behind} commits behind`:xc,children:[L.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M12 4v12m0 0l-4-4m4 4l4-4M4 20h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),n?um:xc,t!=null&&t.behind?` (${t.behind})`:""]}),L.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:w,disabled:i||n,title:t!=null&&t.ahead?`${t.ahead} commits ahead`:wc,children:[L.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M12 20V8m0 0l4 4m-4-4l-4 4M4 4h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),i?cm:wc,t!=null&&t.ahead?` (${t.ahead})`:""]})]}),s?L.jsxs(L.Fragment,{children:[a.length>0&&L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[L.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[rm," (",a.length,")"]}),L.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:d,title:am,children:L.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13H5v-2h14v2z"})})})]}),L.jsx("div",{className:"flex flex-col",children:a.map(v=>L.jsx(Cc,{file:v,onStage:u,onUnstage:f,onDiscard:m,onShowDiff:C},v.path))})]}),o.length>0&&L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[L.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[im," (",o.length,")"]}),L.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:S,title:lm,children:L.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]}),L.jsx("div",{className:"flex flex-col",children:o.map(v=>L.jsx(Cc,{file:v,onStage:u,onUnstage:f,onDiscard:m,onShowDiff:C},v.path))})]})]}):L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:om})]})}const dm="読み込み中...",fm="新規ブランチ",pm="作成",_m="キャンセル";function vm({branches:e,branchesLoading:t,onCheckoutBranch:r,onCreateBranch:i}){const[n,h]=N.useState(!1),[_,l]=N.useState(""),u=N.useCallback(()=>{_.trim()&&(i(_.trim()),l(""),h(!1))},[_,i]),f=N.useCallback(S=>{S.key==="Enter"?(S.preventDefault(),u()):S.key==="Escape"&&(h(!1),l(""))},[u]);return L.jsxs("div",{className:"flex flex-col gap-2",children:[L.jsx("div",{className:"px-3 py-2 border-b border-border",children:n?L.jsxs("div",{className:"flex gap-1.5 items-center",children:[L.jsx("input",{type:"text",className:"flex-1 px-2 py-1 text-xs border border-border rounded-[2px] bg-panel text-ink font-mono focus:outline-none focus:border-focus",placeholder:"ブランチ名...",value:_,onChange:S=>l(S.target.value),onKeyDown:f,autoFocus:!0}),L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:u,disabled:!_.trim(),children:pm}),L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{h(!1),l("")},children:_m})]}):L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>h(!0),children:fm})}),t?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:dm}):L.jsx("div",{className:"flex flex-col",children:e.map(S=>L.jsxs("button",{type:"button",className:tt("flex items-center gap-2 px-3 py-1.5 bg-transparent border-0 text-ink text-[13px] cursor-pointer text-left transition-colors hover:bg-list-hover disabled:cursor-default",S.current&&"bg-list-active cursor-default"),onClick:()=>!S.current&&r(S.name),disabled:S.current,children:[L.jsxs("svg",{className:"w-4 h-4 flex-shrink-0 text-ink-muted",viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),L.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),L.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:S.name}),S.current&&L.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 bg-accent text-white rounded-[3px]",children:"現在"})]},S.name))})]})}const mm="読み込み中...";function gm({logs:e,logsLoading:t}){return L.jsx("div",{className:"flex flex-col",children:t?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:mm}):e.length===0?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:"コミット履歴がありません"}):L.jsx("div",{className:"flex flex-col",children:e.map(r=>L.jsxs("div",{className:"flex flex-col gap-0.5 px-3 py-2 border-b border-border hover:bg-list-hover transition-colors",children:[L.jsxs("div",{className:"flex items-center gap-2",children:[L.jsx("span",{className:"font-mono text-xs text-accent font-semibold",children:r.hashShort}),L.jsx("span",{className:"text-xs text-ink-muted",children:r.author})]}),L.jsx("div",{className:"text-[13px] text-ink overflow-hidden text-ellipsis whitespace-nowrap",children:r.message}),L.jsx("div",{className:"text-[11px] text-muted",children:new Date(r.date).toLocaleString()})]},r.hash))})})}const fi="ソースコントロール",ym="Gitリポジトリではありません",Sm="ワークスペースを選択してください",Cm="読み込み中...",to="更新",wm="変更",xm="ブランチ",bm="履歴",ro="border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",io="flex items-center justify-center h-full text-muted text-[13px] p-5";function Em({status:e,loading:t,error:r,workspaceId:i,branchStatus:n,hasRemote:h,pushing:_,pulling:l,branches:u,branchesLoading:f,logs:S,logsLoading:d,repos:m,selectedRepoPath:C,onSelectRepo:w,onRefresh:g,onStageFile:a,onUnstageFile:o,onStageAll:s,onUnstageAll:c,onCommit:p,onDiscardFile:v,onShowDiff:x,onPush:b,onPull:y,onLoadBranches:k,onCheckoutBranch:R,onCreateBranch:O,onLoadLogs:T}){const[B,z]=N.useState(""),[I,j]=N.useState("changes"),$=N.useCallback(()=>{B.trim()&&(p(B.trim()),z(""))},[B,p]),E=N.useCallback(M=>{j(M),M==="branches"?k():M==="history"&&T()},[k,T]);if(!i)return L.jsxs("section",{className:"panel",children:[L.jsx("div",{className:"panel-header",children:L.jsx("div",{className:"panel-title",children:fi})}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:io,children:Sm})})]});if(t)return L.jsxs("section",{className:"panel",children:[L.jsx("div",{className:"panel-header",children:L.jsx("div",{className:"panel-title",children:fi})}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:io,children:Cm})})]});if(r)return L.jsxs("section",{className:"panel",children:[L.jsxs("div",{className:"panel-header",children:[L.jsx("div",{className:"panel-title",children:fi}),L.jsx("button",{type:"button",className:ro,onClick:g,children:to})]}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:"flex items-center justify-center h-full text-[#f14c4c] text-[13px] p-5",children:r})})]});if(!(e!=null&&e.isGitRepo))return L.jsxs("section",{className:"panel",children:[L.jsxs("div",{className:"panel-header",children:[L.jsx("div",{className:"panel-title",children:fi}),L.jsx("button",{type:"button",className:ro,onClick:g,children:to})]}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:io,children:ym})})]});const A=e.files.length>0,P=m.length>1;return L.jsxs("section",{className:"panel",children:[L.jsxs("div",{className:"panel-header",children:[L.jsxs("div",{children:[L.jsx("div",{className:"panel-title",children:fi}),L.jsxs("div",{className:"panel-subtitle flex items-center gap-1.5",children:[L.jsxs("svg",{viewBox:"0 0 24 24",className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true",children:[L.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),L.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),e.branch]})]}),L.jsx("button",{type:"button",className:ro,onClick:g,children:to})]}),P&&L.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-sidebar text-xs",children:[L.jsx("svg",{className:"w-3.5 h-3.5 text-muted flex-shrink-0",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),L.jsx("select",{className:"flex-1 min-w-0 bg-panel border border-border rounded-[2px] px-2 py-1 text-[12px] font-mono text-ink focus:outline-none focus:border-focus",value:C||"",onChange:M=>w(M.target.value),children:m.map(M=>L.jsxs("option",{value:M.path,children:[M.name," (",M.branch,") ",M.fileCount>0?`• ${M.fileCount}`:""]},M.path))}),L.jsxs("span",{className:"text-[11px] text-muted font-mono flex-shrink-0",children:[m.length," repos"]})]}),L.jsxs("div",{className:"git-tabs",children:[L.jsxs("button",{type:"button",className:tt("git-tab",I==="changes"&&"active"),onClick:()=>E("changes"),children:[wm,A&&L.jsx("span",{className:"text-[10px] font-semibold bg-accent/20 text-accent rounded-full px-1.5 py-0.5 leading-none",children:e.files.length})]}),L.jsx("button",{type:"button",className:tt("git-tab",I==="branches"&&"active"),onClick:()=>E("branches"),children:xm}),L.jsx("button",{type:"button",className:tt("git-tab",I==="history"&&"active"),onClick:()=>E("history"),children:bm})]}),L.jsxs("div",{className:"panel-body",children:[I==="changes"&&L.jsx(hm,{status:e,branchStatus:n,hasRemote:h,pushing:_,pulling:l,commitMessage:B,onCommitMessageChange:z,onCommit:$,onStageFile:a,onUnstageFile:o,onStageAll:s,onUnstageAll:c,onDiscardFile:v,onShowDiff:x,onPush:b,onPull:y}),I==="branches"&&L.jsx(vm,{branches:u,branchesLoading:f,onCheckoutBranch:R,onCreateBranch:O}),I==="history"&&L.jsx(gm,{logs:S,logsLoading:d})]})]})}function bc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function km(e){if(Array.isArray(e))return e}function Lm(e,t,r){return(t=Bm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dm(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,n,h,_,l=[],u=!0,f=!1;try{if(h=(r=r.call(e)).next,t!==0)for(;!(u=(i=h.call(r)).done)&&(l.push(i.value),l.length!==t);u=!0);}catch(S){f=!0,n=S}finally{try{if(!u&&r.return!=null&&(_=r.return(),Object(_)!==_))return}finally{if(f)throw n}}return l}}function Rm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
54
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ec(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function kc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ec(Object(r),!0).forEach(function(i){Lm(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ec(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Tm(e,t){if(e==null)return{};var r,i,n=Am(e,t);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(e);for(i=0;i<h.length;i++)r=h[i],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Am(e,t){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(t.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function Pm(e,t){return km(e)||Dm(e,t)||Om(e,t)||Rm()}function Mm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bm(e){var t=Mm(e,"string");return typeof t=="symbol"?t:t+""}function Om(e,t){if(e){if(typeof e=="string")return bc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bc(e,t):void 0}}function Nm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Dc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lc(Object(r),!0).forEach(function(i){Nm(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lc(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function jm(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(i){return t.reduceRight(function(n,h){return h(n)},i)}}function gi(e){return function t(){for(var r=this,i=arguments.length,n=new Array(i),h=0;h<i;h++)n[h]=arguments[h];return n.length>=e.length?e.apply(this,n):function(){for(var _=arguments.length,l=new Array(_),u=0;u<_;u++)l[u]=arguments[u];return t.apply(r,[].concat(n,l))}}}function as(e){return{}.toString.call(e).includes("Object")}function Im(e){return!Object.keys(e).length}function qi(e){return typeof e=="function"}function Fm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Hm(e,t){return as(t)||sr("changeType"),Object.keys(t).some(function(r){return!Fm(e,r)})&&sr("changeField"),t}function zm(e){qi(e)||sr("selectorType")}function $m(e){qi(e)||as(e)||sr("handlerType"),as(e)&&Object.values(e).some(function(t){return!qi(t)})&&sr("handlersType")}function Um(e){e||sr("initialIsRequired"),as(e)||sr("initialType"),Im(e)&&sr("initialContent")}function Wm(e,t){throw new Error(e[t]||e.default)}var Vm={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},sr=gi(Wm)(Vm),Sn={changes:Hm,selector:zm,handler:$m,initial:Um};function Km(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Sn.initial(e),Sn.handler(t);var r={current:e},i=gi(Xm)(r,t),n=gi(Gm)(r),h=gi(Sn.changes)(e),_=gi(qm)(r);function l(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(S){return S};return Sn.selector(f),f(r.current)}function u(f){jm(i,n,h,_)(f)}return[l,u]}function qm(e,t){return qi(t)?t(e.current):t}function Gm(e,t){return e.current=Dc(Dc({},e.current),t),t}function Xm(e,t,r){return qi(t)?t(e.current):Object.keys(r).forEach(function(i){var n;return(n=t[i])===null||n===void 0?void 0:n.call(t,e.current[i])}),r}var Ym={create:Km},Qm={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Jm(e){return function t(){for(var r=this,i=arguments.length,n=new Array(i),h=0;h<i;h++)n[h]=arguments[h];return n.length>=e.length?e.apply(this,n):function(){for(var _=arguments.length,l=new Array(_),u=0;u<_;u++)l[u]=arguments[u];return t.apply(r,[].concat(n,l))}}}function Zm(e){return{}.toString.call(e).includes("Object")}function eg(e){return e||Rc("configIsRequired"),Zm(e)||Rc("configType"),e.urls?(tg(),{paths:{vs:e.urls.monacoBase}}):e}function tg(){console.warn(hd.deprecation)}function rg(e,t){throw new Error(e[t]||e.default)}var hd={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
52
+ `)}}};return ht(),()=>{var J;D=!0,U=!0,W&&clearTimeout(W),b!==null&&cancelAnimationFrame(b),A.disconnect(),(J=P==null?void 0:P.removeEventListener)==null||J.call(P,"loadingdone",M),K&&K.dispose(),X&&X.dispose(),q&&q(),se&&se(),ae(!1),H&&H.close(),_.current=null,h.current=null,f.dispose()}},[e.id,t]),L.jsxs("div",{className:"terminal-tile",children:[L.jsxs("div",{className:"terminal-tile-header",children:[L.jsx("span",{children:e.title}),L.jsx("button",{type:"button",className:"terminal-close-btn",onClick:()=>{window.confirm("このターミナルを閉じますか?")&&r()},"aria-label":"ターミナルを閉じる",children:"×"})]}),L.jsx("div",{className:"terminal-tile-body",ref:n})]})}function Bv(e){if(e<=1)return{cols:1,rows:1};const t=Math.ceil(Math.sqrt(e)),r=Math.ceil(e/t);return{cols:t,rows:r}}function Ov({terminals:e,wsBase:t,onDeleteTerminal:r,onExitTerminal:i}){const{cols:n,rows:h}=Bv(e.length),[_,l]=N.useState(null),[u,f]=N.useState(()=>typeof window<"u"&&window.matchMedia("(max-width: 720px)").matches);N.useEffect(()=>{const d=window.matchMedia("(max-width: 720px)");f(d.matches);const m=()=>f(d.matches);return d.addEventListener("change",m),()=>d.removeEventListener("change",m)},[]),N.useEffect(()=>{u||l(null)},[u]),N.useEffect(()=>{_&&!e.find(d=>d.id===_)&&l(null)},[e,_]);const y=u?_?"expanded":"preview":null;return L.jsx("section",{className:Ie("terminal-pane",y==="expanded"&&"terminal-pane-expanded"),children:e.length===0?L.jsx("div",{className:"terminal-empty",children:L.jsx("span",{className:"terminal-empty-text",children:"ターミナルを追加"})}):L.jsxs(L.Fragment,{children:[y==="expanded"&&L.jsx("button",{type:"button",className:"terminal-back-btn",onClick:()=>l(null),children:"← 一覧"}),L.jsx("div",{className:Ie("terminal-grid",y==="preview"&&"terminal-grid-preview",y==="expanded"&&"terminal-grid-expanded"),style:u?void 0:{gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gridTemplateRows:`repeat(${h}, minmax(0, 1fr))`},children:e.map(d=>L.jsx("div",{className:Ie("terminal-tile-slot",y==="preview"&&"terminal-tile-slot-preview",y==="expanded"&&d.id===_&&"terminal-tile-slot-active",y==="expanded"&&d.id!==_&&"terminal-tile-slot-hidden"),onClick:y==="preview"?()=>l(d.id):void 0,children:L.jsx(Mv,{session:d,wsUrl:`${t}/api/terminals/${d.id}`,onDelete:()=>r(d.id),onExit:()=>i(d.id)})},d.id))})]})})}const Nv="ワークスペースがありません。";function jv({workspaces:e,selectedWorkspaceId:t,onSelect:r,onDelete:i}){return L.jsx("div",{className:"w-full grid gap-2",children:e.length===0?L.jsx("div",{className:"flex items-center justify-center text-muted text-[13px] p-8",children:Nv}):e.map(n=>L.jsxs("div",{className:Ie("flex items-center gap-2 p-4 border border-border rounded bg-panel transition-colors hover:bg-list-hover",n.id===t&&"bg-list-active border-accent"),children:[L.jsxs("button",{type:"button",className:"flex-1 min-w-0 text-left bg-transparent border-0 p-0 cursor-pointer",onClick:()=>r(n.id),children:[L.jsx("div",{className:"font-semibold text-[15px] mb-1",children:n.name}),L.jsx("div",{className:"text-[12px] text-muted font-mono truncate",children:n.path})]}),L.jsx("button",{type:"button",className:"flex-shrink-0 w-7 h-7 flex items-center justify-center rounded bg-transparent border-0 text-muted cursor-pointer hover:bg-[rgba(0,0,0,0.08)] hover:text-ink transition-colors dark:hover:bg-[rgba(255,255,255,0.08)]",title:"\\u524a\\u9664",onClick:h=>{h.stopPropagation(),confirm(`「${n.name}」を削除しますか?`)&&i(n.id)},children:L.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[L.jsx("polyline",{points:"3 6 5 6 21 6"}),L.jsx("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})})]},n.id))})}function Iv({contextMenu:e,onNewFile:t,onNewFolder:r,onDelete:i}){var n;return L.jsxs("div",{className:"fixed z-[1000] min-w-[160px] py-1 bg-panel border border-border rounded-[6px] shadow-[0_4px_12px_rgba(0,0,0,0.15)]",style:{left:e.x,top:e.y},onClick:h=>h.stopPropagation(),children:[(e.isRoot||((n=e.node)==null?void 0:n.type)==="dir")&&L.jsxs(L.Fragment,{children:[L.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var h;return t(((h=e.node)==null?void 0:h.path)||"",e.node?1:0)},children:"新規ファイル"}),L.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-ink cursor-pointer hover:bg-list-hover",onClick:()=>{var h;return r(((h=e.node)==null?void 0:h.path)||"",e.node?1:0)},children:"新規フォルダ"})]}),e.node&&!e.isRoot&&L.jsxs(L.Fragment,{children:[e.node.type==="dir"&&L.jsx("div",{className:"h-px my-1 bg-border"}),L.jsx("button",{type:"button",className:"block w-full px-3 py-1.5 text-[13px] text-left bg-transparent border-0 text-[#f14c4c] cursor-pointer hover:bg-[rgba(241,76,76,0.1)]",onClick:()=>i(e.node),children:"削除"})]})]})}const vc="読み込み中...",Fv="ファイル",Hv="更新",zv="ファイルが見つかりません。",$v="戻る";function Uv(e,t){if(!t)return"";const r=t.find(i=>i.path===e||e.endsWith(i.path));return r?`git-tree-${r.status}`:""}const Wv=()=>L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-chevron-icon",children:L.jsx("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),mc=()=>L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:L.jsx("path",{d:"M3.5 7.5h6l2 2h9a1 1 0 0 1 1 1V18a2 2 0 0 1-2 2H5.5a2 2 0 0 1-2-2V7.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})}),gc=()=>L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:"tree-svg",children:[L.jsx("path",{d:"M6 3.5h8l4 4V20a1.5 1.5 0 0 1-1.5 1.5H6A1.5 1.5 0 0 1 4.5 20V5A1.5 1.5 0 0 1 6 3.5z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"}),L.jsx("path",{d:"M14 3.5V8h4",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round"})]});function ad({root:e,entries:t=[],loading:r,error:i,mode:n="tree",canBack:h,onBack:_,onToggleDir:l,onOpenFile:u,onRefresh:f,onCreateFile:y,onCreateDirectory:d,onDeleteFile:m,onDeleteDirectory:C,gitFiles:w}){const[g,a]=N.useState(null),[o,s]=N.useState(null),[c,p]=N.useState(""),v=N.useRef(null),x=N.useRef(null),b=t??[];N.useEffect(()=>{const j=()=>a(null);if(g)return document.addEventListener("click",j),()=>document.removeEventListener("click",j)},[g]),N.useEffect(()=>{o&&v.current&&v.current.focus()},[o]);const S=N.useCallback((j,$,E=!1)=>{j.preventDefault(),j.stopPropagation();const A=180,P=150,M=Math.min(j.clientX,window.innerWidth-A-4),H=Math.min(j.clientY,window.innerHeight-P-4);a({x:M,y:H,node:$,isRoot:E})},[]),k=N.useCallback((j,$)=>{a(null),s({parentPath:j,type:"file",depth:$}),p("")},[]),R=N.useCallback((j,$)=>{a(null),s({parentPath:j,type:"dir",depth:$}),p("")},[]),O=N.useCallback(j=>{a(null),j.type==="dir"?window.confirm(`フォルダ "${j.name}" を削除しますか?
53
+ 中のファイルも全て削除されます。`)&&(C==null||C(j.path)):window.confirm(`ファイル "${j.name}" を削除しますか?`)&&(m==null||m(j.path))},[m,C]),T=N.useCallback(()=>{if(!o||!c.trim()){s(null);return}const j=c.trim();o.type==="file"?y==null||y(o.parentPath,j):d==null||d(o.parentPath,j),s(null),p("")},[o,c,y,d]),B=N.useCallback(j=>{j.key==="Enter"?T():j.key==="Escape"&&s(null)},[T]),z=j=>!o||o.depth!==j?null:L.jsxs("div",{className:"tree-row tree-input-row",style:{paddingLeft:12+j*16},children:[L.jsx("span",{className:"tree-icon","aria-hidden":"true",children:o.type==="dir"?L.jsx(mc,{}):L.jsx(gc,{})}),L.jsx("input",{ref:v,type:"text",className:"tree-input",value:c,onChange:$=>p($.target.value),onKeyDown:B,onBlur:T,placeholder:o.type==="dir"?"フォルダ名":"ファイル名"})]}),I=(j,$)=>j.map(E=>{const A=E.type==="file"?Uv(E.path,w):"";return L.jsxs("div",{children:[L.jsxs("button",{type:"button",className:Ie("tree-row",E.type==="dir"&&"is-dir",n==="tree"&&E.expanded&&"is-open",A),style:{paddingLeft:12+$*16},onClick:()=>E.type==="dir"?l(E):u(E),onContextMenu:P=>S(P,E),"aria-expanded":E.type==="dir"&&n==="tree"?E.expanded:void 0,title:E.path,children:[L.jsx("span",{className:"tree-chevron","aria-hidden":"true",children:E.type==="dir"?L.jsx(Wv,{}):null}),L.jsx("span",{className:`tree-icon ${E.type}`,"aria-hidden":"true",children:E.type==="dir"?L.jsx(mc,{}):L.jsx(gc,{})}),L.jsx("span",{className:"tree-label",children:E.name}),E.loading?L.jsx("span",{className:"tree-meta",children:vc}):null]}),n==="tree"&&E.expanded&&E.type==="dir"&&L.jsxs(L.Fragment,{children:[(o==null?void 0:o.parentPath)===E.path&&z($+1),E.children&&E.children.length>0&&I(E.children,$+1)]})]},E.path)});return L.jsxs("section",{className:"panel file-tree",ref:x,children:[L.jsxs("div",{className:"panel-header",children:[L.jsxs("div",{children:[L.jsx("div",{className:"panel-title",children:Fv}),L.jsx("div",{className:"panel-subtitle",children:e})]}),L.jsxs("div",{className:"tree-actions",children:[_?L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:_,disabled:h===!1,children:$v}):null,L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:f,children:Hv})]})]}),L.jsxs("div",{className:"panel-body tree-body",onContextMenu:j=>S(j,null,!0),children:[r?L.jsx("div",{className:"tree-state",children:vc}):null,i?L.jsx("div",{className:"tree-state text-[#f14c4c]",children:i}):null,b.length===0&&!r?L.jsx("div",{className:"tree-state",children:zv}):null,(o==null?void 0:o.parentPath)===""&&z(0),I(b,0)]}),g&&L.jsx(Iv,{contextMenu:g,onNewFile:k,onNewFolder:R,onDelete:O})]})}function ss(){return{files:[],activeFileId:null,tree:[],treeLoading:!1,treeError:null}}function os(){return{terminals:[]}}function Vv(e){const t=e.lastIndexOf(".");return t===-1||t===0?"":e.slice(t+1).toLowerCase()}function Kv(e){const t=Vv(e);return{js:"javascript",jsx:"javascript",ts:"typescript",tsx:"typescript",json:"json",html:"html",css:"css",scss:"scss",sass:"sass",less:"less",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",c:"c",cpp:"cpp",cc:"cpp",cxx:"cpp",h:"c",hpp:"cpp",sh:"shell",bash:"shell",zsh:"shell",fish:"shell",xml:"xml",yaml:"yaml",yml:"yaml",toml:"toml",sql:"sql",graphql:"graphql",vue:"vue",svelte:"svelte",php:"php",r:"r",swift:"swift",kt:"kotlin",dart:"dart",lua:"lua",dockerfile:"dockerfile"}[t]||"plaintext"}function Pe(e){return e instanceof Error?e.message:String(e)}function ls(e){return e.map(t=>({...t,expanded:!1,loading:!1,children:t.type==="dir"?[]:void 0}))}function cd(e){return Kv(e)}function tl(e,t,r){return t?e.map(i=>{if(i.path===t&&i.type==="dir"){const h=[...i.children||[],r].sort((_,l)=>_.type!==l.type?_.type==="dir"?-1:1:_.name.localeCompare(l.name));return{...i,children:h,expanded:!0}}return i.children?{...i,children:tl(i.children,t,r)}:i}):[...e,r].sort((n,h)=>n.type!==h.type?n.type==="dir"?-1:1:n.name.localeCompare(h.name))}function rl(e,t){return e.filter(r=>r.path===t?!1:(r.children&&(r.children=rl(r.children,t)),!0))}function Dr(e,t,r){return e.map(i=>i.path===t?r(i):i.children?{...i,children:Dr(i.children,t,r)}:i)}function yc(e){return e.trim().replace(/[\\/]+$/,"").replace(/\\/g,"/").toLowerCase()}function qv(e){return e.includes("\\")?"\\":"/"}function Gv(e,t){const r=qv(e),i=e.replace(/[\\/]+$/,"");return i?`${i}${r}${t}`:t}function Sc(e){const t=e.replace(/[\\/]+$/,"");if(!t)return e;if(/^[A-Za-z]:$/.test(t))return`${t}\\`;if(t==="/")return"/";const r=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));if(t.startsWith("/")&&r===0)return"/";if(r<=0)return t;const i=t.slice(0,r);return/^[A-Za-z]:$/.test(i)?`${i}\\`:i}function ud(){if(typeof window>"u")return{view:"terminal",workspaceId:null,deckIds:[],workspaceMode:"list"};const e=new URLSearchParams(window.location.search),t=e.get("view"),r=e.get("mode"),i=e.get("decks")||e.get("deck"),n=i?i.split(",").filter(Boolean):[];return{view:t==="workspace"?"workspace":"terminal",workspaceId:e.get("workspace"),deckIds:n,workspaceMode:r==="editor"?"editor":"list"}}function Xv(){if(typeof window>"u")return"light";const e=window.localStorage.getItem(td);return e==="light"||e==="dark"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function Ne(e,t=1e4){return Promise.race([e,new Promise((r,i)=>setTimeout(()=>i(new Error("Request timeout")),t))])}const Yv=({isOpen:e,defaultRoot:t,onSubmit:r,onClose:i})=>{const[n,h]=N.useState(""),[_,l]=N.useState([]),[u,f]=N.useState(!1),[y,d]=N.useState(null),[m,C]=N.useState(!1),w=Kh(e,i),g=n.trim()||t,a=N.useMemo(()=>g?Sc(g)!==g:!1,[g]);N.useEffect(()=>{if(!e){l([]),f(!1),d(null);return}let v=!0;return f(!0),d(null),dc(g,"").then(x=>{v&&(l(ls(x)),f(!1))}).catch(x=>{v&&(d(Pe(x)),f(!1))}),()=>{v=!1}},[e,g]),N.useEffect(()=>{e&&(n.trim()||t&&h(t))},[t,e,n]);const o=()=>{e&&(f(!0),d(null),dc(g,"").then(v=>{l(ls(v)),f(!1)}).catch(v=>{d(Pe(v)),f(!1)}))},s=v=>{if(v.type!=="dir")return;const x=Gv(g,v.name);h(x)},c=()=>{if(!g)return;const v=Sc(g);v&&v!==g&&h(v)},p=async v=>{if(v.preventDefault(),!m){C(!0);try{await r(n),h("")}finally{C(!1)}}};return e?L.jsx("div",{className:"fixed inset-0 bg-black/50 grid place-items-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"workspace-modal-title",children:L.jsxs("form",{className:"modal flex flex-col !overflow-hidden",ref:w,onSubmit:p,children:[L.jsx("div",{className:"text-[14px] font-semibold mb-3 shrink-0",id:"workspace-modal-title",children:"ワークスペース追加"}),L.jsxs("label",{className:"grid gap-1 text-xs shrink-0",children:[L.jsx("span",{children:"パス"}),L.jsx("input",{type:"text",className:"bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus",value:n,placeholder:t||"",required:!0,maxLength:500,onChange:v=>h(v.target.value)})]}),L.jsx("div",{className:"flex-1 min-h-0 mt-3",children:L.jsx(ad,{root:g,entries:_,loading:u,error:y,mode:"navigator",canBack:a,onBack:c,onToggleDir:s,onOpenFile:()=>{},onRefresh:o})}),L.jsxs("div",{className:"flex justify-end gap-2 mt-4 shrink-0",children:[L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,disabled:m,children:"キャンセル"}),L.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:m,children:m?"追加中...":"追加"})]})]})}):null},Qv="ステージ",Jv="アンステージ",Zv="変更を破棄",em="差分を表示",tm={modified:"M",staged:"A",untracked:"U",deleted:"D",renamed:"R",conflicted:"C"};function Cc({file:e,onStage:t,onUnstage:r,onDiscard:i,onShowDiff:n}){const h=`git-${e.status}`,_=tm[e.status];return L.jsxs("div",{className:"git-file-row",children:[L.jsxs("button",{type:"button",className:"git-file-main",onClick:()=>n(e),title:em,children:[L.jsx("span",{className:`git-status-badge ${h}`,children:_}),L.jsx("span",{className:"git-file-path",children:e.path})]}),L.jsx("div",{className:"git-file-actions",children:e.staged?L.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>r(e.path),title:Jv,children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13H5v-2h14v2z"})})}):L.jsxs(L.Fragment,{children:[L.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>i(e.path),title:Zv,children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})})}),L.jsx("button",{type:"button",className:"git-action-btn",onClick:()=>t(e.path),title:Qv,children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]})})]})}const rm="ステージ済みの変更",im="変更",nm="コミット",sm="コミットメッセージを入力...",om="変更はありません",lm="すべてステージ",am="すべてアンステージ",wc="Push",xc="Pull",cm="Pushing...",um="Pulling...";function hm({status:e,branchStatus:t,hasRemote:r,pushing:i,pulling:n,commitMessage:h,onCommitMessageChange:_,onCommit:l,onStageFile:u,onUnstageFile:f,onStageAll:y,onUnstageAll:d,onDiscardFile:m,onShowDiff:C,onPush:w,onPull:g}){const a=e.files.filter(v=>v.staged),o=e.files.filter(v=>!v.staged),s=e.files.length>0,c=a.length>0,p=N.useCallback(v=>{v.key==="Enter"&&(v.ctrlKey||v.metaKey)&&(v.preventDefault(),l())},[l]);return L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"flex flex-col gap-2 px-3",children:[L.jsx("textarea",{className:"border border-border rounded-[2px] p-2 text-[13px] font-[inherit] bg-panel text-ink resize-y min-h-[50px] focus:outline-none focus:border-focus",placeholder:sm,value:h,onChange:v=>_(v.target.value),onKeyDown:p,rows:3}),L.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:l,disabled:!c||!h.trim(),children:nm})]}),r&&L.jsxs("div",{className:"flex gap-2 px-3 py-2 border-b border-border",children:[L.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:g,disabled:n||i,title:t!=null&&t.behind?`${t.behind} commits behind`:xc,children:[L.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M12 4v12m0 0l-4-4m4 4l4-4M4 20h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),n?um:xc,t!=null&&t.behind?` (${t.behind})`:""]}),L.jsxs("button",{type:"button",className:"flex-1 flex items-center justify-center gap-1.5 px-2.5 py-1.5 bg-transparent border border-border rounded-[2px] text-ink text-xs cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:w,disabled:i||n,title:t!=null&&t.ahead?`${t.ahead} commits ahead`:wc,children:[L.jsx("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M12 20V8m0 0l4 4m-4-4l-4 4M4 4h16",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),i?cm:wc,t!=null&&t.ahead?` (${t.ahead})`:""]})]}),s?L.jsxs(L.Fragment,{children:[a.length>0&&L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[L.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[rm," (",a.length,")"]}),L.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:d,title:am,children:L.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13H5v-2h14v2z"})})})]}),L.jsx("div",{className:"flex flex-col",children:a.map(v=>L.jsx(Cc,{file:v,onStage:u,onUnstage:f,onDiscard:m,onShowDiff:C},v.path))})]}),o.length>0&&L.jsxs("div",{className:"flex flex-col",children:[L.jsxs("div",{className:"flex items-center justify-between px-3 py-1",children:[L.jsxs("span",{className:"text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted",children:[im," (",o.length,")"]}),L.jsx("button",{type:"button",className:"w-[22px] h-[22px] p-0 border-0 rounded-[3px] bg-transparent text-ink-muted cursor-pointer flex items-center justify-center hover:bg-list-hover hover:text-ink",onClick:y,title:lm,children:L.jsx("svg",{className:"w-3.5 h-3.5 fill-current",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})]}),L.jsx("div",{className:"flex flex-col",children:o.map(v=>L.jsx(Cc,{file:v,onStage:u,onUnstage:f,onDiscard:m,onShowDiff:C},v.path))})]})]}):L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:om})]})}const dm="読み込み中...",fm="新規ブランチ",pm="作成",_m="キャンセル";function vm({branches:e,branchesLoading:t,onCheckoutBranch:r,onCreateBranch:i}){const[n,h]=N.useState(!1),[_,l]=N.useState(""),u=N.useCallback(()=>{_.trim()&&(i(_.trim()),l(""),h(!1))},[_,i]),f=N.useCallback(y=>{y.key==="Enter"?(y.preventDefault(),u()):y.key==="Escape"&&(h(!1),l(""))},[u]);return L.jsxs("div",{className:"flex flex-col gap-2",children:[L.jsx("div",{className:"px-3 py-2 border-b border-border",children:n?L.jsxs("div",{className:"flex gap-1.5 items-center",children:[L.jsx("input",{type:"text",className:"flex-1 px-2 py-1 text-xs border border-border rounded-[2px] bg-panel text-ink font-mono focus:outline-none focus:border-focus",placeholder:"ブランチ名...",value:_,onChange:y=>l(y.target.value),onKeyDown:f,autoFocus:!0}),L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:u,disabled:!_.trim(),children:pm}),L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>{h(!1),l("")},children:_m})]}):L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",onClick:()=>h(!0),children:fm})}),t?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:dm}):L.jsx("div",{className:"flex flex-col",children:e.map(y=>L.jsxs("button",{type:"button",className:Ie("flex items-center gap-2 px-3 py-1.5 bg-transparent border-0 text-ink text-[13px] cursor-pointer text-left transition-colors hover:bg-list-hover disabled:cursor-default",y.current&&"bg-list-active cursor-default"),onClick:()=>!y.current&&r(y.name),disabled:y.current,children:[L.jsxs("svg",{className:"w-4 h-4 flex-shrink-0 text-ink-muted",viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),L.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),L.jsx("span",{className:"flex-1 overflow-hidden text-ellipsis whitespace-nowrap font-mono",children:y.name}),y.current&&L.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 bg-accent text-white rounded-[3px]",children:"現在"})]},y.name))})]})}const mm="読み込み中...";function gm({logs:e,logsLoading:t}){return L.jsx("div",{className:"flex flex-col",children:t?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:mm}):e.length===0?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:"コミット履歴がありません"}):L.jsx("div",{className:"flex flex-col",children:e.map(r=>L.jsxs("div",{className:"flex flex-col gap-0.5 px-3 py-2 border-b border-border hover:bg-list-hover transition-colors",children:[L.jsxs("div",{className:"flex items-center gap-2",children:[L.jsx("span",{className:"font-mono text-xs text-accent font-semibold",children:r.hashShort}),L.jsx("span",{className:"text-xs text-ink-muted",children:r.author})]}),L.jsx("div",{className:"text-[13px] text-ink overflow-hidden text-ellipsis whitespace-nowrap",children:r.message}),L.jsx("div",{className:"text-[11px] text-muted",children:new Date(r.date).toLocaleString()})]},r.hash))})})}const fi="ソースコントロール",ym="Gitリポジトリではありません",Sm="ワークスペースを選択してください",Cm="読み込み中...",to="更新",wm="変更",xm="ブランチ",bm="履歴",ro="border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover disabled:opacity-50 disabled:cursor-not-allowed",io="flex items-center justify-center h-full text-muted text-[13px] p-5";function Em({status:e,loading:t,error:r,workspaceId:i,branchStatus:n,hasRemote:h,pushing:_,pulling:l,branches:u,branchesLoading:f,logs:y,logsLoading:d,repos:m,selectedRepoPath:C,onSelectRepo:w,onRefresh:g,onStageFile:a,onUnstageFile:o,onStageAll:s,onUnstageAll:c,onCommit:p,onDiscardFile:v,onShowDiff:x,onPush:b,onPull:S,onLoadBranches:k,onCheckoutBranch:R,onCreateBranch:O,onLoadLogs:T}){const[B,z]=N.useState(""),[I,j]=N.useState("changes"),$=N.useCallback(()=>{B.trim()&&(p(B.trim()),z(""))},[B,p]),E=N.useCallback(M=>{j(M),M==="branches"?k():M==="history"&&T()},[k,T]);if(!i)return L.jsxs("section",{className:"panel",children:[L.jsx("div",{className:"panel-header",children:L.jsx("div",{className:"panel-title",children:fi})}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:io,children:Sm})})]});if(t)return L.jsxs("section",{className:"panel",children:[L.jsx("div",{className:"panel-header",children:L.jsx("div",{className:"panel-title",children:fi})}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:io,children:Cm})})]});if(r)return L.jsxs("section",{className:"panel",children:[L.jsxs("div",{className:"panel-header",children:[L.jsx("div",{className:"panel-title",children:fi}),L.jsx("button",{type:"button",className:ro,onClick:g,children:to})]}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:"flex items-center justify-center h-full text-[#f14c4c] text-[13px] p-5",children:r})})]});if(!(e!=null&&e.isGitRepo))return L.jsxs("section",{className:"panel",children:[L.jsxs("div",{className:"panel-header",children:[L.jsx("div",{className:"panel-title",children:fi}),L.jsx("button",{type:"button",className:ro,onClick:g,children:to})]}),L.jsx("div",{className:"panel-body",children:L.jsx("div",{className:io,children:ym})})]});const A=e.files.length>0,P=m.length>1;return L.jsxs("section",{className:"panel",children:[L.jsxs("div",{className:"panel-header",children:[L.jsxs("div",{children:[L.jsx("div",{className:"panel-title",children:fi}),L.jsxs("div",{className:"panel-subtitle flex items-center gap-1.5",children:[L.jsxs("svg",{viewBox:"0 0 24 24",className:"w-3.5 h-3.5 flex-shrink-0","aria-hidden":"true",children:[L.jsx("path",{d:"M6 3v12M18 9a3 3 0 1 1 0 6 3 3 0 0 1 0-6zM6 21a3 3 0 1 1 0-6 3 3 0 0 1 0 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),L.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),e.branch]})]}),L.jsx("button",{type:"button",className:ro,onClick:g,children:to})]}),P&&L.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 border-b border-border bg-sidebar text-xs",children:[L.jsx("svg",{className:"w-3.5 h-3.5 text-muted flex-shrink-0",viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-6l-2-2H5a2 2 0 0 0-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),L.jsx("select",{className:"flex-1 min-w-0 bg-panel border border-border rounded-[2px] px-2 py-1 text-[12px] font-mono text-ink focus:outline-none focus:border-focus",value:C||"",onChange:M=>w(M.target.value),children:m.map(M=>L.jsxs("option",{value:M.path,children:[M.name," (",M.branch,") ",M.fileCount>0?`• ${M.fileCount}`:""]},M.path))}),L.jsxs("span",{className:"text-[11px] text-muted font-mono flex-shrink-0",children:[m.length," repos"]})]}),L.jsxs("div",{className:"git-tabs",children:[L.jsxs("button",{type:"button",className:Ie("git-tab",I==="changes"&&"active"),onClick:()=>E("changes"),children:[wm,A&&L.jsx("span",{className:"text-[10px] font-semibold bg-accent/20 text-accent rounded-full px-1.5 py-0.5 leading-none",children:e.files.length})]}),L.jsx("button",{type:"button",className:Ie("git-tab",I==="branches"&&"active"),onClick:()=>E("branches"),children:xm}),L.jsx("button",{type:"button",className:Ie("git-tab",I==="history"&&"active"),onClick:()=>E("history"),children:bm})]}),L.jsxs("div",{className:"panel-body",children:[I==="changes"&&L.jsx(hm,{status:e,branchStatus:n,hasRemote:h,pushing:_,pulling:l,commitMessage:B,onCommitMessageChange:z,onCommit:$,onStageFile:a,onUnstageFile:o,onStageAll:s,onUnstageAll:c,onDiscardFile:v,onShowDiff:x,onPush:b,onPull:S}),I==="branches"&&L.jsx(vm,{branches:u,branchesLoading:f,onCheckoutBranch:R,onCreateBranch:O}),I==="history"&&L.jsx(gm,{logs:y,logsLoading:d})]})]})}function bc(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}function km(e){if(Array.isArray(e))return e}function Lm(e,t,r){return(t=Bm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dm(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var i,n,h,_,l=[],u=!0,f=!1;try{if(h=(r=r.call(e)).next,t!==0)for(;!(u=(i=h.call(r)).done)&&(l.push(i.value),l.length!==t);u=!0);}catch(y){f=!0,n=y}finally{try{if(!u&&r.return!=null&&(_=r.return(),Object(_)!==_))return}finally{if(f)throw n}}return l}}function Rm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
54
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ec(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function kc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ec(Object(r),!0).forEach(function(i){Lm(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ec(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function Tm(e,t){if(e==null)return{};var r,i,n=Am(e,t);if(Object.getOwnPropertySymbols){var h=Object.getOwnPropertySymbols(e);for(i=0;i<h.length;i++)r=h[i],t.indexOf(r)===-1&&{}.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Am(e,t){if(e==null)return{};var r={};for(var i in e)if({}.hasOwnProperty.call(e,i)){if(t.indexOf(i)!==-1)continue;r[i]=e[i]}return r}function Pm(e,t){return km(e)||Dm(e,t)||Om(e,t)||Rm()}function Mm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Bm(e){var t=Mm(e,"string");return typeof t=="symbol"?t:t+""}function Om(e,t){if(e){if(typeof e=="string")return bc(e,t);var r={}.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?bc(e,t):void 0}}function Nm(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lc(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function Dc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Lc(Object(r),!0).forEach(function(i){Nm(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Lc(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}function jm(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(i){return t.reduceRight(function(n,h){return h(n)},i)}}function gi(e){return function t(){for(var r=this,i=arguments.length,n=new Array(i),h=0;h<i;h++)n[h]=arguments[h];return n.length>=e.length?e.apply(this,n):function(){for(var _=arguments.length,l=new Array(_),u=0;u<_;u++)l[u]=arguments[u];return t.apply(r,[].concat(n,l))}}}function as(e){return{}.toString.call(e).includes("Object")}function Im(e){return!Object.keys(e).length}function qi(e){return typeof e=="function"}function Fm(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Hm(e,t){return as(t)||sr("changeType"),Object.keys(t).some(function(r){return!Fm(e,r)})&&sr("changeField"),t}function zm(e){qi(e)||sr("selectorType")}function $m(e){qi(e)||as(e)||sr("handlerType"),as(e)&&Object.values(e).some(function(t){return!qi(t)})&&sr("handlersType")}function Um(e){e||sr("initialIsRequired"),as(e)||sr("initialType"),Im(e)&&sr("initialContent")}function Wm(e,t){throw new Error(e[t]||e.default)}var Vm={initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"},sr=gi(Wm)(Vm),Sn={changes:Hm,selector:zm,handler:$m,initial:Um};function Km(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Sn.initial(e),Sn.handler(t);var r={current:e},i=gi(Xm)(r,t),n=gi(Gm)(r),h=gi(Sn.changes)(e),_=gi(qm)(r);function l(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(y){return y};return Sn.selector(f),f(r.current)}function u(f){jm(i,n,h,_)(f)}return[l,u]}function qm(e,t){return qi(t)?t(e.current):t}function Gm(e,t){return e.current=Dc(Dc({},e.current),t),t}function Xm(e,t,r){return qi(t)?t(e.current):Object.keys(r).forEach(function(i){var n;return(n=t[i])===null||n===void 0?void 0:n.call(t,e.current[i])}),r}var Ym={create:Km},Qm={paths:{vs:"https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs"}};function Jm(e){return function t(){for(var r=this,i=arguments.length,n=new Array(i),h=0;h<i;h++)n[h]=arguments[h];return n.length>=e.length?e.apply(this,n):function(){for(var _=arguments.length,l=new Array(_),u=0;u<_;u++)l[u]=arguments[u];return t.apply(r,[].concat(n,l))}}}function Zm(e){return{}.toString.call(e).includes("Object")}function eg(e){return e||Rc("configIsRequired"),Zm(e)||Rc("configType"),e.urls?(tg(),{paths:{vs:e.urls.monacoBase}}):e}function tg(){console.warn(hd.deprecation)}function rg(e,t){throw new Error(e[t]||e.default)}var hd={configIsRequired:"the configuration object is required",configType:"the configuration object should be an object",default:"an unknown error accured in `@monaco-editor/loader` package",deprecation:`Deprecation warning!
55
55
  You are using deprecated way of configuration.
56
56
 
57
57
  Instead of using
@@ -60,6 +60,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
60
60
  monaco.config({ paths: { vs: '...' } })
61
61
 
62
62
  For more please check the link https://github.com/suren-atoyan/monaco-loader#config
63
- `},Rc=Jm(rg)(hd),ig={config:eg},ng=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return function(n){return r.reduceRight(function(h,_){return _(h)},n)}};function dd(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],dd(e[r],t[r]))}),kc(kc({},e),t)}var sg={type:"cancelation",msg:"operation is manually canceled"};function no(e){var t=!1,r=new Promise(function(i,n){e.then(function(h){return t?n(sg):i(h)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var og=["monaco"],lg=Ym.create({config:Qm,isInitialized:!1,resolve:null,reject:null,monaco:null}),fd=Pm(lg,2),en=fd[0],Es=fd[1];function ag(e){var t=ig.config(e),r=t.monaco,i=Tm(t,og);Es(function(n){return{config:dd(n.config,i),monaco:r}})}function cg(){var e=en(function(t){var r=t.monaco,i=t.isInitialized,n=t.resolve;return{monaco:r,isInitialized:i,resolve:n}});if(!e.isInitialized){if(Es({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),no(so);if(window.monaco&&window.monaco.editor)return pd(window.monaco),e.resolve(window.monaco),no(so);ng(ug,dg)(fg)}return no(so)}function ug(e){return document.body.appendChild(e)}function hg(e){var t=document.createElement("script");return e&&(t.src=e),t}function dg(e){var t=en(function(i){var n=i.config,h=i.reject;return{config:n,reject:h}}),r=hg("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function fg(){var e=en(function(r){var i=r.config,n=r.resolve,h=r.reject;return{config:i,resolve:n,reject:h}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var i=r.m||r;pd(i),e.resolve(i)},function(r){e.reject(r)})}function pd(e){en().monaco||Es({monaco:e})}function pg(){return en(function(e){var t=e.monaco;return t})}var so=new Promise(function(e,t){return Es({resolve:e,reject:t})}),_d={config:ag,init:cg,__getMonacoInstance:pg},_g={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},oo=_g,vg={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},mg=vg;function gg({children:e}){return vr.createElement("div",{style:mg.container},e)}var yg=gg,Sg=yg;function Cg({width:e,height:t,isEditorReady:r,loading:i,_ref:n,className:h,wrapperProps:_}){return vr.createElement("section",{style:{...oo.wrapper,width:e,height:t},..._},!r&&vr.createElement(Sg,null,i),vr.createElement("div",{ref:n,style:{...oo.fullWidth,...!r&&oo.hide},className:h}))}var wg=Cg,vd=N.memo(wg);function xg(e){N.useEffect(e,[])}var md=xg;function bg(e,t,r=!0){let i=N.useRef(!0);N.useEffect(i.current||!r?()=>{i.current=!1}:e,t)}var nt=bg;function Ri(){}function zr(e,t,r,i){return Eg(e,i)||kg(e,t,r,i)}function Eg(e,t){return e.editor.getModel(gd(e,t))}function kg(e,t,r,i){return e.editor.createModel(t,r,i?gd(e,i):void 0)}function gd(e,t){return e.Uri.parse(t)}function Lg({original:e,modified:t,language:r,originalLanguage:i,modifiedLanguage:n,originalModelPath:h,modifiedModelPath:_,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:u=!1,theme:f="light",loading:S="Loading...",options:d={},height:m="100%",width:C="100%",className:w,wrapperProps:g={},beforeMount:a=Ri,onMount:o=Ri}){let[s,c]=N.useState(!1),[p,v]=N.useState(!0),x=N.useRef(null),b=N.useRef(null),y=N.useRef(null),k=N.useRef(o),R=N.useRef(a),O=N.useRef(!1);md(()=>{let I=_d.init();return I.then(j=>(b.current=j)&&v(!1)).catch(j=>(j==null?void 0:j.type)!=="cancelation"&&console.error("Monaco initialization: error:",j)),()=>x.current?z():I.cancel()}),nt(()=>{if(x.current&&b.current){let I=x.current.getOriginalEditor(),j=zr(b.current,e||"",i||r||"text",h||"");j!==I.getModel()&&I.setModel(j)}},[h],s),nt(()=>{if(x.current&&b.current){let I=x.current.getModifiedEditor(),j=zr(b.current,t||"",n||r||"text",_||"");j!==I.getModel()&&I.setModel(j)}},[_],s),nt(()=>{let I=x.current.getModifiedEditor();I.getOption(b.current.editor.EditorOption.readOnly)?I.setValue(t||""):t!==I.getValue()&&(I.executeEdits("",[{range:I.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),I.pushUndoStop())},[t],s),nt(()=>{var I,j;(j=(I=x.current)==null?void 0:I.getModel())==null||j.original.setValue(e||"")},[e],s),nt(()=>{let{original:I,modified:j}=x.current.getModel();b.current.editor.setModelLanguage(I,i||r||"text"),b.current.editor.setModelLanguage(j,n||r||"text")},[r,i,n],s),nt(()=>{var I;(I=b.current)==null||I.editor.setTheme(f)},[f],s),nt(()=>{var I;(I=x.current)==null||I.updateOptions(d)},[d],s);let T=N.useCallback(()=>{var $;if(!b.current)return;R.current(b.current);let I=zr(b.current,e||"",i||r||"text",h||""),j=zr(b.current,t||"",n||r||"text",_||"");($=x.current)==null||$.setModel({original:I,modified:j})},[r,t,n,e,i,h,_]),B=N.useCallback(()=>{var I;!O.current&&y.current&&(x.current=b.current.editor.createDiffEditor(y.current,{automaticLayout:!0,...d}),T(),(I=b.current)==null||I.editor.setTheme(f),c(!0),O.current=!0)},[d,f,T]);N.useEffect(()=>{s&&k.current(x.current,b.current)},[s]),N.useEffect(()=>{!p&&!s&&B()},[p,s,B]);function z(){var j,$,E,A;let I=(j=x.current)==null?void 0:j.getModel();l||(($=I==null?void 0:I.original)==null||$.dispose()),u||((E=I==null?void 0:I.modified)==null||E.dispose()),(A=x.current)==null||A.dispose()}return vr.createElement(vd,{width:C,height:m,isEditorReady:s,loading:S,_ref:y,className:w,wrapperProps:g})}var Dg=Lg,Rg=N.memo(Dg);function Tg(e){let t=N.useRef();return N.useEffect(()=>{t.current=e},[e]),t.current}var Ag=Tg,Cn=new Map;function Pg({defaultValue:e,defaultLanguage:t,defaultPath:r,value:i,language:n,path:h,theme:_="light",line:l,loading:u="Loading...",options:f={},overrideServices:S={},saveViewState:d=!0,keepCurrentModel:m=!1,width:C="100%",height:w="100%",className:g,wrapperProps:a={},beforeMount:o=Ri,onMount:s=Ri,onChange:c,onValidate:p=Ri}){let[v,x]=N.useState(!1),[b,y]=N.useState(!0),k=N.useRef(null),R=N.useRef(null),O=N.useRef(null),T=N.useRef(s),B=N.useRef(o),z=N.useRef(),I=N.useRef(i),j=Ag(h),$=N.useRef(!1),E=N.useRef(!1);md(()=>{let M=_d.init();return M.then(H=>(k.current=H)&&y(!1)).catch(H=>(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>R.current?P():M.cancel()}),nt(()=>{var H,K,X,q;let M=zr(k.current,e||i||"",t||n||"",h||r||"");M!==((H=R.current)==null?void 0:H.getModel())&&(d&&Cn.set(j,(K=R.current)==null?void 0:K.saveViewState()),(X=R.current)==null||X.setModel(M),d&&((q=R.current)==null||q.restoreViewState(Cn.get(h))))},[h],v),nt(()=>{var M;(M=R.current)==null||M.updateOptions(f)},[f],v),nt(()=>{!R.current||i===void 0||(R.current.getOption(k.current.editor.EditorOption.readOnly)?R.current.setValue(i):i!==R.current.getValue()&&(E.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),R.current.pushUndoStop(),E.current=!1))},[i],v),nt(()=>{var H,K;let M=(H=R.current)==null?void 0:H.getModel();M&&n&&((K=k.current)==null||K.editor.setModelLanguage(M,n))},[n],v),nt(()=>{var M;l!==void 0&&((M=R.current)==null||M.revealLine(l))},[l],v),nt(()=>{var M;(M=k.current)==null||M.editor.setTheme(_)},[_],v);let A=N.useCallback(()=>{var M;if(!(!O.current||!k.current)&&!$.current){B.current(k.current);let H=h||r,K=zr(k.current,i||e||"",t||n||"",H||"");R.current=(M=k.current)==null?void 0:M.editor.create(O.current,{model:K,automaticLayout:!0,...f},S),d&&R.current.restoreViewState(Cn.get(H)),k.current.editor.setTheme(_),l!==void 0&&R.current.revealLine(l),x(!0),$.current=!0}},[e,t,r,i,n,h,f,S,d,_,l]);N.useEffect(()=>{v&&T.current(R.current,k.current)},[v]),N.useEffect(()=>{!b&&!v&&A()},[b,v,A]),I.current=i,N.useEffect(()=>{var M,H;v&&c&&((M=z.current)==null||M.dispose(),z.current=(H=R.current)==null?void 0:H.onDidChangeModelContent(K=>{E.current||c(R.current.getValue(),K)}))},[v,c]),N.useEffect(()=>{if(v){let M=k.current.editor.onDidChangeMarkers(H=>{var X;let K=(X=R.current.getModel())==null?void 0:X.uri;if(K&&H.find(q=>q.path===K.path)){let q=k.current.editor.getModelMarkers({resource:K});p==null||p(q)}});return()=>{M==null||M.dispose()}}return()=>{}},[v,p]);function P(){var M,H;(M=z.current)==null||M.dispose(),m?d&&Cn.set(h,R.current.saveViewState()):(H=R.current.getModel())==null||H.dispose(),R.current.dispose()}return vr.createElement(vd,{width:C,height:w,isEditorReady:v,loading:u,_ref:O,className:g,wrapperProps:a})}var Mg=Pg,Bg=N.memo(Mg),Og=Bg;const Tc="ファイルを選択してください",Ng="vs-dark",jg="vs";function Ig(e){var i;const t=((i=e.split(".").pop())==null?void 0:i.toLowerCase())||"";return{ts:{icon:"TS",color:"#3178c6"},tsx:{icon:"TSX",color:"#3178c6"},js:{icon:"JS",color:"#f7df1e"},jsx:{icon:"JSX",color:"#61dafb"},json:{icon:"{ }",color:"#cbcb41"},html:{icon:"<>",color:"#e34c26"},css:{icon:"#",color:"#264de4"},scss:{icon:"S",color:"#cc6699"},md:{icon:"M↓",color:"#083fa1"},py:{icon:"PY",color:"#3776ab"},go:{icon:"GO",color:"#00add8"},rs:{icon:"RS",color:"#dea584"},java:{icon:"J",color:"#b07219"},sql:{icon:"SQL",color:"#e38c00"},yml:{icon:"Y",color:"#cb171e"},yaml:{icon:"Y",color:"#cb171e"},sh:{icon:"$",color:"#89e051"},bash:{icon:"$",color:"#89e051"},txt:{icon:"TXT",color:"#6a737d"}}[t]||{icon:"📄",color:"var(--ink-muted)"}}function Fg(e){return{typescript:"TypeScript",typescriptreact:"TypeScript React",javascript:"JavaScript",javascriptreact:"JavaScript React",json:"JSON",html:"HTML",css:"CSS",scss:"SCSS",markdown:"Markdown",python:"Python",go:"Go",rust:"Rust",java:"Java",sql:"SQL",yaml:"YAML",shell:"Shell",plaintext:"Plain Text"}[e]||e}function Hg({files:e,activeFileId:t,onSelectFile:r,onCloseFile:i,onChangeFile:n,onSaveFile:h,savingFileId:_,theme:l}){const u=e.find(g=>g.id===t),f=N.useRef(null),[S,d]=N.useState({line:1,column:1}),m=N.useCallback(g=>{f.current=g,g.onDidChangeCursorPosition(a=>{d({line:a.position.lineNumber,column:a.position.column})})},[]);N.useEffect(()=>{const g=a=>{!t||!((a.ctrlKey||a.metaKey)&&a.key.toLowerCase()==="s")||(a.preventDefault(),h==null||h(t))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[t,h]);const C=(g,a)=>{g.stopPropagation(),i(a)},w=(g,a)=>{g.button===1&&(g.preventDefault(),i(a))};return e.length===0?L.jsx("div",{className:"editor-container editor-empty",children:L.jsxs("div",{className:"editor-welcome",children:[L.jsx("div",{className:"editor-welcome-icon",children:L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),L.jsx("polyline",{points:"13 2 13 9 20 9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),L.jsx("div",{className:"editor-welcome-text",children:Tc}),L.jsx("div",{className:"editor-welcome-hint",children:"左のファイルツリーからファイルを選択"})]})}):L.jsxs("div",{className:"editor-container",children:[L.jsx("div",{className:"editor-tabs",children:L.jsx("div",{className:"editor-tabs-list",children:e.map(g=>{const{icon:a,color:o}=Ig(g.name),s=g.id===t,c=_===g.id;return L.jsxs("div",{className:tt("editor-tab",s&&"active",g.dirty&&"dirty"),onClick:()=>r(g.id),onMouseDown:p=>w(p,g.id),role:"tab","aria-selected":s,tabIndex:0,children:[L.jsx("span",{className:"editor-tab-icon",style:{color:o},children:a}),L.jsx("span",{className:"editor-tab-name",children:g.name}),g.dirty&&!c&&L.jsx("span",{className:"editor-tab-dirty","aria-label":"未保存",children:"●"}),c&&L.jsx("span",{className:"editor-tab-saving","aria-label":"保存中",children:L.jsx("svg",{viewBox:"0 0 24 24",className:"spin",children:L.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"30 70"})})}),L.jsx("button",{type:"button",className:"editor-tab-close",onClick:p=>C(p,g.id),"aria-label":"閉じる",children:L.jsx("svg",{viewBox:"0 0 24 24",children:L.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]},g.id)})})}),u&&L.jsx("div",{className:"editor-breadcrumb",children:L.jsx("span",{className:"editor-breadcrumb-path",children:u.path})}),L.jsx("div",{className:"editor-content",children:u?L.jsx(Og,{height:"100%",theme:l==="dark"?Ng:jg,language:u.language,value:u.contents,onChange:g=>n(u.id,g??""),onMount:m,options:{fontFamily:Zh,fontSize:ed,fontLigatures:!0,minimap:{enabled:!0,scale:1,showSlider:"mouseover"},smoothScrolling:!0,cursorBlinking:"smooth",cursorSmoothCaretAnimation:"on",renderLineHighlight:"all",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:8,bottom:8},lineNumbers:"on",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0}}}):L.jsx("div",{className:"editor-no-file",children:L.jsx("span",{children:Tc})})}),u&&L.jsxs("div",{className:"editor-statusbar",children:[L.jsx("div",{className:"editor-statusbar-left",children:L.jsxs("span",{className:"editor-status-item",children:[L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),L.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),"main"]})}),L.jsxs("div",{className:"editor-statusbar-right",children:[L.jsxs("span",{className:"editor-status-item",children:["Ln ",S.line,", Col ",S.column]}),L.jsx("span",{className:"editor-status-item",children:"UTF-8"}),L.jsx("span",{className:"editor-status-item",children:Fg(u.language)})]})]})]})}const zg="差分ビューア",$g="読み込み中...",Ug="閉じる",Wg="vs-dark",Vg="vs";function Kg({diff:e,loading:t,theme:r,onClose:i}){const n=e?cd(e.path):"plaintext";return L.jsxs("div",{className:"fixed inset-0 bg-bg z-50 grid grid-rows-[35px_minmax(0,1fr)]",children:[L.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 bg-title-bar border-b border-border",children:[L.jsxs("div",{children:[L.jsx("div",{className:"text-[13px] font-medium",children:zg}),e&&L.jsx("div",{className:"text-xs text-muted font-mono",children:e.path})]}),L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,children:Ug})]}),L.jsx("div",{className:"min-h-0 overflow-hidden",children:t?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:$g}):e?L.jsx(Rg,{height:"100%",theme:r==="dark"?Wg:Vg,language:n,original:e.original,modified:e.modified,options:{fontFamily:Zh,fontSize:ed,readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},smoothScrolling:!0}}):null})]})}function qg({activeWorkspace:e,defaultRoot:t,activeWorkspaceState:r,editorWorkspaceId:i,gitState:n,theme:h,savingFileId:_,onCloseWorkspaceEditor:l,onToggleDir:u,onOpenFile:f,onRefreshTree:S,onCreateFile:d,onCreateDirectory:m,onDeleteFile:C,onDeleteDirectory:w,onRefreshGit:g,onSelectRepo:a,onStageFile:o,onUnstageFile:s,onStageAll:c,onUnstageAll:p,onCommit:v,onDiscardFile:x,onShowDiff:b,onCloseDiff:y,onPush:k,onPull:R,onLoadBranches:O,onCheckoutBranch:T,onCreateBranch:B,onLoadLogs:z,onSelectFile:I,onCloseFile:j,onChangeFile:$,onSaveFile:E}){var q,se;const[A,P]=N.useState(!1),[M,H]=N.useState("files"),K=N.useCallback(D=>{f(D),P(!1)},[f]),X=((q=n.status)==null?void 0:q.files.length)??0;return L.jsxs("div",{className:tt("workspace-editor-overlay",A&&"drawer-open"),children:[L.jsxs("div",{className:"workspace-editor-header",children:[L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:l,children:"一覧に戻る"}),L.jsx("button",{type:"button",className:"sidebar-toggle-btn bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover min-h-[44px] min-w-[44px]",onClick:()=>P(D=>!D),"aria-label":"\\u30b5\\u30a4\\u30c9\\u30d0\\u30fc",children:L.jsx("svg",{viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:L.jsx("path",{d:"M3 12h18M3 6h18M3 18h18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),L.jsx("div",{className:"workspace-meta",children:e?e.path:null})]}),L.jsxs("div",{className:"workspace-editor-grid",children:[L.jsxs("div",{className:"activity-bar",children:[L.jsx("button",{type:"button",className:tt("activity-bar-item",M==="files"&&"active"),onClick:()=>H("files"),title:"エクスプローラー",children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),L.jsxs("button",{type:"button",className:tt("activity-bar-item",M==="git"&&"active"),onClick:()=>{H("git"),g()},title:"ソースコントロール",children:[L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),L.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),X>0&&L.jsx("span",{className:"activity-bar-badge",children:X})]})]}),L.jsx("div",{className:"sidebar-panel",children:L.jsx("div",{className:"sidebar-content",children:M==="files"?L.jsx(ad,{root:(e==null?void 0:e.path)||t||"",entries:r.tree,loading:r.treeLoading,error:r.treeError,onToggleDir:u,onOpenFile:K,onRefresh:S,onCreateFile:d,onCreateDirectory:m,onDeleteFile:C,onDeleteDirectory:w,gitFiles:(se=n.status)==null?void 0:se.files}):L.jsx(Em,{status:n.status,loading:n.loading,error:n.error,workspaceId:i,branchStatus:n.branchStatus,hasRemote:n.hasRemote,pushing:n.pushing,pulling:n.pulling,branches:n.branches,branchesLoading:n.branchesLoading,logs:n.logs,logsLoading:n.logsLoading,repos:n.repos,selectedRepoPath:n.selectedRepoPath,onSelectRepo:a,onRefresh:g,onStageFile:o,onUnstageFile:s,onStageAll:c,onUnstageAll:p,onCommit:v,onDiscardFile:x,onShowDiff:b,onPush:k,onPull:R,onLoadBranches:O,onCheckoutBranch:T,onCreateBranch:B,onLoadLogs:z})})}),L.jsx(Hg,{files:r.files,activeFileId:r.activeFileId,onSelectFile:I,onCloseFile:j,onChangeFile:$,onSaveFile:E,savingFileId:_,theme:h})]}),L.jsx("div",{className:"sidebar-overlay",onClick:()=>P(!1),"aria-hidden":"true"}),n.diffPath&&L.jsx(Kg,{diff:n.diff,loading:n.diffLoading,theme:h,onClose:y})]})}const Gg="設定",Xg="サーバー設定",Yg="ポート番号",Qg="Basic認証",Jg="Basic認証を有効にする",Zg="ユーザー名",e0="パスワード",t0="※ 12文字以上推奨",r0="キャンセル",i0="保存",n0="※ 設定を保存すると、サーバーが再起動されます",s0="WebSocket設定",o0="接続数上限 (IP毎)",l0="現在の接続数",a0="全接続をクリア",c0="適用",wn="bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus";function u0({isOpen:e,onClose:t,onSave:r}){const[i,n]=N.useState(8787),[h,_]=N.useState(!1),[l,u]=N.useState(""),[f,S]=N.useState(""),[d,m]=N.useState(!1),[C,w]=N.useState(1e3),[g,a]=N.useState(null),[o,s]=N.useState(!1),c=()=>{fetch("/api/ws/stats").then(b=>b.json()).then(b=>{a(b),w(b.limit)}).catch(b=>{console.error("Failed to load WS stats:",b)})};N.useEffect(()=>{if(!e)return;const b=y=>{y.key==="Escape"&&(y.preventDefault(),t())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,t]),N.useEffect(()=>{e&&(fetch("/api/settings").then(b=>b.json()).then(b=>{n(b.port),_(b.basicAuthEnabled),u(b.basicAuthUser),S(b.basicAuthPassword)}).catch(b=>{console.error("Failed to load settings:",b)}),c())},[e]);const p=async()=>{try{await fetch("/api/ws/limit",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:C})}),c()}catch(b){console.error("Failed to set WS limit:",b)}},v=async()=>{s(!0);try{await fetch("/api/ws/clear",{method:"POST"}),c()}catch(b){console.error("Failed to clear WS connections:",b)}finally{s(!1)}},x=async b=>{b.preventDefault(),m(!0);try{await r({port:i,basicAuthEnabled:h,basicAuthUser:l,basicAuthPassword:f}),t()}catch(y){console.error("Failed to save settings:",y),alert("設定の保存に失敗しました")}finally{m(!1)}};return e?L.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"settings-modal-title",onClick:t,children:L.jsxs("div",{className:"modal w-[500px]",onClick:b=>b.stopPropagation(),children:[L.jsxs("div",{className:"flex items-center justify-between mb-4",children:[L.jsx("h2",{className:"m-0 text-[14px] font-semibold",id:"settings-modal-title",children:Gg}),L.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"閉じる",children:"×"})]}),L.jsxs("form",{onSubmit:x,children:[L.jsxs("div",{className:"flex flex-col gap-4",children:[L.jsxs("section",{className:"flex flex-col gap-3",children:[L.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:Xg}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("label",{htmlFor:"port",className:"text-xs text-ink-muted",children:Yg}),L.jsx("input",{type:"number",id:"port",className:wn,value:i,onChange:b=>n(Number(b.target.value)),min:1024,max:65535,required:!0})]}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("h4",{className:"m-0 text-xs font-semibold text-ink-muted",children:Qg}),L.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[L.jsx("input",{type:"checkbox",checked:h,onChange:b=>_(b.target.checked)}),L.jsx("span",{children:Jg})]})]}),h&&L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("label",{htmlFor:"username",className:"text-xs text-ink-muted",children:Zg}),L.jsx("input",{type:"text",id:"username",className:wn,value:l,onChange:b=>u(b.target.value),required:h,autoComplete:"username"})]}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("label",{htmlFor:"password",className:"text-xs text-ink-muted",children:e0}),L.jsx("input",{type:"password",id:"password",className:wn,value:f,onChange:b=>S(b.target.value),required:h,minLength:12,autoComplete:"new-password"}),L.jsx("p",{className:"m-0 text-[11px] text-muted",children:t0})]})]})]}),L.jsxs("section",{className:"flex flex-col gap-3",children:[L.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:s0}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("label",{htmlFor:"wsLimit",className:"text-xs text-ink-muted",children:o0}),L.jsxs("div",{className:"flex gap-2 items-center",children:[L.jsx("input",{type:"number",id:"wsLimit",className:`flex-1 ${wn}`,value:C,onChange:b=>w(Number(b.target.value)),min:1,max:1e4}),L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:p,children:c0})]})]}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("label",{className:"text-xs text-ink-muted",children:l0}),L.jsx("div",{className:"border border-border rounded-[2px] p-2 text-xs bg-bg min-h-[40px] flex flex-col gap-1",children:g&&g.connections.length>0?g.connections.map(({ip:b,count:y})=>L.jsxs("div",{className:"flex justify-between items-center",children:[L.jsx("span",{className:"font-mono text-ink",children:b}),L.jsx("span",{className:"font-semibold text-ink-muted",children:y})]},b)):L.jsx("div",{className:"text-muted text-center",children:"接続なし"})})]}),L.jsx("div",{className:"flex flex-col gap-1",children:L.jsx("button",{type:"button",className:"bg-[#f14c4c] text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:v,disabled:o,children:o?"クリア中...":a0})})]}),L.jsx("p",{className:"m-0 text-[11px] text-muted italic",children:n0})]}),L.jsxs("div",{className:"flex justify-end gap-2 mt-4 border-t border-border pt-4",children:[L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:t,disabled:d,children:r0}),L.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:d,children:d?"保存中...":i0})]})]})]})}):null}const h0=()=>{const[e,t]=N.useState({}),r=N.useCallback((n,h)=>{t(_=>{const l=_[n]||ss();return{..._,[n]:h(l)}})},[]),i=N.useCallback(n=>{t(h=>{const _={...h};return n.forEach(l=>{_[l]||(_[l]=ss())}),_})},[]);return{workspaceStates:e,setWorkspaceStates:t,updateWorkspaceState:r,initializeWorkspaceStates:i}},d0=()=>{const[e,t]=N.useState({}),r=N.useCallback((n,h)=>{t(_=>{const l=_[n]||os();return{..._,[n]:h(l)}})},[]),i=N.useCallback(n=>{t(h=>{const _={...h};return n.forEach(l=>{_[l]||(_[l]=os())}),_})},[]);return{deckStates:e,setDeckStates:t,updateDeckState:r,initializeDeckStates:i}},f0=({setStatusMessage:e,defaultRoot:t,initializeWorkspaceStates:r,setWorkspaceStates:i})=>{const[n,h]=N.useState([]),[_,l]=N.useState(null);N.useEffect(()=>{let S=!0;return rv().then(d=>{S&&(h(d),l(m=>m&&d.some(C=>C.id===m)?m:null),r(d.map(m=>m.id)))}).catch(d=>{S&&e(`ワークスペースを取得できませんでした: ${Pe(d)}`)}),()=>{S=!1}},[e,r]);const u=N.useCallback(async S=>{const m=S.trim()||t;if(!m)return e("パスを入力してください。"),null;const C=yc(m);if(n.some(g=>yc(g.path)===C))return e("同じパスのワークスペースは追加できません。"),null;try{const g=await nv(m);return h(a=>[...a,g]),l(g.id),i(a=>({...a,[g.id]:ss()})),g}catch(g){return e(`ワークスペースを追加できませんでした: ${Pe(g)}`),null}},[n,t,e,i]),f=N.useCallback(async S=>{try{await sv(S),h(d=>d.filter(m=>m.id!==S)),l(d=>d===S?null:d),i(d=>{const m={...d};return delete m[S],m})}catch(d){e(`ワークスペースを削除できませんでした: ${Pe(d)}`)}},[e,i]);return{workspaces:n,editorWorkspaceId:_,setEditorWorkspaceId:l,handleCreateWorkspace:u,handleDeleteWorkspace:f}},p0=({setStatusMessage:e,initializeDeckStates:t,updateDeckState:r,setDeckStates:i,initialDeckIds:n})=>{const[h,_]=N.useState([]),[l,u]=N.useState(n??[]);N.useEffect(()=>{let g=!0;return ov().then(a=>{g&&(_(a),t(a.map(o=>o.id)),a.forEach(o=>{mv(o.id).then(s=>{g&&r(o.id,c=>({...c,terminals:s}))}).catch(()=>{})}))}).catch(a=>{g&&e(`デッキを取得できませんでした: ${Pe(a)}`)}),()=>{g=!1}},[e,t,r]),N.useEffect(()=>{if(h.length===0)return;const g=l.filter(a=>h.some(o=>o.id===a));g.length===l.length&&g.length>0||(g.length>0?u(g):h[0]&&u([h[0].id]))},[h,l]);const f=N.useCallback(async(g,a)=>{try{const o=await lv(g,a);return _(s=>[...s,o]),u(s=>[...s.filter(c=>c!==o.id),o.id]),i(s=>({...s,[o.id]:os()})),o}catch(o){return e(`デッキの作成に失敗しました: ${Pe(o)}`),null}},[e,i]),S=N.useCallback(async g=>{try{await av(g),_(a=>a.filter(o=>o.id!==g)),u(a=>a.filter(o=>o!==g)),i(a=>{const o={...a};return delete o[g],o})}catch(a){e(`デッキの削除に失敗しました: ${Pe(a)}`)}},[e,i]),d=N.useCallback(g=>{_(a=>{const o=g(a);return cv(o.map(s=>s.id)).catch(()=>{}),o})},[]),m=N.useCallback(async(g,a,o,s)=>{try{const c=await vv(g,s,o);r(g,p=>({...p,terminals:[...p.terminals,{id:c.id,title:c.title}]}))}catch(c){e(`ターミナルを起動できませんでした: ${Pe(c)}`)}},[r,e]),C=N.useCallback(async(g,a)=>{try{await gv(a),r(g,o=>({...o,terminals:o.terminals.filter(s=>s.id!==a)}))}catch(o){e(`ターミナルを削除できませんでした: ${Pe(o)}`)}},[r,e]),w=N.useCallback((g,a)=>{r(g,o=>({...o,terminals:o.terminals.filter(s=>s.id!==a)}))},[r]);return{decks:h,activeDeckIds:l,setActiveDeckIds:u,handleCreateDeck:f,handleDeleteDeck:S,handleReorderDecks:d,handleCreateTerminal:m,handleDeleteTerminal:C,handleRemoveTerminalLocal:w}},_0=({editorWorkspaceId:e,activeWorkspaceState:t,updateWorkspaceState:r,setStatusMessage:i})=>{const[n,h]=N.useState(null),_=N.useCallback(()=>{e&&(r(e,a=>({...a,treeLoading:!0,treeError:null})),Ne(hc(e,""),15e3).then(a=>{r(e,o=>({...o,tree:ls(a),treeLoading:!1}))}).catch(a=>{r(e,o=>({...o,treeLoading:!1,treeError:Pe(a)}))}))},[e,r]),l=N.useCallback(a=>{if(!(!e||a.type!=="dir")){if(a.expanded){r(e,o=>({...o,tree:Dr(o.tree,a.path,s=>({...s,expanded:!1}))}));return}if(a.children&&a.children.length>0){r(e,o=>({...o,tree:Dr(o.tree,a.path,s=>({...s,expanded:!0}))}));return}r(e,o=>({...o,tree:Dr(o.tree,a.path,s=>({...s,loading:!0}))})),Ne(hc(e,a.path),15e3).then(o=>{r(e,s=>({...s,tree:Dr(s.tree,a.path,c=>({...c,expanded:!0,loading:!1,children:ls(o)}))}))}).catch(o=>{r(e,s=>({...s,treeError:Pe(o),tree:Dr(s.tree,a.path,c=>({...c,loading:!1}))}))})}},[e,r]),u=N.useCallback(a=>{if(!e||a.type!=="file")return;const o=t.files.find(p=>p.path===a.path);if(o){r(e,p=>({...p,activeFileId:o.id}));return}const s=crypto.randomUUID(),c={id:s,name:a.name,path:a.path,language:cd(a.path),contents:"",dirty:!1};r(e,p=>({...p,files:[...p.files,{...c,contents:"読み込み中..."}],activeFileId:s})),Ne(uv(e,a.path),15e3).then(p=>{r(e,v=>({...v,files:v.files.map(x=>x.id===s?{...x,contents:p.contents}:x)}))}).catch(p=>{r(e,v=>({...v,files:v.files.filter(x=>x.id!==s),activeFileId:v.files.length>1?v.files[0].id:null})),i(`ファイルを開けませんでした: ${Pe(p)}`)})},[e,t.files,r,i]),f=N.useCallback((a,o)=>{e&&r(e,s=>({...s,files:s.files.map(c=>c.id===a?{...c,contents:o,dirty:!0}:c)}))},[e,r]),S=N.useCallback(async a=>{if(!e)return;const o=t.files.find(s=>s.id===a);if(o){h(a);try{await Ne(hv(e,o.path,o.contents),15e3),r(e,s=>({...s,files:s.files.map(c=>c.id===a?{...c,dirty:!1}:c)})),i(Jh)}catch(s){i(`保存に失敗しました: ${Pe(s)}`)}finally{h(null)}}},[e,t.files,r,i]),d=N.useCallback(a=>{e&&r(e,o=>{const s=o.files.findIndex(v=>v.id===a),c=o.files.filter(v=>v.id!==a);let p=o.activeFileId;return o.activeFileId===a&&(c.length===0?p=null:s>=c.length?p=c[c.length-1].id:p=c[s].id),{...o,files:c,activeFileId:p}})},[e,r]),m=N.useCallback(async(a,o)=>{if(!e)return;const s=a?`${a}/${o}`:o;try{await Ne(dv(e,s),15e3);const c={name:o,path:s,type:"file",expanded:!1,loading:!1};r(e,p=>({...p,tree:tl(p.tree,a,c)})),i(`ファイルを作成しました: ${o}`)}catch(c){i(`ファイル作成に失敗しました: ${Pe(c)}`)}},[e,r,i]),C=N.useCallback(async(a,o)=>{if(!e)return;const s=a?`${a}/${o}`:o;try{await Ne(pv(e,s),15e3);const c={name:o,path:s,type:"dir",expanded:!1,loading:!1,children:[]};r(e,p=>({...p,tree:tl(p.tree,a,c)})),i(`フォルダを作成しました: ${o}`)}catch(c){i(`フォルダ作成に失敗しました: ${Pe(c)}`)}},[e,r,i]),w=N.useCallback(async a=>{if(e)try{await Ne(fv(e,a),15e3),r(e,o=>{const s=o.files.filter(v=>v.path!==a);let c=o.activeFileId;const p=o.files.find(v=>v.path===a);return p&&o.activeFileId===p.id&&(c=s.length>0?s[0].id:null),{...o,files:s,activeFileId:c,tree:rl(o.tree,a)}}),i("ファイルを削除しました")}catch(o){i(`ファイル削除に失敗しました: ${Pe(o)}`)}},[e,r,i]),g=N.useCallback(async a=>{if(e)try{await Ne(_v(e,a),15e3),r(e,o=>{const s=o.files.filter(v=>!v.path.startsWith(a+"/")&&v.path!==a);let c=o.activeFileId;const p=o.files.find(v=>v.id===o.activeFileId);return p&&(p.path.startsWith(a+"/")||p.path===a)&&(c=s.length>0?s[0].id:null),{...o,files:s,activeFileId:c,tree:rl(o.tree,a)}}),i("フォルダを削除しました")}catch(o){i(`フォルダ削除に失敗しました: ${Pe(o)}`)}},[e,r,i]);return{savingFileId:n,handleRefreshTree:_,handleToggleDir:l,handleOpenFile:u,handleFileChange:f,handleSaveFile:S,handleCloseFile:d,handleCreateFile:m,handleCreateDirectory:C,handleDeleteFile:w,handleDeleteDirectory:g}};async function v0(e,t,r,i){if(!i.current[e]){i.current[e]=!0,t(e,n=>({...n,loading:!0,reposLoading:!0,error:null}));try{const h=(await Ne(yv(e)).catch(()=>({repos:[]}))).repos;t(e,d=>({...d,repos:h,reposLoading:!1,selectedRepoPath:d.selectedRepoPath??(h.length>0?h[0].path:null)}));const l=(r.current[e]||yi()).selectedRepoPath??(h.length>0?h[0].path:void 0),[u,f,S]=await Promise.all([Ne(id(e,l||void 0)),Ne(od(e,l||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Ne(ld(e,l||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);t(e,d=>({...d,status:u,branchStatus:f,hasRemote:S.hasRemote,loading:!1,error:null}))}catch(n){const h=n instanceof Error?n.message:"Failed to get git status";t(e,_=>({..._,status:null,loading:!1,reposLoading:!1,error:h}))}finally{i.current[e]=!1}}}async function m0(e,t,r,i){r(e,n=>({...n,selectedRepoPath:t,loading:!0}));try{const[n,h,_]=await Promise.all([Ne(id(e,t||void 0)),Ne(od(e,t||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Ne(ld(e,t||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);r(e,l=>({...l,status:n,branchStatus:h,hasRemote:_.hasRemote,loading:!1,branches:[],logs:[]}))}catch(n){const h=n instanceof Error?n.message:"Failed to get git status";i(h),r(e,_=>({..._,loading:!1}))}}async function g0(e,t,r,i,n){try{await nd(e,[t],r),await n()}catch(h){i(h instanceof Error?h.message:"Failed to stage file")}}async function y0(e,t,r,i,n){try{await sd(e,[t],r),await n()}catch(h){i(h instanceof Error?h.message:"Failed to unstage file")}}async function S0(e,t,r,i,n){if(t.length!==0)try{await nd(e,t,r),await n()}catch(h){i(h instanceof Error?h.message:"Failed to stage files")}}async function C0(e,t,r,i,n){if(t.length!==0)try{await sd(e,t,r),await n()}catch(h){i(h instanceof Error?h.message:"Failed to unstage files")}}async function w0(e,t,r,i,n){try{const h=await Sv(e,t.trim(),r);i(`Committed: ${h.summary.changes} changes, +${h.summary.insertions} -${h.summary.deletions}`),await n()}catch(h){i(h instanceof Error?h.message:"Failed to commit")}}async function x0(e,t,r,i,n){try{await Cv(e,[t],r),await n()}catch(h){i(h instanceof Error?h.message:"Failed to discard changes")}}async function b0(e,t,r,i,n){i(e,h=>({...h,diffPath:t.path,diffLoading:!0,diff:null}));try{const h=await wv(e,t.path,t.staged,r);i(e,_=>({..._,diff:h,diffLoading:!1}))}catch(h){n(h instanceof Error?h.message:"Failed to get diff"),i(e,_=>({..._,diffPath:null,diff:null,diffLoading:!1}))}}async function E0(e,t,r,i,n){r(e,h=>({...h,pushing:!0}));try{const h=await xv(e,t);i(`Pushed to ${h.branch}`),await n()}catch(h){i(h instanceof Error?h.message:"Failed to push")}finally{r(e,h=>({...h,pushing:!1}))}}async function k0(e,t,r,i,n){r(e,h=>({...h,pulling:!0}));try{const h=await bv(e,t);h.summary.changes>0?i(`Pulled: ${h.summary.changes} changes, +${h.summary.insertions} -${h.summary.deletions}`):i("Already up to date"),await n()}catch(h){i(h instanceof Error?h.message:"Failed to pull")}finally{r(e,h=>({...h,pulling:!1}))}}async function L0(e,t,r,i){try{await Ev(e,t),r("Fetched from remote"),await i()}catch(n){r(n instanceof Error?n.message:"Failed to fetch")}}async function D0(e,t,r,i){r(e,n=>({...n,branchesLoading:!0}));try{const n=await Ne(kv(e,t));r(e,h=>({...h,branches:n.branches,branchesLoading:!1}))}catch(n){i(n instanceof Error?n.message:"Failed to load branches"),r(e,h=>({...h,branchesLoading:!1}))}}async function R0(e,t,r,i,n,h){try{await Lv(e,t,r),i(`Switched to branch '${t}'`),await n(),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to checkout branch")}}async function T0(e,t,r,i,n,h,_){try{await Dv(e,t,r,i),n(`Created branch '${t}'${r?" and switched to it":""}`),await h(),await _()}catch(l){n(l instanceof Error?l.message:"Failed to create branch")}}async function A0(e,t,r,i,n){i(e,h=>({...h,logsLoading:!0}));try{const h=await Ne(Rv(e,t,r));i(e,_=>({..._,logs:h.logs,logsLoading:!1}))}catch(h){n(h instanceof Error?h.message:"Failed to load git log"),i(e,_=>({..._,logsLoading:!1}))}}const yi=()=>({status:null,loading:!1,error:null,diffPath:null,diff:null,diffLoading:!1,branchStatus:null,hasRemote:!1,pushing:!1,pulling:!1,branches:[],branchesLoading:!1,logs:[],logsLoading:!1,repos:[],reposLoading:!1,selectedRepoPath:null}),P0=(e,t)=>{const[r,i]=N.useState({}),n=N.useRef({}),h=N.useRef(r);h.current=r;const _=e&&r[e]||yi(),l=N.useCallback((T,B)=>{i(z=>({...z,[T]:B(z[T]||yi())}))},[]),u=N.useCallback(async T=>{const B=T||e;B&&await v0(B,l,h,n)},[e,l]),f=N.useCallback(async T=>{e&&await m0(e,T,l,t)},[e,l,t]),S=N.useCallback(async()=>{const T=Object.keys(h.current);await Promise.all(T.map(B=>u(B)))},[u]),d=N.useCallback(()=>{if(!e)return;const T=h.current[e];return(T==null?void 0:T.selectedRepoPath)||void 0},[e]),m=N.useCallback(async T=>{e&&await g0(e,T,d(),t,u)},[e,d,t,u]),C=N.useCallback(async T=>{e&&await y0(e,T,d(),t,u)},[e,d,t,u]),w=N.useCallback(async()=>{if(!e||!_.status)return;const T=_.status.files.filter(B=>!B.staged).map(B=>B.path);await S0(e,T,d(),t,u)},[e,_.status,d,t,u]),g=N.useCallback(async()=>{if(!e||!_.status)return;const T=_.status.files.filter(B=>B.staged).map(B=>B.path);await C0(e,T,d(),t,u)},[e,_.status,d,t,u]),a=N.useCallback(async T=>{!e||!T.trim()||await w0(e,T,d(),t,u)},[e,d,t,u]),o=N.useCallback(async T=>{e&&await x0(e,T,d(),t,u)},[e,d,t,u]),s=N.useCallback(async T=>{e&&await b0(e,T,d(),l,t)},[e,d,l,t]),c=N.useCallback(()=>{e&&l(e,T=>({...T,diffPath:null,diff:null,diffLoading:!1}))},[e,l]),p=N.useCallback(async()=>{e&&await E0(e,d(),l,t,u)},[e,d,l,t,u]),v=N.useCallback(async()=>{e&&await k0(e,d(),l,t,u)},[e,d,l,t,u]),x=N.useCallback(async()=>{e&&await L0(e,d(),t,u)},[e,d,t,u]),b=N.useCallback(async()=>{e&&await D0(e,d(),l,t)},[e,d,l,t]),y=N.useCallback(async T=>{e&&await R0(e,T,d(),t,u,b)},[e,d,t,u,b]),k=N.useCallback(async(T,B=!0)=>{e&&await T0(e,T,B,d(),t,u,b)},[e,d,t,u,b]),R=N.useCallback(async(T=50)=>{e&&await A0(e,T,d(),l,t)},[e,d,l,t]),O=N.useCallback(T=>r[T]||yi(),[r]);return{gitState:_,gitStates:r,refreshGitStatus:u,refreshAllGitStatuses:S,getGitStateForWorkspace:O,handleSelectRepo:f,handleStageFile:m,handleUnstageFile:C,handleStageAll:w,handleUnstageAll:g,handleCommit:a,handleDiscardFile:o,handleShowDiff:s,handleCloseDiff:c,handlePush:p,handlePull:v,handleFetch:x,handleLoadBranches:b,handleCheckoutBranch:y,handleCreateBranch:k,handleLoadLogs:R}};function M0(){const[e,t]=N.useState(Xv);N.useEffect(()=>{if(!(typeof document>"u")){document.documentElement.dataset.theme=e;try{window.localStorage.setItem(td,e)}catch{}}},[e]);const r=N.useCallback(()=>{t(i=>i==="dark"?"light":"dark")},[]);return{theme:e,handleToggleTheme:r}}function B0({view:e,editorWorkspaceId:t,activeDeckIds:r,workspaceMode:i,setView:n,setEditorWorkspaceId:h,setActiveDeckIds:_,setWorkspaceMode:l}){N.useEffect(()=>{const u=()=>{const f=ud();n(f.view),h(f.workspaceId??null),_(f.deckIds),l(f.workspaceMode)};return window.addEventListener("popstate",u),()=>window.removeEventListener("popstate",u)},[n,h,_,l]),N.useEffect(()=>{const u=new URLSearchParams;u.set("view",e),e==="workspace"&&t&&u.set("workspace",t),r.length>0&&u.set("decks",r.join(",")),e==="workspace"&&i==="editor"&&t&&u.set("mode","editor");const f=u.toString(),S=f?`${window.location.pathname}?${f}`:window.location.pathname;window.history.replaceState(null,"",S)},[e,t,r,i])}function O0(){const[e,t]=N.useState(!1),[r,i]=N.useState(!1),[n,h]=N.useState(!1),_=N.useCallback(()=>t(!0),[]),l=N.useCallback(()=>t(!1),[]),u=N.useCallback(()=>i(!0),[]),f=N.useCallback(()=>i(!1),[]),S=N.useCallback(()=>h(!0),[]),d=N.useCallback(()=>h(!1),[]);return{isWorkspaceModalOpen:e,openWorkspaceModal:_,closeWorkspaceModal:l,isDeckModalOpen:r,openDeckModal:u,closeDeckModal:f,isSettingsModalOpen:n,openSettingsModal:S,closeSettingsModal:d}}const Ac=3;function Pc(e,t,r){const i=e.indexOf(t),n=e.indexOf(r);if(i<0||n<0||i===n)return e;const h=[...e];h.splice(i,1);const _=h.indexOf(r);return h.splice(_,0,t),h}function N0(){const e=ud(),t=N.useRef(null),r=N.useRef(!1),[i,n]=N.useState(e.view),[h,_]=N.useState(e.workspaceMode),[l,u]=N.useState(q_),[f,S]=N.useState(""),[d,m]=N.useState(null),[C,w]=N.useState(null),[g,a]=N.useState(!1),[o,s]=N.useState(!1),[c,p]=N.useState(null),{theme:v,handleToggleTheme:x}=M0(),{isWorkspaceModalOpen:b,openWorkspaceModal:y,closeWorkspaceModal:k,isDeckModalOpen:R,openDeckModal:O,closeDeckModal:T,isSettingsModalOpen:B,openSettingsModal:z,closeSettingsModal:I}=O0(),{workspaceStates:j,setWorkspaceStates:$,updateWorkspaceState:E,initializeWorkspaceStates:A}=h0(),{deckStates:P,setDeckStates:M,updateDeckState:H,initializeDeckStates:K}=d0(),{workspaces:X,editorWorkspaceId:q,setEditorWorkspaceId:se,handleCreateWorkspace:D,handleDeleteWorkspace:F}=f0({setStatusMessage:S,defaultRoot:l,initializeWorkspaceStates:A,setWorkspaceStates:$}),{decks:W,activeDeckIds:U,setActiveDeckIds:re,handleCreateDeck:J,handleDeleteDeck:ae,handleReorderDecks:we,handleCreateTerminal:fe,handleDeleteTerminal:ut,handleRemoveTerminalLocal:ne}=p0({setStatusMessage:S,initializeDeckStates:K,updateDeckState:H,setDeckStates:M,initialDeckIds:e.deckIds}),ht=N.useMemo(()=>ss(),[]),Xe=N.useMemo(()=>os(),[]),Ut=X.find(V=>V.id===q)||null,Q=q&&j[q]||ht,{savingFileId:Y,handleRefreshTree:te,handleToggleDir:ie,handleOpenFile:oe,handleFileChange:ce,handleSaveFile:Be,handleCloseFile:me,handleCreateFile:Tt,handleCreateDirectory:We,handleDeleteFile:At,handleDeleteDirectory:pe}=_0({editorWorkspaceId:q,activeWorkspaceState:Q,updateWorkspaceState:E,setStatusMessage:S}),{gitState:ni,refreshGitStatus:ks,handleSelectRepo:yd,handleStageFile:Sd,handleUnstageFile:Cd,handleStageAll:wd,handleUnstageAll:xd,handleCommit:bd,handleDiscardFile:Ed,handleShowDiff:kd,handleCloseDiff:Ld,handlePush:Dd,handlePull:Rd,handleLoadBranches:Td,handleCheckoutBranch:Ad,handleCreateBranch:Pd,handleLoadLogs:Md}=P0(q,S);B0({view:i,editorWorkspaceId:q,activeDeckIds:U,workspaceMode:h,setView:n,setEditorWorkspaceId:se,setActiveDeckIds:re,setWorkspaceMode:_});const Bd=ev(),Ql=N.useMemo(()=>new Map(X.map(V=>[V.id,V])),[X]),Ls=W;N.useEffect(()=>{let V=!0;return iv().then(ee=>{V&&ee!=null&&ee.defaultRoot&&u(ee.defaultRoot)}).catch(()=>{}),()=>{V=!1}},[]),N.useEffect(()=>{if(f!==Jh)return;const V=setTimeout(()=>S(""),Y_);return()=>clearTimeout(V)},[f]),N.useEffect(()=>{h==="editor"&&!q&&_("list")},[h,q]),N.useEffect(()=>{if(typeof window>"u")return;const V=window.matchMedia("(pointer: fine) and (min-width: 721px)"),ee=()=>s(V.matches);return ee(),V.addEventListener("change",ee),()=>V.removeEventListener("change",ee)},[]);const Pt=N.useCallback(()=>{m(null),w(null),a(!1)},[]),tn=N.useCallback(()=>{r.current=!0,window.setTimeout(()=>{r.current=!1},100)},[]);N.useEffect(()=>{o||Pt()},[o,Pt]);const Ds=N.useRef(null);N.useEffect(()=>{if(h!=="editor"||!q){Ds.current=null;return}Ds.current!==q&&(Ds.current=q,te(),ks())},[h,q,te,ks]);const Od=N.useCallback(()=>{if(X.length===0){S(G_);return}O()},[X.length,O]),Nd=N.useCallback(async(V,ee)=>{if(!ee){S(X_);return}await J(V,ee)&&T()},[J,T]),jd=N.useCallback(async V=>{try{const ee=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)});if(!ee.ok){const ge=await ee.text();throw new Error(ge||"Failed to save settings")}await ee.json(),S("設定を保存しました。ブラウザをリロードしてください。"),setTimeout(()=>{window.location.reload()},2e3)}catch(ee){throw console.error("Failed to save settings:",ee),ee}},[]),Id=N.useCallback(V=>{se(V),_("editor")},[se]),Fd=N.useCallback(()=>{_("list")},[]),Hd=N.useCallback(async V=>{await D(V)&&k()},[D,k]),zd=N.useCallback(V=>{const ee=P[V]||Xe;fe(V,ee.terminals.length)},[P,Xe,fe]),$d=N.useCallback(V=>{const ee=P[V]||Xe;fe(V,ee.terminals.length,"claude","Claude Code")},[P,Xe,fe]),Ud=N.useCallback(V=>{const ee=P[V]||Xe;fe(V,ee.terminals.length,"codex","Codex")},[P,Xe,fe]),Wd=N.useCallback((V,ee)=>{ut(V,ee)},[ut]),Vd=N.useCallback((V,ee)=>{ne(V,ee)},[ne]),Kd=N.useCallback(V=>{if(r.current){r.current=!1;return}re([V])},[re]),Jl=N.useCallback(V=>{re(ee=>{const ge=[...ee.filter(_e=>_e!==V),V];return ge.length<=Ac?ge:ge.slice(ge.length-Ac)})},[re]),qd=N.useCallback(V=>{re(ee=>{if(ee.length<=1){const ge=Ls.find(_e=>_e.id!==V);return ge?[ge.id]:ee}return ee.filter(ge=>ge!==V)})},[Ls,re]),Gd=N.useCallback((V,ee)=>{V.preventDefault(),V.stopPropagation(),p({deckId:ee,x:V.clientX,y:V.clientY})},[]),Xd=N.useCallback(()=>{if(!c)return;const{deckId:V}=c;p(null),window.confirm(`このデッキを完全に削除しますか?
64
- ターミナルもすべて削除されます。`)&&ae(V)},[c,ae]),Zl=N.useCallback(()=>{p(null)},[]),Yd=N.useCallback((V,ee)=>{if(!o){V.preventDefault();return}V.dataTransfer.effectAllowed="move",V.dataTransfer.setData("text/plain",ee),m(ee),w(null),a(!1)},[o]),Qd=N.useCallback((V,ee)=>{!o||!d||d===ee||(V.preventDefault(),V.dataTransfer.dropEffect="move",w(ee),a(!1))},[o,d]),Jd=N.useCallback((V,ee)=>{V.currentTarget.contains(V.relatedTarget)||w(ge=>ge===ee?null:ge)},[]),Zd=N.useCallback((V,ee)=>{if(!o)return;V.preventDefault();const ge=d||V.dataTransfer.getData("text/plain");if(!ge||ge===ee){Pt();return}we(_e=>{const af=_e.map(kr=>kr.id),cf=Pc(af,ge,ee),uf=new Map(_e.map(kr=>[kr.id,kr]));return cf.map(kr=>uf.get(kr))}),re(_e=>Pc(_e,ge,ee)),tn(),Pt()},[d,o,Pt,re,tn,we]),ef=N.useCallback(V=>{!o||!d||(V.preventDefault(),V.dataTransfer.dropEffect="move",a(!0))},[o,d]),tf=N.useCallback(V=>{V.currentTarget.contains(V.relatedTarget)||a(!1)},[]),rf=N.useCallback(V=>{if(!o)return;V.preventDefault();const ee=d||V.dataTransfer.getData("text/plain");if(!ee){Pt();return}Jl(ee),tn(),Pt()},[d,Jl,o,Pt,tn]),nf=N.useCallback(V=>{q&&E(q,ee=>({...ee,activeFileId:V}))},[q,E]),sf=h==="editor"&&!!q,of=L.jsxs("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[L.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 flex-shrink-0",children:[L.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90",onClick:y,children:"ワークスペース追加"}),L.jsx(jv,{workspaces:X,selectedWorkspaceId:q,onSelect:Id,onDelete:F})]}),sf&&L.jsx(qg,{activeWorkspace:Ut,defaultRoot:l,activeWorkspaceState:Q,editorWorkspaceId:q,gitState:ni,theme:v,savingFileId:Y,onCloseWorkspaceEditor:Fd,onToggleDir:ie,onOpenFile:oe,onRefreshTree:te,onCreateFile:Tt,onCreateDirectory:We,onDeleteFile:At,onDeleteDirectory:pe,onRefreshGit:ks,onSelectRepo:yd,onStageFile:Sd,onUnstageFile:Cd,onStageAll:wd,onUnstageAll:xd,onCommit:bd,onDiscardFile:Ed,onShowDiff:kd,onCloseDiff:Ld,onPush:Dd,onPull:Rd,onLoadBranches:Td,onCheckoutBranch:Ad,onCreateBranch:Pd,onLoadLogs:Md,onSelectFile:nf,onCloseFile:me,onChangeFile:ce,onSaveFile:Be})]}),lf=L.jsxs("div",{className:"terminal-layout",children:[L.jsx("div",{className:"terminal-topbar",children:L.jsx("div",{className:"topbar-left",children:L.jsxs("div",{className:"deck-tabs",children:[Ls.map(V=>{var ee,ge;return L.jsxs("button",{type:"button",className:tt("deck-tab",U.includes(V.id)&&"active",d===V.id&&"is-dragging",C===V.id&&"is-drag-over"),onClick:()=>Kd(V.id),onContextMenu:_e=>Gd(_e,V.id),draggable:o,onDragStart:_e=>Yd(_e,V.id),onDragOver:_e=>Qd(_e,V.id),onDragLeave:_e=>Jd(_e,V.id),onDrop:_e=>Zd(_e,V.id),onDragEnd:Pt,title:o?`${((ee=Ql.get(V.workspaceId))==null?void 0:ee.path)||V.root}
65
- ドラッグで並び替え / メインにドロップで分割表示`:`${((ge=Ql.get(V.workspaceId))==null?void 0:ge.path)||V.root}`,children:[L.jsx("span",{className:"deck-tab-name",children:V.name}),L.jsx("span",{className:"deck-tab-close",role:"button","aria-label":"閉じる",onClick:_e=>{_e.stopPropagation(),qd(V.id)},children:"×"})]},V.id)}),L.jsx("button",{type:"button",className:"deck-tab deck-tab-add",onClick:Od,title:"デッキ作成",children:"+"})]})})}),L.jsx("div",{className:tt("terminal-split-container",g&&"is-drop-target"),ref:t,style:{gridTemplateColumns:`repeat(${U.length}, 1fr)`},onDragOver:ef,onDragLeave:tf,onDrop:rf,children:U.length===0?L.jsx("div",{className:"panel flex items-center justify-center text-muted text-[13px] p-5",children:"デッキを作成してください。"}):U.map(V=>{const ee=W.find(_e=>_e.id===V),ge=P[V]||Xe;return ee?L.jsxs("div",{className:"deck-split-pane",children:[L.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border bg-sidebar gap-2 min-h-[28px]",children:[U.length>1&&L.jsx("span",{className:"flex-1 min-w-0 text-[11px] font-semibold text-ink-muted overflow-hidden text-ellipsis whitespace-nowrap",children:ee.name}),L.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[L.jsx("button",{type:"button",className:"topbar-btn-sm",onClick:()=>zd(V),title:"ターミナル追加",children:"+"}),L.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-claude",onClick:()=>$d(V),title:"Claude",children:"C"}),L.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-codex",onClick:()=>Ud(V),title:"Codex",children:"X"})]})]}),L.jsx(Ov,{terminals:ge.terminals,wsBase:Bd,onDeleteTerminal:_e=>Wd(V,_e),onExitTerminal:_e=>Vd(V,_e)})]},V):null})})]});return L.jsxs("div",{className:"app","data-view":i,children:[L.jsx(H_,{activeView:i,onSelect:n,theme:v,onToggleTheme:x,onOpenSettings:z}),L.jsxs("main",{className:"main",children:[i==="workspace"&&of,i==="terminal"&&lf]}),L.jsx(z_,{message:f}),L.jsx(Yv,{isOpen:b,defaultRoot:l,onSubmit:Hd,onClose:k}),L.jsx(F_,{isOpen:R,workspaces:X,onSubmit:Nd,onClose:T}),L.jsx(u0,{isOpen:B,onClose:I,onSave:jd}),c&&L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"fixed inset-0 z-[999]",onClick:Zl,onContextMenu:V=>{V.preventDefault(),Zl()}}),L.jsx("div",{className:"fixed z-[1000] bg-panel border border-border shadow-lg rounded-[2px] py-1 min-w-[140px]",style:{left:c.x,top:c.y},children:L.jsx("button",{type:"button",className:"w-full text-left px-3 py-1.5 text-[13px] text-red-400 bg-transparent border-0 cursor-pointer hover:bg-list-hover",onClick:Xd,children:"デッキを削除"})})]})]})}class j0 extends N.Component{constructor(t){super(t),this.handleReload=()=>{window.location.reload()},this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("Application error:",t),console.error("Component stack:",r.componentStack)}render(){return this.state.hasError?L.jsx("div",{className:"flex items-center justify-center min-h-screen p-8 bg-bg",children:L.jsxs("div",{className:"max-w-[500px] p-8 bg-panel border border-border text-center",children:[L.jsx("h1",{className:"m-0 mb-4 text-xl text-[#f14c4c]",children:"Something went wrong"}),L.jsx("p",{className:"m-0 mb-6 text-muted",children:"The application encountered an unexpected error."}),this.state.error&&!1,L.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 bg-accent text-white border-0 rounded-[2px] font-medium cursor-pointer hover:opacity-90",children:"Reload Application"})]})}):this.props.children}}lo.createRoot(document.getElementById("root")).render(L.jsx(vr.StrictMode,{children:L.jsx(j0,{children:L.jsx(N0,{})})}));
63
+ `},Rc=Jm(rg)(hd),ig={config:eg},ng=function(){for(var t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return function(n){return r.reduceRight(function(h,_){return _(h)},n)}};function dd(e,t){return Object.keys(t).forEach(function(r){t[r]instanceof Object&&e[r]&&Object.assign(t[r],dd(e[r],t[r]))}),kc(kc({},e),t)}var sg={type:"cancelation",msg:"operation is manually canceled"};function no(e){var t=!1,r=new Promise(function(i,n){e.then(function(h){return t?n(sg):i(h)}),e.catch(n)});return r.cancel=function(){return t=!0},r}var og=["monaco"],lg=Ym.create({config:Qm,isInitialized:!1,resolve:null,reject:null,monaco:null}),fd=Pm(lg,2),en=fd[0],Es=fd[1];function ag(e){var t=ig.config(e),r=t.monaco,i=Tm(t,og);Es(function(n){return{config:dd(n.config,i),monaco:r}})}function cg(){var e=en(function(t){var r=t.monaco,i=t.isInitialized,n=t.resolve;return{monaco:r,isInitialized:i,resolve:n}});if(!e.isInitialized){if(Es({isInitialized:!0}),e.monaco)return e.resolve(e.monaco),no(so);if(window.monaco&&window.monaco.editor)return pd(window.monaco),e.resolve(window.monaco),no(so);ng(ug,dg)(fg)}return no(so)}function ug(e){return document.body.appendChild(e)}function hg(e){var t=document.createElement("script");return e&&(t.src=e),t}function dg(e){var t=en(function(i){var n=i.config,h=i.reject;return{config:n,reject:h}}),r=hg("".concat(t.config.paths.vs,"/loader.js"));return r.onload=function(){return e()},r.onerror=t.reject,r}function fg(){var e=en(function(r){var i=r.config,n=r.resolve,h=r.reject;return{config:i,resolve:n,reject:h}}),t=window.require;t.config(e.config),t(["vs/editor/editor.main"],function(r){var i=r.m||r;pd(i),e.resolve(i)},function(r){e.reject(r)})}function pd(e){en().monaco||Es({monaco:e})}function pg(){return en(function(e){var t=e.monaco;return t})}var so=new Promise(function(e,t){return Es({resolve:e,reject:t})}),_d={config:ag,init:cg,__getMonacoInstance:pg},_g={wrapper:{display:"flex",position:"relative",textAlign:"initial"},fullWidth:{width:"100%"},hide:{display:"none"}},oo=_g,vg={container:{display:"flex",height:"100%",width:"100%",justifyContent:"center",alignItems:"center"}},mg=vg;function gg({children:e}){return vr.createElement("div",{style:mg.container},e)}var yg=gg,Sg=yg;function Cg({width:e,height:t,isEditorReady:r,loading:i,_ref:n,className:h,wrapperProps:_}){return vr.createElement("section",{style:{...oo.wrapper,width:e,height:t},..._},!r&&vr.createElement(Sg,null,i),vr.createElement("div",{ref:n,style:{...oo.fullWidth,...!r&&oo.hide},className:h}))}var wg=Cg,vd=N.memo(wg);function xg(e){N.useEffect(e,[])}var md=xg;function bg(e,t,r=!0){let i=N.useRef(!0);N.useEffect(i.current||!r?()=>{i.current=!1}:e,t)}var nt=bg;function Ri(){}function zr(e,t,r,i){return Eg(e,i)||kg(e,t,r,i)}function Eg(e,t){return e.editor.getModel(gd(e,t))}function kg(e,t,r,i){return e.editor.createModel(t,r,i?gd(e,i):void 0)}function gd(e,t){return e.Uri.parse(t)}function Lg({original:e,modified:t,language:r,originalLanguage:i,modifiedLanguage:n,originalModelPath:h,modifiedModelPath:_,keepCurrentOriginalModel:l=!1,keepCurrentModifiedModel:u=!1,theme:f="light",loading:y="Loading...",options:d={},height:m="100%",width:C="100%",className:w,wrapperProps:g={},beforeMount:a=Ri,onMount:o=Ri}){let[s,c]=N.useState(!1),[p,v]=N.useState(!0),x=N.useRef(null),b=N.useRef(null),S=N.useRef(null),k=N.useRef(o),R=N.useRef(a),O=N.useRef(!1);md(()=>{let I=_d.init();return I.then(j=>(b.current=j)&&v(!1)).catch(j=>(j==null?void 0:j.type)!=="cancelation"&&console.error("Monaco initialization: error:",j)),()=>x.current?z():I.cancel()}),nt(()=>{if(x.current&&b.current){let I=x.current.getOriginalEditor(),j=zr(b.current,e||"",i||r||"text",h||"");j!==I.getModel()&&I.setModel(j)}},[h],s),nt(()=>{if(x.current&&b.current){let I=x.current.getModifiedEditor(),j=zr(b.current,t||"",n||r||"text",_||"");j!==I.getModel()&&I.setModel(j)}},[_],s),nt(()=>{let I=x.current.getModifiedEditor();I.getOption(b.current.editor.EditorOption.readOnly)?I.setValue(t||""):t!==I.getValue()&&(I.executeEdits("",[{range:I.getModel().getFullModelRange(),text:t||"",forceMoveMarkers:!0}]),I.pushUndoStop())},[t],s),nt(()=>{var I,j;(j=(I=x.current)==null?void 0:I.getModel())==null||j.original.setValue(e||"")},[e],s),nt(()=>{let{original:I,modified:j}=x.current.getModel();b.current.editor.setModelLanguage(I,i||r||"text"),b.current.editor.setModelLanguage(j,n||r||"text")},[r,i,n],s),nt(()=>{var I;(I=b.current)==null||I.editor.setTheme(f)},[f],s),nt(()=>{var I;(I=x.current)==null||I.updateOptions(d)},[d],s);let T=N.useCallback(()=>{var $;if(!b.current)return;R.current(b.current);let I=zr(b.current,e||"",i||r||"text",h||""),j=zr(b.current,t||"",n||r||"text",_||"");($=x.current)==null||$.setModel({original:I,modified:j})},[r,t,n,e,i,h,_]),B=N.useCallback(()=>{var I;!O.current&&S.current&&(x.current=b.current.editor.createDiffEditor(S.current,{automaticLayout:!0,...d}),T(),(I=b.current)==null||I.editor.setTheme(f),c(!0),O.current=!0)},[d,f,T]);N.useEffect(()=>{s&&k.current(x.current,b.current)},[s]),N.useEffect(()=>{!p&&!s&&B()},[p,s,B]);function z(){var j,$,E,A;let I=(j=x.current)==null?void 0:j.getModel();l||(($=I==null?void 0:I.original)==null||$.dispose()),u||((E=I==null?void 0:I.modified)==null||E.dispose()),(A=x.current)==null||A.dispose()}return vr.createElement(vd,{width:C,height:m,isEditorReady:s,loading:y,_ref:S,className:w,wrapperProps:g})}var Dg=Lg,Rg=N.memo(Dg);function Tg(e){let t=N.useRef();return N.useEffect(()=>{t.current=e},[e]),t.current}var Ag=Tg,Cn=new Map;function Pg({defaultValue:e,defaultLanguage:t,defaultPath:r,value:i,language:n,path:h,theme:_="light",line:l,loading:u="Loading...",options:f={},overrideServices:y={},saveViewState:d=!0,keepCurrentModel:m=!1,width:C="100%",height:w="100%",className:g,wrapperProps:a={},beforeMount:o=Ri,onMount:s=Ri,onChange:c,onValidate:p=Ri}){let[v,x]=N.useState(!1),[b,S]=N.useState(!0),k=N.useRef(null),R=N.useRef(null),O=N.useRef(null),T=N.useRef(s),B=N.useRef(o),z=N.useRef(),I=N.useRef(i),j=Ag(h),$=N.useRef(!1),E=N.useRef(!1);md(()=>{let M=_d.init();return M.then(H=>(k.current=H)&&S(!1)).catch(H=>(H==null?void 0:H.type)!=="cancelation"&&console.error("Monaco initialization: error:",H)),()=>R.current?P():M.cancel()}),nt(()=>{var H,K,X,q;let M=zr(k.current,e||i||"",t||n||"",h||r||"");M!==((H=R.current)==null?void 0:H.getModel())&&(d&&Cn.set(j,(K=R.current)==null?void 0:K.saveViewState()),(X=R.current)==null||X.setModel(M),d&&((q=R.current)==null||q.restoreViewState(Cn.get(h))))},[h],v),nt(()=>{var M;(M=R.current)==null||M.updateOptions(f)},[f],v),nt(()=>{!R.current||i===void 0||(R.current.getOption(k.current.editor.EditorOption.readOnly)?R.current.setValue(i):i!==R.current.getValue()&&(E.current=!0,R.current.executeEdits("",[{range:R.current.getModel().getFullModelRange(),text:i,forceMoveMarkers:!0}]),R.current.pushUndoStop(),E.current=!1))},[i],v),nt(()=>{var H,K;let M=(H=R.current)==null?void 0:H.getModel();M&&n&&((K=k.current)==null||K.editor.setModelLanguage(M,n))},[n],v),nt(()=>{var M;l!==void 0&&((M=R.current)==null||M.revealLine(l))},[l],v),nt(()=>{var M;(M=k.current)==null||M.editor.setTheme(_)},[_],v);let A=N.useCallback(()=>{var M;if(!(!O.current||!k.current)&&!$.current){B.current(k.current);let H=h||r,K=zr(k.current,i||e||"",t||n||"",H||"");R.current=(M=k.current)==null?void 0:M.editor.create(O.current,{model:K,automaticLayout:!0,...f},y),d&&R.current.restoreViewState(Cn.get(H)),k.current.editor.setTheme(_),l!==void 0&&R.current.revealLine(l),x(!0),$.current=!0}},[e,t,r,i,n,h,f,y,d,_,l]);N.useEffect(()=>{v&&T.current(R.current,k.current)},[v]),N.useEffect(()=>{!b&&!v&&A()},[b,v,A]),I.current=i,N.useEffect(()=>{var M,H;v&&c&&((M=z.current)==null||M.dispose(),z.current=(H=R.current)==null?void 0:H.onDidChangeModelContent(K=>{E.current||c(R.current.getValue(),K)}))},[v,c]),N.useEffect(()=>{if(v){let M=k.current.editor.onDidChangeMarkers(H=>{var X;let K=(X=R.current.getModel())==null?void 0:X.uri;if(K&&H.find(q=>q.path===K.path)){let q=k.current.editor.getModelMarkers({resource:K});p==null||p(q)}});return()=>{M==null||M.dispose()}}return()=>{}},[v,p]);function P(){var M,H;(M=z.current)==null||M.dispose(),m?d&&Cn.set(h,R.current.saveViewState()):(H=R.current.getModel())==null||H.dispose(),R.current.dispose()}return vr.createElement(vd,{width:C,height:w,isEditorReady:v,loading:u,_ref:O,className:g,wrapperProps:a})}var Mg=Pg,Bg=N.memo(Mg),Og=Bg;const Tc="ファイルを選択してください",Ng="vs-dark",jg="vs";function Ig(e){var i;const t=((i=e.split(".").pop())==null?void 0:i.toLowerCase())||"";return{ts:{icon:"TS",color:"#3178c6"},tsx:{icon:"TSX",color:"#3178c6"},js:{icon:"JS",color:"#f7df1e"},jsx:{icon:"JSX",color:"#61dafb"},json:{icon:"{ }",color:"#cbcb41"},html:{icon:"<>",color:"#e34c26"},css:{icon:"#",color:"#264de4"},scss:{icon:"S",color:"#cc6699"},md:{icon:"M↓",color:"#083fa1"},py:{icon:"PY",color:"#3776ab"},go:{icon:"GO",color:"#00add8"},rs:{icon:"RS",color:"#dea584"},java:{icon:"J",color:"#b07219"},sql:{icon:"SQL",color:"#e38c00"},yml:{icon:"Y",color:"#cb171e"},yaml:{icon:"Y",color:"#cb171e"},sh:{icon:"$",color:"#89e051"},bash:{icon:"$",color:"#89e051"},txt:{icon:"TXT",color:"#6a737d"}}[t]||{icon:"📄",color:"var(--ink-muted)"}}function Fg(e){return{typescript:"TypeScript",typescriptreact:"TypeScript React",javascript:"JavaScript",javascriptreact:"JavaScript React",json:"JSON",html:"HTML",css:"CSS",scss:"SCSS",markdown:"Markdown",python:"Python",go:"Go",rust:"Rust",java:"Java",sql:"SQL",yaml:"YAML",shell:"Shell",plaintext:"Plain Text"}[e]||e}function Hg({files:e,activeFileId:t,onSelectFile:r,onCloseFile:i,onChangeFile:n,onSaveFile:h,savingFileId:_,theme:l}){const u=e.find(g=>g.id===t),f=N.useRef(null),[y,d]=N.useState({line:1,column:1}),m=N.useCallback(g=>{f.current=g,g.onDidChangeCursorPosition(a=>{d({line:a.position.lineNumber,column:a.position.column})})},[]);N.useEffect(()=>{const g=a=>{!t||!((a.ctrlKey||a.metaKey)&&a.key.toLowerCase()==="s")||(a.preventDefault(),h==null||h(t))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[t,h]);const C=(g,a)=>{g.stopPropagation(),i(a)},w=(g,a)=>{g.button===1&&(g.preventDefault(),i(a))};return e.length===0?L.jsx("div",{className:"editor-container editor-empty",children:L.jsxs("div",{className:"editor-welcome",children:[L.jsx("div",{className:"editor-welcome-icon",children:L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M13 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V9z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),L.jsx("polyline",{points:"13 2 13 9 20 9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]})}),L.jsx("div",{className:"editor-welcome-text",children:Tc}),L.jsx("div",{className:"editor-welcome-hint",children:"左のファイルツリーからファイルを選択"})]})}):L.jsxs("div",{className:"editor-container",children:[L.jsx("div",{className:"editor-tabs",children:L.jsx("div",{className:"editor-tabs-list",children:e.map(g=>{const{icon:a,color:o}=Ig(g.name),s=g.id===t,c=_===g.id;return L.jsxs("div",{className:Ie("editor-tab",s&&"active",g.dirty&&"dirty"),onClick:()=>r(g.id),onMouseDown:p=>w(p,g.id),role:"tab","aria-selected":s,tabIndex:0,children:[L.jsx("span",{className:"editor-tab-icon",style:{color:o},children:a}),L.jsx("span",{className:"editor-tab-name",children:g.name}),g.dirty&&!c&&L.jsx("span",{className:"editor-tab-dirty","aria-label":"未保存",children:"●"}),c&&L.jsx("span",{className:"editor-tab-saving","aria-label":"保存中",children:L.jsx("svg",{viewBox:"0 0 24 24",className:"spin",children:L.jsx("circle",{cx:"12",cy:"12",r:"10",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeDasharray:"30 70"})})}),L.jsx("button",{type:"button",className:"editor-tab-close",onClick:p=>C(p,g.id),"aria-label":"閉じる",children:L.jsx("svg",{viewBox:"0 0 24 24",children:L.jsx("path",{d:"M18 6L6 18M6 6l12 12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})})]},g.id)})})}),u&&L.jsx("div",{className:"editor-breadcrumb",children:L.jsx("span",{className:"editor-breadcrumb-path",children:u.path})}),L.jsx("div",{className:"editor-content",children:u?L.jsx(Og,{height:"100%",theme:l==="dark"?Ng:jg,language:u.language,value:u.contents,onChange:g=>n(u.id,g??""),onMount:m,options:{fontFamily:Zh,fontSize:ed,fontLigatures:!0,minimap:{enabled:!0,scale:1,showSlider:"mouseover"},smoothScrolling:!0,cursorBlinking:"smooth",cursorSmoothCaretAnimation:"on",renderLineHighlight:"all",scrollBeyondLastLine:!1,automaticLayout:!0,padding:{top:8,bottom:8},lineNumbers:"on",renderWhitespace:"selection",bracketPairColorization:{enabled:!0},guides:{bracketPairs:!0,indentation:!0}}}):L.jsx("div",{className:"editor-no-file",children:L.jsx("span",{children:Tc})})}),u&&L.jsxs("div",{className:"editor-statusbar",children:[L.jsx("div",{className:"editor-statusbar-left",children:L.jsxs("span",{className:"editor-status-item",children:[L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),L.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"2"})]}),"main"]})}),L.jsxs("div",{className:"editor-statusbar-right",children:[L.jsxs("span",{className:"editor-status-item",children:["Ln ",y.line,", Col ",y.column]}),L.jsx("span",{className:"editor-status-item",children:"UTF-8"}),L.jsx("span",{className:"editor-status-item",children:Fg(u.language)})]})]})]})}const zg="差分ビューア",$g="読み込み中...",Ug="閉じる",Wg="vs-dark",Vg="vs";function Kg({diff:e,loading:t,theme:r,onClose:i}){const n=e?cd(e.path):"plaintext";return L.jsxs("div",{className:"fixed inset-0 bg-bg z-50 grid grid-rows-[35px_minmax(0,1fr)]",children:[L.jsxs("div",{className:"flex items-center justify-between gap-3 px-3 bg-title-bar border-b border-border",children:[L.jsxs("div",{children:[L.jsx("div",{className:"text-[13px] font-medium",children:zg}),e&&L.jsx("div",{className:"text-xs text-muted font-mono",children:e.path})]}),L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:i,children:Ug})]}),L.jsx("div",{className:"min-h-0 overflow-hidden",children:t?L.jsx("div",{className:"flex items-center justify-center h-full text-muted text-[13px] p-5",children:$g}):e?L.jsx(Rg,{height:"100%",theme:r==="dark"?Wg:Vg,language:n,original:e.original,modified:e.modified,options:{fontFamily:Zh,fontSize:ed,readOnly:!0,renderSideBySide:!0,minimap:{enabled:!1},smoothScrolling:!0}}):null})]})}function qg({activeWorkspace:e,defaultRoot:t,activeWorkspaceState:r,editorWorkspaceId:i,gitState:n,theme:h,savingFileId:_,onCloseWorkspaceEditor:l,onToggleDir:u,onOpenFile:f,onRefreshTree:y,onCreateFile:d,onCreateDirectory:m,onDeleteFile:C,onDeleteDirectory:w,onRefreshGit:g,onSelectRepo:a,onStageFile:o,onUnstageFile:s,onStageAll:c,onUnstageAll:p,onCommit:v,onDiscardFile:x,onShowDiff:b,onCloseDiff:S,onPush:k,onPull:R,onLoadBranches:O,onCheckoutBranch:T,onCreateBranch:B,onLoadLogs:z,onSelectFile:I,onCloseFile:j,onChangeFile:$,onSaveFile:E}){var q,se;const[A,P]=N.useState(!1),[M,H]=N.useState("files"),K=N.useCallback(D=>{f(D),P(!1)},[f]),X=((q=n.status)==null?void 0:q.files.length)??0;return L.jsxs("div",{className:Ie("workspace-editor-overlay",A&&"drawer-open"),children:[L.jsxs("div",{className:"workspace-editor-header",children:[L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:l,children:"一覧に戻る"}),L.jsx("button",{type:"button",className:"sidebar-toggle-btn bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover min-h-[44px] min-w-[44px]",onClick:()=>P(D=>!D),"aria-label":"\\u30b5\\u30a4\\u30c9\\u30d0\\u30fc",children:L.jsx("svg",{viewBox:"0 0 24 24",width:"18",height:"18","aria-hidden":"true",children:L.jsx("path",{d:"M3 12h18M3 6h18M3 18h18",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}),L.jsx("div",{className:"workspace-meta",children:e?e.path:null})]}),L.jsxs("div",{className:"workspace-editor-grid",children:[L.jsxs("div",{className:"activity-bar",children:[L.jsx("button",{type:"button",className:Ie("activity-bar-item",M==="files"&&"active"),onClick:()=>H("files"),title:"エクスプローラー",children:L.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:L.jsx("path",{d:"M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2h-6l-2-2H5a2 2 0 00-2 2z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),L.jsxs("button",{type:"button",className:Ie("activity-bar-item",M==="git"&&"active"),onClick:()=>{H("git"),g()},title:"ソースコントロール",children:[L.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[L.jsx("path",{d:"M6 3v12M18 9a3 3 0 110 6 3 3 0 010-6zM6 21a3 3 0 110-6 3 3 0 010 6z",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),L.jsx("path",{d:"M18 12c0 3-3 4-6 4s-6-1-6-4",fill:"none",stroke:"currentColor",strokeWidth:"1.5"})]}),X>0&&L.jsx("span",{className:"activity-bar-badge",children:X})]})]}),L.jsx("div",{className:"sidebar-panel",children:L.jsx("div",{className:"sidebar-content",children:M==="files"?L.jsx(ad,{root:(e==null?void 0:e.path)||t||"",entries:r.tree,loading:r.treeLoading,error:r.treeError,onToggleDir:u,onOpenFile:K,onRefresh:y,onCreateFile:d,onCreateDirectory:m,onDeleteFile:C,onDeleteDirectory:w,gitFiles:(se=n.status)==null?void 0:se.files}):L.jsx(Em,{status:n.status,loading:n.loading,error:n.error,workspaceId:i,branchStatus:n.branchStatus,hasRemote:n.hasRemote,pushing:n.pushing,pulling:n.pulling,branches:n.branches,branchesLoading:n.branchesLoading,logs:n.logs,logsLoading:n.logsLoading,repos:n.repos,selectedRepoPath:n.selectedRepoPath,onSelectRepo:a,onRefresh:g,onStageFile:o,onUnstageFile:s,onStageAll:c,onUnstageAll:p,onCommit:v,onDiscardFile:x,onShowDiff:b,onPush:k,onPull:R,onLoadBranches:O,onCheckoutBranch:T,onCreateBranch:B,onLoadLogs:z})})}),L.jsx(Hg,{files:r.files,activeFileId:r.activeFileId,onSelectFile:I,onCloseFile:j,onChangeFile:$,onSaveFile:E,savingFileId:_,theme:h})]}),L.jsx("div",{className:"sidebar-overlay",onClick:()=>P(!1),"aria-hidden":"true"}),n.diffPath&&L.jsx(Kg,{diff:n.diff,loading:n.diffLoading,theme:h,onClose:S})]})}const Gg="設定",Xg="サーバー設定",Yg="ポート番号",Qg="Basic認証",Jg="Basic認証を有効にする",Zg="ユーザー名",e0="パスワード",t0="※ 12文字以上推奨",r0="キャンセル",i0="保存",n0="※ 設定を保存すると、サーバーが再起動されます",s0="WebSocket設定",o0="接続数上限 (IP毎)",l0="現在の接続数",a0="全接続をクリア",c0="適用",wn="bg-panel border border-border rounded-[2px] px-2 py-1.5 text-[13px] font-mono text-ink focus:outline-none focus:border-focus";function u0({isOpen:e,onClose:t,onSave:r}){const[i,n]=N.useState(8787),[h,_]=N.useState(!1),[l,u]=N.useState(""),[f,y]=N.useState(""),[d,m]=N.useState(!1),[C,w]=N.useState(1e3),[g,a]=N.useState(null),[o,s]=N.useState(!1),c=()=>{fetch("/api/ws/stats").then(b=>b.json()).then(b=>{a(b),w(b.limit)}).catch(b=>{console.error("Failed to load WS stats:",b)})};N.useEffect(()=>{if(!e)return;const b=S=>{S.key==="Escape"&&(S.preventDefault(),t())};return document.addEventListener("keydown",b),()=>document.removeEventListener("keydown",b)},[e,t]),N.useEffect(()=>{e&&(fetch("/api/settings").then(b=>b.json()).then(b=>{n(b.port),_(b.basicAuthEnabled),u(b.basicAuthUser),y(b.basicAuthPassword)}).catch(b=>{console.error("Failed to load settings:",b)}),c())},[e]);const p=async()=>{try{await fetch("/api/ws/limit",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({limit:C})}),c()}catch(b){console.error("Failed to set WS limit:",b)}},v=async()=>{s(!0);try{await fetch("/api/ws/clear",{method:"POST"}),c()}catch(b){console.error("Failed to clear WS connections:",b)}finally{s(!1)}},x=async b=>{b.preventDefault(),m(!0);try{await r({port:i,basicAuthEnabled:h,basicAuthUser:l,basicAuthPassword:f}),t()}catch(S){console.error("Failed to save settings:",S),alert("設定の保存に失敗しました")}finally{m(!1)}};return e?L.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-[500]",role:"dialog","aria-modal":"true","aria-labelledby":"settings-modal-title",onClick:t,children:L.jsxs("div",{className:"modal w-[500px]",onClick:b=>b.stopPropagation(),children:[L.jsxs("div",{className:"flex items-center justify-between mb-4",children:[L.jsx("h2",{className:"m-0 text-[14px] font-semibold",id:"settings-modal-title",children:Gg}),L.jsx("button",{type:"button",className:"modal-close-btn",onClick:t,"aria-label":"閉じる",children:"×"})]}),L.jsxs("form",{onSubmit:x,children:[L.jsxs("div",{className:"flex flex-col gap-4",children:[L.jsxs("section",{className:"flex flex-col gap-3",children:[L.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:Xg}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("label",{htmlFor:"port",className:"text-xs text-ink-muted",children:Yg}),L.jsx("input",{type:"number",id:"port",className:wn,value:i,onChange:b=>n(Number(b.target.value)),min:1024,max:65535,required:!0})]}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("h4",{className:"m-0 text-xs font-semibold text-ink-muted",children:Qg}),L.jsxs("label",{className:"flex items-center gap-2 text-xs cursor-pointer",children:[L.jsx("input",{type:"checkbox",checked:h,onChange:b=>_(b.target.checked)}),L.jsx("span",{children:Jg})]})]}),h&&L.jsxs(L.Fragment,{children:[L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("label",{htmlFor:"username",className:"text-xs text-ink-muted",children:Zg}),L.jsx("input",{type:"text",id:"username",className:wn,value:l,onChange:b=>u(b.target.value),required:h,autoComplete:"username"})]}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("label",{htmlFor:"password",className:"text-xs text-ink-muted",children:e0}),L.jsx("input",{type:"password",id:"password",className:wn,value:f,onChange:b=>y(b.target.value),required:h,minLength:12,autoComplete:"new-password"}),L.jsx("p",{className:"m-0 text-[11px] text-muted",children:t0})]})]})]}),L.jsxs("section",{className:"flex flex-col gap-3",children:[L.jsx("h3",{className:"m-0 text-[11px] font-semibold uppercase tracking-[0.5px] text-ink-muted border-b border-border pb-2",children:s0}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("label",{htmlFor:"wsLimit",className:"text-xs text-ink-muted",children:o0}),L.jsxs("div",{className:"flex gap-2 items-center",children:[L.jsx("input",{type:"number",id:"wsLimit",className:`flex-1 ${wn}`,value:C,onChange:b=>w(Number(b.target.value)),min:1,max:1e4}),L.jsx("button",{type:"button",className:"border border-border bg-transparent text-ink px-2.5 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:p,children:c0})]})]}),L.jsxs("div",{className:"flex flex-col gap-1",children:[L.jsx("label",{className:"text-xs text-ink-muted",children:l0}),L.jsx("div",{className:"border border-border rounded-[2px] p-2 text-xs bg-bg min-h-[40px] flex flex-col gap-1",children:g&&g.connections.length>0?g.connections.map(({ip:b,count:S})=>L.jsxs("div",{className:"flex justify-between items-center",children:[L.jsx("span",{className:"font-mono text-ink",children:b}),L.jsx("span",{className:"font-semibold text-ink-muted",children:S})]},b)):L.jsx("div",{className:"text-muted text-center",children:"接続なし"})})]}),L.jsx("div",{className:"flex flex-col gap-1",children:L.jsx("button",{type:"button",className:"bg-[#f14c4c] text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",onClick:v,disabled:o,children:o?"クリア中...":a0})})]}),L.jsx("p",{className:"m-0 text-[11px] text-muted italic",children:n0})]}),L.jsxs("div",{className:"flex justify-end gap-2 mt-4 border-t border-border pt-4",children:[L.jsx("button",{type:"button",className:"bg-transparent text-ink border-0 px-2 py-1 text-xs rounded-[2px] cursor-pointer hover:bg-list-hover",onClick:t,disabled:d,children:r0}),L.jsx("button",{type:"submit",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90 disabled:opacity-50 disabled:cursor-not-allowed",disabled:d,children:d?"保存中...":i0})]})]})]})}):null}const h0=()=>{const[e,t]=N.useState({}),r=N.useCallback((n,h)=>{t(_=>{const l=_[n]||ss();return{..._,[n]:h(l)}})},[]),i=N.useCallback(n=>{t(h=>{const _={...h};return n.forEach(l=>{_[l]||(_[l]=ss())}),_})},[]);return{workspaceStates:e,setWorkspaceStates:t,updateWorkspaceState:r,initializeWorkspaceStates:i}},d0=()=>{const[e,t]=N.useState({}),r=N.useCallback((n,h)=>{t(_=>{const l=_[n]||os();return{..._,[n]:h(l)}})},[]),i=N.useCallback(n=>{t(h=>{const _={...h};return n.forEach(l=>{_[l]||(_[l]=os())}),_})},[]);return{deckStates:e,setDeckStates:t,updateDeckState:r,initializeDeckStates:i}},f0=({setStatusMessage:e,defaultRoot:t,initializeWorkspaceStates:r,setWorkspaceStates:i})=>{const[n,h]=N.useState([]),[_,l]=N.useState(null);N.useEffect(()=>{let y=!0;return rv().then(d=>{y&&(h(d),l(m=>m&&d.some(C=>C.id===m)?m:null),r(d.map(m=>m.id)))}).catch(d=>{y&&e(`ワークスペースを取得できませんでした: ${Pe(d)}`)}),()=>{y=!1}},[e,r]);const u=N.useCallback(async y=>{const m=y.trim()||t;if(!m)return e("パスを入力してください。"),null;const C=yc(m);if(n.some(g=>yc(g.path)===C))return e("同じパスのワークスペースは追加できません。"),null;try{const g=await nv(m);return h(a=>[...a,g]),l(g.id),i(a=>({...a,[g.id]:ss()})),g}catch(g){return e(`ワークスペースを追加できませんでした: ${Pe(g)}`),null}},[n,t,e,i]),f=N.useCallback(async y=>{try{await sv(y),h(d=>d.filter(m=>m.id!==y)),l(d=>d===y?null:d),i(d=>{const m={...d};return delete m[y],m})}catch(d){e(`ワークスペースを削除できませんでした: ${Pe(d)}`)}},[e,i]);return{workspaces:n,editorWorkspaceId:_,setEditorWorkspaceId:l,handleCreateWorkspace:u,handleDeleteWorkspace:f}},p0=({setStatusMessage:e,initializeDeckStates:t,updateDeckState:r,setDeckStates:i,initialDeckIds:n})=>{const[h,_]=N.useState([]),[l,u]=N.useState(n??[]);N.useEffect(()=>{let g=!0;return ov().then(a=>{g&&(_(a),t(a.map(o=>o.id)),a.forEach(o=>{mv(o.id).then(s=>{g&&r(o.id,c=>({...c,terminals:s}))}).catch(()=>{})}))}).catch(a=>{g&&e(`デッキを取得できませんでした: ${Pe(a)}`)}),()=>{g=!1}},[e,t,r]),N.useEffect(()=>{if(h.length===0)return;const g=l.filter(a=>h.some(o=>o.id===a));g.length===l.length&&g.length>0||(g.length>0?u(g):h[0]&&u([h[0].id]))},[h,l]);const f=N.useCallback(async(g,a)=>{try{const o=await lv(g,a);return _(s=>[...s,o]),u(s=>[...s.filter(c=>c!==o.id),o.id]),i(s=>({...s,[o.id]:os()})),o}catch(o){return e(`デッキの作成に失敗しました: ${Pe(o)}`),null}},[e,i]),y=N.useCallback(async g=>{try{await av(g),_(a=>a.filter(o=>o.id!==g)),u(a=>a.filter(o=>o!==g)),i(a=>{const o={...a};return delete o[g],o})}catch(a){e(`デッキの削除に失敗しました: ${Pe(a)}`)}},[e,i]),d=N.useCallback(g=>{_(a=>{const o=g(a);return cv(o.map(s=>s.id)).catch(()=>{}),o})},[]),m=N.useCallback(async(g,a,o,s)=>{try{const c=await vv(g,s,o);r(g,p=>({...p,terminals:[...p.terminals,{id:c.id,title:c.title}]}))}catch(c){e(`ターミナルを起動できませんでした: ${Pe(c)}`)}},[r,e]),C=N.useCallback(async(g,a)=>{try{await gv(a),r(g,o=>({...o,terminals:o.terminals.filter(s=>s.id!==a)}))}catch(o){e(`ターミナルを削除できませんでした: ${Pe(o)}`)}},[r,e]),w=N.useCallback((g,a)=>{r(g,o=>({...o,terminals:o.terminals.filter(s=>s.id!==a)}))},[r]);return{decks:h,activeDeckIds:l,setActiveDeckIds:u,handleCreateDeck:f,handleDeleteDeck:y,handleReorderDecks:d,handleCreateTerminal:m,handleDeleteTerminal:C,handleRemoveTerminalLocal:w}},_0=({editorWorkspaceId:e,activeWorkspaceState:t,updateWorkspaceState:r,setStatusMessage:i})=>{const[n,h]=N.useState(null),_=N.useCallback(()=>{e&&(r(e,a=>({...a,treeLoading:!0,treeError:null})),Ne(hc(e,""),15e3).then(a=>{r(e,o=>({...o,tree:ls(a),treeLoading:!1}))}).catch(a=>{r(e,o=>({...o,treeLoading:!1,treeError:Pe(a)}))}))},[e,r]),l=N.useCallback(a=>{if(!(!e||a.type!=="dir")){if(a.expanded){r(e,o=>({...o,tree:Dr(o.tree,a.path,s=>({...s,expanded:!1}))}));return}if(a.children&&a.children.length>0){r(e,o=>({...o,tree:Dr(o.tree,a.path,s=>({...s,expanded:!0}))}));return}r(e,o=>({...o,tree:Dr(o.tree,a.path,s=>({...s,loading:!0}))})),Ne(hc(e,a.path),15e3).then(o=>{r(e,s=>({...s,tree:Dr(s.tree,a.path,c=>({...c,expanded:!0,loading:!1,children:ls(o)}))}))}).catch(o=>{r(e,s=>({...s,treeError:Pe(o),tree:Dr(s.tree,a.path,c=>({...c,loading:!1}))}))})}},[e,r]),u=N.useCallback(a=>{if(!e||a.type!=="file")return;const o=t.files.find(p=>p.path===a.path);if(o){r(e,p=>({...p,activeFileId:o.id}));return}const s=crypto.randomUUID(),c={id:s,name:a.name,path:a.path,language:cd(a.path),contents:"",dirty:!1};r(e,p=>({...p,files:[...p.files,{...c,contents:"読み込み中..."}],activeFileId:s})),Ne(uv(e,a.path),15e3).then(p=>{r(e,v=>({...v,files:v.files.map(x=>x.id===s?{...x,contents:p.contents}:x)}))}).catch(p=>{r(e,v=>({...v,files:v.files.filter(x=>x.id!==s),activeFileId:v.files.length>1?v.files[0].id:null})),i(`ファイルを開けませんでした: ${Pe(p)}`)})},[e,t.files,r,i]),f=N.useCallback((a,o)=>{e&&r(e,s=>({...s,files:s.files.map(c=>c.id===a?{...c,contents:o,dirty:!0}:c)}))},[e,r]),y=N.useCallback(async a=>{if(!e)return;const o=t.files.find(s=>s.id===a);if(o){h(a);try{await Ne(hv(e,o.path,o.contents),15e3),r(e,s=>({...s,files:s.files.map(c=>c.id===a?{...c,dirty:!1}:c)})),i(Jh)}catch(s){i(`保存に失敗しました: ${Pe(s)}`)}finally{h(null)}}},[e,t.files,r,i]),d=N.useCallback(a=>{e&&r(e,o=>{const s=o.files.findIndex(v=>v.id===a),c=o.files.filter(v=>v.id!==a);let p=o.activeFileId;return o.activeFileId===a&&(c.length===0?p=null:s>=c.length?p=c[c.length-1].id:p=c[s].id),{...o,files:c,activeFileId:p}})},[e,r]),m=N.useCallback(async(a,o)=>{if(!e)return;const s=a?`${a}/${o}`:o;try{await Ne(dv(e,s),15e3);const c={name:o,path:s,type:"file",expanded:!1,loading:!1};r(e,p=>({...p,tree:tl(p.tree,a,c)})),i(`ファイルを作成しました: ${o}`)}catch(c){i(`ファイル作成に失敗しました: ${Pe(c)}`)}},[e,r,i]),C=N.useCallback(async(a,o)=>{if(!e)return;const s=a?`${a}/${o}`:o;try{await Ne(pv(e,s),15e3);const c={name:o,path:s,type:"dir",expanded:!1,loading:!1,children:[]};r(e,p=>({...p,tree:tl(p.tree,a,c)})),i(`フォルダを作成しました: ${o}`)}catch(c){i(`フォルダ作成に失敗しました: ${Pe(c)}`)}},[e,r,i]),w=N.useCallback(async a=>{if(e)try{await Ne(fv(e,a),15e3),r(e,o=>{const s=o.files.filter(v=>v.path!==a);let c=o.activeFileId;const p=o.files.find(v=>v.path===a);return p&&o.activeFileId===p.id&&(c=s.length>0?s[0].id:null),{...o,files:s,activeFileId:c,tree:rl(o.tree,a)}}),i("ファイルを削除しました")}catch(o){i(`ファイル削除に失敗しました: ${Pe(o)}`)}},[e,r,i]),g=N.useCallback(async a=>{if(e)try{await Ne(_v(e,a),15e3),r(e,o=>{const s=o.files.filter(v=>!v.path.startsWith(a+"/")&&v.path!==a);let c=o.activeFileId;const p=o.files.find(v=>v.id===o.activeFileId);return p&&(p.path.startsWith(a+"/")||p.path===a)&&(c=s.length>0?s[0].id:null),{...o,files:s,activeFileId:c,tree:rl(o.tree,a)}}),i("フォルダを削除しました")}catch(o){i(`フォルダ削除に失敗しました: ${Pe(o)}`)}},[e,r,i]);return{savingFileId:n,handleRefreshTree:_,handleToggleDir:l,handleOpenFile:u,handleFileChange:f,handleSaveFile:y,handleCloseFile:d,handleCreateFile:m,handleCreateDirectory:C,handleDeleteFile:w,handleDeleteDirectory:g}};async function v0(e,t,r,i){if(!i.current[e]){i.current[e]=!0,t(e,n=>({...n,loading:!0,reposLoading:!0,error:null}));try{const h=(await Ne(yv(e)).catch(()=>({repos:[]}))).repos;t(e,d=>({...d,repos:h,reposLoading:!1,selectedRepoPath:d.selectedRepoPath??(h.length>0?h[0].path:null)}));const l=(r.current[e]||yi()).selectedRepoPath??(h.length>0?h[0].path:void 0),[u,f,y]=await Promise.all([Ne(id(e,l||void 0)),Ne(od(e,l||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Ne(ld(e,l||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);t(e,d=>({...d,status:u,branchStatus:f,hasRemote:y.hasRemote,loading:!1,error:null}))}catch(n){const h=n instanceof Error?n.message:"Failed to get git status";t(e,_=>({..._,status:null,loading:!1,reposLoading:!1,error:h}))}finally{i.current[e]=!1}}}async function m0(e,t,r,i){r(e,n=>({...n,selectedRepoPath:t,loading:!0}));try{const[n,h,_]=await Promise.all([Ne(id(e,t||void 0)),Ne(od(e,t||void 0)).catch(()=>({ahead:0,behind:0,hasUpstream:!1})),Ne(ld(e,t||void 0)).catch(()=>({hasRemote:!1,remotes:[]}))]);r(e,l=>({...l,status:n,branchStatus:h,hasRemote:_.hasRemote,loading:!1,branches:[],logs:[]}))}catch(n){const h=n instanceof Error?n.message:"Failed to get git status";i(h),r(e,_=>({..._,loading:!1}))}}async function g0(e,t,r,i,n){try{await nd(e,[t],r),await n()}catch(h){i(h instanceof Error?h.message:"Failed to stage file")}}async function y0(e,t,r,i,n){try{await sd(e,[t],r),await n()}catch(h){i(h instanceof Error?h.message:"Failed to unstage file")}}async function S0(e,t,r,i,n){if(t.length!==0)try{await nd(e,t,r),await n()}catch(h){i(h instanceof Error?h.message:"Failed to stage files")}}async function C0(e,t,r,i,n){if(t.length!==0)try{await sd(e,t,r),await n()}catch(h){i(h instanceof Error?h.message:"Failed to unstage files")}}async function w0(e,t,r,i,n){try{const h=await Sv(e,t.trim(),r);i(`Committed: ${h.summary.changes} changes, +${h.summary.insertions} -${h.summary.deletions}`),await n()}catch(h){i(h instanceof Error?h.message:"Failed to commit")}}async function x0(e,t,r,i,n){try{await Cv(e,[t],r),await n()}catch(h){i(h instanceof Error?h.message:"Failed to discard changes")}}async function b0(e,t,r,i,n){i(e,h=>({...h,diffPath:t.path,diffLoading:!0,diff:null}));try{const h=await wv(e,t.path,t.staged,r);i(e,_=>({..._,diff:h,diffLoading:!1}))}catch(h){n(h instanceof Error?h.message:"Failed to get diff"),i(e,_=>({..._,diffPath:null,diff:null,diffLoading:!1}))}}async function E0(e,t,r,i,n){r(e,h=>({...h,pushing:!0}));try{const h=await xv(e,t);i(`Pushed to ${h.branch}`),await n()}catch(h){i(h instanceof Error?h.message:"Failed to push")}finally{r(e,h=>({...h,pushing:!1}))}}async function k0(e,t,r,i,n){r(e,h=>({...h,pulling:!0}));try{const h=await bv(e,t);h.summary.changes>0?i(`Pulled: ${h.summary.changes} changes, +${h.summary.insertions} -${h.summary.deletions}`):i("Already up to date"),await n()}catch(h){i(h instanceof Error?h.message:"Failed to pull")}finally{r(e,h=>({...h,pulling:!1}))}}async function L0(e,t,r,i){try{await Ev(e,t),r("Fetched from remote"),await i()}catch(n){r(n instanceof Error?n.message:"Failed to fetch")}}async function D0(e,t,r,i){r(e,n=>({...n,branchesLoading:!0}));try{const n=await Ne(kv(e,t));r(e,h=>({...h,branches:n.branches,branchesLoading:!1}))}catch(n){i(n instanceof Error?n.message:"Failed to load branches"),r(e,h=>({...h,branchesLoading:!1}))}}async function R0(e,t,r,i,n,h){try{await Lv(e,t,r),i(`Switched to branch '${t}'`),await n(),await h()}catch(_){i(_ instanceof Error?_.message:"Failed to checkout branch")}}async function T0(e,t,r,i,n,h,_){try{await Dv(e,t,r,i),n(`Created branch '${t}'${r?" and switched to it":""}`),await h(),await _()}catch(l){n(l instanceof Error?l.message:"Failed to create branch")}}async function A0(e,t,r,i,n){i(e,h=>({...h,logsLoading:!0}));try{const h=await Ne(Rv(e,t,r));i(e,_=>({..._,logs:h.logs,logsLoading:!1}))}catch(h){n(h instanceof Error?h.message:"Failed to load git log"),i(e,_=>({..._,logsLoading:!1}))}}const yi=()=>({status:null,loading:!1,error:null,diffPath:null,diff:null,diffLoading:!1,branchStatus:null,hasRemote:!1,pushing:!1,pulling:!1,branches:[],branchesLoading:!1,logs:[],logsLoading:!1,repos:[],reposLoading:!1,selectedRepoPath:null}),P0=(e,t)=>{const[r,i]=N.useState({}),n=N.useRef({}),h=N.useRef(r);h.current=r;const _=e&&r[e]||yi(),l=N.useCallback((T,B)=>{i(z=>({...z,[T]:B(z[T]||yi())}))},[]),u=N.useCallback(async T=>{const B=T||e;B&&await v0(B,l,h,n)},[e,l]),f=N.useCallback(async T=>{e&&await m0(e,T,l,t)},[e,l,t]),y=N.useCallback(async()=>{const T=Object.keys(h.current);await Promise.all(T.map(B=>u(B)))},[u]),d=N.useCallback(()=>{if(!e)return;const T=h.current[e];return(T==null?void 0:T.selectedRepoPath)||void 0},[e]),m=N.useCallback(async T=>{e&&await g0(e,T,d(),t,u)},[e,d,t,u]),C=N.useCallback(async T=>{e&&await y0(e,T,d(),t,u)},[e,d,t,u]),w=N.useCallback(async()=>{if(!e||!_.status)return;const T=_.status.files.filter(B=>!B.staged).map(B=>B.path);await S0(e,T,d(),t,u)},[e,_.status,d,t,u]),g=N.useCallback(async()=>{if(!e||!_.status)return;const T=_.status.files.filter(B=>B.staged).map(B=>B.path);await C0(e,T,d(),t,u)},[e,_.status,d,t,u]),a=N.useCallback(async T=>{!e||!T.trim()||await w0(e,T,d(),t,u)},[e,d,t,u]),o=N.useCallback(async T=>{e&&await x0(e,T,d(),t,u)},[e,d,t,u]),s=N.useCallback(async T=>{e&&await b0(e,T,d(),l,t)},[e,d,l,t]),c=N.useCallback(()=>{e&&l(e,T=>({...T,diffPath:null,diff:null,diffLoading:!1}))},[e,l]),p=N.useCallback(async()=>{e&&await E0(e,d(),l,t,u)},[e,d,l,t,u]),v=N.useCallback(async()=>{e&&await k0(e,d(),l,t,u)},[e,d,l,t,u]),x=N.useCallback(async()=>{e&&await L0(e,d(),t,u)},[e,d,t,u]),b=N.useCallback(async()=>{e&&await D0(e,d(),l,t)},[e,d,l,t]),S=N.useCallback(async T=>{e&&await R0(e,T,d(),t,u,b)},[e,d,t,u,b]),k=N.useCallback(async(T,B=!0)=>{e&&await T0(e,T,B,d(),t,u,b)},[e,d,t,u,b]),R=N.useCallback(async(T=50)=>{e&&await A0(e,T,d(),l,t)},[e,d,l,t]),O=N.useCallback(T=>r[T]||yi(),[r]);return{gitState:_,gitStates:r,refreshGitStatus:u,refreshAllGitStatuses:y,getGitStateForWorkspace:O,handleSelectRepo:f,handleStageFile:m,handleUnstageFile:C,handleStageAll:w,handleUnstageAll:g,handleCommit:a,handleDiscardFile:o,handleShowDiff:s,handleCloseDiff:c,handlePush:p,handlePull:v,handleFetch:x,handleLoadBranches:b,handleCheckoutBranch:S,handleCreateBranch:k,handleLoadLogs:R}};function M0(){const[e,t]=N.useState(Xv);N.useEffect(()=>{if(!(typeof document>"u")){document.documentElement.dataset.theme=e;try{window.localStorage.setItem(td,e)}catch{}}},[e]);const r=N.useCallback(()=>{t(i=>i==="dark"?"light":"dark")},[]);return{theme:e,handleToggleTheme:r}}function B0({view:e,editorWorkspaceId:t,activeDeckIds:r,workspaceMode:i,setView:n,setEditorWorkspaceId:h,setActiveDeckIds:_,setWorkspaceMode:l}){N.useEffect(()=>{const u=()=>{const f=ud();n(f.view),h(f.workspaceId??null),_(f.deckIds),l(f.workspaceMode)};return window.addEventListener("popstate",u),()=>window.removeEventListener("popstate",u)},[n,h,_,l]),N.useEffect(()=>{const u=new URLSearchParams;u.set("view",e),e==="workspace"&&t&&u.set("workspace",t),r.length>0&&u.set("decks",r.join(",")),e==="workspace"&&i==="editor"&&t&&u.set("mode","editor");const f=u.toString(),y=f?`${window.location.pathname}?${f}`:window.location.pathname;window.history.replaceState(null,"",y)},[e,t,r,i])}function O0(){const[e,t]=N.useState(!1),[r,i]=N.useState(!1),[n,h]=N.useState(!1),_=N.useCallback(()=>t(!0),[]),l=N.useCallback(()=>t(!1),[]),u=N.useCallback(()=>i(!0),[]),f=N.useCallback(()=>i(!1),[]),y=N.useCallback(()=>h(!0),[]),d=N.useCallback(()=>h(!1),[]);return{isWorkspaceModalOpen:e,openWorkspaceModal:_,closeWorkspaceModal:l,isDeckModalOpen:r,openDeckModal:u,closeDeckModal:f,isSettingsModalOpen:n,openSettingsModal:y,closeSettingsModal:d}}const Ac=3;function Pc(e,t,r){const i=e.indexOf(t),n=e.indexOf(r);if(i<0||n<0||i===n)return e;const h=[...e];h.splice(i,1);const _=h.indexOf(r);return h.splice(_,0,t),h}function N0(){const e=ud(),t=N.useRef(null),r=N.useRef(!1),[i,n]=N.useState(e.view),[h,_]=N.useState(e.workspaceMode),[l,u]=N.useState(q_),[f,y]=N.useState(""),[d,m]=N.useState(null),[C,w]=N.useState(null),[g,a]=N.useState(!1),[o,s]=N.useState(!1),[c,p]=N.useState(null),{theme:v,handleToggleTheme:x}=M0(),{isWorkspaceModalOpen:b,openWorkspaceModal:S,closeWorkspaceModal:k,isDeckModalOpen:R,openDeckModal:O,closeDeckModal:T,isSettingsModalOpen:B,openSettingsModal:z,closeSettingsModal:I}=O0(),{workspaceStates:j,setWorkspaceStates:$,updateWorkspaceState:E,initializeWorkspaceStates:A}=h0(),{deckStates:P,setDeckStates:M,updateDeckState:H,initializeDeckStates:K}=d0(),{workspaces:X,editorWorkspaceId:q,setEditorWorkspaceId:se,handleCreateWorkspace:D,handleDeleteWorkspace:F}=f0({setStatusMessage:y,defaultRoot:l,initializeWorkspaceStates:A,setWorkspaceStates:$}),{decks:W,activeDeckIds:U,setActiveDeckIds:re,handleCreateDeck:Q,handleDeleteDeck:ae,handleReorderDecks:we,handleCreateTerminal:fe,handleDeleteTerminal:ut,handleRemoveTerminalLocal:ne}=p0({setStatusMessage:y,initializeDeckStates:K,updateDeckState:H,setDeckStates:M,initialDeckIds:e.deckIds}),ht=N.useMemo(()=>ss(),[]),Ye=N.useMemo(()=>os(),[]),Ut=X.find(V=>V.id===q)||null,J=q&&j[q]||ht,{savingFileId:Y,handleRefreshTree:te,handleToggleDir:ie,handleOpenFile:oe,handleFileChange:ce,handleSaveFile:Be,handleCloseFile:me,handleCreateFile:Tt,handleCreateDirectory:Ve,handleDeleteFile:At,handleDeleteDirectory:pe}=_0({editorWorkspaceId:q,activeWorkspaceState:J,updateWorkspaceState:E,setStatusMessage:y}),{gitState:ni,refreshGitStatus:ks,handleSelectRepo:yd,handleStageFile:Sd,handleUnstageFile:Cd,handleStageAll:wd,handleUnstageAll:xd,handleCommit:bd,handleDiscardFile:Ed,handleShowDiff:kd,handleCloseDiff:Ld,handlePush:Dd,handlePull:Rd,handleLoadBranches:Td,handleCheckoutBranch:Ad,handleCreateBranch:Pd,handleLoadLogs:Md}=P0(q,y);B0({view:i,editorWorkspaceId:q,activeDeckIds:U,workspaceMode:h,setView:n,setEditorWorkspaceId:se,setActiveDeckIds:re,setWorkspaceMode:_});const Bd=ev(),Ql=N.useMemo(()=>new Map(X.map(V=>[V.id,V])),[X]),Ls=W;N.useEffect(()=>{let V=!0;return iv().then(ee=>{V&&ee!=null&&ee.defaultRoot&&u(ee.defaultRoot)}).catch(()=>{}),()=>{V=!1}},[]),N.useEffect(()=>{if(f!==Jh)return;const V=setTimeout(()=>y(""),Y_);return()=>clearTimeout(V)},[f]),N.useEffect(()=>{h==="editor"&&!q&&_("list")},[h,q]),N.useEffect(()=>{if(typeof window>"u")return;const V=window.matchMedia("(pointer: fine) and (min-width: 721px)"),ee=()=>s(V.matches);return ee(),V.addEventListener("change",ee),()=>V.removeEventListener("change",ee)},[]);const Pt=N.useCallback(()=>{m(null),w(null),a(!1)},[]),tn=N.useCallback(()=>{r.current=!0,window.setTimeout(()=>{r.current=!1},100)},[]);N.useEffect(()=>{o||Pt()},[o,Pt]);const Ds=N.useRef(null);N.useEffect(()=>{if(h!=="editor"||!q){Ds.current=null;return}Ds.current!==q&&(Ds.current=q,te(),ks())},[h,q,te,ks]);const Od=N.useCallback(()=>{if(X.length===0){y(G_);return}O()},[X.length,O]),Nd=N.useCallback(async(V,ee)=>{if(!ee){y(X_);return}await Q(V,ee)&&T()},[Q,T]),jd=N.useCallback(async V=>{try{const ee=await fetch("/api/settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(V)});if(!ee.ok){const ge=await ee.text();throw new Error(ge||"Failed to save settings")}await ee.json(),y("設定を保存しました。ブラウザをリロードしてください。"),setTimeout(()=>{window.location.reload()},2e3)}catch(ee){throw console.error("Failed to save settings:",ee),ee}},[]),Id=N.useCallback(V=>{se(V),_("editor")},[se]),Fd=N.useCallback(()=>{_("list")},[]),Hd=N.useCallback(async V=>{await D(V)&&k()},[D,k]),zd=N.useCallback(V=>{const ee=P[V]||Ye;fe(V,ee.terminals.length)},[P,Ye,fe]),$d=N.useCallback(V=>{const ee=P[V]||Ye;fe(V,ee.terminals.length,"claude","Claude Code")},[P,Ye,fe]),Ud=N.useCallback(V=>{const ee=P[V]||Ye;fe(V,ee.terminals.length,"codex","Codex")},[P,Ye,fe]),Wd=N.useCallback((V,ee)=>{ut(V,ee)},[ut]),Vd=N.useCallback((V,ee)=>{ne(V,ee)},[ne]),Kd=N.useCallback(V=>{if(r.current){r.current=!1;return}re([V])},[re]),Jl=N.useCallback(V=>{re(ee=>{const ge=[...ee.filter(_e=>_e!==V),V];return ge.length<=Ac?ge:ge.slice(ge.length-Ac)})},[re]),qd=N.useCallback(V=>{re(ee=>{if(ee.length<=1){const ge=Ls.find(_e=>_e.id!==V);return ge?[ge.id]:ee}return ee.filter(ge=>ge!==V)})},[Ls,re]),Gd=N.useCallback((V,ee)=>{V.preventDefault(),V.stopPropagation(),p({deckId:ee,x:V.clientX,y:V.clientY})},[]),Xd=N.useCallback(()=>{if(!c)return;const{deckId:V}=c;p(null),window.confirm(`このデッキを完全に削除しますか?
64
+ ターミナルもすべて削除されます。`)&&ae(V)},[c,ae]),Zl=N.useCallback(()=>{p(null)},[]),Yd=N.useCallback((V,ee)=>{if(!o){V.preventDefault();return}V.dataTransfer.effectAllowed="move",V.dataTransfer.setData("text/plain",ee),m(ee),w(null),a(!1)},[o]),Qd=N.useCallback((V,ee)=>{!o||!d||d===ee||(V.preventDefault(),V.dataTransfer.dropEffect="move",w(ee),a(!1))},[o,d]),Jd=N.useCallback((V,ee)=>{V.currentTarget.contains(V.relatedTarget)||w(ge=>ge===ee?null:ge)},[]),Zd=N.useCallback((V,ee)=>{if(!o)return;V.preventDefault();const ge=d||V.dataTransfer.getData("text/plain");if(!ge||ge===ee){Pt();return}we(_e=>{const af=_e.map(kr=>kr.id),cf=Pc(af,ge,ee),uf=new Map(_e.map(kr=>[kr.id,kr]));return cf.map(kr=>uf.get(kr))}),re(_e=>Pc(_e,ge,ee)),tn(),Pt()},[d,o,Pt,re,tn,we]),ef=N.useCallback(V=>{!o||!d||(V.preventDefault(),V.dataTransfer.dropEffect="move",a(!0))},[o,d]),tf=N.useCallback(V=>{V.currentTarget.contains(V.relatedTarget)||a(!1)},[]),rf=N.useCallback(V=>{if(!o)return;V.preventDefault();const ee=d||V.dataTransfer.getData("text/plain");if(!ee){Pt();return}Jl(ee),tn(),Pt()},[d,Jl,o,Pt,tn]),nf=N.useCallback(V=>{q&&E(q,ee=>({...ee,activeFileId:V}))},[q,E]),sf=h==="editor"&&!!q,of=L.jsxs("div",{className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[L.jsxs("div",{className:"flex flex-col items-center gap-4 p-6 flex-shrink-0",children:[L.jsx("button",{type:"button",className:"bg-accent text-white border-0 px-3.5 py-1.5 text-[13px] font-medium rounded-[2px] cursor-pointer hover:opacity-90",onClick:S,children:"ワークスペース追加"}),L.jsx(jv,{workspaces:X,selectedWorkspaceId:q,onSelect:Id,onDelete:F})]}),sf&&L.jsx(qg,{activeWorkspace:Ut,defaultRoot:l,activeWorkspaceState:J,editorWorkspaceId:q,gitState:ni,theme:v,savingFileId:Y,onCloseWorkspaceEditor:Fd,onToggleDir:ie,onOpenFile:oe,onRefreshTree:te,onCreateFile:Tt,onCreateDirectory:Ve,onDeleteFile:At,onDeleteDirectory:pe,onRefreshGit:ks,onSelectRepo:yd,onStageFile:Sd,onUnstageFile:Cd,onStageAll:wd,onUnstageAll:xd,onCommit:bd,onDiscardFile:Ed,onShowDiff:kd,onCloseDiff:Ld,onPush:Dd,onPull:Rd,onLoadBranches:Td,onCheckoutBranch:Ad,onCreateBranch:Pd,onLoadLogs:Md,onSelectFile:nf,onCloseFile:me,onChangeFile:ce,onSaveFile:Be})]}),lf=L.jsxs("div",{className:"terminal-layout",children:[L.jsx("div",{className:"terminal-topbar",children:L.jsx("div",{className:"topbar-left",children:L.jsxs("div",{className:"deck-tabs",children:[Ls.map(V=>{var ee,ge;return L.jsxs("button",{type:"button",className:Ie("deck-tab",U.includes(V.id)&&"active",d===V.id&&"is-dragging",C===V.id&&"is-drag-over"),onClick:()=>Kd(V.id),onContextMenu:_e=>Gd(_e,V.id),draggable:o,onDragStart:_e=>Yd(_e,V.id),onDragOver:_e=>Qd(_e,V.id),onDragLeave:_e=>Jd(_e,V.id),onDrop:_e=>Zd(_e,V.id),onDragEnd:Pt,title:o?`${((ee=Ql.get(V.workspaceId))==null?void 0:ee.path)||V.root}
65
+ ドラッグで並び替え / メインにドロップで分割表示`:`${((ge=Ql.get(V.workspaceId))==null?void 0:ge.path)||V.root}`,children:[L.jsx("span",{className:"deck-tab-name",children:V.name}),L.jsx("span",{className:"deck-tab-close",role:"button","aria-label":"閉じる",onClick:_e=>{_e.stopPropagation(),qd(V.id)},children:"×"})]},V.id)}),L.jsx("button",{type:"button",className:"deck-tab deck-tab-add",onClick:Od,title:"デッキ作成",children:"+"})]})})}),L.jsx("div",{className:Ie("terminal-split-container",g&&"is-drop-target"),ref:t,style:{gridTemplateColumns:`repeat(${U.length}, minmax(0, 1fr))`},onDragOver:ef,onDragLeave:tf,onDrop:rf,children:U.length===0?L.jsx("div",{className:"panel flex items-center justify-center text-muted text-[13px] p-5",children:"デッキを作成してください。"}):U.map(V=>{const ee=W.find(_e=>_e.id===V),ge=P[V]||Ye;return ee?L.jsxs("div",{className:"deck-split-pane",children:[L.jsxs("div",{className:"flex items-center justify-between px-2 py-1 border-b border-border bg-sidebar gap-2 min-h-[28px]",children:[U.length>1&&L.jsx("span",{className:"flex-1 min-w-0 text-[11px] font-semibold text-ink-muted overflow-hidden text-ellipsis whitespace-nowrap",children:ee.name}),L.jsxs("div",{className:"flex items-center gap-1 ml-auto",children:[L.jsx("button",{type:"button",className:"topbar-btn-sm",onClick:()=>zd(V),title:"ターミナル追加",children:"+"}),L.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-claude",onClick:()=>$d(V),title:"Claude",children:"C"}),L.jsx("button",{type:"button",className:"topbar-btn-sm topbar-btn-codex",onClick:()=>Ud(V),title:"Codex",children:"X"})]})]}),L.jsx(Ov,{terminals:ge.terminals,wsBase:Bd,onDeleteTerminal:_e=>Wd(V,_e),onExitTerminal:_e=>Vd(V,_e)})]},V):null})})]});return L.jsxs("div",{className:"app","data-view":i,children:[L.jsx(H_,{activeView:i,onSelect:n,theme:v,onToggleTheme:x,onOpenSettings:z}),L.jsxs("main",{className:"main",children:[i==="workspace"&&of,i==="terminal"&&lf]}),L.jsx(z_,{message:f}),L.jsx(Yv,{isOpen:b,defaultRoot:l,onSubmit:Hd,onClose:k}),L.jsx(F_,{isOpen:R,workspaces:X,onSubmit:Nd,onClose:T}),L.jsx(u0,{isOpen:B,onClose:I,onSave:jd}),c&&L.jsxs(L.Fragment,{children:[L.jsx("div",{className:"fixed inset-0 z-[999]",onClick:Zl,onContextMenu:V=>{V.preventDefault(),Zl()}}),L.jsx("div",{className:"fixed z-[1000] bg-panel border border-border shadow-lg rounded-[2px] py-1 min-w-[140px]",style:{left:c.x,top:c.y},children:L.jsx("button",{type:"button",className:"w-full text-left px-3 py-1.5 text-[13px] text-red-400 bg-transparent border-0 cursor-pointer hover:bg-list-hover",onClick:Xd,children:"デッキを削除"})})]})]})}class j0 extends N.Component{constructor(t){super(t),this.handleReload=()=>{window.location.reload()},this.state={hasError:!1,error:null}}static getDerivedStateFromError(t){return{hasError:!0,error:t}}componentDidCatch(t,r){console.error("Application error:",t),console.error("Component stack:",r.componentStack)}render(){return this.state.hasError?L.jsx("div",{className:"flex items-center justify-center min-h-screen p-8 bg-bg",children:L.jsxs("div",{className:"max-w-[500px] p-8 bg-panel border border-border text-center",children:[L.jsx("h1",{className:"m-0 mb-4 text-xl text-[#f14c4c]",children:"Something went wrong"}),L.jsx("p",{className:"m-0 mb-6 text-muted",children:"The application encountered an unexpected error."}),this.state.error&&!1,L.jsx("button",{onClick:this.handleReload,className:"px-4 py-2 bg-accent text-white border-0 rounded-[2px] font-medium cursor-pointer hover:opacity-90",children:"Reload Application"})]})}):this.props.children}}lo.createRoot(document.getElementById("root")).render(L.jsx(vr.StrictMode,{children:L.jsx(j0,{children:L.jsx(N0,{})})}));