paneful 0.9.0 → 0.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/dist/server/claude-monitor.js +16 -1
- package/dist/server/editor-monitor.js +394 -0
- package/dist/server/git-monitor.js +98 -0
- package/dist/server/index.js +28 -65
- package/dist/server/port-monitor.js +34 -2
- package/dist/server/ws-handler.js +48 -1
- package/dist/web/assets/index-CaxQEraM.css +32 -0
- package/dist/web/assets/index-DZHbyL92.js +394 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/index-CYMQU0Pz.js +0 -349
- package/dist/web/assets/index-Df0yoS2W.css +0 -32
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))i(s);new MutationObserver(s=>{for(const h of s)if(h.type==="childList")for(const v of h.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&i(v)}).observe(document,{childList:!0,subtree:!0});function r(s){const h={};return s.integrity&&(h.integrity=s.integrity),s.referrerPolicy&&(h.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?h.credentials="include":s.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function i(s){if(s.ep)return;s.ep=!0;const h=r(s);fetch(s.href,h)}})();function qc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Gc={exports:{}},vn={},Xc={exports:{}},ie={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Zi=Symbol.for("react.element"),Bd=Symbol.for("react.portal"),Id=Symbol.for("react.fragment"),jd=Symbol.for("react.strict_mode"),Nd=Symbol.for("react.profiler"),Fd=Symbol.for("react.provider"),Hd=Symbol.for("react.context"),zd=Symbol.for("react.forward_ref"),Wd=Symbol.for("react.suspense"),Ud=Symbol.for("react.memo"),$d=Symbol.for("react.lazy"),xl=Symbol.iterator;function Kd(e){return e===null||typeof e!="object"?null:(e=xl&&e[xl]||e["@@iterator"],typeof e=="function"?e:null)}var Qc={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Yc=Object.assign,Jc={};function si(e,t,r){this.props=e,this.context=t,this.refs=Jc,this.updater=r||Qc}si.prototype.isReactComponent={};si.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")};si.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Zc(){}Zc.prototype=si.prototype;function wa(e,t,r){this.props=e,this.context=t,this.refs=Jc,this.updater=r||Qc}var Ca=wa.prototype=new Zc;Ca.constructor=wa;Yc(Ca,si.prototype);Ca.isPureReactComponent=!0;var bl=Array.isArray,eu=Object.prototype.hasOwnProperty,xa={current:null},tu={key:!0,ref:!0,__self:!0,__source:!0};function ru(e,t,r){var i,s={},h=null,v=null;if(t!=null)for(i in t.ref!==void 0&&(v=t.ref),t.key!==void 0&&(h=""+t.key),t)eu.call(t,i)&&!tu.hasOwnProperty(i)&&(s[i]=t[i]);var o=arguments.length-2;if(o===1)s.children=r;else if(1<o){for(var c=Array(o),f=0;f<o;f++)c[f]=arguments[f+2];s.children=c}if(e&&e.defaultProps)for(i in o=e.defaultProps,o)s[i]===void 0&&(s[i]=o[i]);return{$$typeof:Zi,type:e,key:h,ref:v,props:s,_owner:xa.current}}function Vd(e,t){return{$$typeof:Zi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ba(e){return typeof e=="object"&&e!==null&&e.$$typeof===Zi}function qd(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var kl=/\/+/g;function In(e,t){return typeof e=="object"&&e!==null&&e.key!=null?qd(""+e.key):t.toString(36)}function Ls(e,t,r,i,s){var h=typeof e;(h==="undefined"||h==="boolean")&&(e=null);var v=!1;if(e===null)v=!0;else switch(h){case"string":case"number":v=!0;break;case"object":switch(e.$$typeof){case Zi:case Bd:v=!0}}if(v)return v=e,s=s(v),e=i===""?"."+In(v,0):i,bl(s)?(r="",e!=null&&(r=e.replace(kl,"$&/")+"/"),Ls(s,t,r,"",function(f){return f})):s!=null&&(ba(s)&&(s=Vd(s,r+(!s.key||v&&v.key===s.key?"":(""+s.key).replace(kl,"$&/")+"/")+e)),t.push(s)),1;if(v=0,i=i===""?".":i+":",bl(e))for(var o=0;o<e.length;o++){h=e[o];var c=i+In(h,o);v+=Ls(h,t,r,c,s)}else if(c=Kd(e),typeof c=="function")for(e=c.call(e),o=0;!(h=e.next()).done;)h=h.value,c=i+In(h,o++),v+=Ls(h,t,r,c,s);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 v}function os(e,t,r){if(e==null)return e;var i=[],s=0;return Ls(e,i,"","",function(h){return t.call(r,h,s++)}),i}function Gd(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 Ke={current:null},Ds={transition:null},Xd={ReactCurrentDispatcher:Ke,ReactCurrentBatchConfig:Ds,ReactCurrentOwner:xa};function iu(){throw Error("act(...) is not supported in production builds of React.")}ie.Children={map:os,forEach:function(e,t,r){os(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return os(e,function(){t++}),t},toArray:function(e){return os(e,function(t){return t})||[]},only:function(e){if(!ba(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};ie.Component=si;ie.Fragment=Id;ie.Profiler=Nd;ie.PureComponent=wa;ie.StrictMode=jd;ie.Suspense=Wd;ie.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xd;ie.act=iu;ie.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=Yc({},e.props),s=e.key,h=e.ref,v=e._owner;if(t!=null){if(t.ref!==void 0&&(h=t.ref,v=xa.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(c in t)eu.call(t,c)&&!tu.hasOwnProperty(c)&&(i[c]=t[c]===void 0&&o!==void 0?o[c]:t[c])}var c=arguments.length-2;if(c===1)i.children=r;else if(1<c){o=Array(c);for(var f=0;f<c;f++)o[f]=arguments[f+2];i.children=o}return{$$typeof:Zi,type:e.type,key:s,ref:h,props:i,_owner:v}};ie.createContext=function(e){return e={$$typeof:Hd,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Fd,_context:e},e.Consumer=e};ie.createElement=ru;ie.createFactory=function(e){var t=ru.bind(null,e);return t.type=e,t};ie.createRef=function(){return{current:null}};ie.forwardRef=function(e){return{$$typeof:zd,render:e}};ie.isValidElement=ba;ie.lazy=function(e){return{$$typeof:$d,_payload:{_status:-1,_result:e},_init:Gd}};ie.memo=function(e,t){return{$$typeof:Ud,type:e,compare:t===void 0?null:t}};ie.startTransition=function(e){var t=Ds.transition;Ds.transition={};try{e()}finally{Ds.transition=t}};ie.unstable_act=iu;ie.useCallback=function(e,t){return Ke.current.useCallback(e,t)};ie.useContext=function(e){return Ke.current.useContext(e)};ie.useDebugValue=function(){};ie.useDeferredValue=function(e){return Ke.current.useDeferredValue(e)};ie.useEffect=function(e,t){return Ke.current.useEffect(e,t)};ie.useId=function(){return Ke.current.useId()};ie.useImperativeHandle=function(e,t,r){return Ke.current.useImperativeHandle(e,t,r)};ie.useInsertionEffect=function(e,t){return Ke.current.useInsertionEffect(e,t)};ie.useLayoutEffect=function(e,t){return Ke.current.useLayoutEffect(e,t)};ie.useMemo=function(e,t){return Ke.current.useMemo(e,t)};ie.useReducer=function(e,t,r){return Ke.current.useReducer(e,t,r)};ie.useRef=function(e){return Ke.current.useRef(e)};ie.useState=function(e){return Ke.current.useState(e)};ie.useSyncExternalStore=function(e,t,r){return Ke.current.useSyncExternalStore(e,t,r)};ie.useTransition=function(){return Ke.current.useTransition()};ie.version="18.3.1";Xc.exports=ie;var q=Xc.exports;const su=qc(q);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Qd=q,Yd=Symbol.for("react.element"),Jd=Symbol.for("react.fragment"),Zd=Object.prototype.hasOwnProperty,ef=Qd.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,tf={key:!0,ref:!0,__self:!0,__source:!0};function nu(e,t,r){var i,s={},h=null,v=null;r!==void 0&&(h=""+r),t.key!==void 0&&(h=""+t.key),t.ref!==void 0&&(v=t.ref);for(i in t)Zd.call(t,i)&&!tf.hasOwnProperty(i)&&(s[i]=t[i]);if(e&&e.defaultProps)for(i in t=e.defaultProps,t)s[i]===void 0&&(s[i]=t[i]);return{$$typeof:Yd,type:e,key:h,ref:v,props:s,_owner:ef.current}}vn.Fragment=Jd;vn.jsx=nu;vn.jsxs=nu;Gc.exports=vn;var R=Gc.exports,po={},ou={exports:{}},rt={},au={exports:{}},lu={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.min.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/(function(e){function t(N,k){var T=N.length;N.push(k);e:for(;0<T;){var A=T-1>>>1,B=N[A];if(0<s(B,k))N[A]=k,N[T]=B,T=A;else break e}}function r(N){return N.length===0?null:N[0]}function i(N){if(N.length===0)return null;var k=N[0],T=N.pop();if(T!==k){N[0]=T;e:for(var A=0,B=N.length,$=B>>>1;A<$;){var V=2*(A+1)-1,Y=N[V],J=V+1,j=N[J];if(0>s(Y,T))J<B&&0>s(j,Y)?(N[A]=j,N[J]=T,A=J):(N[A]=Y,N[V]=T,A=V);else if(J<B&&0>s(j,T))N[A]=j,N[J]=T,A=J;else break e}}return k}function s(N,k){var T=N.sortIndex-k.sortIndex;return T!==0?T:N.id-k.id}if(typeof performance=="object"&&typeof performance.now=="function"){var h=performance;e.unstable_now=function(){return h.now()}}else{var v=Date,o=v.now();e.unstable_now=function(){return v.now()-o}}var c=[],f=[],g=1,d=null,p=3,y=!1,x=!1,m=!1,u=typeof setTimeout=="function"?setTimeout:null,a=typeof clearTimeout=="function"?clearTimeout:null,n=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function l(N){for(var k=r(f);k!==null;){if(k.callback===null)i(f);else if(k.startTime<=N)i(f),k.sortIndex=k.expirationTime,t(c,k);else break;k=r(f)}}function _(N){if(m=!1,l(N),!x)if(r(c)!==null)x=!0,H(S);else{var k=r(f);k!==null&&U(_,k.startTime-N)}}function S(N,k){x=!1,m&&(m=!1,a(w),w=-1),y=!0;var T=p;try{for(l(k),d=r(c);d!==null&&(!(d.expirationTime>k)||N&&!O());){var A=d.callback;if(typeof A=="function"){d.callback=null,p=d.priorityLevel;var B=A(d.expirationTime<=k);k=e.unstable_now(),typeof B=="function"?d.callback=B:d===r(c)&&i(c),l(k)}else i(c);d=r(c)}if(d!==null)var $=!0;else{var V=r(f);V!==null&&U(_,V.startTime-k),$=!1}return $}finally{d=null,p=T,y=!1}}var C=!1,b=null,w=-1,E=5,P=-1;function O(){return!(e.unstable_now()-P<E)}function M(){if(b!==null){var N=e.unstable_now();P=N;var k=!0;try{k=b(!0,N)}finally{k?L():(C=!1,b=null)}}else C=!1}var L;if(typeof n=="function")L=function(){n(M)};else if(typeof MessageChannel<"u"){var I=new MessageChannel,F=I.port2;I.port1.onmessage=M,L=function(){F.postMessage(null)}}else L=function(){u(M,0)};function H(N){b=N,C||(C=!0,L())}function U(N,k){w=u(function(){N(e.unstable_now())},k)}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(N){N.callback=null},e.unstable_continueExecution=function(){x||y||(x=!0,H(S))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(N){switch(p){case 1:case 2:case 3:var k=3;break;default:k=p}var T=p;p=k;try{return N()}finally{p=T}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,k){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var T=p;p=N;try{return k()}finally{p=T}},e.unstable_scheduleCallback=function(N,k,T){var A=e.unstable_now();switch(typeof T=="object"&&T!==null?(T=T.delay,T=typeof T=="number"&&0<T?A+T:A):T=A,N){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=T+B,N={id:g++,callback:k,priorityLevel:N,startTime:T,expirationTime:B,sortIndex:-1},T>A?(N.sortIndex=T,t(f,N),r(c)===null&&N===r(f)&&(m?(a(w),w=-1):m=!0,U(_,T-A))):(N.sortIndex=B,t(c,N),x||y||(x=!0,H(S))),N},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(N){var k=p;return function(){var T=p;p=k;try{return N.apply(this,arguments)}finally{p=T}}}})(lu);au.exports=lu;var rf=au.exports;/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.min.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var sf=q,tt=rf;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 cu=new Set,Bi={};function kr(e,t){Qr(e,t),Qr(e+"Capture",t)}function Qr(e,t){for(Bi[e]=t,e=0;e<t.length;e++)cu.add(t[e])}var At=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_o=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]*$/,El={},Ll={};function of(e){return _o.call(Ll,e)?!0:_o.call(El,e)?!1:nf.test(e)?Ll[e]=!0:(El[e]=!0,!1)}function af(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 lf(e,t,r,i){if(t===null||typeof t>"u"||af(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 Ve(e,t,r,i,s,h,v){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=i,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=h,this.removeEmptyString=v}var Be={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Be[e]=new Ve(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Be[t]=new Ve(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Be[e]=new Ve(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Be[e]=new Ve(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){Be[e]=new Ve(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Be[e]=new Ve(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Be[e]=new Ve(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Be[e]=new Ve(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Be[e]=new Ve(e,5,!1,e.toLowerCase(),null,!1,!1)});var ka=/[\-:]([a-z])/g;function Ea(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(ka,Ea);Be[t]=new Ve(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(ka,Ea);Be[t]=new Ve(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(ka,Ea);Be[t]=new Ve(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Be[e]=new Ve(e,1,!1,e.toLowerCase(),null,!1,!1)});Be.xlinkHref=new Ve("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Be[e]=new Ve(e,1,!1,e.toLowerCase(),null,!0,!0)});function La(e,t,r,i){var s=Be.hasOwnProperty(t)?Be[t]:null;(s!==null?s.type!==0:i||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(lf(t,r,s,i)&&(r=null),i||s===null?of(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):s.mustUseProperty?e[s.propertyName]=r===null?s.type===3?!1:"":r:(t=s.attributeName,i=s.attributeNamespace,r===null?e.removeAttribute(t):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,i?e.setAttributeNS(i,t,r):e.setAttribute(t,r))))}var jt=sf.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,as=Symbol.for("react.element"),Tr=Symbol.for("react.portal"),Pr=Symbol.for("react.fragment"),Da=Symbol.for("react.strict_mode"),vo=Symbol.for("react.profiler"),uu=Symbol.for("react.provider"),hu=Symbol.for("react.context"),Ra=Symbol.for("react.forward_ref"),go=Symbol.for("react.suspense"),mo=Symbol.for("react.suspense_list"),Ta=Symbol.for("react.memo"),Ht=Symbol.for("react.lazy"),du=Symbol.for("react.offscreen"),Dl=Symbol.iterator;function hi(e){return e===null||typeof e!="object"?null:(e=Dl&&e[Dl]||e["@@iterator"],typeof e=="function"?e:null)}var Ce=Object.assign,jn;function Si(e){if(jn===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);jn=t&&t[1]||""}return`
|
|
34
|
+
`+jn+e}var Nn=!1;function Fn(e,t){if(!e||Nn)return"";Nn=!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 s=f.stack.split(`
|
|
35
|
+
`),h=i.stack.split(`
|
|
36
|
+
`),v=s.length-1,o=h.length-1;1<=v&&0<=o&&s[v]!==h[o];)o--;for(;1<=v&&0<=o;v--,o--)if(s[v]!==h[o]){if(v!==1||o!==1)do if(v--,o--,0>o||s[v]!==h[o]){var c=`
|
|
37
|
+
`+s[v].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=v&&0<=o);break}}}finally{Nn=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Si(e):""}function cf(e){switch(e.tag){case 5:return Si(e.type);case 16:return Si("Lazy");case 13:return Si("Suspense");case 19:return Si("SuspenseList");case 0:case 2:case 15:return e=Fn(e.type,!1),e;case 11:return e=Fn(e.type.render,!1),e;case 1:return e=Fn(e.type,!0),e;default:return""}}function yo(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 Pr:return"Fragment";case Tr:return"Portal";case vo:return"Profiler";case Da:return"StrictMode";case go:return"Suspense";case mo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case hu:return(e.displayName||"Context")+".Consumer";case uu:return(e._context.displayName||"Context")+".Provider";case Ra:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ta:return t=e.displayName||null,t!==null?t:yo(e.type)||"Memo";case Ht:t=e._payload,e=e._init;try{return yo(e(t))}catch{}}return null}function uf(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 yo(t);case 8:return t===Da?"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 tr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function fu(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hf(e){var t=fu(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 s=r.get,h=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(v){i=""+v,h.call(this,v)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(v){i=""+v},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ls(e){e._valueTracker||(e._valueTracker=hf(e))}function pu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),i="";return e&&(i=fu(e)?e.checked?"true":"false":e.value),e=i,e!==r?(t.setValue(e),!0):!1}function Ws(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 So(e,t){var r=t.checked;return Ce({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Rl(e,t){var r=t.defaultValue==null?"":t.defaultValue,i=t.checked!=null?t.checked:t.defaultChecked;r=tr(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 _u(e,t){t=t.checked,t!=null&&La(e,"checked",t,!1)}function wo(e,t){_u(e,t);var r=tr(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")?Co(e,t.type,r):t.hasOwnProperty("defaultValue")&&Co(e,t.type,tr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Tl(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 Co(e,t,r){(t!=="number"||Ws(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var wi=Array.isArray;function Ur(e,t,r,i){if(e=e.options,t){t={};for(var s=0;s<r.length;s++)t["$"+r[s]]=!0;for(r=0;r<e.length;r++)s=t.hasOwnProperty("$"+e[r].value),e[r].selected!==s&&(e[r].selected=s),s&&i&&(e[r].defaultSelected=!0)}else{for(r=""+tr(r),t=null,s=0;s<e.length;s++){if(e[s].value===r){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function xo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return Ce({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Pl(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(wi(r)){if(1<r.length)throw Error(G(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:tr(r)}}function vu(e,t){var r=tr(t.value),i=tr(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 Ml(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function gu(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 bo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?gu(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var cs,mu=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,i,s){MSApp.execUnsafeLocalFunction(function(){return e(t,r,i,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(cs=cs||document.createElement("div"),cs.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=cs.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ii(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var bi={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},df=["Webkit","ms","Moz","O"];Object.keys(bi).forEach(function(e){df.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),bi[t]=bi[e]})});function yu(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||bi.hasOwnProperty(e)&&bi[e]?(""+t).trim():t+"px"}function Su(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var i=r.indexOf("--")===0,s=yu(r,t[r],i);r==="float"&&(r="cssFloat"),i?e.setProperty(r,s):e[r]=s}}var ff=Ce({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 ko(e,t){if(t){if(ff[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 Eo(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 Lo=null;function Pa(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Do=null,$r=null,Kr=null;function Al(e){if(e=rs(e)){if(typeof Do!="function")throw Error(G(280));var t=e.stateNode;t&&(t=wn(t),Do(e.stateNode,e.type,t))}}function wu(e){$r?Kr?Kr.push(e):Kr=[e]:$r=e}function Cu(){if($r){var e=$r,t=Kr;if(Kr=$r=null,Al(e),t)for(e=0;e<t.length;e++)Al(t[e])}}function xu(e,t){return e(t)}function bu(){}var Hn=!1;function ku(e,t,r){if(Hn)return e(t,r);Hn=!0;try{return xu(e,t,r)}finally{Hn=!1,($r!==null||Kr!==null)&&(bu(),Cu())}}function ji(e,t){var r=e.stateNode;if(r===null)return null;var i=wn(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 Ro=!1;if(At)try{var di={};Object.defineProperty(di,"passive",{get:function(){Ro=!0}}),window.addEventListener("test",di,di),window.removeEventListener("test",di,di)}catch{Ro=!1}function pf(e,t,r,i,s,h,v,o,c){var f=Array.prototype.slice.call(arguments,3);try{t.apply(r,f)}catch(g){this.onError(g)}}var ki=!1,Us=null,$s=!1,To=null,_f={onError:function(e){ki=!0,Us=e}};function vf(e,t,r,i,s,h,v,o,c){ki=!1,Us=null,pf.apply(_f,arguments)}function gf(e,t,r,i,s,h,v,o,c){if(vf.apply(this,arguments),ki){if(ki){var f=Us;ki=!1,Us=null}else throw Error(G(198));$s||($s=!0,To=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 Eu(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 Ol(e){if(Er(e)!==e)throw Error(G(188))}function mf(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 s=r.return;if(s===null)break;var h=s.alternate;if(h===null){if(i=s.return,i!==null){r=i;continue}break}if(s.child===h.child){for(h=s.child;h;){if(h===r)return Ol(s),e;if(h===i)return Ol(s),t;h=h.sibling}throw Error(G(188))}if(r.return!==i.return)r=s,i=h;else{for(var v=!1,o=s.child;o;){if(o===r){v=!0,r=s,i=h;break}if(o===i){v=!0,i=s,r=h;break}o=o.sibling}if(!v){for(o=h.child;o;){if(o===r){v=!0,r=h,i=s;break}if(o===i){v=!0,i=h,r=s;break}o=o.sibling}if(!v)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 Lu(e){return e=mf(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 Ru=tt.unstable_scheduleCallback,Bl=tt.unstable_cancelCallback,yf=tt.unstable_shouldYield,Sf=tt.unstable_requestPaint,be=tt.unstable_now,wf=tt.unstable_getCurrentPriorityLevel,Ma=tt.unstable_ImmediatePriority,Tu=tt.unstable_UserBlockingPriority,Ks=tt.unstable_NormalPriority,Cf=tt.unstable_LowPriority,Pu=tt.unstable_IdlePriority,gn=null,kt=null;function xf(e){if(kt&&typeof kt.onCommitFiberRoot=="function")try{kt.onCommitFiberRoot(gn,e,void 0,(e.current.flags&128)===128)}catch{}}var mt=Math.clz32?Math.clz32:Ef,bf=Math.log,kf=Math.LN2;function Ef(e){return e>>>=0,e===0?32:31-(bf(e)/kf|0)|0}var us=64,hs=4194304;function Ci(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 Vs(e,t){var r=e.pendingLanes;if(r===0)return 0;var i=0,s=e.suspendedLanes,h=e.pingedLanes,v=r&268435455;if(v!==0){var o=v&~s;o!==0?i=Ci(o):(h&=v,h!==0&&(i=Ci(h)))}else v=r&~s,v!==0?i=Ci(v):h!==0&&(i=Ci(h));if(i===0)return 0;if(t!==0&&t!==i&&!(t&s)&&(s=i&-i,h=t&-t,s>=h||s===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-mt(t),s=1<<r,i|=e[r],t&=~s;return i}function Lf(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 Df(e,t){for(var r=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,h=e.pendingLanes;0<h;){var v=31-mt(h),o=1<<v,c=s[v];c===-1?(!(o&r)||o&i)&&(s[v]=Lf(o,t)):c<=t&&(e.expiredLanes|=o),h&=~o}}function Po(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Mu(){var e=us;return us<<=1,!(us&4194240)&&(us=64),e}function zn(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function es(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-mt(t),e[t]=r}function Rf(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 s=31-mt(r),h=1<<s;t[s]=0,i[s]=-1,e[s]=-1,r&=~h}}function Aa(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var i=31-mt(r),s=1<<i;s&t|e[i]&t&&(e[i]|=t),r&=~s}}var ce=0;function Au(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Ou,Oa,Bu,Iu,ju,Mo=!1,ds=[],qt=null,Gt=null,Xt=null,Ni=new Map,Fi=new Map,Wt=[],Tf="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 Il(e,t){switch(e){case"focusin":case"focusout":qt=null;break;case"dragenter":case"dragleave":Gt=null;break;case"mouseover":case"mouseout":Xt=null;break;case"pointerover":case"pointerout":Ni.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Fi.delete(t.pointerId)}}function fi(e,t,r,i,s,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:r,eventSystemFlags:i,nativeEvent:h,targetContainers:[s]},t!==null&&(t=rs(t),t!==null&&Oa(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function Pf(e,t,r,i,s){switch(t){case"focusin":return qt=fi(qt,e,t,r,i,s),!0;case"dragenter":return Gt=fi(Gt,e,t,r,i,s),!0;case"mouseover":return Xt=fi(Xt,e,t,r,i,s),!0;case"pointerover":var h=s.pointerId;return Ni.set(h,fi(Ni.get(h)||null,e,t,r,i,s)),!0;case"gotpointercapture":return h=s.pointerId,Fi.set(h,fi(Fi.get(h)||null,e,t,r,i,s)),!0}return!1}function Nu(e){var t=dr(e.target);if(t!==null){var r=Er(t);if(r!==null){if(t=r.tag,t===13){if(t=Eu(r),t!==null){e.blockedOn=t,ju(e.priority,function(){Bu(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 Rs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Ao(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var i=new r.constructor(r.type,r);Lo=i,r.target.dispatchEvent(i),Lo=null}else return t=rs(r),t!==null&&Oa(t),e.blockedOn=r,!1;t.shift()}return!0}function jl(e,t,r){Rs(e)&&r.delete(t)}function Mf(){Mo=!1,qt!==null&&Rs(qt)&&(qt=null),Gt!==null&&Rs(Gt)&&(Gt=null),Xt!==null&&Rs(Xt)&&(Xt=null),Ni.forEach(jl),Fi.forEach(jl)}function pi(e,t){e.blockedOn===t&&(e.blockedOn=null,Mo||(Mo=!0,tt.unstable_scheduleCallback(tt.unstable_NormalPriority,Mf)))}function Hi(e){function t(s){return pi(s,e)}if(0<ds.length){pi(ds[0],e);for(var r=1;r<ds.length;r++){var i=ds[r];i.blockedOn===e&&(i.blockedOn=null)}}for(qt!==null&&pi(qt,e),Gt!==null&&pi(Gt,e),Xt!==null&&pi(Xt,e),Ni.forEach(t),Fi.forEach(t),r=0;r<Wt.length;r++)i=Wt[r],i.blockedOn===e&&(i.blockedOn=null);for(;0<Wt.length&&(r=Wt[0],r.blockedOn===null);)Nu(r),r.blockedOn===null&&Wt.shift()}var Vr=jt.ReactCurrentBatchConfig,qs=!0;function Af(e,t,r,i){var s=ce,h=Vr.transition;Vr.transition=null;try{ce=1,Ba(e,t,r,i)}finally{ce=s,Vr.transition=h}}function Of(e,t,r,i){var s=ce,h=Vr.transition;Vr.transition=null;try{ce=4,Ba(e,t,r,i)}finally{ce=s,Vr.transition=h}}function Ba(e,t,r,i){if(qs){var s=Ao(e,t,r,i);if(s===null)Yn(e,t,i,Gs,r),Il(e,i);else if(Pf(s,e,t,r,i))i.stopPropagation();else if(Il(e,i),t&4&&-1<Tf.indexOf(e)){for(;s!==null;){var h=rs(s);if(h!==null&&Ou(h),h=Ao(e,t,r,i),h===null&&Yn(e,t,i,Gs,r),h===s)break;s=h}s!==null&&i.stopPropagation()}else Yn(e,t,i,null,r)}}var Gs=null;function Ao(e,t,r,i){if(Gs=null,e=Pa(i),e=dr(e),e!==null)if(t=Er(e),t===null)e=null;else if(r=t.tag,r===13){if(e=Eu(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 Gs=e,null}function Fu(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(wf()){case Ma:return 1;case Tu:return 4;case Ks:case Cf:return 16;case Pu:return 536870912;default:return 16}default:return 16}}var $t=null,Ia=null,Ts=null;function Hu(){if(Ts)return Ts;var e,t=Ia,r=t.length,i,s="value"in $t?$t.value:$t.textContent,h=s.length;for(e=0;e<r&&t[e]===s[e];e++);var v=r-e;for(i=1;i<=v&&t[r-i]===s[h-i];i++);return Ts=s.slice(e,1<i?1-i:void 0)}function Ps(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 fs(){return!0}function Nl(){return!1}function it(e){function t(r,i,s,h,v){this._reactName=r,this._targetInst=s,this.type=i,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(r=e[o],this[o]=r?r(h):h[o]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?fs:Nl,this.isPropagationStopped=Nl,this}return Ce(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=fs)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=fs)},persist:function(){},isPersistent:fs}),t}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ja=it(ni),ts=Ce({},ni,{view:0,detail:0}),Bf=it(ts),Wn,Un,_i,mn=Ce({},ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Na,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!==_i&&(_i&&e.type==="mousemove"?(Wn=e.screenX-_i.screenX,Un=e.screenY-_i.screenY):Un=Wn=0,_i=e),Wn)},movementY:function(e){return"movementY"in e?e.movementY:Un}}),Fl=it(mn),If=Ce({},mn,{dataTransfer:0}),jf=it(If),Nf=Ce({},ts,{relatedTarget:0}),$n=it(Nf),Ff=Ce({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),Hf=it(Ff),zf=Ce({},ni,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Wf=it(zf),Uf=Ce({},ni,{data:0}),Hl=it(Uf),$f={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kf={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"},Vf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function qf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vf[e])?!!t[e]:!1}function Na(){return qf}var Gf=Ce({},ts,{key:function(e){if(e.key){var t=$f[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ps(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Kf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Na,charCode:function(e){return e.type==="keypress"?Ps(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ps(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Xf=it(Gf),Qf=Ce({},mn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zl=it(Qf),Yf=Ce({},ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Na}),Jf=it(Yf),Zf=Ce({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),ep=it(Zf),tp=Ce({},mn,{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}),rp=it(tp),ip=[9,13,27,32],Fa=At&&"CompositionEvent"in window,Ei=null;At&&"documentMode"in document&&(Ei=document.documentMode);var sp=At&&"TextEvent"in window&&!Ei,zu=At&&(!Fa||Ei&&8<Ei&&11>=Ei),Wl=" ",Ul=!1;function Wu(e,t){switch(e){case"keyup":return ip.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Uu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Mr=!1;function np(e,t){switch(e){case"compositionend":return Uu(t);case"keypress":return t.which!==32?null:(Ul=!0,Wl);case"textInput":return e=t.data,e===Wl&&Ul?null:e;default:return null}}function op(e,t){if(Mr)return e==="compositionend"||!Fa&&Wu(e,t)?(e=Hu(),Ts=Ia=$t=null,Mr=!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 zu&&t.locale!=="ko"?null:t.data;default:return null}}var ap={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 $l(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ap[e.type]:t==="textarea"}function $u(e,t,r,i){wu(i),t=Xs(t,"onChange"),0<t.length&&(r=new ja("onChange","change",null,r,i),e.push({event:r,listeners:t}))}var Li=null,zi=null;function lp(e){th(e,0)}function yn(e){var t=Br(e);if(pu(t))return e}function cp(e,t){if(e==="change")return t}var Ku=!1;if(At){var Kn;if(At){var Vn="oninput"in document;if(!Vn){var Kl=document.createElement("div");Kl.setAttribute("oninput","return;"),Vn=typeof Kl.oninput=="function"}Kn=Vn}else Kn=!1;Ku=Kn&&(!document.documentMode||9<document.documentMode)}function Vl(){Li&&(Li.detachEvent("onpropertychange",Vu),zi=Li=null)}function Vu(e){if(e.propertyName==="value"&&yn(zi)){var t=[];$u(t,zi,e,Pa(e)),ku(lp,t)}}function up(e,t,r){e==="focusin"?(Vl(),Li=t,zi=r,Li.attachEvent("onpropertychange",Vu)):e==="focusout"&&Vl()}function hp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return yn(zi)}function dp(e,t){if(e==="click")return yn(t)}function fp(e,t){if(e==="input"||e==="change")return yn(t)}function pp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var St=typeof Object.is=="function"?Object.is:pp;function Wi(e,t){if(St(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 s=r[i];if(!_o.call(t,s)||!St(e[s],t[s]))return!1}return!0}function ql(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Gl(e,t){var r=ql(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=ql(r)}}function qu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Gu(){for(var e=window,t=Ws();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Ws(e.document)}return t}function Ha(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 _p(e){var t=Gu(),r=e.focusedElem,i=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&qu(r.ownerDocument.documentElement,r)){if(i!==null&&Ha(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 s=r.textContent.length,h=Math.min(i.start,s);i=i.end===void 0?h:Math.min(i.end,s),!e.extend&&h>i&&(s=i,i=h,h=s),s=Gl(r,h);var v=Gl(r,i);s&&v&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==v.node||e.focusOffset!==v.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),h>i?(e.addRange(t),e.extend(v.node,v.offset)):(t.setEnd(v.node,v.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 vp=At&&"documentMode"in document&&11>=document.documentMode,Ar=null,Oo=null,Di=null,Bo=!1;function Xl(e,t,r){var i=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Bo||Ar==null||Ar!==Ws(i)||(i=Ar,"selectionStart"in i&&Ha(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}),Di&&Wi(Di,i)||(Di=i,i=Xs(Oo,"onSelect"),0<i.length&&(t=new ja("onSelect","select",null,t,r),e.push({event:t,listeners:i}),t.target=Ar)))}function ps(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Or={animationend:ps("Animation","AnimationEnd"),animationiteration:ps("Animation","AnimationIteration"),animationstart:ps("Animation","AnimationStart"),transitionend:ps("Transition","TransitionEnd")},qn={},Xu={};At&&(Xu=document.createElement("div").style,"AnimationEvent"in window||(delete Or.animationend.animation,delete Or.animationiteration.animation,delete Or.animationstart.animation),"TransitionEvent"in window||delete Or.transitionend.transition);function Sn(e){if(qn[e])return qn[e];if(!Or[e])return e;var t=Or[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in Xu)return qn[e]=t[r];return e}var Qu=Sn("animationend"),Yu=Sn("animationiteration"),Ju=Sn("animationstart"),Zu=Sn("transitionend"),eh=new Map,Ql="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 sr(e,t){eh.set(e,t),kr(t,[e])}for(var Gn=0;Gn<Ql.length;Gn++){var Xn=Ql[Gn],gp=Xn.toLowerCase(),mp=Xn[0].toUpperCase()+Xn.slice(1);sr(gp,"on"+mp)}sr(Qu,"onAnimationEnd");sr(Yu,"onAnimationIteration");sr(Ju,"onAnimationStart");sr("dblclick","onDoubleClick");sr("focusin","onFocus");sr("focusout","onBlur");sr(Zu,"onTransitionEnd");Qr("onMouseEnter",["mouseout","mouseover"]);Qr("onMouseLeave",["mouseout","mouseover"]);Qr("onPointerEnter",["pointerout","pointerover"]);Qr("onPointerLeave",["pointerout","pointerover"]);kr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));kr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));kr("onBeforeInput",["compositionend","keypress","textInput","paste"]);kr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));kr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));kr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xi="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(xi));function Yl(e,t,r){var i=e.type||"unknown-event";e.currentTarget=r,gf(i,t,void 0,e),e.currentTarget=null}function th(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var i=e[r],s=i.event;i=i.listeners;e:{var h=void 0;if(t)for(var v=i.length-1;0<=v;v--){var o=i[v],c=o.instance,f=o.currentTarget;if(o=o.listener,c!==h&&s.isPropagationStopped())break e;Yl(s,o,f),h=c}else for(v=0;v<i.length;v++){if(o=i[v],c=o.instance,f=o.currentTarget,o=o.listener,c!==h&&s.isPropagationStopped())break e;Yl(s,o,f),h=c}}}if($s)throw e=To,$s=!1,To=null,e}function ve(e,t){var r=t[Ho];r===void 0&&(r=t[Ho]=new Set);var i=e+"__bubble";r.has(i)||(rh(t,e,2,!1),r.add(i))}function Qn(e,t,r){var i=0;t&&(i|=4),rh(r,e,i,t)}var _s="_reactListening"+Math.random().toString(36).slice(2);function Ui(e){if(!e[_s]){e[_s]=!0,cu.forEach(function(r){r!=="selectionchange"&&(yp.has(r)||Qn(r,!1,e),Qn(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_s]||(t[_s]=!0,Qn("selectionchange",!1,t))}}function rh(e,t,r,i){switch(Fu(t)){case 1:var s=Af;break;case 4:s=Of;break;default:s=Ba}r=s.bind(null,t,r,e),s=void 0,!Ro||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?s!==void 0?e.addEventListener(t,r,{capture:!0,passive:s}):e.addEventListener(t,r,!0):s!==void 0?e.addEventListener(t,r,{passive:s}):e.addEventListener(t,r,!1)}function Yn(e,t,r,i,s){var h=i;if(!(t&1)&&!(t&2)&&i!==null)e:for(;;){if(i===null)return;var v=i.tag;if(v===3||v===4){var o=i.stateNode.containerInfo;if(o===s||o.nodeType===8&&o.parentNode===s)break;if(v===4)for(v=i.return;v!==null;){var c=v.tag;if((c===3||c===4)&&(c=v.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;v=v.return}for(;o!==null;){if(v=dr(o),v===null)return;if(c=v.tag,c===5||c===6){i=h=v;continue e}o=o.parentNode}}i=i.return}ku(function(){var f=h,g=Pa(r),d=[];e:{var p=eh.get(e);if(p!==void 0){var y=ja,x=e;switch(e){case"keypress":if(Ps(r)===0)break e;case"keydown":case"keyup":y=Xf;break;case"focusin":x="focus",y=$n;break;case"focusout":x="blur",y=$n;break;case"beforeblur":case"afterblur":y=$n;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":y=Fl;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=jf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=Jf;break;case Qu:case Yu:case Ju:y=Hf;break;case Zu:y=ep;break;case"scroll":y=Bf;break;case"wheel":y=rp;break;case"copy":case"cut":case"paste":y=Wf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=zl}var m=(t&4)!==0,u=!m&&e==="scroll",a=m?p!==null?p+"Capture":null:p;m=[];for(var n=f,l;n!==null;){l=n;var _=l.stateNode;if(l.tag===5&&_!==null&&(l=_,a!==null&&(_=ji(n,a),_!=null&&m.push($i(n,_,l)))),u)break;n=n.return}0<m.length&&(p=new y(p,x,null,r,g),d.push({event:p,listeners:m}))}}if(!(t&7)){e:{if(p=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",p&&r!==Lo&&(x=r.relatedTarget||r.fromElement)&&(dr(x)||x[Ot]))break e;if((y||p)&&(p=g.window===g?g:(p=g.ownerDocument)?p.defaultView||p.parentWindow:window,y?(x=r.relatedTarget||r.toElement,y=f,x=x?dr(x):null,x!==null&&(u=Er(x),x!==u||x.tag!==5&&x.tag!==6)&&(x=null)):(y=null,x=f),y!==x)){if(m=Fl,_="onMouseLeave",a="onMouseEnter",n="mouse",(e==="pointerout"||e==="pointerover")&&(m=zl,_="onPointerLeave",a="onPointerEnter",n="pointer"),u=y==null?p:Br(y),l=x==null?p:Br(x),p=new m(_,n+"leave",y,r,g),p.target=u,p.relatedTarget=l,_=null,dr(g)===f&&(m=new m(a,n+"enter",x,r,g),m.target=l,m.relatedTarget=u,_=m),u=_,y&&x)t:{for(m=y,a=x,n=0,l=m;l;l=Rr(l))n++;for(l=0,_=a;_;_=Rr(_))l++;for(;0<n-l;)m=Rr(m),n--;for(;0<l-n;)a=Rr(a),l--;for(;n--;){if(m===a||a!==null&&m===a.alternate)break t;m=Rr(m),a=Rr(a)}m=null}else m=null;y!==null&&Jl(d,p,y,m,!1),x!==null&&u!==null&&Jl(d,u,x,m,!0)}}e:{if(p=f?Br(f):window,y=p.nodeName&&p.nodeName.toLowerCase(),y==="select"||y==="input"&&p.type==="file")var S=cp;else if($l(p))if(Ku)S=fp;else{S=hp;var C=up}else(y=p.nodeName)&&y.toLowerCase()==="input"&&(p.type==="checkbox"||p.type==="radio")&&(S=dp);if(S&&(S=S(e,f))){$u(d,S,r,g);break e}C&&C(e,p,f),e==="focusout"&&(C=p._wrapperState)&&C.controlled&&p.type==="number"&&Co(p,"number",p.value)}switch(C=f?Br(f):window,e){case"focusin":($l(C)||C.contentEditable==="true")&&(Ar=C,Oo=f,Di=null);break;case"focusout":Di=Oo=Ar=null;break;case"mousedown":Bo=!0;break;case"contextmenu":case"mouseup":case"dragend":Bo=!1,Xl(d,r,g);break;case"selectionchange":if(vp)break;case"keydown":case"keyup":Xl(d,r,g)}var b;if(Fa)e:{switch(e){case"compositionstart":var w="onCompositionStart";break e;case"compositionend":w="onCompositionEnd";break e;case"compositionupdate":w="onCompositionUpdate";break e}w=void 0}else Mr?Wu(e,r)&&(w="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(w="onCompositionStart");w&&(zu&&r.locale!=="ko"&&(Mr||w!=="onCompositionStart"?w==="onCompositionEnd"&&Mr&&(b=Hu()):($t=g,Ia="value"in $t?$t.value:$t.textContent,Mr=!0)),C=Xs(f,w),0<C.length&&(w=new Hl(w,e,null,r,g),d.push({event:w,listeners:C}),b?w.data=b:(b=Uu(r),b!==null&&(w.data=b)))),(b=sp?np(e,r):op(e,r))&&(f=Xs(f,"onBeforeInput"),0<f.length&&(g=new Hl("onBeforeInput","beforeinput",null,r,g),d.push({event:g,listeners:f}),g.data=b))}th(d,t)})}function $i(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Xs(e,t){for(var r=t+"Capture",i=[];e!==null;){var s=e,h=s.stateNode;s.tag===5&&h!==null&&(s=h,h=ji(e,r),h!=null&&i.unshift($i(e,h,s)),h=ji(e,t),h!=null&&i.push($i(e,h,s))),e=e.return}return i}function Rr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Jl(e,t,r,i,s){for(var h=t._reactName,v=[];r!==null&&r!==i;){var o=r,c=o.alternate,f=o.stateNode;if(c!==null&&c===i)break;o.tag===5&&f!==null&&(o=f,s?(c=ji(r,h),c!=null&&v.unshift($i(r,c,o))):s||(c=ji(r,h),c!=null&&v.push($i(r,c,o)))),r=r.return}v.length!==0&&e.push({event:t,listeners:v})}var Sp=/\r\n?/g,wp=/\u0000|\uFFFD/g;function Zl(e){return(typeof e=="string"?e:""+e).replace(Sp,`
|
|
38
|
+
`).replace(wp,"")}function vs(e,t,r){if(t=Zl(t),Zl(e)!==t&&r)throw Error(G(425))}function Qs(){}var Io=null,jo=null;function No(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 Fo=typeof setTimeout=="function"?setTimeout:void 0,Cp=typeof clearTimeout=="function"?clearTimeout:void 0,ec=typeof Promise=="function"?Promise:void 0,xp=typeof queueMicrotask=="function"?queueMicrotask:typeof ec<"u"?function(e){return ec.resolve(null).then(e).catch(bp)}:Fo;function bp(e){setTimeout(function(){throw e})}function Jn(e,t){var r=t,i=0;do{var s=r.nextSibling;if(e.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(i===0){e.removeChild(s),Hi(t);return}i--}else r!=="$"&&r!=="$?"&&r!=="$!"||i++;r=s}while(r);Hi(t)}function Qt(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 tc(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 oi=Math.random().toString(36).slice(2),bt="__reactFiber$"+oi,Ki="__reactProps$"+oi,Ot="__reactContainer$"+oi,Ho="__reactEvents$"+oi,kp="__reactListeners$"+oi,Ep="__reactHandles$"+oi;function dr(e){var t=e[bt];if(t)return t;for(var r=e.parentNode;r;){if(t=r[Ot]||r[bt]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=tc(e);e!==null;){if(r=e[bt])return r;e=tc(e)}return t}e=r,r=e.parentNode}return null}function rs(e){return e=e[bt]||e[Ot],!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 wn(e){return e[Ki]||null}var zo=[],Ir=-1;function nr(e){return{current:e}}function ge(e){0>Ir||(e.current=zo[Ir],zo[Ir]=null,Ir--)}function _e(e,t){Ir++,zo[Ir]=e.current,e.current=t}var rr={},He=nr(rr),Xe=nr(!1),yr=rr;function Yr(e,t){var r=e.type.contextTypes;if(!r)return rr;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var s={},h;for(h in r)s[h]=t[h];return i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function Qe(e){return e=e.childContextTypes,e!=null}function Ys(){ge(Xe),ge(He)}function rc(e,t,r){if(He.current!==rr)throw Error(G(168));_e(He,t),_e(Xe,r)}function ih(e,t,r){var i=e.stateNode;if(t=t.childContextTypes,typeof i.getChildContext!="function")return r;i=i.getChildContext();for(var s in i)if(!(s in t))throw Error(G(108,uf(e)||"Unknown",s));return Ce({},r,i)}function Js(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||rr,yr=He.current,_e(He,e),_e(Xe,Xe.current),!0}function ic(e,t,r){var i=e.stateNode;if(!i)throw Error(G(169));r?(e=ih(e,t,yr),i.__reactInternalMemoizedMergedChildContext=e,ge(Xe),ge(He),_e(He,e)):ge(Xe),_e(Xe,r)}var Rt=null,Cn=!1,Zn=!1;function sh(e){Rt===null?Rt=[e]:Rt.push(e)}function Lp(e){Cn=!0,sh(e)}function or(){if(!Zn&&Rt!==null){Zn=!0;var e=0,t=ce;try{var r=Rt;for(ce=1;e<r.length;e++){var i=r[e];do i=i(!0);while(i!==null)}Rt=null,Cn=!1}catch(s){throw Rt!==null&&(Rt=Rt.slice(e+1)),Ru(Ma,or),s}finally{ce=t,Zn=!1}}return null}var jr=[],Nr=0,Zs=null,en=0,at=[],lt=0,Sr=null,Tt=1,Pt="";function ur(e,t){jr[Nr++]=en,jr[Nr++]=Zs,Zs=e,en=t}function nh(e,t,r){at[lt++]=Tt,at[lt++]=Pt,at[lt++]=Sr,Sr=e;var i=Tt;e=Pt;var s=32-mt(i)-1;i&=~(1<<s),r+=1;var h=32-mt(t)+s;if(30<h){var v=s-s%5;h=(i&(1<<v)-1).toString(32),i>>=v,s-=v,Tt=1<<32-mt(t)+s|r<<s|i,Pt=h+e}else Tt=1<<h|r<<s|i,Pt=e}function za(e){e.return!==null&&(ur(e,1),nh(e,1,0))}function Wa(e){for(;e===Zs;)Zs=jr[--Nr],jr[Nr]=null,en=jr[--Nr],jr[Nr]=null;for(;e===Sr;)Sr=at[--lt],at[lt]=null,Pt=at[--lt],at[lt]=null,Tt=at[--lt],at[lt]=null}var et=null,Ze=null,me=!1,gt=null;function oh(e,t){var r=ct(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 sc(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,et=e,Ze=Qt(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,et=e,Ze=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Sr!==null?{id:Tt,overflow:Pt}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=ct(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,et=e,Ze=null,!0):!1;default:return!1}}function Wo(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Uo(e){if(me){var t=Ze;if(t){var r=t;if(!sc(e,t)){if(Wo(e))throw Error(G(418));t=Qt(r.nextSibling);var i=et;t&&sc(e,t)?oh(i,r):(e.flags=e.flags&-4097|2,me=!1,et=e)}}else{if(Wo(e))throw Error(G(418));e.flags=e.flags&-4097|2,me=!1,et=e}}}function nc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;et=e}function gs(e){if(e!==et)return!1;if(!me)return nc(e),me=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!No(e.type,e.memoizedProps)),t&&(t=Ze)){if(Wo(e))throw ah(),Error(G(418));for(;t;)oh(e,t),t=Qt(t.nextSibling)}if(nc(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){Ze=Qt(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Ze=null}}else Ze=et?Qt(e.stateNode.nextSibling):null;return!0}function ah(){for(var e=Ze;e;)e=Qt(e.nextSibling)}function Jr(){Ze=et=null,me=!1}function Ua(e){gt===null?gt=[e]:gt.push(e)}var Dp=jt.ReactCurrentBatchConfig;function vi(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 s=i,h=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===h?t.ref:(t=function(v){var o=s.refs;v===null?delete o[h]:o[h]=v},t._stringRef=h,t)}if(typeof e!="string")throw Error(G(284));if(!r._owner)throw Error(G(290,e))}return e}function ms(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function oc(e){var t=e._init;return t(e._payload)}function lh(e){function t(a,n){if(e){var l=a.deletions;l===null?(a.deletions=[n],a.flags|=16):l.push(n)}}function r(a,n){if(!e)return null;for(;n!==null;)t(a,n),n=n.sibling;return null}function i(a,n){for(a=new Map;n!==null;)n.key!==null?a.set(n.key,n):a.set(n.index,n),n=n.sibling;return a}function s(a,n){return a=er(a,n),a.index=0,a.sibling=null,a}function h(a,n,l){return a.index=l,e?(l=a.alternate,l!==null?(l=l.index,l<n?(a.flags|=2,n):l):(a.flags|=2,n)):(a.flags|=1048576,n)}function v(a){return e&&a.alternate===null&&(a.flags|=2),a}function o(a,n,l,_){return n===null||n.tag!==6?(n=oo(l,a.mode,_),n.return=a,n):(n=s(n,l),n.return=a,n)}function c(a,n,l,_){var S=l.type;return S===Pr?g(a,n,l.props.children,_,l.key):n!==null&&(n.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ht&&oc(S)===n.type)?(_=s(n,l.props),_.ref=vi(a,n,l),_.return=a,_):(_=Ns(l.type,l.key,l.props,null,a.mode,_),_.ref=vi(a,n,l),_.return=a,_)}function f(a,n,l,_){return n===null||n.tag!==4||n.stateNode.containerInfo!==l.containerInfo||n.stateNode.implementation!==l.implementation?(n=ao(l,a.mode,_),n.return=a,n):(n=s(n,l.children||[]),n.return=a,n)}function g(a,n,l,_,S){return n===null||n.tag!==7?(n=vr(l,a.mode,_,S),n.return=a,n):(n=s(n,l),n.return=a,n)}function d(a,n,l){if(typeof n=="string"&&n!==""||typeof n=="number")return n=oo(""+n,a.mode,l),n.return=a,n;if(typeof n=="object"&&n!==null){switch(n.$$typeof){case as:return l=Ns(n.type,n.key,n.props,null,a.mode,l),l.ref=vi(a,null,n),l.return=a,l;case Tr:return n=ao(n,a.mode,l),n.return=a,n;case Ht:var _=n._init;return d(a,_(n._payload),l)}if(wi(n)||hi(n))return n=vr(n,a.mode,l,null),n.return=a,n;ms(a,n)}return null}function p(a,n,l,_){var S=n!==null?n.key:null;if(typeof l=="string"&&l!==""||typeof l=="number")return S!==null?null:o(a,n,""+l,_);if(typeof l=="object"&&l!==null){switch(l.$$typeof){case as:return l.key===S?c(a,n,l,_):null;case Tr:return l.key===S?f(a,n,l,_):null;case Ht:return S=l._init,p(a,n,S(l._payload),_)}if(wi(l)||hi(l))return S!==null?null:g(a,n,l,_,null);ms(a,l)}return null}function y(a,n,l,_,S){if(typeof _=="string"&&_!==""||typeof _=="number")return a=a.get(l)||null,o(n,a,""+_,S);if(typeof _=="object"&&_!==null){switch(_.$$typeof){case as:return a=a.get(_.key===null?l:_.key)||null,c(n,a,_,S);case Tr:return a=a.get(_.key===null?l:_.key)||null,f(n,a,_,S);case Ht:var C=_._init;return y(a,n,l,C(_._payload),S)}if(wi(_)||hi(_))return a=a.get(l)||null,g(n,a,_,S,null);ms(n,_)}return null}function x(a,n,l,_){for(var S=null,C=null,b=n,w=n=0,E=null;b!==null&&w<l.length;w++){b.index>w?(E=b,b=null):E=b.sibling;var P=p(a,b,l[w],_);if(P===null){b===null&&(b=E);break}e&&b&&P.alternate===null&&t(a,b),n=h(P,n,w),C===null?S=P:C.sibling=P,C=P,b=E}if(w===l.length)return r(a,b),me&&ur(a,w),S;if(b===null){for(;w<l.length;w++)b=d(a,l[w],_),b!==null&&(n=h(b,n,w),C===null?S=b:C.sibling=b,C=b);return me&&ur(a,w),S}for(b=i(a,b);w<l.length;w++)E=y(b,a,w,l[w],_),E!==null&&(e&&E.alternate!==null&&b.delete(E.key===null?w:E.key),n=h(E,n,w),C===null?S=E:C.sibling=E,C=E);return e&&b.forEach(function(O){return t(a,O)}),me&&ur(a,w),S}function m(a,n,l,_){var S=hi(l);if(typeof S!="function")throw Error(G(150));if(l=S.call(l),l==null)throw Error(G(151));for(var C=S=null,b=n,w=n=0,E=null,P=l.next();b!==null&&!P.done;w++,P=l.next()){b.index>w?(E=b,b=null):E=b.sibling;var O=p(a,b,P.value,_);if(O===null){b===null&&(b=E);break}e&&b&&O.alternate===null&&t(a,b),n=h(O,n,w),C===null?S=O:C.sibling=O,C=O,b=E}if(P.done)return r(a,b),me&&ur(a,w),S;if(b===null){for(;!P.done;w++,P=l.next())P=d(a,P.value,_),P!==null&&(n=h(P,n,w),C===null?S=P:C.sibling=P,C=P);return me&&ur(a,w),S}for(b=i(a,b);!P.done;w++,P=l.next())P=y(b,a,w,P.value,_),P!==null&&(e&&P.alternate!==null&&b.delete(P.key===null?w:P.key),n=h(P,n,w),C===null?S=P:C.sibling=P,C=P);return e&&b.forEach(function(M){return t(a,M)}),me&&ur(a,w),S}function u(a,n,l,_){if(typeof l=="object"&&l!==null&&l.type===Pr&&l.key===null&&(l=l.props.children),typeof l=="object"&&l!==null){switch(l.$$typeof){case as:e:{for(var S=l.key,C=n;C!==null;){if(C.key===S){if(S=l.type,S===Pr){if(C.tag===7){r(a,C.sibling),n=s(C,l.props.children),n.return=a,a=n;break e}}else if(C.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Ht&&oc(S)===C.type){r(a,C.sibling),n=s(C,l.props),n.ref=vi(a,C,l),n.return=a,a=n;break e}r(a,C);break}else t(a,C);C=C.sibling}l.type===Pr?(n=vr(l.props.children,a.mode,_,l.key),n.return=a,a=n):(_=Ns(l.type,l.key,l.props,null,a.mode,_),_.ref=vi(a,n,l),_.return=a,a=_)}return v(a);case Tr:e:{for(C=l.key;n!==null;){if(n.key===C)if(n.tag===4&&n.stateNode.containerInfo===l.containerInfo&&n.stateNode.implementation===l.implementation){r(a,n.sibling),n=s(n,l.children||[]),n.return=a,a=n;break e}else{r(a,n);break}else t(a,n);n=n.sibling}n=ao(l,a.mode,_),n.return=a,a=n}return v(a);case Ht:return C=l._init,u(a,n,C(l._payload),_)}if(wi(l))return x(a,n,l,_);if(hi(l))return m(a,n,l,_);ms(a,l)}return typeof l=="string"&&l!==""||typeof l=="number"?(l=""+l,n!==null&&n.tag===6?(r(a,n.sibling),n=s(n,l),n.return=a,a=n):(r(a,n),n=oo(l,a.mode,_),n.return=a,a=n),v(a)):r(a,n)}return u}var Zr=lh(!0),ch=lh(!1),tn=nr(null),rn=null,Fr=null,$a=null;function Ka(){$a=Fr=rn=null}function Va(e){var t=tn.current;ge(tn),e._currentValue=t}function $o(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 qr(e,t){rn=e,$a=Fr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ge=!0),e.firstContext=null)}function ht(e){var t=e._currentValue;if($a!==e)if(e={context:e,memoizedValue:t,next:null},Fr===null){if(rn===null)throw Error(G(308));Fr=e,rn.dependencies={lanes:0,firstContext:e}}else Fr=Fr.next=e;return t}var fr=null;function qa(e){fr===null?fr=[e]:fr.push(e)}function uh(e,t,r,i){var s=t.interleaved;return s===null?(r.next=r,qa(t)):(r.next=s.next,s.next=r),t.interleaved=r,Bt(e,i)}function Bt(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 zt=!1;function Ga(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function hh(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 Mt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Yt(e,t,r){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,ne&2){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,Bt(e,r)}return s=i.interleaved,s===null?(t.next=t,qa(i)):(t.next=s.next,s.next=t),i.interleaved=t,Bt(e,r)}function Ms(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,Aa(e,r)}}function ac(e,t){var r=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,r===i)){var s=null,h=null;if(r=r.firstBaseUpdate,r!==null){do{var v={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};h===null?s=h=v:h=h.next=v,r=r.next}while(r!==null);h===null?s=h=t:h=h.next=t}else s=h=t;r={baseState:i.baseState,firstBaseUpdate:s,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 sn(e,t,r,i){var s=e.updateQueue;zt=!1;var h=s.firstBaseUpdate,v=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var c=o,f=c.next;c.next=null,v===null?h=f:v.next=f,v=c;var g=e.alternate;g!==null&&(g=g.updateQueue,o=g.lastBaseUpdate,o!==v&&(o===null?g.firstBaseUpdate=f:o.next=f,g.lastBaseUpdate=c))}if(h!==null){var d=s.baseState;v=0,g=f=c=null,o=h;do{var p=o.lane,y=o.eventTime;if((i&p)===p){g!==null&&(g=g.next={eventTime:y,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var x=e,m=o;switch(p=t,y=r,m.tag){case 1:if(x=m.payload,typeof x=="function"){d=x.call(y,d,p);break e}d=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=m.payload,p=typeof x=="function"?x.call(y,d,p):x,p==null)break e;d=Ce({},d,p);break e;case 2:zt=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,p=s.effects,p===null?s.effects=[o]:p.push(o))}else y={eventTime:y,lane:p,tag:o.tag,payload:o.payload,callback:o.callback,next:null},g===null?(f=g=y,c=d):g=g.next=y,v|=p;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;p=o,o=p.next,p.next=null,s.lastBaseUpdate=p,s.shared.pending=null}}while(!0);if(g===null&&(c=d),s.baseState=c,s.firstBaseUpdate=f,s.lastBaseUpdate=g,t=s.shared.interleaved,t!==null){s=t;do v|=s.lane,s=s.next;while(s!==t)}else h===null&&(s.shared.lanes=0);Cr|=v,e.lanes=v,e.memoizedState=d}}function lc(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var i=e[t],s=i.callback;if(s!==null){if(i.callback=null,i=r,typeof s!="function")throw Error(G(191,s));s.call(i)}}}var is={},Et=nr(is),Vi=nr(is),qi=nr(is);function pr(e){if(e===is)throw Error(G(174));return e}function Xa(e,t){switch(_e(qi,t),_e(Vi,e),_e(Et,is),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:bo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=bo(t,e)}ge(Et),_e(Et,t)}function ei(){ge(Et),ge(Vi),ge(qi)}function dh(e){pr(qi.current);var t=pr(Et.current),r=bo(t,e.type);t!==r&&(_e(Vi,e),_e(Et,r))}function Qa(e){Vi.current===e&&(ge(Et),ge(Vi))}var Se=nr(0);function nn(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 eo=[];function Ya(){for(var e=0;e<eo.length;e++)eo[e]._workInProgressVersionPrimary=null;eo.length=0}var As=jt.ReactCurrentDispatcher,to=jt.ReactCurrentBatchConfig,wr=0,we=null,Ee=null,Re=null,on=!1,Ri=!1,Gi=0,Rp=0;function je(){throw Error(G(321))}function Ja(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!St(e[r],t[r]))return!1;return!0}function Za(e,t,r,i,s,h){if(wr=h,we=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,As.current=e===null||e.memoizedState===null?Ap:Op,e=r(i,s),Ri){h=0;do{if(Ri=!1,Gi=0,25<=h)throw Error(G(301));h+=1,Re=Ee=null,t.updateQueue=null,As.current=Bp,e=r(i,s)}while(Ri)}if(As.current=an,t=Ee!==null&&Ee.next!==null,wr=0,Re=Ee=we=null,on=!1,t)throw Error(G(300));return e}function el(){var e=Gi!==0;return Gi=0,e}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Re===null?we.memoizedState=Re=e:Re=Re.next=e,Re}function dt(){if(Ee===null){var e=we.alternate;e=e!==null?e.memoizedState:null}else e=Ee.next;var t=Re===null?we.memoizedState:Re.next;if(t!==null)Re=t,Ee=e;else{if(e===null)throw Error(G(310));Ee=e,e={memoizedState:Ee.memoizedState,baseState:Ee.baseState,baseQueue:Ee.baseQueue,queue:Ee.queue,next:null},Re===null?we.memoizedState=Re=e:Re=Re.next=e}return Re}function Xi(e,t){return typeof t=="function"?t(e):t}function ro(e){var t=dt(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var i=Ee,s=i.baseQueue,h=r.pending;if(h!==null){if(s!==null){var v=s.next;s.next=h.next,h.next=v}i.baseQueue=s=h,r.pending=null}if(s!==null){h=s.next,i=i.baseState;var o=v=null,c=null,f=h;do{var g=f.lane;if((wr&g)===g)c!==null&&(c=c.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:g,action:f.action,hasEagerState:f.hasEagerState,eagerState:f.eagerState,next:null};c===null?(o=c=d,v=i):c=c.next=d,we.lanes|=g,Cr|=g}f=f.next}while(f!==null&&f!==h);c===null?v=i:c.next=o,St(i,t.memoizedState)||(Ge=!0),t.memoizedState=i,t.baseState=v,t.baseQueue=c,r.lastRenderedState=i}if(e=r.interleaved,e!==null){s=e;do h=s.lane,we.lanes|=h,Cr|=h,s=s.next;while(s!==e)}else s===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function io(e){var t=dt(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var i=r.dispatch,s=r.pending,h=t.memoizedState;if(s!==null){r.pending=null;var v=s=s.next;do h=e(h,v.action),v=v.next;while(v!==s);St(h,t.memoizedState)||(Ge=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),r.lastRenderedState=h}return[h,i]}function fh(){}function ph(e,t){var r=we,i=dt(),s=t(),h=!St(i.memoizedState,s);if(h&&(i.memoizedState=s,Ge=!0),i=i.queue,tl(gh.bind(null,r,i,e),[e]),i.getSnapshot!==t||h||Re!==null&&Re.memoizedState.tag&1){if(r.flags|=2048,Qi(9,vh.bind(null,r,i,s,t),void 0,null),Te===null)throw Error(G(349));wr&30||_h(r,t,s)}return s}function _h(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=we.updateQueue,t===null?(t={lastEffect:null,stores:null},we.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function vh(e,t,r,i){t.value=r,t.getSnapshot=i,mh(t)&&yh(e)}function gh(e,t,r){return r(function(){mh(t)&&yh(e)})}function mh(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!St(e,r)}catch{return!0}}function yh(e){var t=Bt(e,1);t!==null&&yt(t,e,1,-1)}function cc(e){var t=Ct();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xi,lastRenderedState:e},t.queue=e,e=e.dispatch=Mp.bind(null,we,e),[t.memoizedState,e]}function Qi(e,t,r,i){return e={tag:e,create:t,destroy:r,deps:i,next:null},t=we.updateQueue,t===null?(t={lastEffect:null,stores:null},we.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 Sh(){return dt().memoizedState}function Os(e,t,r,i){var s=Ct();we.flags|=e,s.memoizedState=Qi(1|t,r,void 0,i===void 0?null:i)}function xn(e,t,r,i){var s=dt();i=i===void 0?null:i;var h=void 0;if(Ee!==null){var v=Ee.memoizedState;if(h=v.destroy,i!==null&&Ja(i,v.deps)){s.memoizedState=Qi(t,r,h,i);return}}we.flags|=e,s.memoizedState=Qi(1|t,r,h,i)}function uc(e,t){return Os(8390656,8,e,t)}function tl(e,t){return xn(2048,8,e,t)}function wh(e,t){return xn(4,2,e,t)}function Ch(e,t){return xn(4,4,e,t)}function xh(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 bh(e,t,r){return r=r!=null?r.concat([e]):null,xn(4,4,xh.bind(null,t,e),r)}function rl(){}function kh(e,t){var r=dt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Ja(t,i[1])?i[0]:(r.memoizedState=[e,t],e)}function Eh(e,t){var r=dt();t=t===void 0?null:t;var i=r.memoizedState;return i!==null&&t!==null&&Ja(t,i[1])?i[0]:(e=e(),r.memoizedState=[e,t],e)}function Lh(e,t,r){return wr&21?(St(r,t)||(r=Mu(),we.lanes|=r,Cr|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ge=!0),e.memoizedState=r)}function Tp(e,t){var r=ce;ce=r!==0&&4>r?r:4,e(!0);var i=to.transition;to.transition={};try{e(!1),t()}finally{ce=r,to.transition=i}}function Dh(){return dt().memoizedState}function Pp(e,t,r){var i=Zt(e);if(r={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null},Rh(e))Th(t,r);else if(r=uh(e,t,r,i),r!==null){var s=$e();yt(r,e,i,s),Ph(r,t,i)}}function Mp(e,t,r){var i=Zt(e),s={lane:i,action:r,hasEagerState:!1,eagerState:null,next:null};if(Rh(e))Th(t,s);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var v=t.lastRenderedState,o=h(v,r);if(s.hasEagerState=!0,s.eagerState=o,St(o,v)){var c=t.interleaved;c===null?(s.next=s,qa(t)):(s.next=c.next,c.next=s),t.interleaved=s;return}}catch{}finally{}r=uh(e,t,s,i),r!==null&&(s=$e(),yt(r,e,i,s),Ph(r,t,i))}}function Rh(e){var t=e.alternate;return e===we||t!==null&&t===we}function Th(e,t){Ri=on=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ph(e,t,r){if(r&4194240){var i=t.lanes;i&=e.pendingLanes,r|=i,t.lanes=r,Aa(e,r)}}var an={readContext:ht,useCallback:je,useContext:je,useEffect:je,useImperativeHandle:je,useInsertionEffect:je,useLayoutEffect:je,useMemo:je,useReducer:je,useRef:je,useState:je,useDebugValue:je,useDeferredValue:je,useTransition:je,useMutableSource:je,useSyncExternalStore:je,useId:je,unstable_isNewReconciler:!1},Ap={readContext:ht,useCallback:function(e,t){return Ct().memoizedState=[e,t===void 0?null:t],e},useContext:ht,useEffect:uc,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Os(4194308,4,xh.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Os(4194308,4,e,t)},useInsertionEffect:function(e,t){return Os(4,2,e,t)},useMemo:function(e,t){var r=Ct();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var i=Ct();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=Pp.bind(null,we,e),[i.memoizedState,e]},useRef:function(e){var t=Ct();return e={current:e},t.memoizedState=e},useState:cc,useDebugValue:rl,useDeferredValue:function(e){return Ct().memoizedState=e},useTransition:function(){var e=cc(!1),t=e[0];return e=Tp.bind(null,e[1]),Ct().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var i=we,s=Ct();if(me){if(r===void 0)throw Error(G(407));r=r()}else{if(r=t(),Te===null)throw Error(G(349));wr&30||_h(i,t,r)}s.memoizedState=r;var h={value:r,getSnapshot:t};return s.queue=h,uc(gh.bind(null,i,h,e),[e]),i.flags|=2048,Qi(9,vh.bind(null,i,h,r,t),void 0,null),r},useId:function(){var e=Ct(),t=Te.identifierPrefix;if(me){var r=Pt,i=Tt;r=(i&~(1<<32-mt(i)-1)).toString(32)+r,t=":"+t+"R"+r,r=Gi++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=Rp++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Op={readContext:ht,useCallback:kh,useContext:ht,useEffect:tl,useImperativeHandle:bh,useInsertionEffect:wh,useLayoutEffect:Ch,useMemo:Eh,useReducer:ro,useRef:Sh,useState:function(){return ro(Xi)},useDebugValue:rl,useDeferredValue:function(e){var t=dt();return Lh(t,Ee.memoizedState,e)},useTransition:function(){var e=ro(Xi)[0],t=dt().memoizedState;return[e,t]},useMutableSource:fh,useSyncExternalStore:ph,useId:Dh,unstable_isNewReconciler:!1},Bp={readContext:ht,useCallback:kh,useContext:ht,useEffect:tl,useImperativeHandle:bh,useInsertionEffect:wh,useLayoutEffect:Ch,useMemo:Eh,useReducer:io,useRef:Sh,useState:function(){return io(Xi)},useDebugValue:rl,useDeferredValue:function(e){var t=dt();return Ee===null?t.memoizedState=e:Lh(t,Ee.memoizedState,e)},useTransition:function(){var e=io(Xi)[0],t=dt().memoizedState;return[e,t]},useMutableSource:fh,useSyncExternalStore:ph,useId:Dh,unstable_isNewReconciler:!1};function _t(e,t){if(e&&e.defaultProps){t=Ce({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}function Ko(e,t,r,i){t=e.memoizedState,r=r(i,t),r=r==null?t:Ce({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var bn={isMounted:function(e){return(e=e._reactInternals)?Er(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var i=$e(),s=Zt(e),h=Mt(i,s);h.payload=t,r!=null&&(h.callback=r),t=Yt(e,h,s),t!==null&&(yt(t,e,s,i),Ms(t,e,s))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var i=$e(),s=Zt(e),h=Mt(i,s);h.tag=1,h.payload=t,r!=null&&(h.callback=r),t=Yt(e,h,s),t!==null&&(yt(t,e,s,i),Ms(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=$e(),i=Zt(e),s=Mt(r,i);s.tag=2,t!=null&&(s.callback=t),t=Yt(e,s,i),t!==null&&(yt(t,e,i,r),Ms(t,e,i))}};function hc(e,t,r,i,s,h,v){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,h,v):t.prototype&&t.prototype.isPureReactComponent?!Wi(r,i)||!Wi(s,h):!0}function Mh(e,t,r){var i=!1,s=rr,h=t.contextType;return typeof h=="object"&&h!==null?h=ht(h):(s=Qe(t)?yr:He.current,i=t.contextTypes,h=(i=i!=null)?Yr(e,s):rr),t=new t(r,h),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=bn,e.stateNode=t,t._reactInternals=e,i&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=h),t}function dc(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&&bn.enqueueReplaceState(t,t.state,null)}function Vo(e,t,r,i){var s=e.stateNode;s.props=r,s.state=e.memoizedState,s.refs={},Ga(e);var h=t.contextType;typeof h=="object"&&h!==null?s.context=ht(h):(h=Qe(t)?yr:He.current,s.context=Yr(e,h)),s.state=e.memoizedState,h=t.getDerivedStateFromProps,typeof h=="function"&&(Ko(e,t,h,r),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&bn.enqueueReplaceState(s,s.state,null),sn(e,r,s,i),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function ti(e,t){try{var r="",i=t;do r+=cf(i),i=i.return;while(i);var s=r}catch(h){s=`
|
|
39
|
+
Error generating stack: `+h.message+`
|
|
40
|
+
`+h.stack}return{value:e,source:t,stack:s,digest:null}}function so(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function qo(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var Ip=typeof WeakMap=="function"?WeakMap:Map;function Ah(e,t,r){r=Mt(-1,r),r.tag=3,r.payload={element:null};var i=t.value;return r.callback=function(){cn||(cn=!0,ia=i),qo(e,t)},r}function Oh(e,t,r){r=Mt(-1,r),r.tag=3;var i=e.type.getDerivedStateFromError;if(typeof i=="function"){var s=t.value;r.payload=function(){return i(s)},r.callback=function(){qo(e,t)}}var h=e.stateNode;return h!==null&&typeof h.componentDidCatch=="function"&&(r.callback=function(){qo(e,t),typeof i!="function"&&(Jt===null?Jt=new Set([this]):Jt.add(this));var v=t.stack;this.componentDidCatch(t.value,{componentStack:v!==null?v:""})}),r}function fc(e,t,r){var i=e.pingCache;if(i===null){i=e.pingCache=new Ip;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(r)||(s.add(r),e=Qp.bind(null,e,t,r),t.then(e,e))}function pc(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 _c(e,t,r,i,s){return e.mode&1?(e.flags|=65536,e.lanes=s,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=Mt(-1,1),t.tag=2,Yt(r,t,1))),r.lanes|=1),e)}var jp=jt.ReactCurrentOwner,Ge=!1;function Ue(e,t,r,i){t.child=e===null?ch(t,null,r,i):Zr(t,e.child,r,i)}function vc(e,t,r,i,s){r=r.render;var h=t.ref;return qr(t,s),i=Za(e,t,r,i,h,s),r=el(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,It(e,t,s)):(me&&r&&za(t),t.flags|=1,Ue(e,t,i,s),t.child)}function gc(e,t,r,i,s){if(e===null){var h=r.type;return typeof h=="function"&&!ul(h)&&h.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=h,Bh(e,t,h,i,s)):(e=Ns(r.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!(e.lanes&s)){var v=h.memoizedProps;if(r=r.compare,r=r!==null?r:Wi,r(v,i)&&e.ref===t.ref)return It(e,t,s)}return t.flags|=1,e=er(h,i),e.ref=t.ref,e.return=t,t.child=e}function Bh(e,t,r,i,s){if(e!==null){var h=e.memoizedProps;if(Wi(h,i)&&e.ref===t.ref)if(Ge=!1,t.pendingProps=i=h,(e.lanes&s)!==0)e.flags&131072&&(Ge=!0);else return t.lanes=e.lanes,It(e,t,s)}return Go(e,t,r,i,s)}function Ih(e,t,r){var i=t.pendingProps,s=i.children,h=e!==null?e.memoizedState:null;if(i.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},_e(zr,Je),Je|=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,_e(zr,Je),Je|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},i=h!==null?h.baseLanes:r,_e(zr,Je),Je|=i}else h!==null?(i=h.baseLanes|r,t.memoizedState=null):i=r,_e(zr,Je),Je|=i;return Ue(e,t,s,r),t.child}function jh(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Go(e,t,r,i,s){var h=Qe(r)?yr:He.current;return h=Yr(t,h),qr(t,s),r=Za(e,t,r,i,h,s),i=el(),e!==null&&!Ge?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,It(e,t,s)):(me&&i&&za(t),t.flags|=1,Ue(e,t,r,s),t.child)}function mc(e,t,r,i,s){if(Qe(r)){var h=!0;Js(t)}else h=!1;if(qr(t,s),t.stateNode===null)Bs(e,t),Mh(t,r,i),Vo(t,r,i,s),i=!0;else if(e===null){var v=t.stateNode,o=t.memoizedProps;v.props=o;var c=v.context,f=r.contextType;typeof f=="object"&&f!==null?f=ht(f):(f=Qe(r)?yr:He.current,f=Yr(t,f));var g=r.getDerivedStateFromProps,d=typeof g=="function"||typeof v.getSnapshotBeforeUpdate=="function";d||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(o!==i||c!==f)&&dc(t,v,i,f),zt=!1;var p=t.memoizedState;v.state=p,sn(t,i,v,s),c=t.memoizedState,o!==i||p!==c||Xe.current||zt?(typeof g=="function"&&(Ko(t,r,g,i),c=t.memoizedState),(o=zt||hc(t,r,o,i,p,c,f))?(d||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(t.flags|=4194308)):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=c),v.props=i,v.state=c,v.context=f,i=o):(typeof v.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{v=t.stateNode,hh(e,t),o=t.memoizedProps,f=t.type===t.elementType?o:_t(t.type,o),v.props=f,d=t.pendingProps,p=v.context,c=r.contextType,typeof c=="object"&&c!==null?c=ht(c):(c=Qe(r)?yr:He.current,c=Yr(t,c));var y=r.getDerivedStateFromProps;(g=typeof y=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(o!==d||p!==c)&&dc(t,v,i,c),zt=!1,p=t.memoizedState,v.state=p,sn(t,i,v,s);var x=t.memoizedState;o!==d||p!==x||Xe.current||zt?(typeof y=="function"&&(Ko(t,r,y,i),x=t.memoizedState),(f=zt||hc(t,r,f,i,p,x,c)||!1)?(g||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(i,x,c),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(i,x,c)),typeof v.componentDidUpdate=="function"&&(t.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof v.componentDidUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=x),v.props=i,v.state=x,v.context=c,i=f):(typeof v.componentDidUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||o===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),i=!1)}return Xo(e,t,r,i,h,s)}function Xo(e,t,r,i,s,h){jh(e,t);var v=(t.flags&128)!==0;if(!i&&!v)return s&&ic(t,r,!1),It(e,t,h);i=t.stateNode,jp.current=t;var o=v&&typeof r.getDerivedStateFromError!="function"?null:i.render();return t.flags|=1,e!==null&&v?(t.child=Zr(t,e.child,null,h),t.child=Zr(t,null,o,h)):Ue(e,t,o,h),t.memoizedState=i.state,s&&ic(t,r,!0),t.child}function Nh(e){var t=e.stateNode;t.pendingContext?rc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&rc(e,t.context,!1),Xa(e,t.containerInfo)}function yc(e,t,r,i,s){return Jr(),Ua(s),t.flags|=256,Ue(e,t,r,i),t.child}var Qo={dehydrated:null,treeContext:null,retryLane:0};function Yo(e){return{baseLanes:e,cachePool:null,transitions:null}}function Fh(e,t,r){var i=t.pendingProps,s=Se.current,h=!1,v=(t.flags&128)!==0,o;if((o=v)||(o=e!==null&&e.memoizedState===null?!1:(s&2)!==0),o?(h=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),_e(Se,s&1),e===null)return Uo(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):(v=i.children,e=i.fallback,h?(i=t.mode,h=t.child,v={mode:"hidden",children:v},!(i&1)&&h!==null?(h.childLanes=0,h.pendingProps=v):h=Ln(v,i,0,null),e=vr(e,i,r,null),h.return=t,e.return=t,h.sibling=e,t.child=h,t.child.memoizedState=Yo(r),t.memoizedState=Qo,e):il(t,v));if(s=e.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return Np(e,t,v,i,o,s,r);if(h){h=i.fallback,v=t.mode,s=e.child,o=s.sibling;var c={mode:"hidden",children:i.children};return!(v&1)&&t.child!==s?(i=t.child,i.childLanes=0,i.pendingProps=c,t.deletions=null):(i=er(s,c),i.subtreeFlags=s.subtreeFlags&14680064),o!==null?h=er(o,h):(h=vr(h,v,r,null),h.flags|=2),h.return=t,i.return=t,i.sibling=h,t.child=i,i=h,h=t.child,v=e.child.memoizedState,v=v===null?Yo(r):{baseLanes:v.baseLanes|r,cachePool:null,transitions:v.transitions},h.memoizedState=v,h.childLanes=e.childLanes&~r,t.memoizedState=Qo,i}return h=e.child,e=h.sibling,i=er(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 il(e,t){return t=Ln({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ys(e,t,r,i){return i!==null&&Ua(i),Zr(t,e.child,null,r),e=il(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Np(e,t,r,i,s,h,v){if(r)return t.flags&256?(t.flags&=-257,i=so(Error(G(422))),ys(e,t,v,i)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(h=i.fallback,s=t.mode,i=Ln({mode:"visible",children:i.children},s,0,null),h=vr(h,s,v,null),h.flags|=2,i.return=t,h.return=t,i.sibling=h,t.child=i,t.mode&1&&Zr(t,e.child,null,v),t.child.memoizedState=Yo(v),t.memoizedState=Qo,h);if(!(t.mode&1))return ys(e,t,v,null);if(s.data==="$!"){if(i=s.nextSibling&&s.nextSibling.dataset,i)var o=i.dgst;return i=o,h=Error(G(419)),i=so(h,i,void 0),ys(e,t,v,i)}if(o=(v&e.childLanes)!==0,Ge||o){if(i=Te,i!==null){switch(v&-v){case 4:s=2;break;case 16:s=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:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(i.suspendedLanes|v)?0:s,s!==0&&s!==h.retryLane&&(h.retryLane=s,Bt(e,s),yt(i,e,s,-1))}return cl(),i=so(Error(G(421))),ys(e,t,v,i)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=Yp.bind(null,e),s._reactRetry=t,null):(e=h.treeContext,Ze=Qt(s.nextSibling),et=t,me=!0,gt=null,e!==null&&(at[lt++]=Tt,at[lt++]=Pt,at[lt++]=Sr,Tt=e.id,Pt=e.overflow,Sr=t),t=il(t,i.children),t.flags|=4096,t)}function Sc(e,t,r){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),$o(e.return,t,r)}function no(e,t,r,i,s){var h=e.memoizedState;h===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:r,tailMode:s}:(h.isBackwards=t,h.rendering=null,h.renderingStartTime=0,h.last=i,h.tail=r,h.tailMode=s)}function Hh(e,t,r){var i=t.pendingProps,s=i.revealOrder,h=i.tail;if(Ue(e,t,i.children,r),i=Se.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&&Sc(e,r,t);else if(e.tag===19)Sc(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(_e(Se,i),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(r=t.child,s=null;r!==null;)e=r.alternate,e!==null&&nn(e)===null&&(s=r),r=r.sibling;r=s,r===null?(s=t.child,t.child=null):(s=r.sibling,r.sibling=null),no(t,!1,s,r,h);break;case"backwards":for(r=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&nn(e)===null){t.child=s;break}e=s.sibling,s.sibling=r,r=s,s=e}no(t,!0,r,null,h);break;case"together":no(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Bs(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function It(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),Cr|=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=er(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=er(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function Fp(e,t,r){switch(t.tag){case 3:Nh(t),Jr();break;case 5:dh(t);break;case 1:Qe(t.type)&&Js(t);break;case 4:Xa(t,t.stateNode.containerInfo);break;case 10:var i=t.type._context,s=t.memoizedProps.value;_e(tn,i._currentValue),i._currentValue=s;break;case 13:if(i=t.memoizedState,i!==null)return i.dehydrated!==null?(_e(Se,Se.current&1),t.flags|=128,null):r&t.child.childLanes?Fh(e,t,r):(_e(Se,Se.current&1),e=It(e,t,r),e!==null?e.sibling:null);_e(Se,Se.current&1);break;case 19:if(i=(r&t.childLanes)!==0,e.flags&128){if(i)return Hh(e,t,r);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),_e(Se,Se.current),i)break;return null;case 22:case 23:return t.lanes=0,Ih(e,t,r)}return It(e,t,r)}var zh,Jo,Wh,Uh;zh=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}};Jo=function(){};Wh=function(e,t,r,i){var s=e.memoizedProps;if(s!==i){e=t.stateNode,pr(Et.current);var h=null;switch(r){case"input":s=So(e,s),i=So(e,i),h=[];break;case"select":s=Ce({},s,{value:void 0}),i=Ce({},i,{value:void 0}),h=[];break;case"textarea":s=xo(e,s),i=xo(e,i),h=[];break;default:typeof s.onClick!="function"&&typeof i.onClick=="function"&&(e.onclick=Qs)}ko(r,i);var v;r=null;for(f in s)if(!i.hasOwnProperty(f)&&s.hasOwnProperty(f)&&s[f]!=null)if(f==="style"){var o=s[f];for(v in o)o.hasOwnProperty(v)&&(r||(r={}),r[v]="")}else f!=="dangerouslySetInnerHTML"&&f!=="children"&&f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&f!=="autoFocus"&&(Bi.hasOwnProperty(f)?h||(h=[]):(h=h||[]).push(f,null));for(f in i){var c=i[f];if(o=s!=null?s[f]:void 0,i.hasOwnProperty(f)&&c!==o&&(c!=null||o!=null))if(f==="style")if(o){for(v in o)!o.hasOwnProperty(v)||c&&c.hasOwnProperty(v)||(r||(r={}),r[v]="");for(v in c)c.hasOwnProperty(v)&&o[v]!==c[v]&&(r||(r={}),r[v]=c[v])}else r||(h||(h=[]),h.push(f,r)),r=c;else f==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,o=o?o.__html:void 0,c!=null&&o!==c&&(h=h||[]).push(f,c)):f==="children"?typeof c!="string"&&typeof c!="number"||(h=h||[]).push(f,""+c):f!=="suppressContentEditableWarning"&&f!=="suppressHydrationWarning"&&(Bi.hasOwnProperty(f)?(c!=null&&f==="onScroll"&&ve("scroll",e),h||o===c||(h=[])):(h=h||[]).push(f,c))}r&&(h=h||[]).push("style",r);var f=h;(t.updateQueue=f)&&(t.flags|=4)}};Uh=function(e,t,r,i){r!==i&&(t.flags|=4)};function gi(e,t){if(!me)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 Ne(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,i=0;if(t)for(var s=e.child;s!==null;)r|=s.lanes|s.childLanes,i|=s.subtreeFlags&14680064,i|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)r|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=r,t}function Hp(e,t,r){var i=t.pendingProps;switch(Wa(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ne(t),null;case 1:return Qe(t.type)&&Ys(),Ne(t),null;case 3:return i=t.stateNode,ei(),ge(Xe),ge(He),Ya(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(gs(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,gt!==null&&(oa(gt),gt=null))),Jo(e,t),Ne(t),null;case 5:Qa(t);var s=pr(qi.current);if(r=t.type,e!==null&&t.stateNode!=null)Wh(e,t,r,i,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!i){if(t.stateNode===null)throw Error(G(166));return Ne(t),null}if(e=pr(Et.current),gs(t)){i=t.stateNode,r=t.type;var h=t.memoizedProps;switch(i[bt]=t,i[Ki]=h,e=(t.mode&1)!==0,r){case"dialog":ve("cancel",i),ve("close",i);break;case"iframe":case"object":case"embed":ve("load",i);break;case"video":case"audio":for(s=0;s<xi.length;s++)ve(xi[s],i);break;case"source":ve("error",i);break;case"img":case"image":case"link":ve("error",i),ve("load",i);break;case"details":ve("toggle",i);break;case"input":Rl(i,h),ve("invalid",i);break;case"select":i._wrapperState={wasMultiple:!!h.multiple},ve("invalid",i);break;case"textarea":Pl(i,h),ve("invalid",i)}ko(r,h),s=null;for(var v in h)if(h.hasOwnProperty(v)){var o=h[v];v==="children"?typeof o=="string"?i.textContent!==o&&(h.suppressHydrationWarning!==!0&&vs(i.textContent,o,e),s=["children",o]):typeof o=="number"&&i.textContent!==""+o&&(h.suppressHydrationWarning!==!0&&vs(i.textContent,o,e),s=["children",""+o]):Bi.hasOwnProperty(v)&&o!=null&&v==="onScroll"&&ve("scroll",i)}switch(r){case"input":ls(i),Tl(i,h,!0);break;case"textarea":ls(i),Ml(i);break;case"select":case"option":break;default:typeof h.onClick=="function"&&(i.onclick=Qs)}i=s,t.updateQueue=i,i!==null&&(t.flags|=4)}else{v=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=gu(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=v.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof i.is=="string"?e=v.createElement(r,{is:i.is}):(e=v.createElement(r),r==="select"&&(v=e,i.multiple?v.multiple=!0:i.size&&(v.size=i.size))):e=v.createElementNS(e,r),e[bt]=t,e[Ki]=i,zh(e,t,!1,!1),t.stateNode=e;e:{switch(v=Eo(r,i),r){case"dialog":ve("cancel",e),ve("close",e),s=i;break;case"iframe":case"object":case"embed":ve("load",e),s=i;break;case"video":case"audio":for(s=0;s<xi.length;s++)ve(xi[s],e);s=i;break;case"source":ve("error",e),s=i;break;case"img":case"image":case"link":ve("error",e),ve("load",e),s=i;break;case"details":ve("toggle",e),s=i;break;case"input":Rl(e,i),s=So(e,i),ve("invalid",e);break;case"option":s=i;break;case"select":e._wrapperState={wasMultiple:!!i.multiple},s=Ce({},i,{value:void 0}),ve("invalid",e);break;case"textarea":Pl(e,i),s=xo(e,i),ve("invalid",e);break;default:s=i}ko(r,s),o=s;for(h in o)if(o.hasOwnProperty(h)){var c=o[h];h==="style"?Su(e,c):h==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&mu(e,c)):h==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Ii(e,c):typeof c=="number"&&Ii(e,""+c):h!=="suppressContentEditableWarning"&&h!=="suppressHydrationWarning"&&h!=="autoFocus"&&(Bi.hasOwnProperty(h)?c!=null&&h==="onScroll"&&ve("scroll",e):c!=null&&La(e,h,c,v))}switch(r){case"input":ls(e),Tl(e,i,!1);break;case"textarea":ls(e),Ml(e);break;case"option":i.value!=null&&e.setAttribute("value",""+tr(i.value));break;case"select":e.multiple=!!i.multiple,h=i.value,h!=null?Ur(e,!!i.multiple,h,!1):i.defaultValue!=null&&Ur(e,!!i.multiple,i.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Qs)}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 Ne(t),null;case 6:if(e&&t.stateNode!=null)Uh(e,t,e.memoizedProps,i);else{if(typeof i!="string"&&t.stateNode===null)throw Error(G(166));if(r=pr(qi.current),pr(Et.current),gs(t)){if(i=t.stateNode,r=t.memoizedProps,i[bt]=t,(h=i.nodeValue!==r)&&(e=et,e!==null))switch(e.tag){case 3:vs(i.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&vs(i.nodeValue,r,(e.mode&1)!==0)}h&&(t.flags|=4)}else i=(r.nodeType===9?r:r.ownerDocument).createTextNode(i),i[bt]=t,t.stateNode=i}return Ne(t),null;case 13:if(ge(Se),i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(me&&Ze!==null&&t.mode&1&&!(t.flags&128))ah(),Jr(),t.flags|=98560,h=!1;else if(h=gs(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[bt]=t}else Jr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ne(t),h=!1}else gt!==null&&(oa(gt),gt=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||Se.current&1?Le===0&&(Le=3):cl())),t.updateQueue!==null&&(t.flags|=4),Ne(t),null);case 4:return ei(),Jo(e,t),e===null&&Ui(t.stateNode.containerInfo),Ne(t),null;case 10:return Va(t.type._context),Ne(t),null;case 17:return Qe(t.type)&&Ys(),Ne(t),null;case 19:if(ge(Se),h=t.memoizedState,h===null)return Ne(t),null;if(i=(t.flags&128)!==0,v=h.rendering,v===null)if(i)gi(h,!1);else{if(Le!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(v=nn(e),v!==null){for(t.flags|=128,gi(h,!1),i=v.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,v=h.alternate,v===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=v.childLanes,h.lanes=v.lanes,h.child=v.child,h.subtreeFlags=0,h.deletions=null,h.memoizedProps=v.memoizedProps,h.memoizedState=v.memoizedState,h.updateQueue=v.updateQueue,h.type=v.type,e=v.dependencies,h.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return _e(Se,Se.current&1|2),t.child}e=e.sibling}h.tail!==null&&be()>ri&&(t.flags|=128,i=!0,gi(h,!1),t.lanes=4194304)}else{if(!i)if(e=nn(v),e!==null){if(t.flags|=128,i=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),gi(h,!0),h.tail===null&&h.tailMode==="hidden"&&!v.alternate&&!me)return Ne(t),null}else 2*be()-h.renderingStartTime>ri&&r!==1073741824&&(t.flags|=128,i=!0,gi(h,!1),t.lanes=4194304);h.isBackwards?(v.sibling=t.child,t.child=v):(r=h.last,r!==null?r.sibling=v:t.child=v,h.last=v)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=be(),t.sibling=null,r=Se.current,_e(Se,i?r&1|2:r&1),t):(Ne(t),null);case 22:case 23:return ll(),i=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==i&&(t.flags|=8192),i&&t.mode&1?Je&1073741824&&(Ne(t),t.subtreeFlags&6&&(t.flags|=8192)):Ne(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function zp(e,t){switch(Wa(t),t.tag){case 1:return Qe(t.type)&&Ys(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ei(),ge(Xe),ge(He),Ya(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Qa(t),null;case 13:if(ge(Se),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));Jr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ge(Se),null;case 4:return ei(),null;case 10:return Va(t.type._context),null;case 22:case 23:return ll(),null;case 24:return null;default:return null}}var Ss=!1,Fe=!1,Wp=typeof WeakSet=="function"?WeakSet:Set,Z=null;function Hr(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(i){xe(e,t,i)}else r.current=null}function Zo(e,t,r){try{r()}catch(i){xe(e,t,i)}}var wc=!1;function Up(e,t){if(Io=qs,e=Gu(),Ha(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 s=i.anchorOffset,h=i.focusNode;i=i.focusOffset;try{r.nodeType,h.nodeType}catch{r=null;break e}var v=0,o=-1,c=-1,f=0,g=0,d=e,p=null;t:for(;;){for(var y;d!==r||s!==0&&d.nodeType!==3||(o=v+s),d!==h||i!==0&&d.nodeType!==3||(c=v+i),d.nodeType===3&&(v+=d.nodeValue.length),(y=d.firstChild)!==null;)p=d,d=y;for(;;){if(d===e)break t;if(p===r&&++f===s&&(o=v),p===h&&++g===i&&(c=v),(y=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=y}r=o===-1||c===-1?null:{start:o,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(jo={focusedElem:e,selectionRange:r},qs=!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 x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var m=x.memoizedProps,u=x.memoizedState,a=t.stateNode,n=a.getSnapshotBeforeUpdate(t.elementType===t.type?m:_t(t.type,m),u);a.__reactInternalSnapshotBeforeUpdate=n}break;case 3:var l=t.stateNode.containerInfo;l.nodeType===1?l.textContent="":l.nodeType===9&&l.documentElement&&l.removeChild(l.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(_){xe(t,t.return,_)}if(e=t.sibling,e!==null){e.return=t.return,Z=e;break}Z=t.return}return x=wc,wc=!1,x}function Ti(e,t,r){var i=t.updateQueue;if(i=i!==null?i.lastEffect:null,i!==null){var s=i=i.next;do{if((s.tag&e)===e){var h=s.destroy;s.destroy=void 0,h!==void 0&&Zo(t,r,h)}s=s.next}while(s!==i)}}function kn(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 ea(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 $h(e){var t=e.alternate;t!==null&&(e.alternate=null,$h(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[bt],delete t[Ki],delete t[Ho],delete t[kp],delete t[Ep])),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 Kh(e){return e.tag===5||e.tag===3||e.tag===4}function Cc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Kh(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 ta(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=Qs));else if(i!==4&&(e=e.child,e!==null))for(ta(e,t,r),e=e.sibling;e!==null;)ta(e,t,r),e=e.sibling}function ra(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(ra(e,t,r),e=e.sibling;e!==null;)ra(e,t,r),e=e.sibling}var Me=null,vt=!1;function Nt(e,t,r){for(r=r.child;r!==null;)Vh(e,t,r),r=r.sibling}function Vh(e,t,r){if(kt&&typeof kt.onCommitFiberUnmount=="function")try{kt.onCommitFiberUnmount(gn,r)}catch{}switch(r.tag){case 5:Fe||Hr(r,t);case 6:var i=Me,s=vt;Me=null,Nt(e,t,r),Me=i,vt=s,Me!==null&&(vt?(e=Me,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Me.removeChild(r.stateNode));break;case 18:Me!==null&&(vt?(e=Me,r=r.stateNode,e.nodeType===8?Jn(e.parentNode,r):e.nodeType===1&&Jn(e,r),Hi(e)):Jn(Me,r.stateNode));break;case 4:i=Me,s=vt,Me=r.stateNode.containerInfo,vt=!0,Nt(e,t,r),Me=i,vt=s;break;case 0:case 11:case 14:case 15:if(!Fe&&(i=r.updateQueue,i!==null&&(i=i.lastEffect,i!==null))){s=i=i.next;do{var h=s,v=h.destroy;h=h.tag,v!==void 0&&(h&2||h&4)&&Zo(r,t,v),s=s.next}while(s!==i)}Nt(e,t,r);break;case 1:if(!Fe&&(Hr(r,t),i=r.stateNode,typeof i.componentWillUnmount=="function"))try{i.props=r.memoizedProps,i.state=r.memoizedState,i.componentWillUnmount()}catch(o){xe(r,t,o)}Nt(e,t,r);break;case 21:Nt(e,t,r);break;case 22:r.mode&1?(Fe=(i=Fe)||r.memoizedState!==null,Nt(e,t,r),Fe=i):Nt(e,t,r);break;default:Nt(e,t,r)}}function xc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new Wp),t.forEach(function(i){var s=Jp.bind(null,e,i);r.has(i)||(r.add(i),i.then(s,s))})}}function ft(e,t){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var s=r[i];try{var h=e,v=t,o=v;e:for(;o!==null;){switch(o.tag){case 5:Me=o.stateNode,vt=!1;break e;case 3:Me=o.stateNode.containerInfo,vt=!0;break e;case 4:Me=o.stateNode.containerInfo,vt=!0;break e}o=o.return}if(Me===null)throw Error(G(160));Vh(h,v,s),Me=null,vt=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(f){xe(s,t,f)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)qh(t,e),t=t.sibling}function qh(e,t){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(ft(t,e),wt(e),i&4){try{Ti(3,e,e.return),kn(3,e)}catch(m){xe(e,e.return,m)}try{Ti(5,e,e.return)}catch(m){xe(e,e.return,m)}}break;case 1:ft(t,e),wt(e),i&512&&r!==null&&Hr(r,r.return);break;case 5:if(ft(t,e),wt(e),i&512&&r!==null&&Hr(r,r.return),e.flags&32){var s=e.stateNode;try{Ii(s,"")}catch(m){xe(e,e.return,m)}}if(i&4&&(s=e.stateNode,s!=null)){var h=e.memoizedProps,v=r!==null?r.memoizedProps:h,o=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{o==="input"&&h.type==="radio"&&h.name!=null&&_u(s,h),Eo(o,v);var f=Eo(o,h);for(v=0;v<c.length;v+=2){var g=c[v],d=c[v+1];g==="style"?Su(s,d):g==="dangerouslySetInnerHTML"?mu(s,d):g==="children"?Ii(s,d):La(s,g,d,f)}switch(o){case"input":wo(s,h);break;case"textarea":vu(s,h);break;case"select":var p=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!h.multiple;var y=h.value;y!=null?Ur(s,!!h.multiple,y,!1):p!==!!h.multiple&&(h.defaultValue!=null?Ur(s,!!h.multiple,h.defaultValue,!0):Ur(s,!!h.multiple,h.multiple?[]:"",!1))}s[Ki]=h}catch(m){xe(e,e.return,m)}}break;case 6:if(ft(t,e),wt(e),i&4){if(e.stateNode===null)throw Error(G(162));s=e.stateNode,h=e.memoizedProps;try{s.nodeValue=h}catch(m){xe(e,e.return,m)}}break;case 3:if(ft(t,e),wt(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Hi(t.containerInfo)}catch(m){xe(e,e.return,m)}break;case 4:ft(t,e),wt(e);break;case 13:ft(t,e),wt(e),s=e.child,s.flags&8192&&(h=s.memoizedState!==null,s.stateNode.isHidden=h,!h||s.alternate!==null&&s.alternate.memoizedState!==null||(ol=be())),i&4&&xc(e);break;case 22:if(g=r!==null&&r.memoizedState!==null,e.mode&1?(Fe=(f=Fe)||g,ft(t,e),Fe=f):ft(t,e),wt(e),i&8192){if(f=e.memoizedState!==null,(e.stateNode.isHidden=f)&&!g&&e.mode&1)for(Z=e,g=e.child;g!==null;){for(d=Z=g;Z!==null;){switch(p=Z,y=p.child,p.tag){case 0:case 11:case 14:case 15:Ti(4,p,p.return);break;case 1:Hr(p,p.return);var x=p.stateNode;if(typeof x.componentWillUnmount=="function"){i=p,r=p.return;try{t=i,x.props=t.memoizedProps,x.state=t.memoizedState,x.componentWillUnmount()}catch(m){xe(i,r,m)}}break;case 5:Hr(p,p.return);break;case 22:if(p.memoizedState!==null){kc(d);continue}}y!==null?(y.return=p,Z=y):kc(d)}g=g.sibling}e:for(g=null,d=e;;){if(d.tag===5){if(g===null){g=d;try{s=d.stateNode,f?(h=s.style,typeof h.setProperty=="function"?h.setProperty("display","none","important"):h.display="none"):(o=d.stateNode,c=d.memoizedProps.style,v=c!=null&&c.hasOwnProperty("display")?c.display:null,o.style.display=yu("display",v))}catch(m){xe(e,e.return,m)}}}else if(d.tag===6){if(g===null)try{d.stateNode.nodeValue=f?"":d.memoizedProps}catch(m){xe(e,e.return,m)}}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;g===d&&(g=null),d=d.return}g===d&&(g=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:ft(t,e),wt(e),i&4&&xc(e);break;case 21:break;default:ft(t,e),wt(e)}}function wt(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(Kh(r)){var i=r;break e}r=r.return}throw Error(G(160))}switch(i.tag){case 5:var s=i.stateNode;i.flags&32&&(Ii(s,""),i.flags&=-33);var h=Cc(e);ra(e,h,s);break;case 3:case 4:var v=i.stateNode.containerInfo,o=Cc(e);ta(e,o,v);break;default:throw Error(G(161))}}catch(c){xe(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function $p(e,t,r){Z=e,Gh(e)}function Gh(e,t,r){for(var i=(e.mode&1)!==0;Z!==null;){var s=Z,h=s.child;if(s.tag===22&&i){var v=s.memoizedState!==null||Ss;if(!v){var o=s.alternate,c=o!==null&&o.memoizedState!==null||Fe;o=Ss;var f=Fe;if(Ss=v,(Fe=c)&&!f)for(Z=s;Z!==null;)v=Z,c=v.child,v.tag===22&&v.memoizedState!==null?Ec(s):c!==null?(c.return=v,Z=c):Ec(s);for(;h!==null;)Z=h,Gh(h),h=h.sibling;Z=s,Ss=o,Fe=f}bc(e)}else s.subtreeFlags&8772&&h!==null?(h.return=s,Z=h):bc(e)}}function bc(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:Fe||kn(5,t);break;case 1:var i=t.stateNode;if(t.flags&4&&!Fe)if(r===null)i.componentDidMount();else{var s=t.elementType===t.type?r.memoizedProps:_t(t.type,r.memoizedProps);i.componentDidUpdate(s,r.memoizedState,i.__reactInternalSnapshotBeforeUpdate)}var h=t.updateQueue;h!==null&&lc(t,h,i);break;case 3:var v=t.updateQueue;if(v!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}lc(t,v,r)}break;case 5:var o=t.stateNode;if(r===null&&t.flags&4){r=o;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.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 g=f.memoizedState;if(g!==null){var d=g.dehydrated;d!==null&&Hi(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}Fe||t.flags&512&&ea(t)}catch(p){xe(t,t.return,p)}}if(t===e){Z=null;break}if(r=t.sibling,r!==null){r.return=t.return,Z=r;break}Z=t.return}}function kc(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 Ec(e){for(;Z!==null;){var t=Z;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{kn(4,t)}catch(c){xe(t,r,c)}break;case 1:var i=t.stateNode;if(typeof i.componentDidMount=="function"){var s=t.return;try{i.componentDidMount()}catch(c){xe(t,s,c)}}var h=t.return;try{ea(t)}catch(c){xe(t,h,c)}break;case 5:var v=t.return;try{ea(t)}catch(c){xe(t,v,c)}}}catch(c){xe(t,t.return,c)}if(t===e){Z=null;break}var o=t.sibling;if(o!==null){o.return=t.return,Z=o;break}Z=t.return}}var Kp=Math.ceil,ln=jt.ReactCurrentDispatcher,sl=jt.ReactCurrentOwner,ut=jt.ReactCurrentBatchConfig,ne=0,Te=null,ke=null,Oe=0,Je=0,zr=nr(0),Le=0,Yi=null,Cr=0,En=0,nl=0,Pi=null,qe=null,ol=0,ri=1/0,Dt=null,cn=!1,ia=null,Jt=null,ws=!1,Kt=null,un=0,Mi=0,sa=null,Is=-1,js=0;function $e(){return ne&6?be():Is!==-1?Is:Is=be()}function Zt(e){return e.mode&1?ne&2&&Oe!==0?Oe&-Oe:Dp.transition!==null?(js===0&&(js=Mu()),js):(e=ce,e!==0||(e=window.event,e=e===void 0?16:Fu(e.type)),e):1}function yt(e,t,r,i){if(50<Mi)throw Mi=0,sa=null,Error(G(185));es(e,r,i),(!(ne&2)||e!==Te)&&(e===Te&&(!(ne&2)&&(En|=r),Le===4&&Ut(e,Oe)),Ye(e,i),r===1&&ne===0&&!(t.mode&1)&&(ri=be()+500,Cn&&or()))}function Ye(e,t){var r=e.callbackNode;Df(e,t);var i=Vs(e,e===Te?Oe:0);if(i===0)r!==null&&Bl(r),e.callbackNode=null,e.callbackPriority=0;else if(t=i&-i,e.callbackPriority!==t){if(r!=null&&Bl(r),t===1)e.tag===0?Lp(Lc.bind(null,e)):sh(Lc.bind(null,e)),xp(function(){!(ne&6)&&or()}),r=null;else{switch(Au(i)){case 1:r=Ma;break;case 4:r=Tu;break;case 16:r=Ks;break;case 536870912:r=Pu;break;default:r=Ks}r=rd(r,Xh.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function Xh(e,t){if(Is=-1,js=0,ne&6)throw Error(G(327));var r=e.callbackNode;if(Gr()&&e.callbackNode!==r)return null;var i=Vs(e,e===Te?Oe:0);if(i===0)return null;if(i&30||i&e.expiredLanes||t)t=hn(e,i);else{t=i;var s=ne;ne|=2;var h=Yh();(Te!==e||Oe!==t)&&(Dt=null,ri=be()+500,_r(e,t));do try{Gp();break}catch(o){Qh(e,o)}while(!0);Ka(),ln.current=h,ne=s,ke!==null?t=0:(Te=null,Oe=0,t=Le)}if(t!==0){if(t===2&&(s=Po(e),s!==0&&(i=s,t=na(e,s))),t===1)throw r=Yi,_r(e,0),Ut(e,i),Ye(e,be()),r;if(t===6)Ut(e,i);else{if(s=e.current.alternate,!(i&30)&&!Vp(s)&&(t=hn(e,i),t===2&&(h=Po(e),h!==0&&(i=h,t=na(e,h))),t===1))throw r=Yi,_r(e,0),Ut(e,i),Ye(e,be()),r;switch(e.finishedWork=s,e.finishedLanes=i,t){case 0:case 1:throw Error(G(345));case 2:hr(e,qe,Dt);break;case 3:if(Ut(e,i),(i&130023424)===i&&(t=ol+500-be(),10<t)){if(Vs(e,0)!==0)break;if(s=e.suspendedLanes,(s&i)!==i){$e(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=Fo(hr.bind(null,e,qe,Dt),t);break}hr(e,qe,Dt);break;case 4:if(Ut(e,i),(i&4194240)===i)break;for(t=e.eventTimes,s=-1;0<i;){var v=31-mt(i);h=1<<v,v=t[v],v>s&&(s=v),i&=~h}if(i=s,i=be()-i,i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*Kp(i/1960))-i,10<i){e.timeoutHandle=Fo(hr.bind(null,e,qe,Dt),i);break}hr(e,qe,Dt);break;case 5:hr(e,qe,Dt);break;default:throw Error(G(329))}}}return Ye(e,be()),e.callbackNode===r?Xh.bind(null,e):null}function na(e,t){var r=Pi;return e.current.memoizedState.isDehydrated&&(_r(e,t).flags|=256),e=hn(e,t),e!==2&&(t=qe,qe=r,t!==null&&oa(t)),e}function oa(e){qe===null?qe=e:qe.push.apply(qe,e)}function Vp(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 s=r[i],h=s.getSnapshot;s=s.value;try{if(!St(h(),s))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 Ut(e,t){for(t&=~nl,t&=~En,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-mt(t),i=1<<r;e[r]=-1,t&=~i}}function Lc(e){if(ne&6)throw Error(G(327));Gr();var t=Vs(e,0);if(!(t&1))return Ye(e,be()),null;var r=hn(e,t);if(e.tag!==0&&r===2){var i=Po(e);i!==0&&(t=i,r=na(e,i))}if(r===1)throw r=Yi,_r(e,0),Ut(e,t),Ye(e,be()),r;if(r===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,hr(e,qe,Dt),Ye(e,be()),null}function al(e,t){var r=ne;ne|=1;try{return e(t)}finally{ne=r,ne===0&&(ri=be()+500,Cn&&or())}}function xr(e){Kt!==null&&Kt.tag===0&&!(ne&6)&&Gr();var t=ne;ne|=1;var r=ut.transition,i=ce;try{if(ut.transition=null,ce=1,e)return e()}finally{ce=i,ut.transition=r,ne=t,!(ne&6)&&or()}}function ll(){Je=zr.current,ge(zr)}function _r(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,Cp(r)),ke!==null)for(r=ke.return;r!==null;){var i=r;switch(Wa(i),i.tag){case 1:i=i.type.childContextTypes,i!=null&&Ys();break;case 3:ei(),ge(Xe),ge(He),Ya();break;case 5:Qa(i);break;case 4:ei();break;case 13:ge(Se);break;case 19:ge(Se);break;case 10:Va(i.type._context);break;case 22:case 23:ll()}r=r.return}if(Te=e,ke=e=er(e.current,null),Oe=Je=t,Le=0,Yi=null,nl=En=Cr=0,qe=Pi=null,fr!==null){for(t=0;t<fr.length;t++)if(r=fr[t],i=r.interleaved,i!==null){r.interleaved=null;var s=i.next,h=r.pending;if(h!==null){var v=h.next;h.next=s,i.next=v}r.pending=i}fr=null}return e}function Qh(e,t){do{var r=ke;try{if(Ka(),As.current=an,on){for(var i=we.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}on=!1}if(wr=0,Re=Ee=we=null,Ri=!1,Gi=0,sl.current=null,r===null||r.return===null){Le=1,Yi=t,ke=null;break}e:{var h=e,v=r.return,o=r,c=t;if(t=Oe,o.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var f=c,g=o,d=g.tag;if(!(g.mode&1)&&(d===0||d===11||d===15)){var p=g.alternate;p?(g.updateQueue=p.updateQueue,g.memoizedState=p.memoizedState,g.lanes=p.lanes):(g.updateQueue=null,g.memoizedState=null)}var y=pc(v);if(y!==null){y.flags&=-257,_c(y,v,o,h,t),y.mode&1&&fc(h,f,t),t=y,c=f;var x=t.updateQueue;if(x===null){var m=new Set;m.add(c),t.updateQueue=m}else x.add(c);break e}else{if(!(t&1)){fc(h,f,t),cl();break e}c=Error(G(426))}}else if(me&&o.mode&1){var u=pc(v);if(u!==null){!(u.flags&65536)&&(u.flags|=256),_c(u,v,o,h,t),Ua(ti(c,o));break e}}h=c=ti(c,o),Le!==4&&(Le=2),Pi===null?Pi=[h]:Pi.push(h),h=v;do{switch(h.tag){case 3:h.flags|=65536,t&=-t,h.lanes|=t;var a=Ah(h,c,t);ac(h,a);break e;case 1:o=c;var n=h.type,l=h.stateNode;if(!(h.flags&128)&&(typeof n.getDerivedStateFromError=="function"||l!==null&&typeof l.componentDidCatch=="function"&&(Jt===null||!Jt.has(l)))){h.flags|=65536,t&=-t,h.lanes|=t;var _=Oh(h,o,t);ac(h,_);break e}}h=h.return}while(h!==null)}Zh(r)}catch(S){t=S,ke===r&&r!==null&&(ke=r=r.return);continue}break}while(!0)}function Yh(){var e=ln.current;return ln.current=an,e===null?an:e}function cl(){(Le===0||Le===3||Le===2)&&(Le=4),Te===null||!(Cr&268435455)&&!(En&268435455)||Ut(Te,Oe)}function hn(e,t){var r=ne;ne|=2;var i=Yh();(Te!==e||Oe!==t)&&(Dt=null,_r(e,t));do try{qp();break}catch(s){Qh(e,s)}while(!0);if(Ka(),ne=r,ln.current=i,ke!==null)throw Error(G(261));return Te=null,Oe=0,Le}function qp(){for(;ke!==null;)Jh(ke)}function Gp(){for(;ke!==null&&!yf();)Jh(ke)}function Jh(e){var t=td(e.alternate,e,Je);e.memoizedProps=e.pendingProps,t===null?Zh(e):ke=t,sl.current=null}function Zh(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=zp(r,t),r!==null){r.flags&=32767,ke=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Le=6,ke=null;return}}else if(r=Hp(r,t,Je),r!==null){ke=r;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);Le===0&&(Le=5)}function hr(e,t,r){var i=ce,s=ut.transition;try{ut.transition=null,ce=1,Xp(e,t,r,i)}finally{ut.transition=s,ce=i}return null}function Xp(e,t,r,i){do Gr();while(Kt!==null);if(ne&6)throw Error(G(327));r=e.finishedWork;var s=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(Rf(e,h),e===Te&&(ke=Te=null,Oe=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||ws||(ws=!0,rd(Ks,function(){return Gr(),null})),h=(r.flags&15990)!==0,r.subtreeFlags&15990||h){h=ut.transition,ut.transition=null;var v=ce;ce=1;var o=ne;ne|=4,sl.current=null,Up(e,r),qh(r,e),_p(jo),qs=!!Io,jo=Io=null,e.current=r,$p(r),Sf(),ne=o,ce=v,ut.transition=h}else e.current=r;if(ws&&(ws=!1,Kt=e,un=s),h=e.pendingLanes,h===0&&(Jt=null),xf(r.stateNode),Ye(e,be()),t!==null)for(i=e.onRecoverableError,r=0;r<t.length;r++)s=t[r],i(s.value,{componentStack:s.stack,digest:s.digest});if(cn)throw cn=!1,e=ia,ia=null,e;return un&1&&e.tag!==0&&Gr(),h=e.pendingLanes,h&1?e===sa?Mi++:(Mi=0,sa=e):Mi=0,or(),null}function Gr(){if(Kt!==null){var e=Au(un),t=ut.transition,r=ce;try{if(ut.transition=null,ce=16>e?16:e,Kt===null)var i=!1;else{if(e=Kt,Kt=null,un=0,ne&6)throw Error(G(331));var s=ne;for(ne|=4,Z=e.current;Z!==null;){var h=Z,v=h.child;if(Z.flags&16){var o=h.deletions;if(o!==null){for(var c=0;c<o.length;c++){var f=o[c];for(Z=f;Z!==null;){var g=Z;switch(g.tag){case 0:case 11:case 15:Ti(8,g,h)}var d=g.child;if(d!==null)d.return=g,Z=d;else for(;Z!==null;){g=Z;var p=g.sibling,y=g.return;if($h(g),g===f){Z=null;break}if(p!==null){p.return=y,Z=p;break}Z=y}}}var x=h.alternate;if(x!==null){var m=x.child;if(m!==null){x.child=null;do{var u=m.sibling;m.sibling=null,m=u}while(m!==null)}}Z=h}}if(h.subtreeFlags&2064&&v!==null)v.return=h,Z=v;else e:for(;Z!==null;){if(h=Z,h.flags&2048)switch(h.tag){case 0:case 11:case 15:Ti(9,h,h.return)}var a=h.sibling;if(a!==null){a.return=h.return,Z=a;break e}Z=h.return}}var n=e.current;for(Z=n;Z!==null;){v=Z;var l=v.child;if(v.subtreeFlags&2064&&l!==null)l.return=v,Z=l;else e:for(v=n;Z!==null;){if(o=Z,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:kn(9,o)}}catch(S){xe(o,o.return,S)}if(o===v){Z=null;break e}var _=o.sibling;if(_!==null){_.return=o.return,Z=_;break e}Z=o.return}}if(ne=s,or(),kt&&typeof kt.onPostCommitFiberRoot=="function")try{kt.onPostCommitFiberRoot(gn,e)}catch{}i=!0}return i}finally{ce=r,ut.transition=t}}return!1}function Dc(e,t,r){t=ti(r,t),t=Ah(e,t,1),e=Yt(e,t,1),t=$e(),e!==null&&(es(e,1,t),Ye(e,t))}function xe(e,t,r){if(e.tag===3)Dc(e,e,r);else for(;t!==null;){if(t.tag===3){Dc(t,e,r);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(Jt===null||!Jt.has(i))){e=ti(r,e),e=Oh(t,e,1),t=Yt(t,e,1),e=$e(),t!==null&&(es(t,1,e),Ye(t,e));break}}t=t.return}}function Qp(e,t,r){var i=e.pingCache;i!==null&&i.delete(t),t=$e(),e.pingedLanes|=e.suspendedLanes&r,Te===e&&(Oe&r)===r&&(Le===4||Le===3&&(Oe&130023424)===Oe&&500>be()-ol?_r(e,0):nl|=r),Ye(e,t)}function ed(e,t){t===0&&(e.mode&1?(t=hs,hs<<=1,!(hs&130023424)&&(hs=4194304)):t=1);var r=$e();e=Bt(e,t),e!==null&&(es(e,t,r),Ye(e,r))}function Yp(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),ed(e,r)}function Jp(e,t){var r=0;switch(e.tag){case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(r=s.retryLane);break;case 19:i=e.stateNode;break;default:throw Error(G(314))}i!==null&&i.delete(t),ed(e,r)}var td;td=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Xe.current)Ge=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return Ge=!1,Fp(e,t,r);Ge=!!(e.flags&131072)}else Ge=!1,me&&t.flags&1048576&&nh(t,en,t.index);switch(t.lanes=0,t.tag){case 2:var i=t.type;Bs(e,t),e=t.pendingProps;var s=Yr(t,He.current);qr(t,r),s=Za(null,t,i,e,s,r);var h=el();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Qe(i)?(h=!0,Js(t)):h=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Ga(t),s.updater=bn,t.stateNode=s,s._reactInternals=t,Vo(t,i,e,r),t=Xo(null,t,i,!0,h,r)):(t.tag=0,me&&h&&za(t),Ue(null,t,s,r),t=t.child),t;case 16:i=t.elementType;e:{switch(Bs(e,t),e=t.pendingProps,s=i._init,i=s(i._payload),t.type=i,s=t.tag=e_(i),e=_t(i,e),s){case 0:t=Go(null,t,i,e,r);break e;case 1:t=mc(null,t,i,e,r);break e;case 11:t=vc(null,t,i,e,r);break e;case 14:t=gc(null,t,i,_t(i.type,e),r);break e}throw Error(G(306,i,""))}return t;case 0:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:_t(i,s),Go(e,t,i,s,r);case 1:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:_t(i,s),mc(e,t,i,s,r);case 3:e:{if(Nh(t),e===null)throw Error(G(387));i=t.pendingProps,h=t.memoizedState,s=h.element,hh(e,t),sn(t,i,null,r);var v=t.memoizedState;if(i=v.element,h.isDehydrated)if(h={element:i,isDehydrated:!1,cache:v.cache,pendingSuspenseBoundaries:v.pendingSuspenseBoundaries,transitions:v.transitions},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){s=ti(Error(G(423)),t),t=yc(e,t,i,r,s);break e}else if(i!==s){s=ti(Error(G(424)),t),t=yc(e,t,i,r,s);break e}else for(Ze=Qt(t.stateNode.containerInfo.firstChild),et=t,me=!0,gt=null,r=ch(t,null,i,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Jr(),i===s){t=It(e,t,r);break e}Ue(e,t,i,r)}t=t.child}return t;case 5:return dh(t),e===null&&Uo(t),i=t.type,s=t.pendingProps,h=e!==null?e.memoizedProps:null,v=s.children,No(i,s)?v=null:h!==null&&No(i,h)&&(t.flags|=32),jh(e,t),Ue(e,t,v,r),t.child;case 6:return e===null&&Uo(t),null;case 13:return Fh(e,t,r);case 4:return Xa(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Zr(t,null,i,r):Ue(e,t,i,r),t.child;case 11:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:_t(i,s),vc(e,t,i,s,r);case 7:return Ue(e,t,t.pendingProps,r),t.child;case 8:return Ue(e,t,t.pendingProps.children,r),t.child;case 12:return Ue(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(i=t.type._context,s=t.pendingProps,h=t.memoizedProps,v=s.value,_e(tn,i._currentValue),i._currentValue=v,h!==null)if(St(h.value,v)){if(h.children===s.children&&!Xe.current){t=It(e,t,r);break e}}else for(h=t.child,h!==null&&(h.return=t);h!==null;){var o=h.dependencies;if(o!==null){v=h.child;for(var c=o.firstContext;c!==null;){if(c.context===i){if(h.tag===1){c=Mt(-1,r&-r),c.tag=2;var f=h.updateQueue;if(f!==null){f=f.shared;var g=f.pending;g===null?c.next=c:(c.next=g.next,g.next=c),f.pending=c}}h.lanes|=r,c=h.alternate,c!==null&&(c.lanes|=r),$o(h.return,r,t),o.lanes|=r;break}c=c.next}}else if(h.tag===10)v=h.type===t.type?null:h.child;else if(h.tag===18){if(v=h.return,v===null)throw Error(G(341));v.lanes|=r,o=v.alternate,o!==null&&(o.lanes|=r),$o(v,r,t),v=h.sibling}else v=h.child;if(v!==null)v.return=h;else for(v=h;v!==null;){if(v===t){v=null;break}if(h=v.sibling,h!==null){h.return=v.return,v=h;break}v=v.return}h=v}Ue(e,t,s.children,r),t=t.child}return t;case 9:return s=t.type,i=t.pendingProps.children,qr(t,r),s=ht(s),i=i(s),t.flags|=1,Ue(e,t,i,r),t.child;case 14:return i=t.type,s=_t(i,t.pendingProps),s=_t(i.type,s),gc(e,t,i,s,r);case 15:return Bh(e,t,t.type,t.pendingProps,r);case 17:return i=t.type,s=t.pendingProps,s=t.elementType===i?s:_t(i,s),Bs(e,t),t.tag=1,Qe(i)?(e=!0,Js(t)):e=!1,qr(t,r),Mh(t,i,s),Vo(t,i,s,r),Xo(null,t,i,!0,e,r);case 19:return Hh(e,t,r);case 22:return Ih(e,t,r)}throw Error(G(156,t.tag))};function rd(e,t){return Ru(e,t)}function Zp(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 ct(e,t,r,i){return new Zp(e,t,r,i)}function ul(e){return e=e.prototype,!(!e||!e.isReactComponent)}function e_(e){if(typeof e=="function")return ul(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ra)return 11;if(e===Ta)return 14}return 2}function er(e,t){var r=e.alternate;return r===null?(r=ct(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 Ns(e,t,r,i,s,h){var v=2;if(i=e,typeof e=="function")ul(e)&&(v=1);else if(typeof e=="string")v=5;else e:switch(e){case Pr:return vr(r.children,s,h,t);case Da:v=8,s|=8;break;case vo:return e=ct(12,r,t,s|2),e.elementType=vo,e.lanes=h,e;case go:return e=ct(13,r,t,s),e.elementType=go,e.lanes=h,e;case mo:return e=ct(19,r,t,s),e.elementType=mo,e.lanes=h,e;case du:return Ln(r,s,h,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case uu:v=10;break e;case hu:v=9;break e;case Ra:v=11;break e;case Ta:v=14;break e;case Ht:v=16,i=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=ct(v,r,t,s),t.elementType=e,t.type=i,t.lanes=h,t}function vr(e,t,r,i){return e=ct(7,e,i,t),e.lanes=r,e}function Ln(e,t,r,i){return e=ct(22,e,i,t),e.elementType=du,e.lanes=r,e.stateNode={isHidden:!1},e}function oo(e,t,r){return e=ct(6,e,null,t),e.lanes=r,e}function ao(e,t,r){return t=ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function t_(e,t,r,i,s){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=zn(0),this.expirationTimes=zn(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zn(0),this.identifierPrefix=i,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function hl(e,t,r,i,s,h,v,o,c){return e=new t_(e,t,r,o,c),t===1?(t=1,h===!0&&(t|=8)):t=0,h=ct(3,null,null,t),e.current=h,h.stateNode=e,h.memoizedState={element:i,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ga(h),e}function r_(e,t,r){var i=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Tr,key:i==null?null:""+i,children:e,containerInfo:t,implementation:r}}function id(e){if(!e)return rr;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(Qe(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(Qe(r))return ih(e,r,t)}return t}function sd(e,t,r,i,s,h,v,o,c){return e=hl(r,i,!0,e,s,h,v,o,c),e.context=id(null),r=e.current,i=$e(),s=Zt(r),h=Mt(i,s),h.callback=t??null,Yt(r,h,s),e.current.lanes=s,es(e,s,i),Ye(e,i),e}function Dn(e,t,r,i){var s=t.current,h=$e(),v=Zt(s);return r=id(r),t.context===null?t.context=r:t.pendingContext=r,t=Mt(h,v),t.payload={element:e},i=i===void 0?null:i,i!==null&&(t.callback=i),e=Yt(s,t,v),e!==null&&(yt(e,s,v,h),Ms(e,s,v)),v}function dn(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 Rc(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function dl(e,t){Rc(e,t),(e=e.alternate)&&Rc(e,t)}function i_(){return null}var nd=typeof reportError=="function"?reportError:function(e){console.error(e)};function fl(e){this._internalRoot=e}Rn.prototype.render=fl.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));Dn(e,t,null,null)};Rn.prototype.unmount=fl.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xr(function(){Dn(null,e,null,null)}),t[Ot]=null}};function Rn(e){this._internalRoot=e}Rn.prototype.unstable_scheduleHydration=function(e){if(e){var t=Iu();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Wt.length&&t!==0&&t<Wt[r].priority;r++);Wt.splice(r,0,e),r===0&&Nu(e)}};function pl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Tn(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Tc(){}function s_(e,t,r,i,s){if(s){if(typeof i=="function"){var h=i;i=function(){var f=dn(v);h.call(f)}}var v=sd(t,i,e,0,null,!1,!1,"",Tc);return e._reactRootContainer=v,e[Ot]=v.current,Ui(e.nodeType===8?e.parentNode:e),xr(),v}for(;s=e.lastChild;)e.removeChild(s);if(typeof i=="function"){var o=i;i=function(){var f=dn(c);o.call(f)}}var c=hl(e,0,!1,null,null,!1,!1,"",Tc);return e._reactRootContainer=c,e[Ot]=c.current,Ui(e.nodeType===8?e.parentNode:e),xr(function(){Dn(t,c,r,i)}),c}function Pn(e,t,r,i,s){var h=r._reactRootContainer;if(h){var v=h;if(typeof s=="function"){var o=s;s=function(){var c=dn(v);o.call(c)}}Dn(t,v,e,s)}else v=s_(r,t,e,s,i);return dn(v)}Ou=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=Ci(t.pendingLanes);r!==0&&(Aa(t,r|1),Ye(t,be()),!(ne&6)&&(ri=be()+500,or()))}break;case 13:xr(function(){var i=Bt(e,1);if(i!==null){var s=$e();yt(i,e,1,s)}}),dl(e,1)}};Oa=function(e){if(e.tag===13){var t=Bt(e,134217728);if(t!==null){var r=$e();yt(t,e,134217728,r)}dl(e,134217728)}};Bu=function(e){if(e.tag===13){var t=Zt(e),r=Bt(e,t);if(r!==null){var i=$e();yt(r,e,t,i)}dl(e,t)}};Iu=function(){return ce};ju=function(e,t){var r=ce;try{return ce=e,t()}finally{ce=r}};Do=function(e,t,r){switch(t){case"input":if(wo(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 s=wn(i);if(!s)throw Error(G(90));pu(i),wo(i,s)}}}break;case"textarea":vu(e,r);break;case"select":t=r.value,t!=null&&Ur(e,!!r.multiple,t,!1)}};xu=al;bu=xr;var n_={usingClientEntryPoint:!1,Events:[rs,Br,wn,wu,Cu,al]},mi={findFiberByHostInstance:dr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},o_={bundleType:mi.bundleType,version:mi.version,rendererPackageName:mi.rendererPackageName,rendererConfig:mi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Lu(e),e===null?null:e.stateNode},findFiberByHostInstance:mi.findFiberByHostInstance||i_,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 Cs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Cs.isDisabled&&Cs.supportsFiber)try{gn=Cs.inject(o_),kt=Cs}catch{}}rt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=n_;rt.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!pl(t))throw Error(G(200));return r_(e,t,null,r)};rt.createRoot=function(e,t){if(!pl(e))throw Error(G(299));var r=!1,i="",s=nd;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=hl(e,1,!1,null,null,r,!1,i,s),e[Ot]=t.current,Ui(e.nodeType===8?e.parentNode:e),new fl(t)};rt.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=Lu(t),e=e===null?null:e.stateNode,e};rt.flushSync=function(e){return xr(e)};rt.hydrate=function(e,t,r){if(!Tn(t))throw Error(G(200));return Pn(null,e,t,!0,r)};rt.hydrateRoot=function(e,t,r){if(!pl(e))throw Error(G(405));var i=r!=null&&r.hydratedSources||null,s=!1,h="",v=nd;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onRecoverableError!==void 0&&(v=r.onRecoverableError)),t=sd(t,null,e,1,r??null,s,!1,h,v),e[Ot]=t.current,Ui(e),i)for(e=0;e<i.length;e++)r=i[e],s=r._getVersion,s=s(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,s]:t.mutableSourceEagerHydrationData.push(r,s);return new Rn(t)};rt.render=function(e,t,r){if(!Tn(t))throw Error(G(200));return Pn(null,e,t,!1,r)};rt.unmountComponentAtNode=function(e){if(!Tn(e))throw Error(G(40));return e._reactRootContainer?(xr(function(){Pn(null,null,e,!1,function(){e._reactRootContainer=null,e[Ot]=null})}),!0):!1};rt.unstable_batchedUpdates=al;rt.unstable_renderSubtreeIntoContainer=function(e,t,r,i){if(!Tn(r))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return Pn(e,t,r,!1,i)};rt.version="18.3.1-next-f1338f8080-20240426";function od(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(od)}catch(e){console.error(e)}}od(),ou.exports=rt;var a_=ou.exports,Pc=a_;po.createRoot=Pc.createRoot,po.hydrateRoot=Pc.hydrateRoot;const l_={},Mc=e=>{let t;const r=new Set,i=(g,d)=>{const p=typeof g=="function"?g(t):g;if(!Object.is(p,t)){const y=t;t=d??(typeof p!="object"||p===null)?p:Object.assign({},t,p),r.forEach(x=>x(t,y))}},s=()=>t,c={setState:i,getState:s,getInitialState:()=>f,subscribe:g=>(r.add(g),()=>r.delete(g)),destroy:()=>{(l_?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),r.clear()}},f=t=e(i,s,c);return c},c_=e=>e?Mc(e):Mc;var ad={exports:{}},ld={},cd={exports:{}},ud={};/**
|
|
41
|
+
* @license React
|
|
42
|
+
* use-sync-external-store-shim.production.js
|
|
43
|
+
*
|
|
44
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
45
|
+
*
|
|
46
|
+
* This source code is licensed under the MIT license found in the
|
|
47
|
+
* LICENSE file in the root directory of this source tree.
|
|
48
|
+
*/var ii=q;function u_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var h_=typeof Object.is=="function"?Object.is:u_,d_=ii.useState,f_=ii.useEffect,p_=ii.useLayoutEffect,__=ii.useDebugValue;function v_(e,t){var r=t(),i=d_({inst:{value:r,getSnapshot:t}}),s=i[0].inst,h=i[1];return p_(function(){s.value=r,s.getSnapshot=t,lo(s)&&h({inst:s})},[e,r,t]),f_(function(){return lo(s)&&h({inst:s}),e(function(){lo(s)&&h({inst:s})})},[e]),__(r),r}function lo(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!h_(e,r)}catch{return!0}}function g_(e,t){return t()}var m_=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g_:v_;ud.useSyncExternalStore=ii.useSyncExternalStore!==void 0?ii.useSyncExternalStore:m_;cd.exports=ud;var y_=cd.exports;/**
|
|
49
|
+
* @license React
|
|
50
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the MIT license found in the
|
|
55
|
+
* LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/var Mn=q,S_=y_;function w_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var C_=typeof Object.is=="function"?Object.is:w_,x_=S_.useSyncExternalStore,b_=Mn.useRef,k_=Mn.useEffect,E_=Mn.useMemo,L_=Mn.useDebugValue;ld.useSyncExternalStoreWithSelector=function(e,t,r,i,s){var h=b_(null);if(h.current===null){var v={hasValue:!1,value:null};h.current=v}else v=h.current;h=E_(function(){function c(y){if(!f){if(f=!0,g=y,y=i(y),s!==void 0&&v.hasValue){var x=v.value;if(s(x,y))return d=x}return d=y}if(x=d,C_(g,y))return x;var m=i(y);return s!==void 0&&s(x,m)?(g=y,x):(g=y,d=m)}var f=!1,g,d,p=r===void 0?null:r;return[function(){return c(t())},p===null?void 0:function(){return c(p())}]},[t,r,i,s]);var o=x_(e,h[0],h[1]);return k_(function(){v.hasValue=!0,v.value=o},[o]),L_(o),o};ad.exports=ld;var D_=ad.exports;const R_=qc(D_),hd={},{useDebugValue:T_}=su,{useSyncExternalStoreWithSelector:P_}=R_;let Ac=!1;const M_=e=>e;function A_(e,t=M_,r){(hd?"production":void 0)!=="production"&&r&&!Ac&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),Ac=!0);const i=P_(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,r);return T_(i),i}const Oc=e=>{(hd?"production":void 0)!=="production"&&typeof e!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t=typeof e=="function"?c_(e):e,r=(i,s)=>A_(t,i,s);return Object.assign(r,t),r},ss=e=>e?Oc(e):Oc,ue=ss((e,t)=>({sessions:{},activePorts:{},claudeStatus:{},gitBranches:{},createSession:(r,i)=>e(s=>({sessions:{...s.sessions,[r]:{terminalId:r,projectId:i,terminal:null,title:"Terminal",alive:!0}}})),setTerminalInstance:(r,i)=>e(s=>{const h=s.sessions[r];return h?{sessions:{...s.sessions,[r]:{...h,terminal:i}}}:s}),setTitle:(r,i)=>e(s=>{const h=s.sessions[r];return h?{sessions:{...s.sessions,[r]:{...h,title:i}}}:s}),markDead:r=>e(i=>{const s=i.sessions[r];return s?{sessions:{...i.sessions,[r]:{...s,alive:!1}}}:i}),removeSession:r=>e(i=>{const{[r]:s,...h}=i.sessions;return{sessions:h}}),getSession:r=>t().sessions[r],getProjectSessions:r=>Object.values(t().sessions).filter(i=>i.projectId===r),setActivePorts:r=>e({activePorts:r}),setClaudeStatus:r=>e({claudeStatus:r}),setGitBranches:r=>e({gitBranches:r})}));let xs=null,yi=null;function Ai(e){yi=yi?{...yi,...e}:{...e},xs&&clearTimeout(xs),xs=setTimeout(()=>{const t=yi;yi=null,xs=null,fetch("/api/settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).catch(()=>{})},300)}const ae=ss()((e,t)=>({projects:{},activeProjectId:null,setActiveProject:r=>{e({activeProjectId:r}),Ai({activeProjectId:r})},addProject:r=>e(i=>({projects:{...i.projects,[r.id]:r},activeProjectId:i.activeProjectId??r.id})),removeProject:r=>e(i=>{const{[r]:s,...h}=i.projects,v=i.activeProjectId===r?Object.keys(h)[0]??null:i.activeProjectId;return{projects:h,activeProjectId:v}}),addTerminalToProject:(r,i)=>e(s=>{const h=s.projects[r];return!h||h.terminalIds.includes(i)?s:{projects:{...s.projects,[r]:{...h,terminalIds:[...h.terminalIds,i]}}}}),removeTerminalFromProject:(r,i)=>e(s=>{const h=s.projects[r];return h?{projects:{...s.projects,[r]:{...h,terminalIds:h.terminalIds.filter(v=>v!==i)}}}:s}),clearProjectTerminals:r=>e(i=>{const s=i.projects[r];return s?{projects:{...i.projects,[r]:{...s,terminalIds:[]}}}:i}),getActiveProject:()=>{const{projects:r,activeProjectId:i}=t();return i?r[i]??null:null},hydrateFromServer:async()=>{try{const[r,i]=await Promise.all([fetch("/api/projects"),fetch("/api/settings")]),s=await r.json(),h=await i.json(),v={};for(const c of s)v[c.id]={id:c.id,name:c.name,cwd:c.cwd,terminalIds:[]};const o=h.activeProjectId&&v[h.activeProjectId]?h.activeProjectId:Object.keys(v)[0]??null;e({projects:v,activeProjectId:o})}catch{}}})),O_=.1,B_=.9,I_=50,j_={background:"#0a0a0f",foreground:"#ececf1",cursor:"#ececf1",cursorAccent:"#0a0a0f",selectionBackground:"#5b5bd640",selectionForeground:"#ececf1",black:"#1a1a24",red:"#e5484d",green:"#30a46c",yellow:"#f5d90a",blue:"#5b5bd6",magenta:"#ab4aba",cyan:"#12a594",white:"#ececf1",brightBlack:"#6b6b80",brightRed:"#ff6369",brightGreen:"#3dd68c",brightYellow:"#ffef5c",brightBlue:"#849dff",brightMagenta:"#d19dff",brightCyan:"#0ac5b3",brightWhite:"#ffffff"},N_={background:"#ffffff",foreground:"#1a1a2e",cursor:"#1a1a2e",cursorAccent:"#ffffff",selectionBackground:"#5b5bd630",selectionForeground:"#1a1a2e",black:"#1a1a2e",red:"#dc3545",green:"#1a8f5c",yellow:"#b58900",blue:"#5b5bd6",magenta:"#9b3bb0",cyan:"#0f8a7e",white:"#d0d0d8",brightBlack:"#8888a0",brightRed:"#e5484d",brightGreen:"#30a46c",brightYellow:"#d4a017",brightBlue:"#6e6ee6",brightMagenta:"#ab4aba",brightCyan:"#12a594",brightWhite:"#d0d0d8"};function de(e){return e?e.type==="leaf"?[e.terminalId]:[...de(e.first),...de(e.second)]:[]}function aa(e,t){if(e.type==="leaf")return null;const r=de(e.first),i=de(e.second);return r.includes(t)||i.includes(t)?e.direction:aa(e.first,t)??aa(e.second,t)}function F_(e,t,r,i){if(!e)return{type:"leaf",terminalId:r};const s=i??(aa(e,t)==="vertical"?"horizontal":"vertical");return la(e,t,r,s)}function la(e,t,r,i){return e.type==="leaf"?e.terminalId===t?{type:"split",direction:i,ratio:.5,first:e,second:{type:"leaf",terminalId:r}}:e:{...e,first:la(e.first,t,r,i),second:la(e.second,t,r,i)}}function fn(e,t){if(!e)return null;if(e.type==="leaf")return e.terminalId===t?null:e;const r=de(e.first),i=de(e.second);if(e.first.type==="leaf"&&e.first.terminalId===t)return e.second;if(e.second.type==="leaf"&&e.second.terminalId===t)return e.first;if(r.includes(t)){const s=fn(e.first,t);return s?{...e,first:s}:e.second}if(i.includes(t)){const s=fn(e.second,t);return s?{...e,second:s}:e.first}return e}function ca(e,t,r){const i=Math.max(O_,Math.min(B_,r));if(t.length===0)return e.type==="split"?{...e,ratio:i}:e;if(e.type==="leaf")return e;const[s,...h]=t;return s===0?{...e,first:ca(e.first,h,i)}:{...e,second:ca(e.second,h,i)}}function ua(e,t,r){return e.type==="leaf"?e.terminalId===t?{...e,terminalId:r}:e.terminalId===r?{...e,terminalId:t}:e:{...e,first:ua(e.first,t,r),second:ua(e.second,t,r)}}function H_(e,t,r,i){const s=fn(e,t);return s?ha(s,r,t,i==="left"||i==="right"?"vertical":"horizontal",i==="left"||i==="top"):null}function ha(e,t,r,i,s){if(e.type==="leaf"){if(e.terminalId===t){const h={type:"leaf",terminalId:r};return{type:"split",direction:i,ratio:.5,first:s?h:e,second:s?e:h}}return e}return{...e,first:ha(e.first,t,r,i,s),second:ha(e.second,t,r,i,s)}}const Xr=["even-horizontal","even-vertical","main-left","main-top","grid"];function br(e,t){if(e.length===0)return null;if(e.length===1)return{type:"leaf",terminalId:e[0]};switch(t){case"even-horizontal":return gr(e,"horizontal");case"even-vertical":return gr(e,"vertical");case"main-left":return Bc(e,"vertical");case"main-top":return Bc(e,"horizontal");case"grid":return z_(e)}}function gr(e,t){if(e.length===1)return{type:"leaf",terminalId:e[0]};if(e.length===2)return{type:"split",direction:t,ratio:.5,first:{type:"leaf",terminalId:e[0]},second:{type:"leaf",terminalId:e[1]}};const r=1/e.length;return{type:"split",direction:t,ratio:r,first:{type:"leaf",terminalId:e[0]},second:gr(e.slice(1),t)}}function Bc(e,t,r){const[i,...s]=e,v=gr(s,t==="vertical"?"horizontal":"vertical");return{type:"split",direction:t,ratio:.6,first:{type:"leaf",terminalId:i},second:v}}function z_(e){if(e.length<=2)return gr(e,"vertical");const t=Math.ceil(e.length/2),r=e.slice(0,t),i=e.slice(t);return{type:"split",direction:"horizontal",ratio:.5,first:gr(r,"vertical"),second:i.length>0?gr(i,"vertical"):{type:"leaf",terminalId:r[r.length-1]}}}function Ic(e,t,r){const i=de(e),s=i.indexOf(t);return s===-1?null:r==="left"||r==="up"?s>0?i[s-1]:null:s<i.length-1?i[s+1]:null}const re=ss((e,t)=>({layouts:{},currentPresetIndex:0,getLayout:r=>t().layouts[r]??null,setLayout:(r,i)=>e(s=>({layouts:{...s.layouts,[r]:i}})),addPaneToProject:(r,i,s,h)=>e(v=>{const o=v.layouts[r]??null,c=F_(o,i,s,h);return{layouts:{...v.layouts,[r]:c}}}),removePaneFromProject:(r,i)=>e(s=>{const h=s.layouts[r];if(!h)return s;const v=fn(h,i);return{layouts:{...s.layouts,[r]:v}}}),resizePaneInProject:(r,i,s)=>e(h=>{const v=h.layouts[r];if(!v)return h;const o=ca(v,i,s);return{layouts:{...h.layouts,[r]:o}}}),swapPanesInProject:(r,i,s)=>e(h=>{const v=h.layouts[r];if(!v)return h;const o=ua(v,i,s);return{layouts:{...h.layouts,[r]:o}}}),movePaneInProject:(r,i,s,h)=>e(v=>{const o=v.layouts[r];if(!o)return v;const c=H_(o,i,s,h);return{layouts:{...v.layouts,[r]:c}}}),applyPresetToProject:(r,i)=>e(s=>{const h=Xr[s.currentPresetIndex],v=br(i,h);return{layouts:{...s.layouts,[r]:v}}}),cyclePreset:(r,i)=>e(s=>{const h=(s.currentPresetIndex+1)%Xr.length,v=Xr[h],o=br(i,v);return{currentPresetIndex:h,layouts:{...s.layouts,[r]:o}}}),removeProjectLayout:r=>e(i=>{const{[r]:s,...h}=i.layouts;return{layouts:h}})}));function Fs(e){document.documentElement.setAttribute("data-theme",e)}function da(e){return e==="system"?window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark":e}const dd=localStorage.getItem("paneful:theme")||"system";Fs(dd);function bs(e){const{theme:t,sidebarWidth:r,editorSyncEnabled:i}=e();Ai({ui:{theme:t,sidebarWidth:r,editorSyncEnabled:i}})}const ee=ss((e,t)=>({focusedTerminalId:null,sidebarOpen:!0,sidebarWidth:224,draggingTerminalId:null,dropTarget:null,connectionStatus:"connecting",editorSyncEnabled:!0,theme:dd,syncToast:null,searchTerminalId:null,commandPaletteOpen:!1,pendingFavouriteLaunchId:null,setFocusedTerminal:r=>e({focusedTerminalId:r}),toggleSidebar:()=>e(r=>({sidebarOpen:!r.sidebarOpen})),setSidebarOpen:r=>e({sidebarOpen:r}),setSidebarWidth:r=>{const i=Math.min(400,Math.max(160,r));e({sidebarWidth:i}),bs(t)},setDragging:r=>e({draggingTerminalId:r}),setDropTarget:r=>e({dropTarget:r}),setConnectionStatus:r=>e({connectionStatus:r}),toggleEditorSync:()=>{e(r=>({editorSyncEnabled:!r.editorSyncEnabled})),bs(t)},setTheme:r=>{localStorage.setItem("paneful:theme",r),Fs(r),e({theme:r}),bs(t)},cycleTheme:()=>{const r=["system","light","dark"],i=t().theme,s=r[(r.indexOf(i)+1)%r.length];localStorage.setItem("paneful:theme",s),Fs(s),e({theme:s}),bs(t)},openSearch:r=>e({searchTerminalId:r}),closeSearch:()=>e({searchTerminalId:null}),toggleCommandPalette:()=>e(r=>({commandPaletteOpen:!r.commandPaletteOpen})),closeCommandPalette:()=>e({commandPaletteOpen:!1}),requestFavouriteLaunch:r=>e({pendingFavouriteLaunchId:r}),clearPendingFavouriteLaunch:()=>e({pendingFavouriteLaunchId:null}),showSyncToast:r=>{e({syncToast:{projectName:r,id:Date.now()}})},dismissSyncToast:()=>e({syncToast:null}),hydrateFromServer:async()=>{try{const i=await(await fetch("/api/settings")).json();if(i.ui){const{theme:s,sidebarWidth:h,editorSyncEnabled:v}=i.ui;s&&(localStorage.setItem("paneful:theme",s),Fs(s)),e({...s?{theme:s}:{},...h!==void 0?{sidebarWidth:h}:{},...v!==void 0?{editorSyncEnabled:v}:{}})}}catch{}}}));var fd={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(globalThis,()=>(()=>{var r={4567:function(v,o,c){var f=this&&this.__decorate||function(n,l,_,S){var C,b=arguments.length,w=b<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,l,_,S);else for(var E=n.length-1;E>=0;E--)(C=n[E])&&(w=(b<3?C(w):b>3?C(l,_,w):C(l,_))||w);return b>3&&w&&Object.defineProperty(l,_,w),w},g=this&&this.__param||function(n,l){return function(_,S){l(_,S,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.AccessibilityManager=void 0;const d=c(9042),p=c(9924),y=c(844),x=c(4725),m=c(2585),u=c(3656);let a=o.AccessibilityManager=class extends y.Disposable{constructor(n,l,_,S){super(),this._terminal=n,this._coreBrowserService=_,this._renderService=S,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let C=0;C<this._terminal.rows;C++)this._rowElements[C]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[C]);if(this._topBoundaryFocusListener=C=>this._handleBoundaryFocus(C,0),this._bottomBoundaryFocusListener=C=>this._handleBoundaryFocus(C,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new p.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(C=>this._handleResize(C.rows))),this.register(this._terminal.onRender(C=>this._refreshRows(C.start,C.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(C=>this._handleChar(C))),this.register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
57
|
+
`))),this.register(this._terminal.onA11yTab(C=>this._handleTab(C))),this.register(this._terminal.onKey(C=>this._handleKey(C.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this.register((0,u.addDisposableDomListener)(document,"selectionchange",()=>this._handleSelectionChange())),this.register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,y.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(n){for(let l=0;l<n;l++)this._handleChar(" ")}_handleChar(n){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==n&&(this._charsToAnnounce+=n):this._charsToAnnounce+=n,n===`
|
|
58
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=d.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(n){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(n)||this._charsToConsume.push(n)}_refreshRows(n,l){this._liveRegionDebouncer.refresh(n,l,this._terminal.rows)}_renderRows(n,l){const _=this._terminal.buffer,S=_.lines.length.toString();for(let C=n;C<=l;C++){const b=_.lines.get(_.ydisp+C),w=[],E=(b==null?void 0:b.translateToString(!0,void 0,void 0,w))||"",P=(_.ydisp+C+1).toString(),O=this._rowElements[C];O&&(E.length===0?(O.innerText=" ",this._rowColumns.set(O,[0,1])):(O.textContent=E,this._rowColumns.set(O,w)),O.setAttribute("aria-posinset",P),O.setAttribute("aria-setsize",S))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(n,l){const _=n.target,S=this._rowElements[l===0?1:this._rowElements.length-2];if(_.getAttribute("aria-posinset")===(l===0?"1":`${this._terminal.buffer.lines.length}`)||n.relatedTarget!==S)return;let C,b;if(l===0?(C=_,b=this._rowElements.pop(),this._rowContainer.removeChild(b)):(C=this._rowElements.shift(),b=_,this._rowContainer.removeChild(C)),C.removeEventListener("focus",this._topBoundaryFocusListener),b.removeEventListener("focus",this._bottomBoundaryFocusListener),l===0){const w=this._createAccessibilityTreeNode();this._rowElements.unshift(w),this._rowContainer.insertAdjacentElement("afterbegin",w)}else{const w=this._createAccessibilityTreeNode();this._rowElements.push(w),this._rowContainer.appendChild(w)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(l===0?-1:1),this._rowElements[l===0?1:this._rowElements.length-2].focus(),n.preventDefault(),n.stopImmediatePropagation()}_handleSelectionChange(){var E;if(this._rowElements.length===0)return;const n=document.getSelection();if(!n)return;if(n.isCollapsed)return void(this._rowContainer.contains(n.anchorNode)&&this._terminal.clearSelection());if(!n.anchorNode||!n.focusNode)return void console.error("anchorNode and/or focusNode are null");let l={node:n.anchorNode,offset:n.anchorOffset},_={node:n.focusNode,offset:n.focusOffset};if((l.node.compareDocumentPosition(_.node)&Node.DOCUMENT_POSITION_PRECEDING||l.node===_.node&&l.offset>_.offset)&&([l,_]=[_,l]),l.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(l={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(l.node))return;const S=this._rowElements.slice(-1)[0];if(_.node.compareDocumentPosition(S)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(_={node:S,offset:((E=S.textContent)==null?void 0:E.length)??0}),!this._rowContainer.contains(_.node))return;const C=({node:P,offset:O})=>{const M=P instanceof Text?P.parentNode:P;let L=parseInt(M==null?void 0:M.getAttribute("aria-posinset"),10)-1;if(isNaN(L))return console.warn("row is invalid. Race condition?"),null;const I=this._rowColumns.get(M);if(!I)return console.warn("columns is null. Race condition?"),null;let F=O<I.length?I[O]:I.slice(-1)[0]+1;return F>=this._terminal.cols&&(++L,F=0),{row:L,column:F}},b=C(l),w=C(_);if(b&&w){if(b.row>w.row||b.row===w.row&&b.column>=w.column)throw new Error("invalid range");this._terminal.select(b.column,b.row,(w.row-b.row)*this._terminal.cols-b.column+w.column)}}_handleResize(n){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let l=this._rowContainer.children.length;l<this._terminal.rows;l++)this._rowElements[l]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[l]);for(;this._rowElements.length>n;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const n=this._coreBrowserService.mainDocument.createElement("div");return n.setAttribute("role","listitem"),n.tabIndex=-1,this._refreshRowDimensions(n),n}_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 n=0;n<this._terminal.rows;n++)this._refreshRowDimensions(this._rowElements[n])}}_refreshRowDimensions(n){n.style.height=`${this._renderService.dimensions.css.cell.height}px`}};o.AccessibilityManager=a=f([g(1,m.IInstantiationService),g(2,x.ICoreBrowserService),g(3,x.IRenderService)],a)},3614:(v,o)=>{function c(p){return p.replace(/\r?\n/g,"\r")}function f(p,y){return y?"\x1B[200~"+p+"\x1B[201~":p}function g(p,y,x,m){p=f(p=c(p),x.decPrivateModes.bracketedPasteMode&&m.rawOptions.ignoreBracketedPasteMode!==!0),x.triggerDataEvent(p,!0),y.value=""}function d(p,y,x){const m=x.getBoundingClientRect(),u=p.clientX-m.left-10,a=p.clientY-m.top-10;y.style.width="20px",y.style.height="20px",y.style.left=`${u}px`,y.style.top=`${a}px`,y.style.zIndex="1000",y.focus()}Object.defineProperty(o,"__esModule",{value:!0}),o.rightClickHandler=o.moveTextAreaUnderMouseCursor=o.paste=o.handlePasteEvent=o.copyHandler=o.bracketTextForPaste=o.prepareTextForTerminal=void 0,o.prepareTextForTerminal=c,o.bracketTextForPaste=f,o.copyHandler=function(p,y){p.clipboardData&&p.clipboardData.setData("text/plain",y.selectionText),p.preventDefault()},o.handlePasteEvent=function(p,y,x,m){p.stopPropagation(),p.clipboardData&&g(p.clipboardData.getData("text/plain"),y,x,m)},o.paste=g,o.moveTextAreaUnderMouseCursor=d,o.rightClickHandler=function(p,y,x,m,u){d(p,y,x),u&&m.rightClickSelect(p),y.value=m.selectionText,y.select()}},7239:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorContrastCache=void 0;const f=c(1505);o.ColorContrastCache=class{constructor(){this._color=new f.TwoKeyMap,this._css=new f.TwoKeyMap}setCss(g,d,p){this._css.set(g,d,p)}getCss(g,d){return this._css.get(g,d)}setColor(g,d,p){this._color.set(g,d,p)}getColor(g,d){return this._color.get(g,d)}clear(){this._color.clear(),this._css.clear()}}},3656:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.addDisposableDomListener=void 0,o.addDisposableDomListener=function(c,f,g,d){c.addEventListener(f,g,d);let p=!1;return{dispose:()=>{p||(p=!0,c.removeEventListener(f,g,d))}}}},3551:function(v,o,c){var f=this&&this.__decorate||function(a,n,l,_){var S,C=arguments.length,b=C<3?n:_===null?_=Object.getOwnPropertyDescriptor(n,l):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(a,n,l,_);else for(var w=a.length-1;w>=0;w--)(S=a[w])&&(b=(C<3?S(b):C>3?S(n,l,b):S(n,l))||b);return C>3&&b&&Object.defineProperty(n,l,b),b},g=this&&this.__param||function(a,n){return function(l,_){n(l,_,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Linkifier=void 0;const d=c(3656),p=c(8460),y=c(844),x=c(2585),m=c(4725);let u=o.Linkifier=class extends y.Disposable{get currentLink(){return this._currentLink}constructor(a,n,l,_,S){super(),this._element=a,this._mouseService=n,this._renderService=l,this._bufferService=_,this._linkProviderService=S,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new p.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new p.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,y.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,y.toDisposable)(()=>{var C;this._lastMouseEvent=void 0,(C=this._activeProviderReplies)==null||C.clear()})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),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){this._lastMouseEvent=a;const n=this._positionFromMouseEvent(a,this._element,this._mouseService);if(!n)return;this._isMouseOut=!1;const l=a.composedPath();for(let _=0;_<l.length;_++){const S=l[_];if(S.classList.contains("xterm"))break;if(S.classList.contains("xterm-hover"))return}this._lastBufferCell&&n.x===this._lastBufferCell.x&&n.y===this._lastBufferCell.y||(this._handleHover(n),this._lastBufferCell=n)}_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,n){var _,S;this._activeProviderReplies&&n||((_=this._activeProviderReplies)==null||_.forEach(C=>{C==null||C.forEach(b=>{b.link.dispose&&b.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=a.y);let l=!1;for(const[C,b]of this._linkProviderService.linkProviders.entries())n?(S=this._activeProviderReplies)!=null&&S.get(C)&&(l=this._checkLinkProviderResult(C,a,l)):b.provideLinks(a.y,w=>{var P,O;if(this._isMouseOut)return;const E=w==null?void 0:w.map(M=>({link:M}));(P=this._activeProviderReplies)==null||P.set(C,E),l=this._checkLinkProviderResult(C,a,l),((O=this._activeProviderReplies)==null?void 0:O.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(a.y,this._activeProviderReplies)})}_removeIntersectingLinks(a,n){const l=new Set;for(let _=0;_<n.size;_++){const S=n.get(_);if(S)for(let C=0;C<S.length;C++){const b=S[C],w=b.link.range.start.y<a?0:b.link.range.start.x,E=b.link.range.end.y>a?this._bufferService.cols:b.link.range.end.x;for(let P=w;P<=E;P++){if(l.has(P)){S.splice(C--,1);break}l.add(P)}}}}_checkLinkProviderResult(a,n,l){var C;if(!this._activeProviderReplies)return l;const _=this._activeProviderReplies.get(a);let S=!1;for(let b=0;b<a;b++)this._activeProviderReplies.has(b)&&!this._activeProviderReplies.get(b)||(S=!0);if(!S&&_){const b=_.find(w=>this._linkAtPosition(w.link,n));b&&(l=!0,this._handleNewLink(b))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!l)for(let b=0;b<this._activeProviderReplies.size;b++){const w=(C=this._activeProviderReplies.get(b))==null?void 0:C.find(E=>this._linkAtPosition(E.link,n));if(w){l=!0,this._handleNewLink(w);break}}return l}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(a){if(!this._currentLink)return;const n=this._positionFromMouseEvent(a,this._element,this._mouseService);n&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,n)&&this._currentLink.link.activate(a,this._currentLink.link.text)}_clearCurrentLink(a,n){this._currentLink&&this._lastMouseEvent&&(!a||!n||this._currentLink.link.range.start.y>=a&&this._currentLink.link.range.end.y<=n)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,y.disposeArray)(this._linkCacheDisposables))}_handleNewLink(a){if(!this._lastMouseEvent)return;const n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._linkAtPosition(a.link,n)&&(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 l,_;return(_=(l=this._currentLink)==null?void 0:l.state)==null?void 0:_.decorations.pointerCursor},set:l=>{var _;(_=this._currentLink)!=null&&_.state&&this._currentLink.state.decorations.pointerCursor!==l&&(this._currentLink.state.decorations.pointerCursor=l,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",l))}},underline:{get:()=>{var l,_;return(_=(l=this._currentLink)==null?void 0:l.state)==null?void 0:_.decorations.underline},set:l=>{var _,S,C;(_=this._currentLink)!=null&&_.state&&((C=(S=this._currentLink)==null?void 0:S.state)==null?void 0:C.decorations.underline)!==l&&(this._currentLink.state.decorations.underline=l,this._currentLink.state.isHovered&&this._fireUnderlineEvent(a.link,l))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(l=>{if(!this._currentLink)return;const _=l.start===0?0:l.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+l.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(_,S),this._lastMouseEvent)){const C=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);C&&this._askForLink(C,!1)}})))}_linkHover(a,n,l){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!0),this._currentLink.state.decorations.pointerCursor&&a.classList.add("xterm-cursor-pointer")),n.hover&&n.hover(l,n.text)}_fireUnderlineEvent(a,n){const l=a.range,_=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(l.start.x-1,l.start.y-_-1,l.end.x,l.end.y-_-1,void 0);(n?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(a,n,l){var _;(_=this._currentLink)!=null&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(n,!1),this._currentLink.state.decorations.pointerCursor&&a.classList.remove("xterm-cursor-pointer")),n.leave&&n.leave(l,n.text)}_linkAtPosition(a,n){const l=a.range.start.y*this._bufferService.cols+a.range.start.x,_=a.range.end.y*this._bufferService.cols+a.range.end.x,S=n.y*this._bufferService.cols+n.x;return l<=S&&S<=_}_positionFromMouseEvent(a,n,l){const _=l.getCoords(a,n,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(a,n,l,_,S){return{x1:a,y1:n,x2:l,y2:_,cols:this._bufferService.cols,fg:S}}};o.Linkifier=u=f([g(1,m.IMouseService),g(2,m.IRenderService),g(3,x.IBufferService),g(4,m.ILinkProviderService)],u)},9042:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.tooMuchOutput=o.promptLabel=void 0,o.promptLabel="Terminal input",o.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(v,o,c){var f=this&&this.__decorate||function(m,u,a,n){var l,_=arguments.length,S=_<3?u:n===null?n=Object.getOwnPropertyDescriptor(u,a):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(m,u,a,n);else for(var C=m.length-1;C>=0;C--)(l=m[C])&&(S=(_<3?l(S):_>3?l(u,a,S):l(u,a))||S);return _>3&&S&&Object.defineProperty(u,a,S),S},g=this&&this.__param||function(m,u){return function(a,n){u(a,n,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkProvider=void 0;const d=c(511),p=c(2585);let y=o.OscLinkProvider=class{constructor(m,u,a){this._bufferService=m,this._optionsService=u,this._oscLinkService=a}provideLinks(m,u){var E;const a=this._bufferService.buffer.lines.get(m-1);if(!a)return void u(void 0);const n=[],l=this._optionsService.rawOptions.linkHandler,_=new d.CellData,S=a.getTrimmedLength();let C=-1,b=-1,w=!1;for(let P=0;P<S;P++)if(b!==-1||a.hasContent(P)){if(a.loadCell(P,_),_.hasExtendedAttrs()&&_.extended.urlId){if(b===-1){b=P,C=_.extended.urlId;continue}w=_.extended.urlId!==C}else b!==-1&&(w=!0);if(w||b!==-1&&P===S-1){const O=(E=this._oscLinkService.getLinkData(C))==null?void 0:E.uri;if(O){const M={start:{x:b+1,y:m},end:{x:P+(w||P!==S-1?0:1),y:m}};let L=!1;if(!(l!=null&&l.allowNonHttpProtocols))try{const I=new URL(O);["http:","https:"].includes(I.protocol)||(L=!0)}catch{L=!0}L||n.push({text:O,range:M,activate:(I,F)=>l?l.activate(I,F,M):x(0,F),hover:(I,F)=>{var H;return(H=l==null?void 0:l.hover)==null?void 0:H.call(l,I,F,M)},leave:(I,F)=>{var H;return(H=l==null?void 0:l.leave)==null?void 0:H.call(l,I,F,M)}})}w=!1,_.hasExtendedAttrs()&&_.extended.urlId?(b=P,C=_.extended.urlId):(b=-1,C=-1)}}u(n)}};function x(m,u){if(confirm(`Do you want to navigate to ${u}?
|
|
59
|
+
|
|
60
|
+
WARNING: This link could potentially be dangerous`)){const a=window.open();if(a){try{a.opener=null}catch{}a.location.href=u}else console.warn("Opening link blocked as opener could not be cleared")}}o.OscLinkProvider=y=f([g(0,p.IBufferService),g(1,p.IOptionsService),g(2,p.IOscLinkService)],y)},6193:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.RenderDebouncer=void 0,o.RenderDebouncer=class{constructor(c,f){this._renderCallback=c,this._coreBrowserService=f,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(c){return this._refreshCallbacks.push(c),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(c,f,g){this._rowCount=g,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,f):f,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const c of this._refreshCallbacks)c(0);this._refreshCallbacks=[]}}},3236:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Terminal=void 0;const f=c(3614),g=c(3656),d=c(3551),p=c(9042),y=c(3730),x=c(1680),m=c(3107),u=c(5744),a=c(2950),n=c(1296),l=c(428),_=c(4269),S=c(5114),C=c(8934),b=c(3230),w=c(9312),E=c(4725),P=c(6731),O=c(8055),M=c(8969),L=c(8460),I=c(844),F=c(6114),H=c(8437),U=c(2584),N=c(7399),k=c(5941),T=c(9074),A=c(2585),B=c(5435),$=c(4567),V=c(779);class Y extends M.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(j={}){super(j),this.browser=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new I.MutableDisposable),this._onCursorMove=this.register(new L.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new L.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new L.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new L.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new L.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new L.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new L.EventEmitter),this._onBlur=this.register(new L.EventEmitter),this._onA11yCharEmitter=this.register(new L.EventEmitter),this._onA11yTabEmitter=this.register(new L.EventEmitter),this._onWillOpen=this.register(new L.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(T.DecorationService),this._instantiationService.setService(A.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(V.LinkProviderService),this._instantiationService.setService(E.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(y.OscLinkProvider)),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((D,K)=>this.refresh(D,K))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(D=>this._reportWindowsOptions(D))),this.register(this._inputHandler.onColor(D=>this._handleColorEvent(D))),this.register((0,L.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,L.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,L.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(D=>this._afterResize(D.cols,D.rows))),this.register((0,I.toDisposable)(()=>{var D,K;this._customKeyEventHandler=void 0,(K=(D=this.element)==null?void 0:D.parentNode)==null||K.removeChild(this.element)}))}_handleColorEvent(j){if(this._themeService)for(const D of j){let K,z="";switch(D.index){case 256:K="foreground",z="10";break;case 257:K="background",z="11";break;case 258:K="cursor",z="12";break;default:K="ansi",z="4;"+D.index}switch(D.type){case 0:const Q=O.color.toColorRGB(K==="ansi"?this._themeService.colors.ansi[D.index]:this._themeService.colors[K]);this.coreService.triggerDataEvent(`${U.C0.ESC}]${z};${(0,k.toRgbString)(Q)}${U.C1_ESCAPED.ST}`);break;case 1:if(K==="ansi")this._themeService.modifyColors(X=>X.ansi[D.index]=O.channels.toColor(...D.color));else{const X=K;this._themeService.modifyColors(se=>se[X]=O.channels.toColor(...D.color))}break;case 2:this._themeService.restoreColor(D.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(j){j?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance($.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(j){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var j;return(j=this.textarea)==null?void 0:j.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(U.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 j=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(j);if(!D)return;const K=Math.min(this.buffer.x,this.cols-1),z=this._renderService.dimensions.css.cell.height,Q=D.getWidth(K),X=this._renderService.dimensions.css.cell.width*Q,se=this.buffer.y*this._renderService.dimensions.css.cell.height,fe=K*this._renderService.dimensions.css.cell.width;this.textarea.style.left=fe+"px",this.textarea.style.top=se+"px",this.textarea.style.width=X+"px",this.textarea.style.height=z+"px",this.textarea.style.lineHeight=z+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,g.addDisposableDomListener)(this.element,"copy",D=>{this.hasSelection()&&(0,f.copyHandler)(D,this._selectionService)}));const j=D=>(0,f.handlePasteEvent)(D,this.textarea,this.coreService,this.optionsService);this.register((0,g.addDisposableDomListener)(this.textarea,"paste",j)),this.register((0,g.addDisposableDomListener)(this.element,"paste",j)),F.isFirefox?this.register((0,g.addDisposableDomListener)(this.element,"mousedown",D=>{D.button===2&&(0,f.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,g.addDisposableDomListener)(this.element,"contextmenu",D=>{(0,f.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),F.isLinux&&this.register((0,g.addDisposableDomListener)(this.element,"auxclick",D=>{D.button===1&&(0,f.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,g.addDisposableDomListener)(this.textarea,"keyup",j=>this._keyUp(j),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keydown",j=>this._keyDown(j),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"keypress",j=>this._keyPress(j),!0)),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionupdate",j=>this._compositionHelper.compositionupdate(j))),this.register((0,g.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,g.addDisposableDomListener)(this.textarea,"input",j=>this._inputEvent(j),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(j){var K;if(!j)throw new Error("Terminal requires a parent element.");if(j.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((K=this.element)==null?void 0:K.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=j.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),j.appendChild(this.element);const D=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),D.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,g.addDisposableDomListener)(this.screenElement,"mousemove",z=>this.updateCursorStyle(z))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),D.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),F.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(S.CoreBrowserService,this.textarea,j.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(E.ICoreBrowserService,this._coreBrowserService),this.register((0,g.addDisposableDomListener)(this.textarea,"focus",z=>this._handleTextAreaFocus(z))),this.register((0,g.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(l.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(E.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(P.ThemeService),this._instantiationService.setService(E.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(_.CharacterJoinerService),this._instantiationService.setService(E.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(b.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(E.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(z=>this._onRender.fire(z))),this.onResize(z=>this._renderService.resize(z.cols,z.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(a.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(E.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(d.Linkifier,this.screenElement)),this.element.appendChild(D);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(x.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(z=>this.scrollLines(z.amount,z.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(w.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(E.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(z=>this.scrollLines(z.amount,z.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(z=>this._renderService.handleSelectionChanged(z.start,z.end,z.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(z=>{this.textarea.value=z,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(z=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,g.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.register(this._instantiationService.createInstance(m.BufferDecorationRenderer,this.screenElement)),this.register((0,g.addDisposableDomListener)(this.element,"mousedown",z=>this._selectionService.handleMouseDown(z))),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($.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",z=>this._handleScreenReaderModeOptionChange(z))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",z=>{!this._overviewRulerRenderer&&z&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(u.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(n.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const j=this,D=this.element;function K(X){const se=j._mouseService.getMouseReportCoords(X,j.screenElement);if(!se)return!1;let fe,pe;switch(X.overrideType||X.type){case"mousemove":pe=32,X.buttons===void 0?(fe=3,X.button!==void 0&&(fe=X.button<3?X.button:3)):fe=1&X.buttons?0:4&X.buttons?1:2&X.buttons?2:3;break;case"mouseup":pe=0,fe=X.button<3?X.button:3;break;case"mousedown":pe=1,fe=X.button<3?X.button:3;break;case"wheel":if(j._customWheelEventHandler&&j._customWheelEventHandler(X)===!1||j.viewport.getLinesScrolled(X)===0)return!1;pe=X.deltaY<0?0:1,fe=4;break;default:return!1}return!(pe===void 0||fe===void 0||fe>4)&&j.coreMouseService.triggerMouseEvent({col:se.col,row:se.row,x:se.x,y:se.y,button:fe,action:pe,ctrl:X.ctrlKey,alt:X.altKey,shift:X.shiftKey})}const z={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Q={mouseup:X=>(K(X),X.buttons||(this._document.removeEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.removeEventListener("mousemove",z.mousedrag)),this.cancel(X)),wheel:X=>(K(X),this.cancel(X,!0)),mousedrag:X=>{X.buttons&&K(X)},mousemove:X=>{X.buttons||K(X)}};this.register(this.coreMouseService.onProtocolChange(X=>{X?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(X)),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&X?z.mousemove||(D.addEventListener("mousemove",Q.mousemove),z.mousemove=Q.mousemove):(D.removeEventListener("mousemove",z.mousemove),z.mousemove=null),16&X?z.wheel||(D.addEventListener("wheel",Q.wheel,{passive:!1}),z.wheel=Q.wheel):(D.removeEventListener("wheel",z.wheel),z.wheel=null),2&X?z.mouseup||(z.mouseup=Q.mouseup):(this._document.removeEventListener("mouseup",z.mouseup),z.mouseup=null),4&X?z.mousedrag||(z.mousedrag=Q.mousedrag):(this._document.removeEventListener("mousemove",z.mousedrag),z.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,g.addDisposableDomListener)(D,"mousedown",X=>{if(X.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(X))return K(X),z.mouseup&&this._document.addEventListener("mouseup",z.mouseup),z.mousedrag&&this._document.addEventListener("mousemove",z.mousedrag),this.cancel(X)})),this.register((0,g.addDisposableDomListener)(D,"wheel",X=>{if(!z.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(X)===!1)return!1;if(!this.buffer.hasScrollback){const se=this.viewport.getLinesScrolled(X);if(se===0)return;const fe=U.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(X.deltaY<0?"A":"B");let pe="";for(let Ie=0;Ie<Math.abs(se);Ie++)pe+=fe;return this.coreService.triggerDataEvent(pe,!0),this.cancel(X,!0)}return this.viewport.handleWheel(X)?this.cancel(X):void 0}},{passive:!1})),this.register((0,g.addDisposableDomListener)(D,"touchstart",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(X),this.cancel(X)},{passive:!0})),this.register((0,g.addDisposableDomListener)(D,"touchmove",X=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(X)?void 0:this.cancel(X)},{passive:!1}))}refresh(j,D){var K;(K=this._renderService)==null||K.refreshRows(j,D)}updateCursorStyle(j){var D;(D=this._selectionService)!=null&&D.shouldColumnSelect(j)?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(j,D,K=0){var z;K===1?(super.scrollLines(j,D,K),this.refresh(0,this.rows-1)):(z=this.viewport)==null||z.scrollLines(j)}paste(j){(0,f.paste)(j,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(j){this._customKeyEventHandler=j}attachCustomWheelEventHandler(j){this._customWheelEventHandler=j}registerLinkProvider(j){return this._linkProviderService.registerLinkProvider(j)}registerCharacterJoiner(j){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const D=this._characterJoinerService.register(j);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(j){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(j)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(j){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+j)}registerDecoration(j){return this._decorationService.registerDecoration(j)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(j,D,K){this._selectionService.setSelection(j,D,K)}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 j;(j=this._selectionService)==null||j.clearSelection()}selectAll(){var j;(j=this._selectionService)==null||j.selectAll()}selectLines(j,D){var K;(K=this._selectionService)==null||K.selectLines(j,D)}_keyDown(j){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1)return!1;const D=this.browser.isMac&&this.options.macOptionIsMeta&&j.altKey;if(!D&&!this._compositionHelper.keydown(j))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;D||j.key!=="Dead"&&j.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const K=(0,N.evaluateKeyboardEvent)(j,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(j),K.type===3||K.type===2){const z=this.rows-1;return this.scrollLines(K.type===2?-z:z),this.cancel(j,!0)}return K.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,j)||(K.cancel&&this.cancel(j,!0),!K.key||!!(j.key&&!j.ctrlKey&&!j.altKey&&!j.metaKey&&j.key.length===1&&j.key.charCodeAt(0)>=65&&j.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(K.key!==U.C0.ETX&&K.key!==U.C0.CR||(this.textarea.value=""),this._onKey.fire({key:K.key,domEvent:j}),this._showCursor(),this.coreService.triggerDataEvent(K.key,!0),!this.optionsService.rawOptions.screenReaderMode||j.altKey||j.ctrlKey?this.cancel(j,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(j,D){const K=j.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||j.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||j.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?K:K&&(!D.keyCode||D.keyCode>47)}_keyUp(j){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1||(function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18}(j)||this.focus(),this.updateCursorStyle(j),this._keyPressHandled=!1)}_keyPress(j){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(j)===!1)return!1;if(this.cancel(j),j.charCode)D=j.charCode;else if(j.which===null||j.which===void 0)D=j.keyCode;else{if(j.which===0||j.charCode===0)return!1;D=j.which}return!(!D||(j.altKey||j.ctrlKey||j.metaKey)&&!this._isThirdLevelShift(this.browser,j)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:j}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(j){if(j.data&&j.inputType==="insertText"&&(!j.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const D=j.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(j),!0}return!1}resize(j,D){j!==this.cols||D!==this.rows?super.resize(j,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(j,D){var K,z;(K=this._charSizeService)==null||K.measure(),(z=this.viewport)==null||z.syncScrollArea(!0)}clear(){var j;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 D=1;D<this.rows;D++)this.buffer.lines.push(this.buffer.getBlankLine(H.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),(j=this.viewport)==null||j.reset(),this.refresh(0,this.rows-1)}}reset(){var D,K;this.options.rows=this.rows,this.options.cols=this.cols;const j=this._customKeyEventHandler;this._setup(),super.reset(),(D=this._selectionService)==null||D.reset(),this._decorationService.reset(),(K=this.viewport)==null||K.reset(),this._customKeyEventHandler=j,this.refresh(0,this.rows-1)}clearTextureAtlas(){var j;(j=this._renderService)==null||j.clearTextureAtlas()}_reportFocus(){var j;(j=this.element)!=null&&j.classList.contains("focus")?this.coreService.triggerDataEvent(U.C0.ESC+"[I"):this.coreService.triggerDataEvent(U.C0.ESC+"[O")}_reportWindowsOptions(j){if(this._renderService)switch(j){case B.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const D=this._renderService.dimensions.css.canvas.width.toFixed(0),K=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[4;${K};${D}t`);break;case B.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const z=this._renderService.dimensions.css.cell.width.toFixed(0),Q=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${U.C0.ESC}[6;${Q};${z}t`)}}cancel(j,D){if(this.options.cancelEvents||D)return j.preventDefault(),j.stopPropagation(),!1}}o.Terminal=Y},9924:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TimeBasedDebouncer=void 0,o.TimeBasedDebouncer=class{constructor(c,f=1e3){this._renderCallback=c,this._debounceThresholdMS=f,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(c,f,g){this._rowCount=g,c=c!==void 0?c:0,f=f!==void 0?f:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,c):c,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 p=d-this._lastRefreshMs,y=this._debounceThresholdMS-p;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},y)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const c=Math.max(this._rowStart,0),f=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(c,f)}}},1680:function(v,o,c){var f=this&&this.__decorate||function(a,n,l,_){var S,C=arguments.length,b=C<3?n:_===null?_=Object.getOwnPropertyDescriptor(n,l):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(a,n,l,_);else for(var w=a.length-1;w>=0;w--)(S=a[w])&&(b=(C<3?S(b):C>3?S(n,l,b):S(n,l))||b);return C>3&&b&&Object.defineProperty(n,l,b),b},g=this&&this.__param||function(a,n){return function(l,_){n(l,_,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.Viewport=void 0;const d=c(3656),p=c(4725),y=c(8460),x=c(844),m=c(2585);let u=o.Viewport=class extends x.Disposable{constructor(a,n,l,_,S,C,b,w){super(),this._viewportElement=a,this._scrollArea=n,this._bufferService=l,this._optionsService=_,this._charSizeService=S,this._renderService=C,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 y.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(E=>this._activeBuffer=E.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(E=>this._renderDimensions=E)),this._handleThemeChange(w.colors),this.register(w.onChangeColors(E=>this._handleThemeChange(E))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(a){this._viewportElement.style.backgroundColor=a.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(a){if(a)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const n=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==n&&(this._lastRecordedBufferHeight=n,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const a=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==a&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=a),this._refreshAnimationFrame=null}syncScrollArea(a=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(a);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(a)}_handleScroll(a){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const n=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:n,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const a=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(a*(this._smoothScrollState.target-this._smoothScrollState.origin)),a<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(a,n){const l=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(n<0&&this._viewportElement.scrollTop!==0||n>0&&l<this._lastRecordedBufferHeight)||(a.cancelable&&a.preventDefault(),!1)}handleWheel(a){const n=this._getPixelsScrolled(a);return n!==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+n:this._smoothScrollState.target+=n,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=n,this._bubbleScroll(a,n))}scrollLines(a){if(a!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const n=a*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+n,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:a,suppressScrollEvent:!1})}_getPixelsScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let n=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_LINE?n*=this._currentRowHeight:a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._currentRowHeight*this._bufferService.rows),n}getBufferElements(a,n){var w;let l,_="";const S=[],C=n??this._bufferService.buffer.lines.length,b=this._bufferService.buffer.lines;for(let E=a;E<C;E++){const P=b.get(E);if(!P)continue;const O=(w=b.get(E+1))==null?void 0:w.isWrapped;if(_+=P.translateToString(!O),!O||E===b.length-1){const M=document.createElement("div");M.textContent=_,S.push(M),_.length>0&&(l=M),_=""}}return{bufferElements:S,cursorElement:l}}getLinesScrolled(a){if(a.deltaY===0||a.shiftKey)return 0;let n=this._applyScrollModifier(a.deltaY,a);return a.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(n/=this._currentRowHeight+0,this._wheelPartialScroll+=n,n=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):a.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(n*=this._bufferService.rows),n}_applyScrollModifier(a,n){const l=this._optionsService.rawOptions.fastScrollModifier;return l==="alt"&&n.altKey||l==="ctrl"&&n.ctrlKey||l==="shift"&&n.shiftKey?a*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:a*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(a){this._lastTouchY=a.touches[0].pageY}handleTouchMove(a){const n=this._lastTouchY-a.touches[0].pageY;return this._lastTouchY=a.touches[0].pageY,n!==0&&(this._viewportElement.scrollTop+=n,this._bubbleScroll(a,n))}};o.Viewport=u=f([g(2,m.IBufferService),g(3,m.IOptionsService),g(4,p.ICharSizeService),g(5,p.IRenderService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],u)},3107:function(v,o,c){var f=this&&this.__decorate||function(m,u,a,n){var l,_=arguments.length,S=_<3?u:n===null?n=Object.getOwnPropertyDescriptor(u,a):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(m,u,a,n);else for(var C=m.length-1;C>=0;C--)(l=m[C])&&(S=(_<3?l(S):_>3?l(u,a,S):l(u,a))||S);return _>3&&S&&Object.defineProperty(u,a,S),S},g=this&&this.__param||function(m,u){return function(a,n){u(a,n,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferDecorationRenderer=void 0;const d=c(4725),p=c(844),y=c(2585);let x=o.BufferDecorationRenderer=class extends p.Disposable{constructor(m,u,a,n,l){super(),this._screenElement=m,this._bufferService=u,this._coreBrowserService=a,this._decorationService=n,this._renderService=l,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(_=>this._removeDecoration(_))),this.register((0,p.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const m of this._decorationService.decorations)this._renderDecoration(m);this._dimensionsChanged=!1}_renderDecoration(m){this._refreshStyle(m),this._dimensionsChanged&&this._refreshXPosition(m)}_createElement(m){var n;const u=this._coreBrowserService.mainDocument.createElement("div");u.classList.add("xterm-decoration"),u.classList.toggle("xterm-decoration-top-layer",((n=m==null?void 0:m.options)==null?void 0:n.layer)==="top"),u.style.width=`${Math.round((m.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,u.style.height=(m.options.height||1)*this._renderService.dimensions.css.cell.height+"px",u.style.top=(m.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",u.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const a=m.options.x??0;return a&&a>this._bufferService.cols&&(u.style.display="none"),this._refreshXPosition(m,u),u}_refreshStyle(m){const u=m.marker.line-this._bufferService.buffers.active.ydisp;if(u<0||u>=this._bufferService.rows)m.element&&(m.element.style.display="none",m.onRenderEmitter.fire(m.element));else{let a=this._decorationElements.get(m);a||(a=this._createElement(m),m.element=a,this._decorationElements.set(m,a),this._container.appendChild(a),m.onDispose(()=>{this._decorationElements.delete(m),a.remove()})),a.style.top=u*this._renderService.dimensions.css.cell.height+"px",a.style.display=this._altBufferIsActive?"none":"block",m.onRenderEmitter.fire(a)}}_refreshXPosition(m,u=m.element){if(!u)return;const a=m.options.x??0;(m.options.anchor||"left")==="right"?u.style.right=a?a*this._renderService.dimensions.css.cell.width+"px":"":u.style.left=a?a*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(m){var u;(u=this._decorationElements.get(m))==null||u.remove(),this._decorationElements.delete(m),m.dispose()}};o.BufferDecorationRenderer=x=f([g(1,y.IBufferService),g(2,d.ICoreBrowserService),g(3,y.IDecorationService),g(4,d.IRenderService)],x)},5871:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ColorZoneStore=void 0,o.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(c){if(c.options.overviewRulerOptions){for(const f of this._zones)if(f.color===c.options.overviewRulerOptions.color&&f.position===c.options.overviewRulerOptions.position){if(this._lineIntersectsZone(f,c.marker.line))return;if(this._lineAdjacentToZone(f,c.marker.line,c.options.overviewRulerOptions.position))return void this._addLineToZone(f,c.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=c.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=c.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=c.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=c.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:c.options.overviewRulerOptions.color,position:c.options.overviewRulerOptions.position,startBufferLine:c.marker.line,endBufferLine:c.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(c){this._linePadding=c}_lineIntersectsZone(c,f){return f>=c.startBufferLine&&f<=c.endBufferLine}_lineAdjacentToZone(c,f,g){return f>=c.startBufferLine-this._linePadding[g||"full"]&&f<=c.endBufferLine+this._linePadding[g||"full"]}_addLineToZone(c,f){c.startBufferLine=Math.min(c.startBufferLine,f),c.endBufferLine=Math.max(c.endBufferLine,f)}}},5744:function(v,o,c){var f=this&&this.__decorate||function(l,_,S,C){var b,w=arguments.length,E=w<3?_:C===null?C=Object.getOwnPropertyDescriptor(_,S):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,_,S,C);else for(var P=l.length-1;P>=0;P--)(b=l[P])&&(E=(w<3?b(E):w>3?b(_,S,E):b(_,S))||E);return w>3&&E&&Object.defineProperty(_,S,E),E},g=this&&this.__param||function(l,_){return function(S,C){_(S,C,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OverviewRulerRenderer=void 0;const d=c(5871),p=c(4725),y=c(844),x=c(2585),m={full:0,left:0,center:0,right:0},u={full:0,left:0,center:0,right:0},a={full:0,left:0,center:0,right:0};let n=o.OverviewRulerRenderer=class extends y.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(l,_,S,C,b,w,E){var O;super(),this._viewportElement=l,this._screenElement=_,this._bufferService=S,this._decorationService=C,this._renderService=b,this._optionsService=w,this._coreBrowserService=E,this._colorZoneStore=new d.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(O=this._viewportElement.parentElement)==null||O.insertBefore(this._canvas,this._viewportElement);const P=this._canvas.getContext("2d");if(!P)throw new Error("Ctx cannot be null");this._ctx=P,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,y.toDisposable)(()=>{var M;(M=this._canvas)==null||M.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const l=Math.floor(this._canvas.width/3),_=Math.ceil(this._canvas.width/3);u.full=this._canvas.width,u.left=l,u.center=_,u.right=l,this._refreshDrawHeightConstants(),a.full=0,a.left=0,a.center=u.left,a.right=u.left+u.center}_refreshDrawHeightConstants(){m.full=Math.round(2*this._coreBrowserService.dpr);const l=this._canvas.height/this._bufferService.buffer.lines.length,_=Math.round(Math.max(Math.min(l,12),6)*this._coreBrowserService.dpr);m.left=_,m.center=_,m.right=_}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*m.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const _ of this._decorationService.decorations)this._colorZoneStore.addDecoration(_);this._ctx.lineWidth=1;const l=this._colorZoneStore.zones;for(const _ of l)_.position!=="full"&&this._renderColorZone(_);for(const _ of l)_.position==="full"&&this._renderColorZone(_);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(l){this._ctx.fillStyle=l.color,this._ctx.fillRect(a[l.position||"full"],Math.round((this._canvas.height-1)*(l.startBufferLine/this._bufferService.buffers.active.lines.length)-m[l.position||"full"]/2),u[l.position||"full"],Math.round((this._canvas.height-1)*((l.endBufferLine-l.startBufferLine)/this._bufferService.buffers.active.lines.length)+m[l.position||"full"]))}_queueRefresh(l,_){this._shouldUpdateDimensions=l||this._shouldUpdateDimensions,this._shouldUpdateAnchor=_||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};o.OverviewRulerRenderer=n=f([g(2,x.IBufferService),g(3,x.IDecorationService),g(4,p.IRenderService),g(5,x.IOptionsService),g(6,p.ICoreBrowserService)],n)},2950:function(v,o,c){var f=this&&this.__decorate||function(m,u,a,n){var l,_=arguments.length,S=_<3?u:n===null?n=Object.getOwnPropertyDescriptor(u,a):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(m,u,a,n);else for(var C=m.length-1;C>=0;C--)(l=m[C])&&(S=(_<3?l(S):_>3?l(u,a,S):l(u,a))||S);return _>3&&S&&Object.defineProperty(u,a,S),S},g=this&&this.__param||function(m,u){return function(a,n){u(a,n,m)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompositionHelper=void 0;const d=c(4725),p=c(2585),y=c(2584);let x=o.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(m,u,a,n,l,_){this._textarea=m,this._compositionView=u,this._bufferService=a,this._optionsService=n,this._coreService=l,this._renderService=_,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(m){this._compositionView.textContent=m.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(m){if(this._isComposing||this._isSendingComposition){if(m.keyCode===229||m.keyCode===16||m.keyCode===17||m.keyCode===18)return!1;this._finalizeComposition(!1)}return m.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(m){if(this._compositionView.classList.remove("active"),this._isComposing=!1,m){const u={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let a;this._isSendingComposition=!1,u.start+=this._dataAlreadySent.length,a=this._isComposing?this._textarea.value.substring(u.start,u.end):this._textarea.value.substring(u.start),a.length>0&&this._coreService.triggerDataEvent(a,!0)}},0)}else{this._isSendingComposition=!1;const u=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(u,!0)}}_handleAnyTextareaChanges(){const m=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const u=this._textarea.value,a=u.replace(m,"");this._dataAlreadySent=a,u.length>m.length?this._coreService.triggerDataEvent(a,!0):u.length<m.length?this._coreService.triggerDataEvent(`${y.C0.DEL}`,!0):u.length===m.length&&u!==m&&this._coreService.triggerDataEvent(u,!0)}},0)}updateCompositionElements(m){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),a=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,l=u*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=l+"px",this._compositionView.style.top=n+"px",this._compositionView.style.height=a+"px",this._compositionView.style.lineHeight=a+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const _=this._compositionView.getBoundingClientRect();this._textarea.style.left=l+"px",this._textarea.style.top=n+"px",this._textarea.style.width=Math.max(_.width,1)+"px",this._textarea.style.height=Math.max(_.height,1)+"px",this._textarea.style.lineHeight=_.height+"px"}m||setTimeout(()=>this.updateCompositionElements(!0),0)}}};o.CompositionHelper=x=f([g(2,p.IBufferService),g(3,p.IOptionsService),g(4,p.ICoreService),g(5,d.IRenderService)],x)},9806:(v,o)=>{function c(f,g,d){const p=d.getBoundingClientRect(),y=f.getComputedStyle(d),x=parseInt(y.getPropertyValue("padding-left")),m=parseInt(y.getPropertyValue("padding-top"));return[g.clientX-p.left-x,g.clientY-p.top-m]}Object.defineProperty(o,"__esModule",{value:!0}),o.getCoords=o.getCoordsRelativeToElement=void 0,o.getCoordsRelativeToElement=c,o.getCoords=function(f,g,d,p,y,x,m,u,a){if(!x)return;const n=c(f,g,d);return n?(n[0]=Math.ceil((n[0]+(a?m/2:0))/m),n[1]=Math.ceil(n[1]/u),n[0]=Math.min(Math.max(n[0],1),p+(a?1:0)),n[1]=Math.min(Math.max(n[1],1),y),n):void 0}},9504:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.moveToCellSequence=void 0;const f=c(2584);function g(u,a,n,l){const _=u-d(u,n),S=a-d(a,n),C=Math.abs(_-S)-function(b,w,E){let P=0;const O=b-d(b,E),M=w-d(w,E);for(let L=0;L<Math.abs(O-M);L++){const I=p(b,w)==="A"?-1:1,F=E.buffer.lines.get(O+I*L);F!=null&&F.isWrapped&&P++}return P}(u,a,n);return m(C,x(p(u,a),l))}function d(u,a){let n=0,l=a.buffer.lines.get(u),_=l==null?void 0:l.isWrapped;for(;_&&u>=0&&u<a.rows;)n++,l=a.buffer.lines.get(--u),_=l==null?void 0:l.isWrapped;return n}function p(u,a){return u>a?"A":"B"}function y(u,a,n,l,_,S){let C=u,b=a,w="";for(;C!==n||b!==l;)C+=_?1:-1,_&&C>S.cols-1?(w+=S.buffer.translateBufferLineToString(b,!1,u,C),C=0,u=0,b++):!_&&C<0&&(w+=S.buffer.translateBufferLineToString(b,!1,0,u+1),C=S.cols-1,u=C,b--);return w+S.buffer.translateBufferLineToString(b,!1,u,C)}function x(u,a){const n=a?"O":"[";return f.C0.ESC+n+u}function m(u,a){u=Math.floor(u);let n="";for(let l=0;l<u;l++)n+=a;return n}o.moveToCellSequence=function(u,a,n,l){const _=n.buffer.x,S=n.buffer.y;if(!n.buffer.hasScrollback)return function(w,E,P,O,M,L){return g(E,O,M,L).length===0?"":m(y(w,E,w,E-d(E,M),!1,M).length,x("D",L))}(_,S,0,a,n,l)+g(S,a,n,l)+function(w,E,P,O,M,L){let I;I=g(E,O,M,L).length>0?O-d(O,M):E;const F=O,H=function(U,N,k,T,A,B){let $;return $=g(k,T,A,B).length>0?T-d(T,A):N,U<k&&$<=T||U>=k&&$<T?"C":"D"}(w,E,P,O,M,L);return m(y(w,I,P,F,H==="C",M).length,x(H,L))}(_,S,u,a,n,l);let C;if(S===a)return C=_>u?"D":"C",m(Math.abs(_-u),x(C,l));C=S>a?"D":"C";const b=Math.abs(S-a);return m(function(w,E){return E.cols-w}(S>a?u:_,n)+(b-1)*n.cols+1+((S>a?_:u)-1),x(C,l))}},1296:function(v,o,c){var f=this&&this.__decorate||function(L,I,F,H){var U,N=arguments.length,k=N<3?I:H===null?H=Object.getOwnPropertyDescriptor(I,F):H;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(L,I,F,H);else for(var T=L.length-1;T>=0;T--)(U=L[T])&&(k=(N<3?U(k):N>3?U(I,F,k):U(I,F))||k);return N>3&&k&&Object.defineProperty(I,F,k),k},g=this&&this.__param||function(L,I){return function(F,H){I(F,H,L)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRenderer=void 0;const d=c(3787),p=c(2550),y=c(2223),x=c(6171),m=c(6052),u=c(4725),a=c(8055),n=c(8460),l=c(844),_=c(2585),S="xterm-dom-renderer-owner-",C="xterm-rows",b="xterm-fg-",w="xterm-bg-",E="xterm-focus",P="xterm-selection";let O=1,M=o.DomRenderer=class extends l.Disposable{constructor(L,I,F,H,U,N,k,T,A,B,$,V,Y){super(),this._terminal=L,this._document=I,this._element=F,this._screenElement=H,this._viewportElement=U,this._helperContainer=N,this._linkifier2=k,this._charSizeService=A,this._optionsService=B,this._bufferService=$,this._coreBrowserService=V,this._themeService=Y,this._terminalClass=O++,this._rowElements=[],this._selectionRenderModel=(0,m.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new n.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(C),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(P),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,x.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(J=>this._injectCss(J))),this._injectCss(this._themeService.colors),this._rowFactory=T.createInstance(d.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(J=>this._handleLinkHover(J))),this.register(this._linkifier2.onHideLinkUnderline(J=>this._handleLinkLeave(J))),this.register((0,l.toDisposable)(()=>{this._element.classList.remove(S+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new p.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const L=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*L,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*L),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/L),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/L),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 F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const I=`${this._terminalSelector} .${C} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=I,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(L){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let I=`${this._terminalSelector} .${C} { color: ${L.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;I+=`${this._terminalSelector} .${C} .xterm-dim { color: ${a.color.multiplyOpacity(L.foreground,.5).css};}`,I+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const F=`blink_underline_${this._terminalClass}`,H=`blink_bar_${this._terminalClass}`,U=`blink_block_${this._terminalClass}`;I+=`@keyframes ${F} { 50% { border-bottom-style: hidden; }}`,I+=`@keyframes ${H} { 50% { box-shadow: none; }}`,I+=`@keyframes ${U} { 0% { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css}; } 50% { background-color: inherit; color: ${L.cursor.css}; }}`,I+=`${this._terminalSelector} .${C}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${C}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${H} 1s step-end infinite;}${this._terminalSelector} .${C}.${E} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block { background-color: ${L.cursor.css}; color: ${L.cursorAccent.css};}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${L.cursor.css} !important; color: ${L.cursorAccent.css} !important;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${L.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${L.cursor.css} inset;}${this._terminalSelector} .${C} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${L.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,I+=`${this._terminalSelector} .${P} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${P} div { position: absolute; background-color: ${L.selectionBackgroundOpaque.css};}${this._terminalSelector} .${P} div { position: absolute; background-color: ${L.selectionInactiveBackgroundOpaque.css};}`;for(const[N,k]of L.ansi.entries())I+=`${this._terminalSelector} .${b}${N} { color: ${k.css}; }${this._terminalSelector} .${b}${N}.xterm-dim { color: ${a.color.multiplyOpacity(k,.5).css}; }${this._terminalSelector} .${w}${N} { background-color: ${k.css}; }`;I+=`${this._terminalSelector} .${b}${y.INVERTED_DEFAULT_COLOR} { color: ${a.color.opaque(L.background).css}; }${this._terminalSelector} .${b}${y.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${a.color.multiplyOpacity(a.color.opaque(L.background),.5).css}; }${this._terminalSelector} .${w}${y.INVERTED_DEFAULT_COLOR} { background-color: ${L.foreground.css}; }`,this._themeStyleElement.textContent=I}_setDefaultSpacing(){const L=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${L}px`,this._rowFactory.defaultSpacing=L}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(L,I){for(let F=this._rowElements.length;F<=I;F++){const H=this._document.createElement("div");this._rowContainer.appendChild(H),this._rowElements.push(H)}for(;this._rowElements.length>I;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(L,I){this._refreshRowElements(L,I),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(E),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(E),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(L,I,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(L,I,F),this.renderRows(0,this._bufferService.rows-1),!L||!I)return;this._selectionRenderModel.update(this._terminal,L,I,F);const H=this._selectionRenderModel.viewportStartRow,U=this._selectionRenderModel.viewportEndRow,N=this._selectionRenderModel.viewportCappedStartRow,k=this._selectionRenderModel.viewportCappedEndRow;if(N>=this._bufferService.rows||k<0)return;const T=this._document.createDocumentFragment();if(F){const A=L[0]>I[0];T.appendChild(this._createSelectionElement(N,A?I[0]:L[0],A?L[0]:I[0],k-N+1))}else{const A=H===N?L[0]:0,B=N===U?I[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(N,A,B));const $=k-N-1;if(T.appendChild(this._createSelectionElement(N+1,0,this._bufferService.cols,$)),N!==k){const V=U===k?I[0]:this._bufferService.cols;T.appendChild(this._createSelectionElement(k,0,V))}}this._selectionContainer.appendChild(T)}_createSelectionElement(L,I,F,H=1){const U=this._document.createElement("div"),N=I*this.dimensions.css.cell.width;let k=this.dimensions.css.cell.width*(F-I);return N+k>this.dimensions.css.canvas.width&&(k=this.dimensions.css.canvas.width-N),U.style.height=H*this.dimensions.css.cell.height+"px",U.style.top=L*this.dimensions.css.cell.height+"px",U.style.left=`${N}px`,U.style.width=`${k}px`,U}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 L of this._rowElements)L.replaceChildren()}renderRows(L,I){const F=this._bufferService.buffer,H=F.ybase+F.y,U=Math.min(F.x,this._bufferService.cols-1),N=this._optionsService.rawOptions.cursorBlink,k=this._optionsService.rawOptions.cursorStyle,T=this._optionsService.rawOptions.cursorInactiveStyle;for(let A=L;A<=I;A++){const B=A+F.ydisp,$=this._rowElements[A],V=F.lines.get(B);if(!$||!V)break;$.replaceChildren(...this._rowFactory.createRow(V,B,B===H,k,T,U,N,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!0)}_handleLinkLeave(L){this._setCellUnderline(L.x1,L.x2,L.y1,L.y2,L.cols,!1)}_setCellUnderline(L,I,F,H,U,N){F<0&&(L=0),H<0&&(I=0);const k=this._bufferService.rows-1;F=Math.max(Math.min(F,k),0),H=Math.max(Math.min(H,k),0),U=Math.min(U,this._bufferService.cols);const T=this._bufferService.buffer,A=T.ybase+T.y,B=Math.min(T.x,U-1),$=this._optionsService.rawOptions.cursorBlink,V=this._optionsService.rawOptions.cursorStyle,Y=this._optionsService.rawOptions.cursorInactiveStyle;for(let J=F;J<=H;++J){const j=J+T.ydisp,D=this._rowElements[J],K=T.lines.get(j);if(!D||!K)break;D.replaceChildren(...this._rowFactory.createRow(K,j,j===A,V,Y,B,$,this.dimensions.css.cell.width,this._widthCache,N?J===F?L:0:-1,N?(J===H?I:U)-1:-1))}}};o.DomRenderer=M=f([g(7,_.IInstantiationService),g(8,u.ICharSizeService),g(9,_.IOptionsService),g(10,_.IBufferService),g(11,u.ICoreBrowserService),g(12,u.IThemeService)],M)},3787:function(v,o,c){var f=this&&this.__decorate||function(C,b,w,E){var P,O=arguments.length,M=O<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,w):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(C,b,w,E);else for(var L=C.length-1;L>=0;L--)(P=C[L])&&(M=(O<3?P(M):O>3?P(b,w,M):P(b,w))||M);return O>3&&M&&Object.defineProperty(b,w,M),M},g=this&&this.__param||function(C,b){return function(w,E){b(w,E,C)}};Object.defineProperty(o,"__esModule",{value:!0}),o.DomRendererRowFactory=void 0;const d=c(2223),p=c(643),y=c(511),x=c(2585),m=c(8055),u=c(4725),a=c(4269),n=c(6171),l=c(3734);let _=o.DomRendererRowFactory=class{constructor(C,b,w,E,P,O,M){this._document=C,this._characterJoinerService=b,this._optionsService=w,this._coreBrowserService=E,this._coreService=P,this._decorationService=O,this._themeService=M,this._workCell=new y.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(C,b,w){this._selectionStart=C,this._selectionEnd=b,this._columnSelectMode=w}createRow(C,b,w,E,P,O,M,L,I,F,H){const U=[],N=this._characterJoinerService.getJoinedCharacters(b),k=this._themeService.colors;let T,A=C.getNoBgTrimmedLength();w&&A<O+1&&(A=O+1);let B=0,$="",V=0,Y=0,J=0,j=!1,D=0,K=!1,z=0;const Q=[],X=F!==-1&&H!==-1;for(let se=0;se<A;se++){C.loadCell(se,this._workCell);let fe=this._workCell.getWidth();if(fe===0)continue;let pe=!1,Ie=se,te=this._workCell;if(N.length>0&&se===N[0][0]){pe=!0;const ye=N.shift();te=new a.JoinedCellData(this._workCell,C.translateToString(!0,ye[0],ye[1]),ye[1]-ye[0]),Ie=ye[1]-1,fe=te.getWidth()}const ar=this._isCellInSelection(se,b),li=w&&se===O,ci=X&&se>=F&&se<=H;let ui=!1;this._decorationService.forEachDecorationAtCell(se,b,void 0,ye=>{ui=!0});let lr=te.getChars()||p.WHITESPACE_CELL_CHAR;if(lr===" "&&(te.isUnderline()||te.isOverline())&&(lr=" "),z=fe*L-I.get(lr,te.isBold(),te.isItalic()),T){if(B&&(ar&&K||!ar&&!K&&te.bg===V)&&(ar&&K&&k.selectionForeground||te.fg===Y)&&te.extended.ext===J&&ci===j&&z===D&&!li&&!pe&&!ui){te.isInvisible()?$+=p.WHITESPACE_CELL_CHAR:$+=lr,B++;continue}B&&(T.textContent=$),T=this._document.createElement("span"),B=0,$=""}else T=this._document.createElement("span");if(V=te.bg,Y=te.fg,J=te.extended.ext,j=ci,D=z,K=ar,pe&&O>=se&&O<=Ie&&(O=se),!this._coreService.isCursorHidden&&li&&this._coreService.isCursorInitialized){if(Q.push("xterm-cursor"),this._coreBrowserService.isFocused)M&&Q.push("xterm-cursor-blink"),Q.push(E==="bar"?"xterm-cursor-bar":E==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(P)switch(P){case"outline":Q.push("xterm-cursor-outline");break;case"block":Q.push("xterm-cursor-block");break;case"bar":Q.push("xterm-cursor-bar");break;case"underline":Q.push("xterm-cursor-underline")}}if(te.isBold()&&Q.push("xterm-bold"),te.isItalic()&&Q.push("xterm-italic"),te.isDim()&&Q.push("xterm-dim"),$=te.isInvisible()?p.WHITESPACE_CELL_CHAR:te.getChars()||p.WHITESPACE_CELL_CHAR,te.isUnderline()&&(Q.push(`xterm-underline-${te.extended.underlineStyle}`),$===" "&&($=" "),!te.isUnderlineColorDefault()))if(te.isUnderlineColorRGB())T.style.textDecorationColor=`rgb(${l.AttributeData.toColorRGB(te.getUnderlineColor()).join(",")})`;else{let ye=te.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&te.isBold()&&ye<8&&(ye+=8),T.style.textDecorationColor=k.ansi[ye].css}te.isOverline()&&(Q.push("xterm-overline"),$===" "&&($=" ")),te.isStrikethrough()&&Q.push("xterm-strikethrough"),ci&&(T.style.textDecoration="underline");let ze=te.getFgColor(),Dr=te.getFgColorMode(),st=te.getBgColor(),W=te.getBgColorMode();const he=!!te.isInverse();if(he){const ye=ze;ze=st,st=ye;const Od=Dr;Dr=W,W=Od}let le,We,Pe,cr=!1;switch(this._decorationService.forEachDecorationAtCell(se,b,void 0,ye=>{ye.options.layer!=="top"&&cr||(ye.backgroundColorRGB&&(W=50331648,st=ye.backgroundColorRGB.rgba>>8&16777215,le=ye.backgroundColorRGB),ye.foregroundColorRGB&&(Dr=50331648,ze=ye.foregroundColorRGB.rgba>>8&16777215,We=ye.foregroundColorRGB),cr=ye.options.layer==="top")}),!cr&&ar&&(le=this._coreBrowserService.isFocused?k.selectionBackgroundOpaque:k.selectionInactiveBackgroundOpaque,st=le.rgba>>8&16777215,W=50331648,cr=!0,k.selectionForeground&&(Dr=50331648,ze=k.selectionForeground.rgba>>8&16777215,We=k.selectionForeground)),cr&&Q.push("xterm-decoration-top"),W){case 16777216:case 33554432:Pe=k.ansi[st],Q.push(`xterm-bg-${st}`);break;case 50331648:Pe=m.channels.toColor(st>>16,st>>8&255,255&st),this._addStyle(T,`background-color:#${S((st>>>0).toString(16),"0",6)}`);break;default:he?(Pe=k.foreground,Q.push(`xterm-bg-${d.INVERTED_DEFAULT_COLOR}`)):Pe=k.background}switch(le||te.isDim()&&(le=m.color.multiplyOpacity(Pe,.5)),Dr){case 16777216:case 33554432:te.isBold()&&ze<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ze+=8),this._applyMinimumContrast(T,Pe,k.ansi[ze],te,le,void 0)||Q.push(`xterm-fg-${ze}`);break;case 50331648:const ye=m.channels.toColor(ze>>16&255,ze>>8&255,255&ze);this._applyMinimumContrast(T,Pe,ye,te,le,We)||this._addStyle(T,`color:#${S(ze.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(T,Pe,k.foreground,te,le,We)||he&&Q.push(`xterm-fg-${d.INVERTED_DEFAULT_COLOR}`)}Q.length&&(T.className=Q.join(" "),Q.length=0),li||pe||ui?T.textContent=$:B++,z!==this.defaultSpacing&&(T.style.letterSpacing=`${z}px`),U.push(T),se=Ie}return T&&B&&(T.textContent=$),U}_applyMinimumContrast(C,b,w,E,P,O){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,n.treatGlyphAsBackgroundColor)(E.getCode()))return!1;const M=this._getContrastCache(E);let L;if(P||O||(L=M.getColor(b.rgba,w.rgba)),L===void 0){const I=this._optionsService.rawOptions.minimumContrastRatio/(E.isDim()?2:1);L=m.color.ensureContrastRatio(P||b,O||w,I),M.setColor((P||b).rgba,(O||w).rgba,L??null)}return!!L&&(this._addStyle(C,`color:${L.css}`),!0)}_getContrastCache(C){return C.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(C,b){C.setAttribute("style",`${C.getAttribute("style")||""}${b};`)}_isCellInSelection(C,b){const w=this._selectionStart,E=this._selectionEnd;return!(!w||!E)&&(this._columnSelectMode?w[0]<=E[0]?C>=w[0]&&b>=w[1]&&C<E[0]&&b<=E[1]:C<w[0]&&b>=w[1]&&C>=E[0]&&b<=E[1]:b>w[1]&&b<E[1]||w[1]===E[1]&&b===w[1]&&C>=w[0]&&C<E[0]||w[1]<E[1]&&b===E[1]&&C<E[0]||w[1]<E[1]&&b===w[1]&&C>=w[0])}};function S(C,b,w){for(;C.length<w;)C=b+C;return C}o.DomRendererRowFactory=_=f([g(1,u.ICharacterJoinerService),g(2,x.IOptionsService),g(3,u.ICoreBrowserService),g(4,x.ICoreService),g(5,x.IDecorationService),g(6,u.IThemeService)],_)},2550:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WidthCache=void 0,o.WidthCache=class{constructor(c,f){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=c.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const g=c.createElement("span");g.classList.add("xterm-char-measure-element");const d=c.createElement("span");d.classList.add("xterm-char-measure-element"),d.style.fontWeight="bold";const p=c.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontStyle="italic";const y=c.createElement("span");y.classList.add("xterm-char-measure-element"),y.style.fontWeight="bold",y.style.fontStyle="italic",this._measureElements=[g,d,p,y],this._container.appendChild(g),this._container.appendChild(d),this._container.appendChild(p),this._container.appendChild(y),f.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(c,f,g,d){c===this._font&&f===this._fontSize&&g===this._weight&&d===this._weightBold||(this._font=c,this._fontSize=f,this._weight=g,this._weightBold=d,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${g}`,this._measureElements[1].style.fontWeight=`${d}`,this._measureElements[2].style.fontWeight=`${g}`,this._measureElements[3].style.fontWeight=`${d}`,this.clear())}get(c,f,g){let d=0;if(!f&&!g&&c.length===1&&(d=c.charCodeAt(0))<256){if(this._flat[d]!==-9999)return this._flat[d];const x=this._measure(c,0);return x>0&&(this._flat[d]=x),x}let p=c;f&&(p+="B"),g&&(p+="I");let y=this._holey.get(p);if(y===void 0){let x=0;f&&(x|=1),g&&(x|=2),y=this._measure(c,x),y>0&&this._holey.set(p,y)}return y}_measure(c,f){const g=this._measureElements[f];return g.textContent=c.repeat(32),g.offsetWidth/32}}},2223:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.TEXT_BASELINE=o.DIM_OPACITY=o.INVERTED_DEFAULT_COLOR=void 0;const f=c(6114);o.INVERTED_DEFAULT_COLOR=257,o.DIM_OPACITY=.5,o.TEXT_BASELINE=f.isFirefox||f.isLegacyEdge?"bottom":"ideographic"},6171:(v,o)=>{function c(g){return 57508<=g&&g<=57558}function f(g){return g>=128512&&g<=128591||g>=127744&&g<=128511||g>=128640&&g<=128767||g>=9728&&g<=9983||g>=9984&&g<=10175||g>=65024&&g<=65039||g>=129280&&g<=129535||g>=127462&&g<=127487}Object.defineProperty(o,"__esModule",{value:!0}),o.computeNextVariantOffset=o.createRenderDimensions=o.treatGlyphAsBackgroundColor=o.allowRescaling=o.isEmoji=o.isRestrictedPowerlineGlyph=o.isPowerlineGlyph=o.throwIfFalsy=void 0,o.throwIfFalsy=function(g){if(!g)throw new Error("value must not be falsy");return g},o.isPowerlineGlyph=c,o.isRestrictedPowerlineGlyph=function(g){return 57520<=g&&g<=57527},o.isEmoji=f,o.allowRescaling=function(g,d,p,y){return d===1&&p>Math.ceil(1.5*y)&&g!==void 0&&g>255&&!f(g)&&!c(g)&&!function(x){return 57344<=x&&x<=63743}(g)},o.treatGlyphAsBackgroundColor=function(g){return c(g)||function(d){return 9472<=d&&d<=9631}(g)},o.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}}}},o.computeNextVariantOffset=function(g,d,p=0){return(g-(2*Math.round(d)-p))%(2*Math.round(d))}},6052:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createSelectionRenderModel=void 0;class c{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(g,d,p,y=!1){if(this.selectionStart=d,this.selectionEnd=p,!d||!p||d[0]===p[0]&&d[1]===p[1])return void this.clear();const x=g.buffers.active.ydisp,m=d[1]-x,u=p[1]-x,a=Math.max(m,0),n=Math.min(u,g.rows-1);a>=g.rows||n<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=y,this.viewportStartRow=m,this.viewportEndRow=u,this.viewportCappedStartRow=a,this.viewportCappedEndRow=n,this.startCol=d[0],this.endCol=p[0])}isCellSelected(g,d,p){return!!this.hasSelection&&(p-=g.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?d>=this.startCol&&p>=this.viewportCappedStartRow&&d<this.endCol&&p<=this.viewportCappedEndRow:d<this.startCol&&p>=this.viewportCappedStartRow&&d>=this.endCol&&p<=this.viewportCappedEndRow:p>this.viewportStartRow&&p<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&p===this.viewportStartRow&&d>=this.startCol&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportEndRow&&d<this.endCol||this.viewportStartRow<this.viewportEndRow&&p===this.viewportStartRow&&d>=this.startCol)}}o.createSelectionRenderModel=function(){return new c}},456:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionModel=void 0,o.SelectionModel=class{constructor(c){this._bufferService=c,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 c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?c%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)-1]:[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[c,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const c=this.selectionStart[0]+this.selectionStartLength;return c>this._bufferService.cols?[c%this._bufferService.cols,this.selectionStart[1]+Math.floor(c/this._bufferService.cols)]:[Math.max(c,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const c=this.selectionStart,f=this.selectionEnd;return!(!c||!f)&&(c[1]>f[1]||c[1]===f[1]&&c[0]>f[0])}handleTrim(c){return this.selectionStart&&(this.selectionStart[1]-=c),this.selectionEnd&&(this.selectionEnd[1]-=c),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(v,o,c){var f=this&&this.__decorate||function(n,l,_,S){var C,b=arguments.length,w=b<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,l,_,S);else for(var E=n.length-1;E>=0;E--)(C=n[E])&&(w=(b<3?C(w):b>3?C(l,_,w):C(l,_))||w);return b>3&&w&&Object.defineProperty(l,_,w),w},g=this&&this.__param||function(n,l){return function(_,S){l(_,S,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharSizeService=void 0;const d=c(2585),p=c(8460),y=c(844);let x=o.CharSizeService=class extends y.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(n,l,_){super(),this._optionsService=_,this.width=0,this.height=0,this._onCharSizeChange=this.register(new p.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new a(this._optionsService))}catch{this._measureStrategy=this.register(new u(n,l,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const n=this._measureStrategy.measure();n.width===this.width&&n.height===this.height||(this.width=n.width,this.height=n.height,this._onCharSizeChange.fire())}};o.CharSizeService=x=f([g(2,d.IOptionsService)],x);class m extends y.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(l,_){l!==void 0&&l>0&&_!==void 0&&_>0&&(this._result.width=l,this._result.height=_)}}class u extends m{constructor(l,_,S){super(),this._document=l,this._parentElement=_,this._optionsService=S,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class a extends m{constructor(l){super(),this._optionsService=l,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const _=this._ctx.measureText("W");if(!("width"in _&&"fontBoundingBoxAscent"in _&&"fontBoundingBoxDescent"in _))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const l=this._ctx.measureText("W");return this._validateAndSet(l.width,l.fontBoundingBoxAscent+l.fontBoundingBoxDescent),this._result}}},4269:function(v,o,c){var f=this&&this.__decorate||function(a,n,l,_){var S,C=arguments.length,b=C<3?n:_===null?_=Object.getOwnPropertyDescriptor(n,l):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")b=Reflect.decorate(a,n,l,_);else for(var w=a.length-1;w>=0;w--)(S=a[w])&&(b=(C<3?S(b):C>3?S(n,l,b):S(n,l))||b);return C>3&&b&&Object.defineProperty(n,l,b),b},g=this&&this.__param||function(a,n){return function(l,_){n(l,_,a)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CharacterJoinerService=o.JoinedCellData=void 0;const d=c(3734),p=c(643),y=c(511),x=c(2585);class m extends d.AttributeData{constructor(n,l,_){super(),this.content=0,this.combinedData="",this.fg=n.fg,this.bg=n.bg,this.combinedData=l,this._width=_}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(n){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.JoinedCellData=m;let u=o.CharacterJoinerService=class pd{constructor(n){this._bufferService=n,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new y.CellData}register(n){const l={id:this._nextCharacterJoinerId++,handler:n};return this._characterJoiners.push(l),l.id}deregister(n){for(let l=0;l<this._characterJoiners.length;l++)if(this._characterJoiners[l].id===n)return this._characterJoiners.splice(l,1),!0;return!1}getJoinedCharacters(n){if(this._characterJoiners.length===0)return[];const l=this._bufferService.buffer.lines.get(n);if(!l||l.length===0)return[];const _=[],S=l.translateToString(!0);let C=0,b=0,w=0,E=l.getFg(0),P=l.getBg(0);for(let O=0;O<l.getTrimmedLength();O++)if(l.loadCell(O,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==E||this._workCell.bg!==P){if(O-C>1){const M=this._getJoinedRanges(S,w,b,l,C);for(let L=0;L<M.length;L++)_.push(M[L])}C=O,w=b,E=this._workCell.fg,P=this._workCell.bg}b+=this._workCell.getChars().length||p.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-C>1){const O=this._getJoinedRanges(S,w,b,l,C);for(let M=0;M<O.length;M++)_.push(O[M])}return _}_getJoinedRanges(n,l,_,S,C){const b=n.substring(l,_);let w=[];try{w=this._characterJoiners[0].handler(b)}catch(E){console.error(E)}for(let E=1;E<this._characterJoiners.length;E++)try{const P=this._characterJoiners[E].handler(b);for(let O=0;O<P.length;O++)pd._mergeRanges(w,P[O])}catch(P){console.error(P)}return this._stringRangesToCellRanges(w,S,C),w}_stringRangesToCellRanges(n,l,_){let S=0,C=!1,b=0,w=n[S];if(w){for(let E=_;E<this._bufferService.cols;E++){const P=l.getWidth(E),O=l.getString(E).length||p.WHITESPACE_CELL_CHAR.length;if(P!==0){if(!C&&w[0]<=b&&(w[0]=E,C=!0),w[1]<=b){if(w[1]=E,w=n[++S],!w)break;w[0]<=b?(w[0]=E,C=!0):C=!1}b+=O}}w&&(w[1]=this._bufferService.cols)}}static _mergeRanges(n,l){let _=!1;for(let S=0;S<n.length;S++){const C=n[S];if(_){if(l[1]<=C[0])return n[S-1][1]=l[1],n;if(l[1]<=C[1])return n[S-1][1]=Math.max(l[1],C[1]),n.splice(S,1),n;n.splice(S,1),S--}else{if(l[1]<=C[0])return n.splice(S,0,l),n;if(l[1]<=C[1])return C[0]=Math.min(l[0],C[0]),n;l[0]<C[1]&&(C[0]=Math.min(l[0],C[0]),_=!0)}}return _?n[n.length-1][1]=l[1]:n.push(l),n}};o.CharacterJoinerService=u=f([g(0,x.IBufferService)],u)},5114:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreBrowserService=void 0;const f=c(844),g=c(8460),d=c(3656);class p extends f.Disposable{constructor(m,u,a){super(),this._textarea=m,this._window=u,this.mainDocument=a,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new y(this._window),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new g.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange(n=>this._screenDprMonitor.setWindow(n))),this.register((0,g.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get window(){return this._window}set window(m){this._window!==m&&(this._window=m,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}o.CoreBrowserService=p;class y extends f.Disposable{constructor(m){super(),this._parentWindow=m,this._windowResizeListener=this.register(new f.MutableDisposable),this._onDprChange=this.register(new g.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,f.toDisposable)(()=>this.clearListener()))}setWindow(m){this._parentWindow=m,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,d.addDisposableDomListener)(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var m;this._outerListener&&((m=this._resolutionMediaMatchList)==null||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._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.LinkProviderService=void 0;const f=c(844);class g extends f.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,f.toDisposable)(()=>this.linkProviders.length=0))}registerLinkProvider(p){return this.linkProviders.push(p),{dispose:()=>{const y=this.linkProviders.indexOf(p);y!==-1&&this.linkProviders.splice(y,1)}}}}o.LinkProviderService=g},8934:function(v,o,c){var f=this&&this.__decorate||function(x,m,u,a){var n,l=arguments.length,_=l<3?m:a===null?a=Object.getOwnPropertyDescriptor(m,u):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(x,m,u,a);else for(var S=x.length-1;S>=0;S--)(n=x[S])&&(_=(l<3?n(_):l>3?n(m,u,_):n(m,u))||_);return l>3&&_&&Object.defineProperty(m,u,_),_},g=this&&this.__param||function(x,m){return function(u,a){m(u,a,x)}};Object.defineProperty(o,"__esModule",{value:!0}),o.MouseService=void 0;const d=c(4725),p=c(9806);let y=o.MouseService=class{constructor(x,m){this._renderService=x,this._charSizeService=m}getCoords(x,m,u,a,n){return(0,p.getCoords)(window,x,m,u,a,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,n)}getMouseReportCoords(x,m){const u=(0,p.getCoordsRelativeToElement)(window,x,m);if(this._charSizeService.hasValidSize)return u[0]=Math.min(Math.max(u[0],0),this._renderService.dimensions.css.canvas.width-1),u[1]=Math.min(Math.max(u[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(u[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(u[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(u[0]),y:Math.floor(u[1])}}};o.MouseService=y=f([g(0,d.IRenderService),g(1,d.ICharSizeService)],y)},3230:function(v,o,c){var f=this&&this.__decorate||function(n,l,_,S){var C,b=arguments.length,w=b<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,l,_,S);else for(var E=n.length-1;E>=0;E--)(C=n[E])&&(w=(b<3?C(w):b>3?C(l,_,w):C(l,_))||w);return b>3&&w&&Object.defineProperty(l,_,w),w},g=this&&this.__param||function(n,l){return function(_,S){l(_,S,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.RenderService=void 0;const d=c(6193),p=c(4725),y=c(8460),x=c(844),m=c(7226),u=c(2585);let a=o.RenderService=class extends x.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(n,l,_,S,C,b,w,E){super(),this._rowCount=n,this._charSizeService=S,this._renderer=this.register(new x.MutableDisposable),this._pausedResizeTask=new m.DebouncedIdleTask,this._observerDisposable=this.register(new x.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new y.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new y.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new y.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new d.RenderDebouncer((P,O)=>this._renderRows(P,O),w),this.register(this._renderDebouncer),this.register(w.onDprChange(()=>this.handleDevicePixelRatioChange())),this.register(b.onResize(()=>this._fullRefresh())),this.register(b.buffers.onBufferActivate(()=>{var P;return(P=this._renderer.value)==null?void 0:P.clear()})),this.register(_.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(C.onDecorationRegistered(()=>this._fullRefresh())),this.register(C.onDecorationRemoved(()=>this._fullRefresh())),this.register(_.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(b.cols,b.rows),this._fullRefresh()})),this.register(_.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(b.buffer.y,b.buffer.y,!0))),this.register(E.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(w.window,l),this.register(w.onWindowChange(P=>this._registerIntersectionObserver(P,l)))}_registerIntersectionObserver(n,l){if("IntersectionObserver"in n){const _=new n.IntersectionObserver(S=>this._handleIntersectionChange(S[S.length-1]),{threshold:0});_.observe(l),this._observerDisposable.value=(0,x.toDisposable)(()=>_.disconnect())}}_handleIntersectionChange(n){this._isPaused=n.isIntersecting===void 0?n.intersectionRatio===0:!n.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(n,l,_=!1){this._isPaused?this._needsFullRefresh=!0:(_||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(n,l,this._rowCount))}_renderRows(n,l){this._renderer.value&&(n=Math.min(n,this._rowCount-1),l=Math.min(l,this._rowCount-1),this._renderer.value.renderRows(n,l),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:n,end:l}),this._onRender.fire({start:n,end:l}),this._isNextRenderRedrawOnly=!0)}resize(n,l){this._rowCount=l,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(n){this._renderer.value=n,this._renderer.value&&(this._renderer.value.onRequestRedraw(l=>this.refreshRows(l.start,l.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(n){return this._renderDebouncer.addRefreshCallback(n)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var n,l;this._renderer.value&&((l=(n=this._renderer.value).clearTextureAtlas)==null||l.call(n),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(n,l){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>{var _;return(_=this._renderer.value)==null?void 0:_.handleResize(n,l)}):this._renderer.value.handleResize(n,l),this._fullRefresh())}handleCharSizeChanged(){var n;(n=this._renderer.value)==null||n.handleCharSizeChanged()}handleBlur(){var n;(n=this._renderer.value)==null||n.handleBlur()}handleFocus(){var n;(n=this._renderer.value)==null||n.handleFocus()}handleSelectionChanged(n,l,_){var S;this._selectionState.start=n,this._selectionState.end=l,this._selectionState.columnSelectMode=_,(S=this._renderer.value)==null||S.handleSelectionChanged(n,l,_)}handleCursorMove(){var n;(n=this._renderer.value)==null||n.handleCursorMove()}clear(){var n;(n=this._renderer.value)==null||n.clear()}};o.RenderService=a=f([g(2,u.IOptionsService),g(3,p.ICharSizeService),g(4,u.IDecorationService),g(5,u.IBufferService),g(6,p.ICoreBrowserService),g(7,p.IThemeService)],a)},9312:function(v,o,c){var f=this&&this.__decorate||function(w,E,P,O){var M,L=arguments.length,I=L<3?E:O===null?O=Object.getOwnPropertyDescriptor(E,P):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(w,E,P,O);else for(var F=w.length-1;F>=0;F--)(M=w[F])&&(I=(L<3?M(I):L>3?M(E,P,I):M(E,P))||I);return L>3&&I&&Object.defineProperty(E,P,I),I},g=this&&this.__param||function(w,E){return function(P,O){E(P,O,w)}};Object.defineProperty(o,"__esModule",{value:!0}),o.SelectionService=void 0;const d=c(9806),p=c(9504),y=c(456),x=c(4725),m=c(8460),u=c(844),a=c(6114),n=c(4841),l=c(511),_=c(2585),S=" ",C=new RegExp(S,"g");let b=o.SelectionService=class extends u.Disposable{constructor(w,E,P,O,M,L,I,F,H){super(),this._element=w,this._screenElement=E,this._linkifier=P,this._bufferService=O,this._coreService=M,this._mouseService=L,this._optionsService=I,this._renderService=F,this._coreBrowserService=H,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new l.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new m.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new m.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new m.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=U=>this._handleMouseMove(U),this._mouseUpListener=U=>this._handleMouseUp(U),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(U=>this._handleTrim(U)),this.register(this._bufferService.buffers.onBufferActivate(U=>this._handleBufferActivate(U))),this.enable(),this._model=new y.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,u.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 w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!w||!E||w[0]===E[0]&&w[1]===E[1])}get selectionText(){const w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;if(!w||!E)return"";const P=this._bufferService.buffer,O=[];if(this._activeSelectionMode===3){if(w[0]===E[0])return"";const M=w[0]<E[0]?w[0]:E[0],L=w[0]<E[0]?E[0]:w[0];for(let I=w[1];I<=E[1];I++){const F=P.translateBufferLineToString(I,!0,M,L);O.push(F)}}else{const M=w[1]===E[1]?E[0]:void 0;O.push(P.translateBufferLineToString(w[1],!0,w[0],M));for(let L=w[1]+1;L<=E[1]-1;L++){const I=P.lines.get(L),F=P.translateBufferLineToString(L,!0);I!=null&&I.isWrapped?O[O.length-1]+=F:O.push(F)}if(w[1]!==E[1]){const L=P.lines.get(E[1]),I=P.translateBufferLineToString(E[1],!0,0,E[0]);L&&L.isWrapped?O[O.length-1]+=I:O.push(I)}}return O.map(M=>M.replace(C," ")).join(a.isWindows?`\r
|
|
61
|
+
`:`
|
|
62
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),a.isLinux&&w&&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(w){const E=this._getMouseBufferCoords(w),P=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!!(P&&O&&E)&&this._areCoordsInSelection(E,P,O)}isCellInSelection(w,E){const P=this._model.finalSelectionStart,O=this._model.finalSelectionEnd;return!(!P||!O)&&this._areCoordsInSelection([w,E],P,O)}_areCoordsInSelection(w,E,P){return w[1]>E[1]&&w[1]<P[1]||E[1]===P[1]&&w[1]===E[1]&&w[0]>=E[0]&&w[0]<P[0]||E[1]<P[1]&&w[1]===P[1]&&w[0]<P[0]||E[1]<P[1]&&w[1]===E[1]&&w[0]>=E[0]}_selectWordAtCursor(w,E){var M,L;const P=(L=(M=this._linkifier.currentLink)==null?void 0:M.link)==null?void 0:L.range;if(P)return this._model.selectionStart=[P.start.x-1,P.start.y-1],this._model.selectionStartLength=(0,n.getRangeLength)(P,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const O=this._getMouseBufferCoords(w);return!!O&&(this._selectWordAt(O,E),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,E){this._model.clearSelection(),w=Math.max(w,0),E=Math.min(E,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,E],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const E=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(E)return E[0]--,E[1]--,E[1]+=this._bufferService.buffer.ydisp,E}_getMouseEventScrollAmount(w){let E=(0,d.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const P=this._renderService.dimensions.css.canvas.height;return E>=0&&E<=P?0:(E>P&&(E-=P),E=Math.min(Math.max(E,-50),50),E/=50,E/Math.abs(E)+Math.round(14*E))}shouldForceSelection(w){return a.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),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(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const E=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);E&&E.length!==this._model.selectionStart[0]&&E.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const E=this._getMouseBufferCoords(w);E&&(this._activeSelectionMode=2,this._selectLineAt(E[1]))}shouldColumnSelect(w){return w.altKey&&!(a.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const E=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!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(w),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const P=this._bufferService.buffer;if(this._model.selectionEnd[1]<P.lines.length){const O=P.lines.get(this._model.selectionEnd[1]);O&&O.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}E&&E[0]===this._model.selectionEnd[0]&&E[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 w=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const E=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&E<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const P=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(P&&P[0]!==void 0&&P[1]!==void 0){const O=(0,p.moveToCellSequence)(P[0]-1,P[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(O,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,E=this._model.finalSelectionEnd,P=!(!w||!E||w[0]===E[0]&&w[1]===E[1]);P?w&&E&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&E[0]===this._oldSelectionEnd[0]&&E[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,E,P)):this._oldHasSelection&&this._fireOnSelectionChange(w,E,P)}_fireOnSelectionChange(w,E,P){this._oldSelectionStart=w,this._oldSelectionEnd=E,this._oldHasSelection=P,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim(E=>this._handleTrim(E))}_convertViewportColToCharacterIndex(w,E){let P=E;for(let O=0;E>=O;O++){const M=w.loadCell(O,this._workCell).getChars().length;this._workCell.getWidth()===0?P--:M>1&&E!==O&&(P+=M-1)}return P}setSelection(w,E,P){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,E],this._model.selectionStartLength=P,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,E,P=!0,O=!0){if(w[0]>=this._bufferService.cols)return;const M=this._bufferService.buffer,L=M.lines.get(w[1]);if(!L)return;const I=M.translateBufferLineToString(w[1],!1);let F=this._convertViewportColToCharacterIndex(L,w[0]),H=F;const U=w[0]-F;let N=0,k=0,T=0,A=0;if(I.charAt(F)===" "){for(;F>0&&I.charAt(F-1)===" ";)F--;for(;H<I.length&&I.charAt(H+1)===" ";)H++}else{let V=w[0],Y=w[0];L.getWidth(V)===0&&(N++,V--),L.getWidth(Y)===2&&(k++,Y++);const J=L.getString(Y).length;for(J>1&&(A+=J-1,H+=J-1);V>0&&F>0&&!this._isCharWordSeparator(L.loadCell(V-1,this._workCell));){L.loadCell(V-1,this._workCell);const j=this._workCell.getChars().length;this._workCell.getWidth()===0?(N++,V--):j>1&&(T+=j-1,F-=j-1),F--,V--}for(;Y<L.length&&H+1<I.length&&!this._isCharWordSeparator(L.loadCell(Y+1,this._workCell));){L.loadCell(Y+1,this._workCell);const j=this._workCell.getChars().length;this._workCell.getWidth()===2?(k++,Y++):j>1&&(A+=j-1,H+=j-1),H++,Y++}}H++;let B=F+U-N+T,$=Math.min(this._bufferService.cols,H-F+N+k-T-A);if(E||I.slice(F,H).trim()!==""){if(P&&B===0&&L.getCodePoint(0)!==32){const V=M.lines.get(w[1]-1);if(V&&L.isWrapped&&V.getCodePoint(this._bufferService.cols-1)!==32){const Y=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(Y){const J=this._bufferService.cols-Y.start;B-=J,$+=J}}}if(O&&B+$===this._bufferService.cols&&L.getCodePoint(this._bufferService.cols-1)!==32){const V=M.lines.get(w[1]+1);if(V!=null&&V.isWrapped&&V.getCodePoint(0)!==32){const Y=this._getWordAt([0,w[1]+1],!1,!1,!0);Y&&($+=Y.length)}}return{start:B,length:$}}}_selectWordAt(w,E){const P=this._getWordAt(w,E);if(P){for(;P.start<0;)P.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[P.start,w[1]],this._model.selectionStartLength=P.length}}_selectToWordAt(w){const E=this._getWordAt(w,!0);if(E){let P=w[1];for(;E.start<0;)E.start+=this._bufferService.cols,P--;if(!this._model.areSelectionValuesReversed())for(;E.start+E.length>this._bufferService.cols;)E.length-=this._bufferService.cols,P++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?E.start:E.start+E.length,P]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const E=this._bufferService.buffer.getWrappedRangeForLine(w),P={start:{x:0,y:E.first},end:{x:this._bufferService.cols-1,y:E.last}};this._model.selectionStart=[0,E.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,n.getRangeLength)(P,this._bufferService.cols)}};o.SelectionService=b=f([g(3,_.IBufferService),g(4,_.ICoreService),g(5,x.IMouseService),g(6,_.IOptionsService),g(7,x.IRenderService),g(8,x.ICoreBrowserService)],b)},4725:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ILinkProviderService=o.IThemeService=o.ICharacterJoinerService=o.ISelectionService=o.IRenderService=o.IMouseService=o.ICoreBrowserService=o.ICharSizeService=void 0;const f=c(8343);o.ICharSizeService=(0,f.createDecorator)("CharSizeService"),o.ICoreBrowserService=(0,f.createDecorator)("CoreBrowserService"),o.IMouseService=(0,f.createDecorator)("MouseService"),o.IRenderService=(0,f.createDecorator)("RenderService"),o.ISelectionService=(0,f.createDecorator)("SelectionService"),o.ICharacterJoinerService=(0,f.createDecorator)("CharacterJoinerService"),o.IThemeService=(0,f.createDecorator)("ThemeService"),o.ILinkProviderService=(0,f.createDecorator)("LinkProviderService")},6731:function(v,o,c){var f=this&&this.__decorate||function(b,w,E,P){var O,M=arguments.length,L=M<3?w:P===null?P=Object.getOwnPropertyDescriptor(w,E):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(b,w,E,P);else for(var I=b.length-1;I>=0;I--)(O=b[I])&&(L=(M<3?O(L):M>3?O(w,E,L):O(w,E))||L);return M>3&&L&&Object.defineProperty(w,E,L),L},g=this&&this.__param||function(b,w){return function(E,P){w(E,P,b)}};Object.defineProperty(o,"__esModule",{value:!0}),o.ThemeService=o.DEFAULT_ANSI_COLORS=void 0;const d=c(7239),p=c(8055),y=c(8460),x=c(844),m=c(2585),u=p.css.toColor("#ffffff"),a=p.css.toColor("#000000"),n=p.css.toColor("#ffffff"),l=p.css.toColor("#000000"),_={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};o.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const b=[p.css.toColor("#2e3436"),p.css.toColor("#cc0000"),p.css.toColor("#4e9a06"),p.css.toColor("#c4a000"),p.css.toColor("#3465a4"),p.css.toColor("#75507b"),p.css.toColor("#06989a"),p.css.toColor("#d3d7cf"),p.css.toColor("#555753"),p.css.toColor("#ef2929"),p.css.toColor("#8ae234"),p.css.toColor("#fce94f"),p.css.toColor("#729fcf"),p.css.toColor("#ad7fa8"),p.css.toColor("#34e2e2"),p.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let E=0;E<216;E++){const P=w[E/36%6|0],O=w[E/6%6|0],M=w[E%6];b.push({css:p.channels.toCss(P,O,M),rgba:p.channels.toRgba(P,O,M)})}for(let E=0;E<24;E++){const P=8+10*E;b.push({css:p.channels.toCss(P,P,P),rgba:p.channels.toRgba(P,P,P)})}return b})());let S=o.ThemeService=class extends x.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 y.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:u,background:a,cursor:n,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:_,selectionBackgroundOpaque:p.color.blend(a,_),selectionInactiveBackgroundTransparent:_,selectionInactiveBackgroundOpaque:p.color.blend(a,_),ansi:o.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 w=this._colors;if(w.foreground=C(b.foreground,u),w.background=C(b.background,a),w.cursor=C(b.cursor,n),w.cursorAccent=C(b.cursorAccent,l),w.selectionBackgroundTransparent=C(b.selectionBackground,_),w.selectionBackgroundOpaque=p.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=C(b.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=p.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=b.selectionForeground?C(b.selectionForeground,p.NULL_COLOR):void 0,w.selectionForeground===p.NULL_COLOR&&(w.selectionForeground=void 0),p.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=p.color.opacity(w.selectionBackgroundTransparent,.3)),p.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=p.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=o.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=C(b.black,o.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=C(b.red,o.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=C(b.green,o.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=C(b.yellow,o.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=C(b.blue,o.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=C(b.magenta,o.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=C(b.cyan,o.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=C(b.white,o.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=C(b.brightBlack,o.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=C(b.brightRed,o.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=C(b.brightGreen,o.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=C(b.brightYellow,o.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=C(b.brightBlue,o.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=C(b.brightMagenta,o.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=C(b.brightCyan,o.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=C(b.brightWhite,o.DEFAULT_ANSI_COLORS[15]),b.extendedAnsi){const E=Math.min(w.ansi.length-16,b.extendedAnsi.length);for(let P=0;P<E;P++)w.ansi[P+16]=C(b.extendedAnsi[P],o.DEFAULT_ANSI_COLORS[P+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 w=0;w<this._restoreColors.ansi.length;++w)this._colors.ansi[w]=this._restoreColors.ansi[w]}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 C(b,w){if(b!==void 0)try{return p.css.toColor(b)}catch{}return w}o.ThemeService=S=f([g(0,m.IOptionsService)],S)},6349:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CircularList=void 0;const f=c(8460),g=c(844);class d extends g.Disposable{constructor(y){super(),this._maxLength=y,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(y){if(this._maxLength===y)return;const x=new Array(y);for(let m=0;m<Math.min(y,this.length);m++)x[m]=this._array[this._getCyclicIndex(m)];this._array=x,this._maxLength=y,this._startIndex=0}get length(){return this._length}set length(y){if(y>this._length)for(let x=this._length;x<y;x++)this._array[x]=void 0;this._length=y}get(y){return this._array[this._getCyclicIndex(y)]}set(y,x){this._array[this._getCyclicIndex(y)]=x}push(y){this._array[this._getCyclicIndex(this._length)]=y,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(y,x,...m){if(x){for(let u=y;u<this._length-x;u++)this._array[this._getCyclicIndex(u)]=this._array[this._getCyclicIndex(u+x)];this._length-=x,this.onDeleteEmitter.fire({index:y,amount:x})}for(let u=this._length-1;u>=y;u--)this._array[this._getCyclicIndex(u+m.length)]=this._array[this._getCyclicIndex(u)];for(let u=0;u<m.length;u++)this._array[this._getCyclicIndex(y+u)]=m[u];if(m.length&&this.onInsertEmitter.fire({index:y,amount:m.length}),this._length+m.length>this._maxLength){const u=this._length+m.length-this._maxLength;this._startIndex+=u,this._length=this._maxLength,this.onTrimEmitter.fire(u)}else this._length+=m.length}trimStart(y){y>this._length&&(y=this._length),this._startIndex+=y,this._length-=y,this.onTrimEmitter.fire(y)}shiftElements(y,x,m){if(!(x<=0)){if(y<0||y>=this._length)throw new Error("start argument out of range");if(y+m<0)throw new Error("Cannot shift elements in list beyond index 0");if(m>0){for(let a=x-1;a>=0;a--)this.set(y+a+m,this.get(y+a));const u=y+x+m-this._length;if(u>0)for(this._length+=u;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let u=0;u<x;u++)this.set(y+u+m,this.get(y+u))}}_getCyclicIndex(y){return(this._startIndex+y)%this._maxLength}}o.CircularList=d},1439:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.clone=void 0,o.clone=function c(f,g=5){if(typeof f!="object")return f;const d=Array.isArray(f)?[]:{};for(const p in f)d[p]=g<=1?f[p]:f[p]&&c(f[p],g-1);return d}},8055:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.contrastRatio=o.toPaddedHex=o.rgba=o.rgb=o.css=o.color=o.channels=o.NULL_COLOR=void 0;let c=0,f=0,g=0,d=0;var p,y,x,m,u;function a(l){const _=l.toString(16);return _.length<2?"0"+_:_}function n(l,_){return l<_?(_+.05)/(l+.05):(l+.05)/(_+.05)}o.NULL_COLOR={css:"#00000000",rgba:0},function(l){l.toCss=function(_,S,C,b){return b!==void 0?`#${a(_)}${a(S)}${a(C)}${a(b)}`:`#${a(_)}${a(S)}${a(C)}`},l.toRgba=function(_,S,C,b=255){return(_<<24|S<<16|C<<8|b)>>>0},l.toColor=function(_,S,C,b){return{css:l.toCss(_,S,C,b),rgba:l.toRgba(_,S,C,b)}}}(p||(o.channels=p={})),function(l){function _(S,C){return d=Math.round(255*C),[c,f,g]=u.toChannels(S.rgba),{css:p.toCss(c,f,g,d),rgba:p.toRgba(c,f,g,d)}}l.blend=function(S,C){if(d=(255&C.rgba)/255,d===1)return{css:C.css,rgba:C.rgba};const b=C.rgba>>24&255,w=C.rgba>>16&255,E=C.rgba>>8&255,P=S.rgba>>24&255,O=S.rgba>>16&255,M=S.rgba>>8&255;return c=P+Math.round((b-P)*d),f=O+Math.round((w-O)*d),g=M+Math.round((E-M)*d),{css:p.toCss(c,f,g),rgba:p.toRgba(c,f,g)}},l.isOpaque=function(S){return(255&S.rgba)==255},l.ensureContrastRatio=function(S,C,b){const w=u.ensureContrastRatio(S.rgba,C.rgba,b);if(w)return p.toColor(w>>24&255,w>>16&255,w>>8&255)},l.opaque=function(S){const C=(255|S.rgba)>>>0;return[c,f,g]=u.toChannels(C),{css:p.toCss(c,f,g),rgba:C}},l.opacity=_,l.multiplyOpacity=function(S,C){return d=255&S.rgba,_(S,d*C/255)},l.toColorRGB=function(S){return[S.rgba>>24&255,S.rgba>>16&255,S.rgba>>8&255]}}(y||(o.color=y={})),function(l){let _,S;try{const C=document.createElement("canvas");C.width=1,C.height=1;const b=C.getContext("2d",{willReadFrequently:!0});b&&(_=b,_.globalCompositeOperation="copy",S=_.createLinearGradient(0,0,1,1))}catch{}l.toColor=function(C){if(C.match(/#[\da-f]{3,8}/i))switch(C.length){case 4:return c=parseInt(C.slice(1,2).repeat(2),16),f=parseInt(C.slice(2,3).repeat(2),16),g=parseInt(C.slice(3,4).repeat(2),16),p.toColor(c,f,g);case 5:return c=parseInt(C.slice(1,2).repeat(2),16),f=parseInt(C.slice(2,3).repeat(2),16),g=parseInt(C.slice(3,4).repeat(2),16),d=parseInt(C.slice(4,5).repeat(2),16),p.toColor(c,f,g,d);case 7:return{css:C,rgba:(parseInt(C.slice(1),16)<<8|255)>>>0};case 9:return{css:C,rgba:parseInt(C.slice(1),16)>>>0}}const b=C.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(b)return c=parseInt(b[1]),f=parseInt(b[2]),g=parseInt(b[3]),d=Math.round(255*(b[5]===void 0?1:parseFloat(b[5]))),p.toColor(c,f,g,d);if(!_||!S)throw new Error("css.toColor: Unsupported css format");if(_.fillStyle=S,_.fillStyle=C,typeof _.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(_.fillRect(0,0,1,1),[c,f,g,d]=_.getImageData(0,0,1,1).data,d!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:p.toRgba(c,f,g,d),css:C}}}(x||(o.css=x={})),function(l){function _(S,C,b){const w=S/255,E=C/255,P=b/255;return .2126*(w<=.03928?w/12.92:Math.pow((w+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(P<=.03928?P/12.92:Math.pow((P+.055)/1.055,2.4))}l.relativeLuminance=function(S){return _(S>>16&255,S>>8&255,255&S)},l.relativeLuminance2=_}(m||(o.rgb=m={})),function(l){function _(C,b,w){const E=C>>24&255,P=C>>16&255,O=C>>8&255;let M=b>>24&255,L=b>>16&255,I=b>>8&255,F=n(m.relativeLuminance2(M,L,I),m.relativeLuminance2(E,P,O));for(;F<w&&(M>0||L>0||I>0);)M-=Math.max(0,Math.ceil(.1*M)),L-=Math.max(0,Math.ceil(.1*L)),I-=Math.max(0,Math.ceil(.1*I)),F=n(m.relativeLuminance2(M,L,I),m.relativeLuminance2(E,P,O));return(M<<24|L<<16|I<<8|255)>>>0}function S(C,b,w){const E=C>>24&255,P=C>>16&255,O=C>>8&255;let M=b>>24&255,L=b>>16&255,I=b>>8&255,F=n(m.relativeLuminance2(M,L,I),m.relativeLuminance2(E,P,O));for(;F<w&&(M<255||L<255||I<255);)M=Math.min(255,M+Math.ceil(.1*(255-M))),L=Math.min(255,L+Math.ceil(.1*(255-L))),I=Math.min(255,I+Math.ceil(.1*(255-I))),F=n(m.relativeLuminance2(M,L,I),m.relativeLuminance2(E,P,O));return(M<<24|L<<16|I<<8|255)>>>0}l.blend=function(C,b){if(d=(255&b)/255,d===1)return b;const w=b>>24&255,E=b>>16&255,P=b>>8&255,O=C>>24&255,M=C>>16&255,L=C>>8&255;return c=O+Math.round((w-O)*d),f=M+Math.round((E-M)*d),g=L+Math.round((P-L)*d),p.toRgba(c,f,g)},l.ensureContrastRatio=function(C,b,w){const E=m.relativeLuminance(C>>8),P=m.relativeLuminance(b>>8);if(n(E,P)<w){if(P<E){const L=_(C,b,w),I=n(E,m.relativeLuminance(L>>8));if(I<w){const F=S(C,b,w);return I>n(E,m.relativeLuminance(F>>8))?L:F}return L}const O=S(C,b,w),M=n(E,m.relativeLuminance(O>>8));if(M<w){const L=_(C,b,w);return M>n(E,m.relativeLuminance(L>>8))?O:L}return O}},l.reduceLuminance=_,l.increaseLuminance=S,l.toChannels=function(C){return[C>>24&255,C>>16&255,C>>8&255,255&C]}}(u||(o.rgba=u={})),o.toPaddedHex=a,o.contrastRatio=n},8969:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CoreTerminal=void 0;const f=c(844),g=c(2585),d=c(4348),p=c(7866),y=c(744),x=c(7302),m=c(6975),u=c(8460),a=c(1753),n=c(1480),l=c(7994),_=c(9282),S=c(5435),C=c(5981),b=c(2660);let w=!1;class E extends f.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new u.EventEmitter),this._onScroll.event(O=>{var M;(M=this._onScrollApi)==null||M.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 M in O)this.optionsService.options[M]=O[M]}constructor(O){super(),this._windowsWrappingHeuristics=this.register(new f.MutableDisposable),this._onBinary=this.register(new u.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new u.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new u.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new u.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new u.EventEmitter),this._instantiationService=new d.InstantiationService,this.optionsService=this.register(new x.OptionsService(O)),this._instantiationService.setService(g.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(y.BufferService)),this._instantiationService.setService(g.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(p.LogService)),this._instantiationService.setService(g.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(m.CoreService)),this._instantiationService.setService(g.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(a.CoreMouseService)),this._instantiationService.setService(g.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(n.UnicodeService)),this._instantiationService.setService(g.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(l.CharsetService),this._instantiationService.setService(g.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(b.OscLinkService),this._instantiationService.setService(g.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new S.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,u.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,u.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,u.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,u.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(M=>{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(M=>{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 C.WriteBuffer((M,L)=>this._inputHandler.parse(M,L))),this.register((0,u.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(O,M){this._writeBuffer.write(O,M)}writeSync(O,M){this._logService.logLevel<=g.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(O,M)}input(O,M=!0){this.coreService.triggerDataEvent(O,M)}resize(O,M){isNaN(O)||isNaN(M)||(O=Math.max(O,y.MINIMUM_COLS),M=Math.max(M,y.MINIMUM_ROWS),this._bufferService.resize(O,M))}scroll(O,M=!1){this._bufferService.scroll(O,M)}scrollLines(O,M,L){this._bufferService.scrollLines(O,M,L)}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 M=O-this._bufferService.buffer.ydisp;M!==0&&this.scrollLines(M)}registerEscHandler(O,M){return this._inputHandler.registerEscHandler(O,M)}registerDcsHandler(O,M){return this._inputHandler.registerDcsHandler(O,M)}registerCsiHandler(O,M){return this._inputHandler.registerCsiHandler(O,M)}registerOscHandler(O,M){return this._inputHandler.registerOscHandler(O,M)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let O=!1;const M=this.optionsService.rawOptions.windowsPty;M&&M.buildNumber!==void 0&&M.buildNumber!==void 0?O=M.backend==="conpty"&&M.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(_.updateWindowsModeWrappedState.bind(null,this._bufferService))),O.push(this.registerCsiHandler({final:"H"},()=>((0,_.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,f.toDisposable)(()=>{for(const M of O)M.dispose()})}}}o.CoreTerminal=E},8460:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.runAndSubscribe=o.forwardEvent=o.EventEmitter=void 0,o.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=c=>(this._listeners.push(c),{dispose:()=>{if(!this._disposed){for(let f=0;f<this._listeners.length;f++)if(this._listeners[f]===c)return void this._listeners.splice(f,1)}}})),this._event}fire(c,f){const g=[];for(let d=0;d<this._listeners.length;d++)g.push(this._listeners[d]);for(let d=0;d<g.length;d++)g[d].call(void 0,c,f)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},o.forwardEvent=function(c,f){return c(g=>f.fire(g))},o.runAndSubscribe=function(c,f){return f(void 0),c(g=>f(g))}},5435:function(v,o,c){var f=this&&this.__decorate||function(N,k,T,A){var B,$=arguments.length,V=$<3?k:A===null?A=Object.getOwnPropertyDescriptor(k,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(N,k,T,A);else for(var Y=N.length-1;Y>=0;Y--)(B=N[Y])&&(V=($<3?B(V):$>3?B(k,T,V):B(k,T))||V);return $>3&&V&&Object.defineProperty(k,T,V),V},g=this&&this.__param||function(N,k){return function(T,A){k(T,A,N)}};Object.defineProperty(o,"__esModule",{value:!0}),o.InputHandler=o.WindowsOptionsReportType=void 0;const d=c(2584),p=c(7116),y=c(2015),x=c(844),m=c(482),u=c(8437),a=c(8460),n=c(643),l=c(511),_=c(3734),S=c(2585),C=c(1480),b=c(6242),w=c(6351),E=c(5941),P={"(":0,")":1,"*":2,"+":3,"-":1,".":2},O=131072;function M(N,k){if(N>24)return k.setWinLines||!1;switch(N){case 1:return!!k.restoreWin;case 2:return!!k.minimizeWin;case 3:return!!k.setWinPosition;case 4:return!!k.setWinSizePixels;case 5:return!!k.raiseWin;case 6:return!!k.lowerWin;case 7:return!!k.refreshWin;case 8:return!!k.setWinSizeChars;case 9:return!!k.maximizeWin;case 10:return!!k.fullscreenWin;case 11:return!!k.getWinState;case 13:return!!k.getWinPosition;case 14:return!!k.getWinSizePixels;case 15:return!!k.getScreenSizePixels;case 16:return!!k.getCellSizePixels;case 18:return!!k.getWinSizeChars;case 19:return!!k.getScreenSizeChars;case 20:return!!k.getIconTitle;case 21:return!!k.getWinTitle;case 22:return!!k.pushTitle;case 23:return!!k.popTitle;case 24:return!!k.setWinLines}return!1}var L;(function(N){N[N.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",N[N.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(L||(o.WindowsOptionsReportType=L={}));let I=0;class F extends x.Disposable{getAttrData(){return this._curAttrData}constructor(k,T,A,B,$,V,Y,J,j=new y.EscapeSequenceParser){super(),this._bufferService=k,this._charsetService=T,this._coreService=A,this._logService=B,this._optionsService=$,this._oscLinkService=V,this._coreMouseService=Y,this._unicodeService=J,this._parser=j,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new m.StringToUtf32,this._utf8Decoder=new m.Utf8ToUtf32,this._workCell=new l.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new a.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new a.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new a.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new a.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new a.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new a.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new a.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new a.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new a.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new a.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new a.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new a.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new H(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(D=>this._activeBuffer=D.activeBuffer)),this._parser.setCsiHandlerFallback((D,K)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(D),params:K.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,K,z)=>{this._logService.debug("Unknown OSC code: ",{identifier:D,action:K,data:z})}),this._parser.setDcsHandlerFallback((D,K,z)=>{K==="HOOK"&&(z=z.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(D),action:K,payload:z})}),this._parser.setPrintHandler((D,K,z)=>this.print(D,K,z)),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 b.OscHandler(D=>(this.setTitle(D),this.setIconName(D),!0))),this._parser.registerOscHandler(1,new b.OscHandler(D=>this.setIconName(D))),this._parser.registerOscHandler(2,new b.OscHandler(D=>this.setTitle(D))),this._parser.registerOscHandler(4,new b.OscHandler(D=>this.setOrReportIndexedColor(D))),this._parser.registerOscHandler(8,new b.OscHandler(D=>this.setHyperlink(D))),this._parser.registerOscHandler(10,new b.OscHandler(D=>this.setOrReportFgColor(D))),this._parser.registerOscHandler(11,new b.OscHandler(D=>this.setOrReportBgColor(D))),this._parser.registerOscHandler(12,new b.OscHandler(D=>this.setOrReportCursorColor(D))),this._parser.registerOscHandler(104,new b.OscHandler(D=>this.restoreIndexedColor(D))),this._parser.registerOscHandler(110,new b.OscHandler(D=>this.restoreFgColor(D))),this._parser.registerOscHandler(111,new b.OscHandler(D=>this.restoreBgColor(D))),this._parser.registerOscHandler(112,new b.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 p.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 w.DcsHandler((D,K)=>this.requestStatusString(D,K)))}_preserveStack(k,T,A,B){this._parseStack.paused=!0,this._parseStack.cursorStartX=k,this._parseStack.cursorStartY=T,this._parseStack.decodedLength=A,this._parseStack.position=B}_logSlowResolvingAsync(k){this._logService.logLevel<=S.LogLevelEnum.WARN&&Promise.race([k,new Promise((T,A)=>setTimeout(()=>A("#SLOW_TIMEOUT"),5e3))]).catch(T=>{if(T!=="#SLOW_TIMEOUT")throw T;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(k,T){let A,B=this._activeBuffer.x,$=this._activeBuffer.y,V=0;const Y=this._parseStack.paused;if(Y){if(A=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,T))return this._logSlowResolvingAsync(A),A;B=this._parseStack.cursorStartX,$=this._parseStack.cursorStartY,this._parseStack.paused=!1,k.length>O&&(V=this._parseStack.position+O)}if(this._logService.logLevel<=S.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof k=="string"?` "${k}"`:` "${Array.prototype.map.call(k,D=>String.fromCharCode(D)).join("")}"`),typeof k=="string"?k.split("").map(D=>D.charCodeAt(0)):k),this._parseBuffer.length<k.length&&this._parseBuffer.length<O&&(this._parseBuffer=new Uint32Array(Math.min(k.length,O))),Y||this._dirtyRowTracker.clearRange(),k.length>O)for(let D=V;D<k.length;D+=O){const K=D+O<k.length?D+O:k.length,z=typeof k=="string"?this._stringDecoder.decode(k.substring(D,K),this._parseBuffer):this._utf8Decoder.decode(k.subarray(D,K),this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,z))return this._preserveStack(B,$,z,D),this._logSlowResolvingAsync(A),A}else if(!Y){const D=typeof k=="string"?this._stringDecoder.decode(k,this._parseBuffer):this._utf8Decoder.decode(k,this._parseBuffer);if(A=this._parser.parse(this._parseBuffer,D))return this._preserveStack(B,$,D,0),this._logSlowResolvingAsync(A),A}this._activeBuffer.x===B&&this._activeBuffer.y===$||this._onCursorMove.fire();const J=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),j=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);j<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(j,this._bufferService.rows-1),Math.min(J,this._bufferService.rows-1))}print(k,T,A){let B,$;const V=this._charsetService.charset,Y=this._optionsService.rawOptions.screenReaderMode,J=this._bufferService.cols,j=this._coreService.decPrivateModes.wraparound,D=this._coreService.modes.insertMode,K=this._curAttrData;let z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&A-T>0&&z.getWidth(this._activeBuffer.x-1)===2&&z.setCellFromCodepoint(this._activeBuffer.x-1,0,1,K);let Q=this._parser.precedingJoinState;for(let X=T;X<A;++X){if(B=k[X],B<127&&V){const Ie=V[String.fromCharCode(B)];Ie&&(B=Ie.charCodeAt(0))}const se=this._unicodeService.charProperties(B,Q);$=C.UnicodeService.extractWidth(se);const fe=C.UnicodeService.extractShouldJoin(se),pe=fe?C.UnicodeService.extractWidth(Q):0;if(Q=se,Y&&this._onA11yChar.fire((0,m.stringFromCodePoint)(B)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+$-pe>J){if(j){const Ie=z;let te=this._activeBuffer.x-pe;for(this._activeBuffer.x=pe,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),z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),pe>0&&z instanceof u.BufferLine&&z.copyCellsFrom(Ie,te,0,pe,!1);te<J;)Ie.setCellFromCodepoint(te++,0,1,K)}else if(this._activeBuffer.x=J-1,$===2)continue}if(fe&&this._activeBuffer.x){const Ie=z.getWidth(this._activeBuffer.x-1)?1:2;z.addCodepointToCell(this._activeBuffer.x-Ie,B,$);for(let te=$-pe;--te>=0;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}else if(D&&(z.insertCells(this._activeBuffer.x,$-pe,this._activeBuffer.getNullCell(K)),z.getWidth(J-1)===2&&z.setCellFromCodepoint(J-1,n.NULL_CELL_CODE,n.NULL_CELL_WIDTH,K)),z.setCellFromCodepoint(this._activeBuffer.x++,B,$,K),$>0)for(;--$;)z.setCellFromCodepoint(this._activeBuffer.x++,0,0,K)}this._parser.precedingJoinState=Q,this._activeBuffer.x<J&&A-T>0&&z.getWidth(this._activeBuffer.x)===0&&!z.hasContent(this._activeBuffer.x)&&z.setCellFromCodepoint(this._activeBuffer.x,0,1,K),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(k,T){return k.final!=="t"||k.prefix||k.intermediates?this._parser.registerCsiHandler(k,T):this._parser.registerCsiHandler(k,A=>!M(A.params[0],this._optionsService.rawOptions.windowOptions)||T(A))}registerDcsHandler(k,T){return this._parser.registerDcsHandler(k,new w.DcsHandler(T))}registerEscHandler(k,T){return this._parser.registerEscHandler(k,T)}registerOscHandler(k,T){return this._parser.registerOscHandler(k,new b.OscHandler(T))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var k;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&&((k=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&k.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);T.hasWidth(this._activeBuffer.x)&&!T.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const k=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-k),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(k=this._bufferService.cols-1){this._activeBuffer.x=Math.min(k,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(k,T){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=k,this._activeBuffer.y=this._activeBuffer.scrollTop+T):(this._activeBuffer.x=k,this._activeBuffer.y=T),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(k,T){this._restrictCursor(),this._setCursor(this._activeBuffer.x+k,this._activeBuffer.y+T)}cursorUp(k){const T=this._activeBuffer.y-this._activeBuffer.scrollTop;return T>=0?this._moveCursor(0,-Math.min(T,k.params[0]||1)):this._moveCursor(0,-(k.params[0]||1)),!0}cursorDown(k){const T=this._activeBuffer.scrollBottom-this._activeBuffer.y;return T>=0?this._moveCursor(0,Math.min(T,k.params[0]||1)):this._moveCursor(0,k.params[0]||1),!0}cursorForward(k){return this._moveCursor(k.params[0]||1,0),!0}cursorBackward(k){return this._moveCursor(-(k.params[0]||1),0),!0}cursorNextLine(k){return this.cursorDown(k),this._activeBuffer.x=0,!0}cursorPrecedingLine(k){return this.cursorUp(k),this._activeBuffer.x=0,!0}cursorCharAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(k){return this._setCursor(k.length>=2?(k.params[1]||1)-1:0,(k.params[0]||1)-1),!0}charPosAbsolute(k){return this._setCursor((k.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(k){return this._moveCursor(k.params[0]||1,0),!0}linePosAbsolute(k){return this._setCursor(this._activeBuffer.x,(k.params[0]||1)-1),!0}vPositionRelative(k){return this._moveCursor(0,k.params[0]||1),!0}hVPosition(k){return this.cursorPosition(k),!0}tabClear(k){const T=k.params[0];return T===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:T===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=k.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(k){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let T=k.params[0]||1;for(;T--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(k){const T=k.params[0];return T===1&&(this._curAttrData.bg|=536870912),T!==2&&T!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(k,T,A,B=!1,$=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);V.replaceCells(T,A,this._activeBuffer.getNullCell(this._eraseAttrData()),$),B&&(V.isWrapped=!1)}_resetBufferLine(k,T=!1){const A=this._activeBuffer.lines.get(this._activeBuffer.ybase+k);A&&(A.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),T),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+k),A.isWrapped=!1)}eraseInDisplay(k,T=!1){let A;switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);A<this._bufferService.rows;A++)this._resetBufferLine(A,T);this._dirtyRowTracker.markDirty(A);break;case 1:for(A=this._activeBuffer.y,this._dirtyRowTracker.markDirty(A),this._eraseInBufferLine(A,0,this._activeBuffer.x+1,!0,T),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(A+1).isWrapped=!1);A--;)this._resetBufferLine(A,T);this._dirtyRowTracker.markDirty(0);break;case 2:for(A=this._bufferService.rows,this._dirtyRowTracker.markDirty(A-1);A--;)this._resetBufferLine(A,T);this._dirtyRowTracker.markDirty(0);break;case 3:const B=this._activeBuffer.lines.length-this._bufferService.rows;B>0&&(this._activeBuffer.lines.trimStart(B),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-B,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-B,0),this._onScroll.fire(0))}return!0}eraseInLine(k,T=!1){switch(this._restrictCursor(this._bufferService.cols),k.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,T);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,T);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,T)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(k){this._restrictCursor();let T=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y,B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,$=this._bufferService.rows-1+this._activeBuffer.ybase-B+1;for(;T--;)this._activeBuffer.lines.splice($-1,1),this._activeBuffer.lines.splice(A,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(k){this._restrictCursor();let T=k.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const A=this._activeBuffer.ybase+this._activeBuffer.y;let B;for(B=this._bufferService.rows-1-this._activeBuffer.scrollBottom,B=this._bufferService.rows-1+this._activeBuffer.ybase-B;T--;)this._activeBuffer.lines.splice(A,1),this._activeBuffer.lines.splice(B,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(k){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.insertCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(k){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.deleteCells(this._activeBuffer.x,k.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(k){let T=k.params[0]||1;for(;T--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(k){let T=k.params[0]||1;for(;T--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(u.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=k.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.deleteCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=k.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.insertCells(0,T,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=k.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.insertCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(k){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=k.params[0]||1;for(let A=this._activeBuffer.scrollTop;A<=this._activeBuffer.scrollBottom;++A){const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+A);B.deleteCells(this._activeBuffer.x,T,this._activeBuffer.getNullCell(this._eraseAttrData())),B.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(k){this._restrictCursor();const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return T&&(T.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(k.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(k){const T=this._parser.precedingJoinState;if(!T)return!0;const A=k.params[0]||1,B=C.UnicodeService.extractWidth(T),$=this._activeBuffer.x-B,V=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString($),Y=new Uint32Array(V.length*A);let J=0;for(let D=0;D<V.length;){const K=V.codePointAt(D)||0;Y[J++]=K,D+=K>65535?2:1}let j=J;for(let D=1;D<A;++D)Y.copyWithin(j,0,J),j+=J;return this.print(Y,0,j),!0}sendDeviceAttributesPrimary(k){return k.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(k){return k.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(k.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c")),!0}_is(k){return(this._optionsService.rawOptions.termName+"").indexOf(k)===0}setMode(k){for(let T=0;T<k.length;T++)switch(k.params[T]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(k){for(let T=0;T<k.length;T++)switch(k.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 1016:this._coreMouseService.activeEncoding="SGR_PIXELS";break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(k){for(let T=0;T<k.length;T++)switch(k.params[T]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(k){for(let T=0;T<k.length;T++)switch(k.params[T]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006: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(),k.params[T]===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(k,T){const A=this._coreService.decPrivateModes,{activeProtocol:B,activeEncoding:$}=this._coreMouseService,V=this._coreService,{buffers:Y,cols:J}=this._bufferService,{active:j,alt:D}=Y,K=this._optionsService.rawOptions,z=fe=>fe?1:2,Q=k.params[0];return X=Q,se=T?Q===2?4:Q===4?z(V.modes.insertMode):Q===12?3:Q===20?z(K.convertEol):0:Q===1?z(A.applicationCursorKeys):Q===3?K.windowOptions.setWinLines?J===80?2:J===132?1:0:0:Q===6?z(A.origin):Q===7?z(A.wraparound):Q===8?3:Q===9?z(B==="X10"):Q===12?z(K.cursorBlink):Q===25?z(!V.isCursorHidden):Q===45?z(A.reverseWraparound):Q===66?z(A.applicationKeypad):Q===67?4:Q===1e3?z(B==="VT200"):Q===1002?z(B==="DRAG"):Q===1003?z(B==="ANY"):Q===1004?z(A.sendFocus):Q===1005?4:Q===1006?z($==="SGR"):Q===1015?4:Q===1016?z($==="SGR_PIXELS"):Q===1048?1:Q===47||Q===1047||Q===1049?z(j===D):Q===2004?z(A.bracketedPasteMode):0,V.triggerDataEvent(`${d.C0.ESC}[${T?"":"?"}${X};${se}$y`),!0;var X,se}_updateAttrColor(k,T,A,B,$){return T===2?(k|=50331648,k&=-16777216,k|=_.AttributeData.fromColorRGB([A,B,$])):T===5&&(k&=-50331904,k|=33554432|255&A),k}_extractColor(k,T,A){const B=[0,0,-1,0,0,0];let $=0,V=0;do{if(B[V+$]=k.params[T+V],k.hasSubParams(T+V)){const Y=k.getSubParams(T+V);let J=0;do B[1]===5&&($=1),B[V+J+1+$]=Y[J];while(++J<Y.length&&J+V+1+$<B.length);break}if(B[1]===5&&V+$>=2||B[1]===2&&V+$>=5)break;B[1]&&($=1)}while(++V+T<k.length&&V+$<B.length);for(let Y=2;Y<B.length;++Y)B[Y]===-1&&(B[Y]=0);switch(B[0]){case 38:A.fg=this._updateAttrColor(A.fg,B[1],B[3],B[4],B[5]);break;case 48:A.bg=this._updateAttrColor(A.bg,B[1],B[3],B[4],B[5]);break;case 58:A.extended=A.extended.clone(),A.extended.underlineColor=this._updateAttrColor(A.extended.underlineColor,B[1],B[3],B[4],B[5])}return V}_processUnderline(k,T){T.extended=T.extended.clone(),(!~k||k>5)&&(k=1),T.extended.underlineStyle=k,T.fg|=268435456,k===0&&(T.fg&=-268435457),T.updateExtended()}_processSGR0(k){k.fg=u.DEFAULT_ATTR_DATA.fg,k.bg=u.DEFAULT_ATTR_DATA.bg,k.extended=k.extended.clone(),k.extended.underlineStyle=0,k.extended.underlineColor&=-67108864,k.updateExtended()}charAttributes(k){if(k.length===1&&k.params[0]===0)return this._processSGR0(this._curAttrData),!0;const T=k.length;let A;const B=this._curAttrData;for(let $=0;$<T;$++)A=k.params[$],A>=30&&A<=37?(B.fg&=-50331904,B.fg|=16777216|A-30):A>=40&&A<=47?(B.bg&=-50331904,B.bg|=16777216|A-40):A>=90&&A<=97?(B.fg&=-50331904,B.fg|=16777224|A-90):A>=100&&A<=107?(B.bg&=-50331904,B.bg|=16777224|A-100):A===0?this._processSGR0(B):A===1?B.fg|=134217728:A===3?B.bg|=67108864:A===4?(B.fg|=268435456,this._processUnderline(k.hasSubParams($)?k.getSubParams($)[0]:1,B)):A===5?B.fg|=536870912:A===7?B.fg|=67108864:A===8?B.fg|=1073741824:A===9?B.fg|=2147483648:A===2?B.bg|=134217728:A===21?this._processUnderline(2,B):A===22?(B.fg&=-134217729,B.bg&=-134217729):A===23?B.bg&=-67108865:A===24?(B.fg&=-268435457,this._processUnderline(0,B)):A===25?B.fg&=-536870913:A===27?B.fg&=-67108865:A===28?B.fg&=-1073741825:A===29?B.fg&=2147483647:A===39?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg):A===49?(B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):A===38||A===48||A===58?$+=this._extractColor(k,$,B):A===53?B.bg|=1073741824:A===55?B.bg&=-1073741825:A===59?(B.extended=B.extended.clone(),B.extended.underlineColor=-1,B.updateExtended()):A===100?(B.fg&=-67108864,B.fg|=16777215&u.DEFAULT_ATTR_DATA.fg,B.bg&=-67108864,B.bg|=16777215&u.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",A);return!0}deviceStatus(k){switch(k.params[0]){case 5:this._coreService.triggerDataEvent(`${d.C0.ESC}[0n`);break;case 6:const T=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[${T};${A}R`)}return!0}deviceStatusPrivate(k){if(k.params[0]===6){const T=this._activeBuffer.y+1,A=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${d.C0.ESC}[?${T};${A}R`)}return!0}softReset(k){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=u.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(k){const T=k.params[0]||1;switch(T){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const A=T%2==1;return this._optionsService.options.cursorBlink=A,!0}setScrollRegion(k){const T=k.params[0]||1;let A;return(k.length<2||(A=k.params[1])>this._bufferService.rows||A===0)&&(A=this._bufferService.rows),A>T&&(this._activeBuffer.scrollTop=T-1,this._activeBuffer.scrollBottom=A-1,this._setCursor(0,0)),!0}windowOptions(k){if(!M(k.params[0],this._optionsService.rawOptions.windowOptions))return!0;const T=k.length>1?k.params[1]:0;switch(k.params[0]){case 14:T!==2&&this._onRequestWindowsOptionsReport.fire(L.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(L.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:T!==0&&T!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),T!==0&&T!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:T!==0&&T!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),T!==0&&T!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(k){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(k){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(k){return this._windowTitle=k,this._onTitleChange.fire(k),!0}setIconName(k){return this._iconName=k,!0}setOrReportIndexedColor(k){const T=[],A=k.split(";");for(;A.length>1;){const B=A.shift(),$=A.shift();if(/^\d+$/.exec(B)){const V=parseInt(B);if(U(V))if($==="?")T.push({type:0,index:V});else{const Y=(0,E.parseColor)($);Y&&T.push({type:1,index:V,color:Y})}}}return T.length&&this._onColor.fire(T),!0}setHyperlink(k){const T=k.split(";");return!(T.length<2)&&(T[1]?this._createHyperlink(T[0],T[1]):!T[0]&&this._finishHyperlink())}_createHyperlink(k,T){this._getCurrentLinkId()&&this._finishHyperlink();const A=k.split(":");let B;const $=A.findIndex(V=>V.startsWith("id="));return $!==-1&&(B=A[$].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:B,uri:T}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(k,T){const A=k.split(";");for(let B=0;B<A.length&&!(T>=this._specialColors.length);++B,++T)if(A[B]==="?")this._onColor.fire([{type:0,index:this._specialColors[T]}]);else{const $=(0,E.parseColor)(A[B]);$&&this._onColor.fire([{type:1,index:this._specialColors[T],color:$}])}return!0}setOrReportFgColor(k){return this._setOrReportSpecialColor(k,0)}setOrReportBgColor(k){return this._setOrReportSpecialColor(k,1)}setOrReportCursorColor(k){return this._setOrReportSpecialColor(k,2)}restoreIndexedColor(k){if(!k)return this._onColor.fire([{type:2}]),!0;const T=[],A=k.split(";");for(let B=0;B<A.length;++B)if(/^\d+$/.exec(A[B])){const $=parseInt(A[B]);U($)&&T.push({type:2,index:$})}return T.length&&this._onColor.fire(T),!0}restoreFgColor(k){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(k){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(k){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),!0}selectCharset(k){return k.length!==2?(this.selectDefaultCharset(),!0):(k[0]==="/"||this._charsetService.setgCharset(P[k[0]],p.CHARSETS[k[1]]||p.DEFAULT_CHARSET),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const k=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,k,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=u.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=u.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(k){return this._charsetService.setgLevel(k),!0}screenAlignmentPattern(){const k=new l.CellData;k.content=4194373,k.fg=this._curAttrData.fg,k.bg=this._curAttrData.bg,this._setCursor(0,0);for(let T=0;T<this._bufferService.rows;++T){const A=this._activeBuffer.ybase+this._activeBuffer.y+T,B=this._activeBuffer.lines.get(A);B&&(B.fill(k),B.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(k,T){const A=this._bufferService.buffer,B=this._optionsService.rawOptions;return($=>(this._coreService.triggerDataEvent(`${d.C0.ESC}${$}${d.C0.ESC}\\`),!0))(k==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:k==='"p'?'P1$r61;1"p':k==="r"?`P1$r${A.scrollTop+1};${A.scrollBottom+1}r`:k==="m"?"P1$r0m":k===" q"?`P1$r${{block:2,underline:4,bar:6}[B.cursorStyle]-(B.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(k,T){this._dirtyRowTracker.markRangeDirty(k,T)}}o.InputHandler=F;let H=class{constructor(N){this._bufferService=N,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(N){N<this.start?this.start=N:N>this.end&&(this.end=N)}markRangeDirty(N,k){N>k&&(I=N,N=k,k=I),N<this.start&&(this.start=N),k>this.end&&(this.end=k)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(N){return 0<=N&&N<256}H=f([g(0,S.IBufferService)],H)},844:(v,o)=>{function c(f){for(const g of f)g.dispose();f.length=0}Object.defineProperty(o,"__esModule",{value:!0}),o.getDisposeArrayDisposable=o.disposeArray=o.toDisposable=o.MutableDisposable=o.Disposable=void 0,o.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 g=this._disposables.indexOf(f);g!==-1&&this._disposables.splice(g,1)}},o.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(f){var g;this._isDisposed||f===this._value||((g=this._value)==null||g.dispose(),this._value=f)}clear(){this.value=void 0}dispose(){var f;this._isDisposed=!0,(f=this._value)==null||f.dispose(),this._value=void 0}},o.toDisposable=function(f){return{dispose:f}},o.disposeArray=c,o.getDisposeArrayDisposable=function(f){return{dispose:()=>c(f)}}},1505:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.FourKeyMap=o.TwoKeyMap=void 0;class c{constructor(){this._data={}}set(g,d,p){this._data[g]||(this._data[g]={}),this._data[g][d]=p}get(g,d){return this._data[g]?this._data[g][d]:void 0}clear(){this._data={}}}o.TwoKeyMap=c,o.FourKeyMap=class{constructor(){this._data=new c}set(f,g,d,p,y){this._data.get(f,g)||this._data.set(f,g,new c),this._data.get(f,g).set(d,p,y)}get(f,g,d,p){var y;return(y=this._data.get(f,g))==null?void 0:y.get(d,p)}clear(){this._data.clear()}}},6114:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.isChromeOS=o.isLinux=o.isWindows=o.isIphone=o.isIpad=o.isMac=o.getSafariVersion=o.isSafari=o.isLegacyEdge=o.isFirefox=o.isNode=void 0,o.isNode=typeof process<"u"&&"title"in process;const c=o.isNode?"node":navigator.userAgent,f=o.isNode?"node":navigator.platform;o.isFirefox=c.includes("Firefox"),o.isLegacyEdge=c.includes("Edge"),o.isSafari=/^((?!chrome|android).)*safari/i.test(c),o.getSafariVersion=function(){if(!o.isSafari)return 0;const g=c.match(/Version\/(\d+)/);return g===null||g.length<2?0:parseInt(g[1])},o.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(f),o.isIpad=f==="iPad",o.isIphone=f==="iPhone",o.isWindows=["Windows","Win16","Win32","WinCE"].includes(f),o.isLinux=f.indexOf("Linux")>=0,o.isChromeOS=/\bCrOS\b/.test(c)},6106:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.SortedList=void 0;let c=0;o.SortedList=class{constructor(f){this._getKey=f,this._array=[]}clear(){this._array.length=0}insert(f){this._array.length!==0?(c=this._search(this._getKey(f)),this._array.splice(c,0,f)):this._array.push(f)}delete(f){if(this._array.length===0)return!1;const g=this._getKey(f);if(g===void 0||(c=this._search(g),c===-1)||this._getKey(this._array[c])!==g)return!1;do if(this._array[c]===f)return this._array.splice(c,1),!0;while(++c<this._array.length&&this._getKey(this._array[c])===g);return!1}*getKeyIterator(f){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do yield this._array[c];while(++c<this._array.length&&this._getKey(this._array[c])===f)}forEachByKey(f,g){if(this._array.length!==0&&(c=this._search(f),!(c<0||c>=this._array.length)&&this._getKey(this._array[c])===f))do g(this._array[c]);while(++c<this._array.length&&this._getKey(this._array[c])===f)}values(){return[...this._array].values()}_search(f){let g=0,d=this._array.length-1;for(;d>=g;){let p=g+d>>1;const y=this._getKey(this._array[p]);if(y>f)d=p-1;else{if(!(y<f)){for(;p>0&&this._getKey(this._array[p-1])===f;)p--;return p}g=p+1}}return g}}},7226:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DebouncedIdleTask=o.IdleTaskQueue=o.PriorityTaskQueue=void 0;const f=c(6114);class g{constructor(){this._tasks=[],this._i=0}enqueue(y){this._tasks.push(y),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(y){this._idleCallback=void 0;let x=0,m=0,u=y.timeRemaining(),a=0;for(;this._i<this._tasks.length;){if(x=Date.now(),this._tasks[this._i]()||this._i++,x=Math.max(1,Date.now()-x),m=Math.max(x,m),a=y.timeRemaining(),1.5*m>a)return u-x<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(u-x))}ms`),void this._start();u=a}this.clear()}}class d extends g{_requestCallback(y){return setTimeout(()=>y(this._createDeadline(16)))}_cancelCallback(y){clearTimeout(y)}_createDeadline(y){const x=Date.now()+y;return{timeRemaining:()=>Math.max(0,x-Date.now())}}}o.PriorityTaskQueue=d,o.IdleTaskQueue=!f.isNode&&"requestIdleCallback"in window?class extends g{_requestCallback(p){return requestIdleCallback(p)}_cancelCallback(p){cancelIdleCallback(p)}}:d,o.DebouncedIdleTask=class{constructor(){this._queue=new o.IdleTaskQueue}set(p){this._queue.clear(),this._queue.enqueue(p)}flush(){this._queue.flush()}}},9282:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.updateWindowsModeWrappedState=void 0;const f=c(643);o.updateWindowsModeWrappedState=function(g){const d=g.buffer.lines.get(g.buffer.ybase+g.buffer.y-1),p=d==null?void 0:d.get(g.cols-1),y=g.buffer.lines.get(g.buffer.ybase+g.buffer.y);y&&p&&(y.isWrapped=p[f.CHAR_DATA_CODE_INDEX]!==f.NULL_CELL_CODE&&p[f.CHAR_DATA_CODE_INDEX]!==f.WHITESPACE_CELL_CODE)}},3734:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ExtendedAttrs=o.AttributeData=void 0;class c{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 c;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}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}o.AttributeData=c;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}get underlineVariantOffset(){const d=(3758096384&this._ext)>>29;return d<0?4294967288^d:d}set underlineVariantOffset(d){this._ext&=536870911,this._ext|=d<<29&3758096384}constructor(d=0,p=0){this._ext=0,this._urlId=0,this._ext=d,this._urlId=p}clone(){return new f(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}o.ExtendedAttrs=f},9092:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Buffer=o.MAX_BUFFER_SIZE=void 0;const f=c(6349),g=c(7226),d=c(3734),p=c(8437),y=c(4634),x=c(511),m=c(643),u=c(4863),a=c(7116);o.MAX_BUFFER_SIZE=4294967295,o.Buffer=class{constructor(n,l,_){this._hasScrollback=n,this._optionsService=l,this._bufferService=_,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=p.DEFAULT_ATTR_DATA.clone(),this.savedCharset=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=x.CellData.fromCharData([0,m.NULL_CELL_CHAR,m.NULL_CELL_WIDTH,m.NULL_CELL_CODE]),this._whitespaceCell=x.CellData.fromCharData([0,m.WHITESPACE_CELL_CHAR,m.WHITESPACE_CELL_WIDTH,m.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new g.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new f.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(n){return n?(this._nullCell.fg=n.fg,this._nullCell.bg=n.bg,this._nullCell.extended=n.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new d.ExtendedAttrs),this._nullCell}getWhitespaceCell(n){return n?(this._whitespaceCell.fg=n.fg,this._whitespaceCell.bg=n.bg,this._whitespaceCell.extended=n.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new d.ExtendedAttrs),this._whitespaceCell}getBlankLine(n,l){return new p.BufferLine(this._bufferService.cols,this.getNullCell(n),l)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const n=this.ybase+this.y-this.ydisp;return n>=0&&n<this._rows}_getCorrectBufferLength(n){if(!this._hasScrollback)return n;const l=n+this._optionsService.rawOptions.scrollback;return l>o.MAX_BUFFER_SIZE?o.MAX_BUFFER_SIZE:l}fillViewportRows(n){if(this.lines.length===0){n===void 0&&(n=p.DEFAULT_ATTR_DATA);let l=this._rows;for(;l--;)this.lines.push(this.getBlankLine(n))}}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(n,l){const _=this.getNullCell(p.DEFAULT_ATTR_DATA);let S=0;const C=this._getCorrectBufferLength(l);if(C>this.lines.maxLength&&(this.lines.maxLength=C),this.lines.length>0){if(this._cols<n)for(let w=0;w<this.lines.length;w++)S+=+this.lines.get(w).resize(n,_);let b=0;if(this._rows<l)for(let w=this._rows;w<l;w++)this.lines.length<l+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new p.BufferLine(n,_)):this.ybase>0&&this.lines.length<=this.ybase+this.y+b+1?(this.ybase--,b++,this.ydisp>0&&this.ydisp--):this.lines.push(new p.BufferLine(n,_)));else for(let w=this._rows;w>l;w--)this.lines.length>l+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(C<this.lines.maxLength){const w=this.lines.length-C;w>0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=C}this.x=Math.min(this.x,n-1),this.y=Math.min(this.y,l-1),b&&(this.y+=b),this.savedX=Math.min(this.savedX,n-1),this.scrollTop=0}if(this.scrollBottom=l-1,this._isReflowEnabled&&(this._reflow(n,l),this._cols>n))for(let b=0;b<this.lines.length;b++)S+=+this.lines.get(b).resize(n,_);this._cols=n,this._rows=l,this._memoryCleanupQueue.clear(),S>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let n=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,n=!1);let l=0;for(;this._memoryCleanupPosition<this.lines.length;)if(l+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),l>100)return!0;return n}get _isReflowEnabled(){const n=this._optionsService.rawOptions.windowsPty;return n&&n.buildNumber?this._hasScrollback&&n.backend==="conpty"&&n.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(n,l){this._cols!==n&&(n>this._cols?this._reflowLarger(n,l):this._reflowSmaller(n,l))}_reflowLarger(n,l){const _=(0,y.reflowLargerGetLinesToRemove)(this.lines,this._cols,n,this.ybase+this.y,this.getNullCell(p.DEFAULT_ATTR_DATA));if(_.length>0){const S=(0,y.reflowLargerCreateNewLayout)(this.lines,_);(0,y.reflowLargerApplyNewLayout)(this.lines,S.layout),this._reflowLargerAdjustViewport(n,l,S.countRemoved)}}_reflowLargerAdjustViewport(n,l,_){const S=this.getNullCell(p.DEFAULT_ATTR_DATA);let C=_;for(;C-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<l&&this.lines.push(new p.BufferLine(n,S))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-_,0)}_reflowSmaller(n,l){const _=this.getNullCell(p.DEFAULT_ATTR_DATA),S=[];let C=0;for(let b=this.lines.length-1;b>=0;b--){let w=this.lines.get(b);if(!w||!w.isWrapped&&w.getTrimmedLength()<=n)continue;const E=[w];for(;w.isWrapped&&b>0;)w=this.lines.get(--b),E.unshift(w);const P=this.ybase+this.y;if(P>=b&&P<b+E.length)continue;const O=E[E.length-1].getTrimmedLength(),M=(0,y.reflowSmallerGetNewLineLengths)(E,this._cols,n),L=M.length-E.length;let I;I=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+L):Math.max(0,this.lines.length-this.lines.maxLength+L);const F=[];for(let A=0;A<L;A++){const B=this.getBlankLine(p.DEFAULT_ATTR_DATA,!0);F.push(B)}F.length>0&&(S.push({start:b+E.length+C,newLines:F}),C+=F.length),E.push(...F);let H=M.length-1,U=M[H];U===0&&(H--,U=M[H]);let N=E.length-L-1,k=O;for(;N>=0;){const A=Math.min(k,U);if(E[H]===void 0)break;if(E[H].copyCellsFrom(E[N],k-A,U-A,A,!0),U-=A,U===0&&(H--,U=M[H]),k-=A,k===0){N--;const B=Math.max(N,0);k=(0,y.getWrappedLineTrimmedLength)(E,B,this._cols)}}for(let A=0;A<E.length;A++)M[A]<n&&E[A].setCell(M[A],_);let T=L-I;for(;T-- >0;)this.ybase===0?this.y<l-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+C)-l&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+L,this.ybase+l-1)}if(S.length>0){const b=[],w=[];for(let H=0;H<this.lines.length;H++)w.push(this.lines.get(H));const E=this.lines.length;let P=E-1,O=0,M=S[O];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+C);let L=0;for(let H=Math.min(this.lines.maxLength-1,E+C-1);H>=0;H--)if(M&&M.start>P+L){for(let U=M.newLines.length-1;U>=0;U--)this.lines.set(H--,M.newLines[U]);H++,b.push({index:P+1,amount:M.newLines.length}),L+=M.newLines.length,M=S[++O]}else this.lines.set(H,w[P--]);let I=0;for(let H=b.length-1;H>=0;H--)b[H].index+=I,this.lines.onInsertEmitter.fire(b[H]),I+=b[H].amount;const F=Math.max(0,E+C-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(n,l,_=0,S){const C=this.lines.get(n);return C?C.translateToString(l,_,S):""}getWrappedRangeForLine(n){let l=n,_=n;for(;l>0&&this.lines.get(l).isWrapped;)l--;for(;_+1<this.lines.length&&this.lines.get(_+1).isWrapped;)_++;return{first:l,last:_}}setupTabStops(n){for(n!=null?this.tabs[n]||(n=this.prevStop(n)):(this.tabs={},n=0);n<this._cols;n+=this._optionsService.rawOptions.tabStopWidth)this.tabs[n]=!0}prevStop(n){for(n==null&&(n=this.x);!this.tabs[--n]&&n>0;);return n>=this._cols?this._cols-1:n<0?0:n}nextStop(n){for(n==null&&(n=this.x);!this.tabs[++n]&&n<this._cols;);return n>=this._cols?this._cols-1:n<0?0:n}clearMarkers(n){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].line===n&&(this.markers[l].dispose(),this.markers.splice(l--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let n=0;n<this.markers.length;n++)this.markers[n].dispose(),this.markers.splice(n--,1);this._isClearing=!1}addMarker(n){const l=new u.Marker(n);return this.markers.push(l),l.register(this.lines.onTrim(_=>{l.line-=_,l.line<0&&l.dispose()})),l.register(this.lines.onInsert(_=>{l.line>=_.index&&(l.line+=_.amount)})),l.register(this.lines.onDelete(_=>{l.line>=_.index&&l.line<_.index+_.amount&&l.dispose(),l.line>_.index&&(l.line-=_.amount)})),l.register(l.onDispose(()=>this._removeMarker(l))),l}_removeMarker(n){this._isClearing||this.markers.splice(this.markers.indexOf(n),1)}}},8437:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLine=o.DEFAULT_ATTR_DATA=void 0;const f=c(3734),g=c(511),d=c(643),p=c(482);o.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);let y=0;class x{constructor(u,a,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*u);const l=a||g.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let _=0;_<u;++_)this.setCell(_,l);this.length=u}get(u){const a=this._data[3*u+0],n=2097151&a;return[this._data[3*u+1],2097152&a?this._combined[u]:n?(0,p.stringFromCodePoint)(n):"",a>>22,2097152&a?this._combined[u].charCodeAt(this._combined[u].length-1):n]}set(u,a){this._data[3*u+1]=a[d.CHAR_DATA_ATTR_INDEX],a[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[u]=a[1],this._data[3*u+0]=2097152|u|a[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*u+0]=a[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|a[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(u){return this._data[3*u+0]>>22}hasWidth(u){return 12582912&this._data[3*u+0]}getFg(u){return this._data[3*u+1]}getBg(u){return this._data[3*u+2]}hasContent(u){return 4194303&this._data[3*u+0]}getCodePoint(u){const a=this._data[3*u+0];return 2097152&a?this._combined[u].charCodeAt(this._combined[u].length-1):2097151&a}isCombined(u){return 2097152&this._data[3*u+0]}getString(u){const a=this._data[3*u+0];return 2097152&a?this._combined[u]:2097151&a?(0,p.stringFromCodePoint)(2097151&a):""}isProtected(u){return 536870912&this._data[3*u+2]}loadCell(u,a){return y=3*u,a.content=this._data[y+0],a.fg=this._data[y+1],a.bg=this._data[y+2],2097152&a.content&&(a.combinedData=this._combined[u]),268435456&a.bg&&(a.extended=this._extendedAttrs[u]),a}setCell(u,a){2097152&a.content&&(this._combined[u]=a.combinedData),268435456&a.bg&&(this._extendedAttrs[u]=a.extended),this._data[3*u+0]=a.content,this._data[3*u+1]=a.fg,this._data[3*u+2]=a.bg}setCellFromCodepoint(u,a,n,l){268435456&l.bg&&(this._extendedAttrs[u]=l.extended),this._data[3*u+0]=a|n<<22,this._data[3*u+1]=l.fg,this._data[3*u+2]=l.bg}addCodepointToCell(u,a,n){let l=this._data[3*u+0];2097152&l?this._combined[u]+=(0,p.stringFromCodePoint)(a):2097151&l?(this._combined[u]=(0,p.stringFromCodePoint)(2097151&l)+(0,p.stringFromCodePoint)(a),l&=-2097152,l|=2097152):l=a|4194304,n&&(l&=-12582913,l|=n<<22),this._data[3*u+0]=l}insertCells(u,a,n){if((u%=this.length)&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,n),a<this.length-u){const l=new g.CellData;for(let _=this.length-u-a-1;_>=0;--_)this.setCell(u+a+_,this.loadCell(u+_,l));for(let _=0;_<a;++_)this.setCell(u+_,n)}else for(let l=u;l<this.length;++l)this.setCell(l,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(u,a,n){if(u%=this.length,a<this.length-u){const l=new g.CellData;for(let _=0;_<this.length-u-a;++_)this.setCell(u+_,this.loadCell(u+a+_,l));for(let _=this.length-a;_<this.length;++_)this.setCell(_,n)}else for(let l=u;l<this.length;++l)this.setCell(l,n);u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,n),this.getWidth(u)!==0||this.hasContent(u)||this.setCellFromCodepoint(u,0,1,n)}replaceCells(u,a,n,l=!1){if(l)for(u&&this.getWidth(u-1)===2&&!this.isProtected(u-1)&&this.setCellFromCodepoint(u-1,0,1,n),a<this.length&&this.getWidth(a-1)===2&&!this.isProtected(a)&&this.setCellFromCodepoint(a,0,1,n);u<a&&u<this.length;)this.isProtected(u)||this.setCell(u,n),u++;else for(u&&this.getWidth(u-1)===2&&this.setCellFromCodepoint(u-1,0,1,n),a<this.length&&this.getWidth(a-1)===2&&this.setCellFromCodepoint(a,0,1,n);u<a&&u<this.length;)this.setCell(u++,n)}resize(u,a){if(u===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const n=3*u;if(u>this.length){if(this._data.buffer.byteLength>=4*n)this._data=new Uint32Array(this._data.buffer,0,n);else{const l=new Uint32Array(n);l.set(this._data),this._data=l}for(let l=this.length;l<u;++l)this.setCell(l,a)}else{this._data=this._data.subarray(0,n);const l=Object.keys(this._combined);for(let S=0;S<l.length;S++){const C=parseInt(l[S],10);C>=u&&delete this._combined[C]}const _=Object.keys(this._extendedAttrs);for(let S=0;S<_.length;S++){const C=parseInt(_[S],10);C>=u&&delete this._extendedAttrs[C]}}return this.length=u,4*n*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const u=new Uint32Array(this._data.length);return u.set(this._data),this._data=u,1}return 0}fill(u,a=!1){if(a)for(let n=0;n<this.length;++n)this.isProtected(n)||this.setCell(n,u);else{this._combined={},this._extendedAttrs={};for(let n=0;n<this.length;++n)this.setCell(n,u)}}copyFrom(u){this.length!==u.length?this._data=new Uint32Array(u._data):this._data.set(u._data),this.length=u.length,this._combined={};for(const a in u._combined)this._combined[a]=u._combined[a];this._extendedAttrs={};for(const a in u._extendedAttrs)this._extendedAttrs[a]=u._extendedAttrs[a];this.isWrapped=u.isWrapped}clone(){const u=new x(0);u._data=new Uint32Array(this._data),u.length=this.length;for(const a in this._combined)u._combined[a]=this._combined[a];for(const a in this._extendedAttrs)u._extendedAttrs[a]=this._extendedAttrs[a];return u.isWrapped=this.isWrapped,u}getTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0])return u+(this._data[3*u+0]>>22);return 0}getNoBgTrimmedLength(){for(let u=this.length-1;u>=0;--u)if(4194303&this._data[3*u+0]||50331648&this._data[3*u+2])return u+(this._data[3*u+0]>>22);return 0}copyCellsFrom(u,a,n,l,_){const S=u._data;if(_)for(let b=l-1;b>=0;b--){for(let w=0;w<3;w++)this._data[3*(n+b)+w]=S[3*(a+b)+w];268435456&S[3*(a+b)+2]&&(this._extendedAttrs[n+b]=u._extendedAttrs[a+b])}else for(let b=0;b<l;b++){for(let w=0;w<3;w++)this._data[3*(n+b)+w]=S[3*(a+b)+w];268435456&S[3*(a+b)+2]&&(this._extendedAttrs[n+b]=u._extendedAttrs[a+b])}const C=Object.keys(u._combined);for(let b=0;b<C.length;b++){const w=parseInt(C[b],10);w>=a&&(this._combined[w-a+n]=u._combined[w])}}translateToString(u,a,n,l){a=a??0,n=n??this.length,u&&(n=Math.min(n,this.getTrimmedLength())),l&&(l.length=0);let _="";for(;a<n;){const S=this._data[3*a+0],C=2097151&S,b=2097152&S?this._combined[a]:C?(0,p.stringFromCodePoint)(C):d.WHITESPACE_CELL_CHAR;if(_+=b,l)for(let w=0;w<b.length;++w)l.push(a);a+=S>>22||1}return l&&l.push(a),_}}o.BufferLine=x},4841:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.getRangeLength=void 0,o.getRangeLength=function(c,f){if(c.start.y>c.end.y)throw new Error(`Buffer range end (${c.end.x}, ${c.end.y}) cannot be before start (${c.start.x}, ${c.start.y})`);return f*(c.end.y-c.start.y)+(c.end.x-c.start.x+1)}},4634:(v,o)=>{function c(f,g,d){if(g===f.length-1)return f[g].getTrimmedLength();const p=!f[g].hasContent(d-1)&&f[g].getWidth(d-1)===1,y=f[g+1].getWidth(0)===2;return p&&y?d-1:d}Object.defineProperty(o,"__esModule",{value:!0}),o.getWrappedLineTrimmedLength=o.reflowSmallerGetNewLineLengths=o.reflowLargerApplyNewLayout=o.reflowLargerCreateNewLayout=o.reflowLargerGetLinesToRemove=void 0,o.reflowLargerGetLinesToRemove=function(f,g,d,p,y){const x=[];for(let m=0;m<f.length-1;m++){let u=m,a=f.get(++u);if(!a.isWrapped)continue;const n=[f.get(m)];for(;u<f.length&&a.isWrapped;)n.push(a),a=f.get(++u);if(p>=m&&p<u){m+=n.length-1;continue}let l=0,_=c(n,l,g),S=1,C=0;for(;S<n.length;){const w=c(n,S,g),E=w-C,P=d-_,O=Math.min(E,P);n[l].copyCellsFrom(n[S],C,_,O,!1),_+=O,_===d&&(l++,_=0),C+=O,C===w&&(S++,C=0),_===0&&l!==0&&n[l-1].getWidth(d-1)===2&&(n[l].copyCellsFrom(n[l-1],d-1,_++,1,!1),n[l-1].setCell(d-1,y))}n[l].replaceCells(_,d,y);let b=0;for(let w=n.length-1;w>0&&(w>l||n[w].getTrimmedLength()===0);w--)b++;b>0&&(x.push(m+n.length-b),x.push(b)),m+=n.length-1}return x},o.reflowLargerCreateNewLayout=function(f,g){const d=[];let p=0,y=g[p],x=0;for(let m=0;m<f.length;m++)if(y===m){const u=g[++p];f.onDeleteEmitter.fire({index:m-x,amount:u}),m+=u-1,x+=u,y=g[++p]}else d.push(m);return{layout:d,countRemoved:x}},o.reflowLargerApplyNewLayout=function(f,g){const d=[];for(let p=0;p<g.length;p++)d.push(f.get(g[p]));for(let p=0;p<d.length;p++)f.set(p,d[p]);f.length=g.length},o.reflowSmallerGetNewLineLengths=function(f,g,d){const p=[],y=f.map((a,n)=>c(f,n,g)).reduce((a,n)=>a+n);let x=0,m=0,u=0;for(;u<y;){if(y-u<d){p.push(y-u);break}x+=d;const a=c(f,m,g);x>a&&(x-=a,m++);const n=f[m].getWidth(x-1)===2;n&&x--;const l=n?d-1:d;p.push(l),u+=l}return p},o.getWrappedLineTrimmedLength=c},5295:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferSet=void 0;const f=c(8460),g=c(844),d=c(9092);class p extends g.Disposable{constructor(x,m){super(),this._optionsService=x,this._bufferService=m,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(x){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(x),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(x,m){this._normal.resize(x,m),this._alt.resize(x,m),this.setupTabStops(x)}setupTabStops(x){this._normal.setupTabStops(x),this._alt.setupTabStops(x)}}o.BufferSet=p},511:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CellData=void 0;const f=c(482),g=c(643),d=c(3734);class p extends d.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new d.ExtendedAttrs,this.combinedData=""}static fromCharData(x){const m=new p;return m.setFromCharData(x),m}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(x){this.fg=x[g.CHAR_DATA_ATTR_INDEX],this.bg=0;let m=!1;if(x[g.CHAR_DATA_CHAR_INDEX].length>2)m=!0;else if(x[g.CHAR_DATA_CHAR_INDEX].length===2){const u=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=u&&u<=56319){const a=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=a&&a<=57343?this.content=1024*(u-55296)+a-56320+65536|x[g.CHAR_DATA_WIDTH_INDEX]<<22:m=!0}else m=!0}else this.content=x[g.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|x[g.CHAR_DATA_WIDTH_INDEX]<<22;m&&(this.combinedData=x[g.CHAR_DATA_CHAR_INDEX],this.content=2097152|x[g.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}o.CellData=p},643:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WHITESPACE_CELL_CODE=o.WHITESPACE_CELL_WIDTH=o.WHITESPACE_CELL_CHAR=o.NULL_CELL_CODE=o.NULL_CELL_WIDTH=o.NULL_CELL_CHAR=o.CHAR_DATA_CODE_INDEX=o.CHAR_DATA_WIDTH_INDEX=o.CHAR_DATA_CHAR_INDEX=o.CHAR_DATA_ATTR_INDEX=o.DEFAULT_EXT=o.DEFAULT_ATTR=o.DEFAULT_COLOR=void 0,o.DEFAULT_COLOR=0,o.DEFAULT_ATTR=256|o.DEFAULT_COLOR<<9,o.DEFAULT_EXT=0,o.CHAR_DATA_ATTR_INDEX=0,o.CHAR_DATA_CHAR_INDEX=1,o.CHAR_DATA_WIDTH_INDEX=2,o.CHAR_DATA_CODE_INDEX=3,o.NULL_CELL_CHAR="",o.NULL_CELL_WIDTH=1,o.NULL_CELL_CODE=0,o.WHITESPACE_CELL_CHAR=" ",o.WHITESPACE_CELL_WIDTH=1,o.WHITESPACE_CELL_CODE=32},4863:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Marker=void 0;const f=c(8460),g=c(844);class d{get id(){return this._id}constructor(y){this.line=y,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,g.disposeArray)(this._disposables),this._disposables.length=0)}register(y){return this._disposables.push(y),y}}o.Marker=d,d._nextId=1},7116:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DEFAULT_CHARSET=o.CHARSETS=void 0,o.CHARSETS={},o.DEFAULT_CHARSET=o.CHARSETS.B,o.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:"≥","{":"π","|":"≠","}":"£","~":"·"},o.CHARSETS.A={"#":"£"},o.CHARSETS.B=void 0,o.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},o.CHARSETS.C=o.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},o.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},o.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},o.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},o.CHARSETS.E=o.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},o.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},o.CHARSETS.H=o.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},o.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(v,o)=>{var c,f,g;Object.defineProperty(o,"__esModule",{value:!0}),o.C1_ESCAPED=o.C1=o.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=`
|
|
63
|
+
`,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=""}(c||(o.C0=c={})),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||(o.C1=f={})),function(d){d.ST=`${c.ESC}\\`}(g||(o.C1_ESCAPED=g={}))},7399:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.evaluateKeyboardEvent=void 0;const f=c(2584),g={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};o.evaluateKeyboardEvent=function(d,p,y,x){const m={type:0,cancel:!1,key:void 0},u=(d.shiftKey?1:0)|(d.altKey?2:0)|(d.ctrlKey?4:0)|(d.metaKey?8:0);switch(d.keyCode){case 0:d.key==="UIKeyInputUpArrow"?m.key=p?f.C0.ESC+"OA":f.C0.ESC+"[A":d.key==="UIKeyInputLeftArrow"?m.key=p?f.C0.ESC+"OD":f.C0.ESC+"[D":d.key==="UIKeyInputRightArrow"?m.key=p?f.C0.ESC+"OC":f.C0.ESC+"[C":d.key==="UIKeyInputDownArrow"&&(m.key=p?f.C0.ESC+"OB":f.C0.ESC+"[B");break;case 8:m.key=d.ctrlKey?"\b":f.C0.DEL,d.altKey&&(m.key=f.C0.ESC+m.key);break;case 9:if(d.shiftKey){m.key=f.C0.ESC+"[Z";break}m.key=f.C0.HT,m.cancel=!0;break;case 13:m.key=d.altKey?f.C0.ESC+f.C0.CR:f.C0.CR,m.cancel=!0;break;case 27:m.key=f.C0.ESC,d.altKey&&(m.key=f.C0.ESC+f.C0.ESC),m.cancel=!0;break;case 37:if(d.metaKey)break;u?(m.key=f.C0.ESC+"[1;"+(u+1)+"D",m.key===f.C0.ESC+"[1;3D"&&(m.key=f.C0.ESC+(y?"b":"[1;5D"))):m.key=p?f.C0.ESC+"OD":f.C0.ESC+"[D";break;case 39:if(d.metaKey)break;u?(m.key=f.C0.ESC+"[1;"+(u+1)+"C",m.key===f.C0.ESC+"[1;3C"&&(m.key=f.C0.ESC+(y?"f":"[1;5C"))):m.key=p?f.C0.ESC+"OC":f.C0.ESC+"[C";break;case 38:if(d.metaKey)break;u?(m.key=f.C0.ESC+"[1;"+(u+1)+"A",y||m.key!==f.C0.ESC+"[1;3A"||(m.key=f.C0.ESC+"[1;5A")):m.key=p?f.C0.ESC+"OA":f.C0.ESC+"[A";break;case 40:if(d.metaKey)break;u?(m.key=f.C0.ESC+"[1;"+(u+1)+"B",y||m.key!==f.C0.ESC+"[1;3B"||(m.key=f.C0.ESC+"[1;5B")):m.key=p?f.C0.ESC+"OB":f.C0.ESC+"[B";break;case 45:d.shiftKey||d.ctrlKey||(m.key=f.C0.ESC+"[2~");break;case 46:m.key=u?f.C0.ESC+"[3;"+(u+1)+"~":f.C0.ESC+"[3~";break;case 36:m.key=u?f.C0.ESC+"[1;"+(u+1)+"H":p?f.C0.ESC+"OH":f.C0.ESC+"[H";break;case 35:m.key=u?f.C0.ESC+"[1;"+(u+1)+"F":p?f.C0.ESC+"OF":f.C0.ESC+"[F";break;case 33:d.shiftKey?m.type=2:d.ctrlKey?m.key=f.C0.ESC+"[5;"+(u+1)+"~":m.key=f.C0.ESC+"[5~";break;case 34:d.shiftKey?m.type=3:d.ctrlKey?m.key=f.C0.ESC+"[6;"+(u+1)+"~":m.key=f.C0.ESC+"[6~";break;case 112:m.key=u?f.C0.ESC+"[1;"+(u+1)+"P":f.C0.ESC+"OP";break;case 113:m.key=u?f.C0.ESC+"[1;"+(u+1)+"Q":f.C0.ESC+"OQ";break;case 114:m.key=u?f.C0.ESC+"[1;"+(u+1)+"R":f.C0.ESC+"OR";break;case 115:m.key=u?f.C0.ESC+"[1;"+(u+1)+"S":f.C0.ESC+"OS";break;case 116:m.key=u?f.C0.ESC+"[15;"+(u+1)+"~":f.C0.ESC+"[15~";break;case 117:m.key=u?f.C0.ESC+"[17;"+(u+1)+"~":f.C0.ESC+"[17~";break;case 118:m.key=u?f.C0.ESC+"[18;"+(u+1)+"~":f.C0.ESC+"[18~";break;case 119:m.key=u?f.C0.ESC+"[19;"+(u+1)+"~":f.C0.ESC+"[19~";break;case 120:m.key=u?f.C0.ESC+"[20;"+(u+1)+"~":f.C0.ESC+"[20~";break;case 121:m.key=u?f.C0.ESC+"[21;"+(u+1)+"~":f.C0.ESC+"[21~";break;case 122:m.key=u?f.C0.ESC+"[23;"+(u+1)+"~":f.C0.ESC+"[23~";break;case 123:m.key=u?f.C0.ESC+"[24;"+(u+1)+"~":f.C0.ESC+"[24~";break;default:if(!d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)if(y&&!x||!d.altKey||d.metaKey)!y||d.altKey||d.ctrlKey||d.shiftKey||!d.metaKey?d.key&&!d.ctrlKey&&!d.altKey&&!d.metaKey&&d.keyCode>=48&&d.key.length===1?m.key=d.key:d.key&&d.ctrlKey&&(d.key==="_"&&(m.key=f.C0.US),d.key==="@"&&(m.key=f.C0.NUL)):d.keyCode===65&&(m.type=1);else{const a=g[d.keyCode],n=a==null?void 0:a[d.shiftKey?1:0];if(n)m.key=f.C0.ESC+n;else if(d.keyCode>=65&&d.keyCode<=90){const l=d.ctrlKey?d.keyCode-64:d.keyCode+32;let _=String.fromCharCode(l);d.shiftKey&&(_=_.toUpperCase()),m.key=f.C0.ESC+_}else if(d.keyCode===32)m.key=f.C0.ESC+(d.ctrlKey?f.C0.NUL:" ");else if(d.key==="Dead"&&d.code.startsWith("Key")){let l=d.code.slice(3,4);d.shiftKey||(l=l.toLowerCase()),m.key=f.C0.ESC+l,m.cancel=!0}}else d.keyCode>=65&&d.keyCode<=90?m.key=String.fromCharCode(d.keyCode-64):d.keyCode===32?m.key=f.C0.NUL:d.keyCode>=51&&d.keyCode<=55?m.key=String.fromCharCode(d.keyCode-51+27):d.keyCode===56?m.key=f.C0.DEL:d.keyCode===219?m.key=f.C0.ESC:d.keyCode===220?m.key=f.C0.FS:d.keyCode===221&&(m.key=f.C0.GS)}return m}},482:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Utf8ToUtf32=o.StringToUtf32=o.utf32ToString=o.stringFromCodePoint=void 0,o.stringFromCodePoint=function(c){return c>65535?(c-=65536,String.fromCharCode(55296+(c>>10))+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)},o.utf32ToString=function(c,f=0,g=c.length){let d="";for(let p=f;p<g;++p){let y=c[p];y>65535?(y-=65536,d+=String.fromCharCode(55296+(y>>10))+String.fromCharCode(y%1024+56320)):d+=String.fromCharCode(y)}return d},o.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(c,f){const g=c.length;if(!g)return 0;let d=0,p=0;if(this._interim){const y=c.charCodeAt(p++);56320<=y&&y<=57343?f[d++]=1024*(this._interim-55296)+y-56320+65536:(f[d++]=this._interim,f[d++]=y),this._interim=0}for(let y=p;y<g;++y){const x=c.charCodeAt(y);if(55296<=x&&x<=56319){if(++y>=g)return this._interim=x,d;const m=c.charCodeAt(y);56320<=m&&m<=57343?f[d++]=1024*(x-55296)+m-56320+65536:(f[d++]=x,f[d++]=m)}else x!==65279&&(f[d++]=x)}return d}},o.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(c,f){const g=c.length;if(!g)return 0;let d,p,y,x,m=0,u=0,a=0;if(this.interim[0]){let _=!1,S=this.interim[0];S&=(224&S)==192?31:(240&S)==224?15:7;let C,b=0;for(;(C=63&this.interim[++b])&&b<4;)S<<=6,S|=C;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,E=w-b;for(;a<E;){if(a>=g)return 0;if(C=c[a++],(192&C)!=128){a--,_=!0;break}this.interim[b++]=C,S<<=6,S|=63&C}_||(w===2?S<128?a--:f[m++]=S:w===3?S<2048||S>=55296&&S<=57343||S===65279||(f[m++]=S):S<65536||S>1114111||(f[m++]=S)),this.interim.fill(0)}const n=g-4;let l=a;for(;l<g;){for(;!(!(l<n)||128&(d=c[l])||128&(p=c[l+1])||128&(y=c[l+2])||128&(x=c[l+3]));)f[m++]=d,f[m++]=p,f[m++]=y,f[m++]=x,l+=4;if(d=c[l++],d<128)f[m++]=d;else if((224&d)==192){if(l>=g)return this.interim[0]=d,m;if(p=c[l++],(192&p)!=128){l--;continue}if(u=(31&d)<<6|63&p,u<128){l--;continue}f[m++]=u}else if((240&d)==224){if(l>=g)return this.interim[0]=d,m;if(p=c[l++],(192&p)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,m;if(y=c[l++],(192&y)!=128){l--;continue}if(u=(15&d)<<12|(63&p)<<6|63&y,u<2048||u>=55296&&u<=57343||u===65279)continue;f[m++]=u}else if((248&d)==240){if(l>=g)return this.interim[0]=d,m;if(p=c[l++],(192&p)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,m;if(y=c[l++],(192&y)!=128){l--;continue}if(l>=g)return this.interim[0]=d,this.interim[1]=p,this.interim[2]=y,m;if(x=c[l++],(192&x)!=128){l--;continue}if(u=(7&d)<<18|(63&p)<<12|(63&y)<<6|63&x,u<65536||u>1114111)continue;f[m++]=u}}return m}}},225:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeV6=void 0;const f=c(1480),g=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],d=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;o.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let y=0;y<g.length;++y)p.fill(0,g[y][0],g[y][1]+1)}}wcwidth(y){return y<32?0:y<127?1:y<65536?p[y]:function(x,m){let u,a=0,n=m.length-1;if(x<m[0][0]||x>m[n][1])return!1;for(;n>=a;)if(u=a+n>>1,x>m[u][1])a=u+1;else{if(!(x<m[u][0]))return!0;n=u-1}return!1}(y,d)?0:y>=131072&&y<=196605||y>=196608&&y<=262141?2:1}charProperties(y,x){let m=this.wcwidth(y),u=m===0&&x!==0;if(u){const a=f.UnicodeService.extractWidth(x);a===0?u=!1:a>m&&(m=a)}return f.UnicodeService.createPropertyValue(0,m,u)}}},5981:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.WriteBuffer=void 0;const f=c(8460),g=c(844);class d extends g.Disposable{constructor(y){super(),this._action=y,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(y,x){if(x!==void 0&&this._syncCalls>x)return void(this._syncCalls=0);if(this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let m;for(this._isSyncWriting=!0;m=this._writeBuffer.shift();){this._action(m);const u=this._callbacks.shift();u&&u()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(y,x){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+=y.length,this._writeBuffer.push(y),this._callbacks.push(x),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=y.length,this._writeBuffer.push(y),this._callbacks.push(x)}_innerWrite(y=0,x=!0){const m=y||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const u=this._writeBuffer[this._bufferOffset],a=this._action(u,x);if(a){const l=_=>Date.now()-m>=12?setTimeout(()=>this._innerWrite(0,_)):this._innerWrite(m,_);return void a.catch(_=>(queueMicrotask(()=>{throw _}),Promise.resolve(!1))).then(l)}const n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=u.length,Date.now()-m>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}o.WriteBuffer=d},5941:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.toRgbString=o.parseColor=void 0;const c=/^([\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 g(d,p){const y=d.toString(16),x=y.length<2?"0"+y:y;switch(p){case 4:return y[0];case 8:return x;case 12:return(x+x).slice(0,3);default:return x+x}}o.parseColor=function(d){if(!d)return;let p=d.toLowerCase();if(p.indexOf("rgb:")===0){p=p.slice(4);const y=c.exec(p);if(y){const x=y[1]?15:y[4]?255:y[7]?4095:65535;return[Math.round(parseInt(y[1]||y[4]||y[7]||y[10],16)/x*255),Math.round(parseInt(y[2]||y[5]||y[8]||y[11],16)/x*255),Math.round(parseInt(y[3]||y[6]||y[9]||y[12],16)/x*255)]}}else if(p.indexOf("#")===0&&(p=p.slice(1),f.exec(p)&&[3,6,9,12].includes(p.length))){const y=p.length/3,x=[0,0,0];for(let m=0;m<3;++m){const u=parseInt(p.slice(y*m,y*m+y),16);x[m]=y===1?u<<4:y===2?u:y===3?u>>4:u>>8}return x}},o.toRgbString=function(d,p=16){const[y,x,m]=d;return`rgb:${g(y,p)}/${g(x,p)}/${g(m,p)}`}},5770:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.PAYLOAD_LIMIT=void 0,o.PAYLOAD_LIMIT=1e7},6351:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DcsHandler=o.DcsParser=void 0;const f=c(482),g=c(8742),d=c(5770),p=[];o.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=p,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}registerHandler(x,m){this._handlers[x]===void 0&&(this._handlers[x]=[]);const u=this._handlers[x];return u.push(m),{dispose:()=>{const a=u.indexOf(m);a!==-1&&u.splice(a,1)}}}clearHandler(x){this._handlers[x]&&delete this._handlers[x]}setHandlerFallback(x){this._handlerFb=x}reset(){if(this._active.length)for(let x=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;x>=0;--x)this._active[x].unhook(!1);this._stack.paused=!1,this._active=p,this._ident=0}hook(x,m){if(this.reset(),this._ident=x,this._active=this._handlers[x]||p,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].hook(m);else this._handlerFb(this._ident,"HOOK",m)}put(x,m,u){if(this._active.length)for(let a=this._active.length-1;a>=0;a--)this._active[a].put(x,m,u);else this._handlerFb(this._ident,"PUT",(0,f.utf32ToString)(x,m,u))}unhook(x,m=!0){if(this._active.length){let u=!1,a=this._active.length-1,n=!1;if(this._stack.paused&&(a=this._stack.loopPosition-1,u=m,n=this._stack.fallThrough,this._stack.paused=!1),!n&&u===!1){for(;a>=0&&(u=this._active[a].unhook(x),u!==!0);a--)if(u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!1,u;a--}for(;a>=0;a--)if(u=this._active[a].unhook(!1),u instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=a,this._stack.fallThrough=!0,u}else this._handlerFb(this._ident,"UNHOOK",x);this._active=p,this._ident=0}};const y=new g.Params;y.addParam(0),o.DcsHandler=class{constructor(x){this._handler=x,this._data="",this._params=y,this._hitLimit=!1}hook(x){this._params=x.length>1||x.params[0]?x.clone():y,this._data="",this._hitLimit=!1}put(x,m,u){this._hitLimit||(this._data+=(0,f.utf32ToString)(x,m,u),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(x){let m=!1;if(this._hitLimit)m=!1;else if(x&&(m=this._handler(this._data,this._params),m instanceof Promise))return m.then(u=>(this._params=y,this._data="",this._hitLimit=!1,u));return this._params=y,this._data="",this._hitLimit=!1,m}}},2015:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.EscapeSequenceParser=o.VT500_TRANSITION_TABLE=o.TransitionTable=void 0;const f=c(844),g=c(8742),d=c(6242),p=c(6351);class y{constructor(a){this.table=new Uint8Array(a)}setDefault(a,n){this.table.fill(a<<4|n)}add(a,n,l,_){this.table[n<<8|a]=l<<4|_}addMany(a,n,l,_){for(let S=0;S<a.length;S++)this.table[n<<8|a[S]]=l<<4|_}}o.TransitionTable=y;const x=160;o.VT500_TRANSITION_TABLE=function(){const u=new y(4095),a=Array.apply(null,Array(256)).map((b,w)=>w),n=(b,w)=>a.slice(b,w),l=n(32,127),_=n(0,24);_.push(25),_.push.apply(_,n(28,32));const S=n(0,14);let C;for(C in u.setDefault(1,0),u.addMany(l,0,2,0),S)u.addMany([24,26,153,154],C,3,0),u.addMany(n(128,144),C,3,0),u.addMany(n(144,152),C,3,0),u.add(156,C,0,0),u.add(27,C,11,1),u.add(157,C,4,8),u.addMany([152,158,159],C,0,7),u.add(155,C,11,3),u.add(144,C,11,9);return u.addMany(_,0,3,0),u.addMany(_,1,3,1),u.add(127,1,0,1),u.addMany(_,8,0,8),u.addMany(_,3,3,3),u.add(127,3,0,3),u.addMany(_,4,3,4),u.add(127,4,0,4),u.addMany(_,6,3,6),u.addMany(_,5,3,5),u.add(127,5,0,5),u.addMany(_,2,3,2),u.add(127,2,0,2),u.add(93,1,4,8),u.addMany(l,8,5,8),u.add(127,8,5,8),u.addMany([156,27,24,26,7],8,6,0),u.addMany(n(28,32),8,0,8),u.addMany([88,94,95],1,0,7),u.addMany(l,7,0,7),u.addMany(_,7,0,7),u.add(156,7,0,0),u.add(127,7,0,7),u.add(91,1,11,3),u.addMany(n(64,127),3,7,0),u.addMany(n(48,60),3,8,4),u.addMany([60,61,62,63],3,9,4),u.addMany(n(48,60),4,8,4),u.addMany(n(64,127),4,7,0),u.addMany([60,61,62,63],4,0,6),u.addMany(n(32,64),6,0,6),u.add(127,6,0,6),u.addMany(n(64,127),6,0,0),u.addMany(n(32,48),3,9,5),u.addMany(n(32,48),5,9,5),u.addMany(n(48,64),5,0,6),u.addMany(n(64,127),5,7,0),u.addMany(n(32,48),4,9,5),u.addMany(n(32,48),1,9,2),u.addMany(n(32,48),2,9,2),u.addMany(n(48,127),2,10,0),u.addMany(n(48,80),1,10,0),u.addMany(n(81,88),1,10,0),u.addMany([89,90,92],1,10,0),u.addMany(n(96,127),1,10,0),u.add(80,1,11,9),u.addMany(_,9,0,9),u.add(127,9,0,9),u.addMany(n(28,32),9,0,9),u.addMany(n(32,48),9,9,12),u.addMany(n(48,60),9,8,10),u.addMany([60,61,62,63],9,9,10),u.addMany(_,11,0,11),u.addMany(n(32,128),11,0,11),u.addMany(n(28,32),11,0,11),u.addMany(_,10,0,10),u.add(127,10,0,10),u.addMany(n(28,32),10,0,10),u.addMany(n(48,60),10,8,10),u.addMany([60,61,62,63],10,0,11),u.addMany(n(32,48),10,9,12),u.addMany(_,12,0,12),u.add(127,12,0,12),u.addMany(n(28,32),12,0,12),u.addMany(n(32,48),12,9,12),u.addMany(n(48,64),12,0,11),u.addMany(n(64,127),12,12,13),u.addMany(n(64,127),10,12,13),u.addMany(n(64,127),9,12,13),u.addMany(_,13,13,13),u.addMany(l,13,13,13),u.add(127,13,0,13),u.addMany([27,156,24,26],13,14,0),u.add(x,0,2,0),u.add(x,8,5,8),u.add(x,6,0,6),u.add(x,11,0,11),u.add(x,13,13,13),u}();class m extends f.Disposable{constructor(a=o.VT500_TRANSITION_TABLE){super(),this._transitions=a,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new g.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(n,l,_)=>{},this._executeHandlerFb=n=>{},this._csiHandlerFb=(n,l)=>{},this._escHandlerFb=n=>{},this._errorHandlerFb=n=>n,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 p.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(a,n=[64,126]){let l=0;if(a.prefix){if(a.prefix.length>1)throw new Error("only one byte as prefix supported");if(l=a.prefix.charCodeAt(0),l&&60>l||l>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(a.intermediates){if(a.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let S=0;S<a.intermediates.length;++S){const C=a.intermediates.charCodeAt(S);if(32>C||C>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");l<<=8,l|=C}}if(a.final.length!==1)throw new Error("final must be a single byte");const _=a.final.charCodeAt(0);if(n[0]>_||_>n[1])throw new Error(`final must be in range ${n[0]} .. ${n[1]}`);return l<<=8,l|=_,l}identToString(a){const n=[];for(;a;)n.push(String.fromCharCode(255&a)),a>>=8;return n.reverse().join("")}setPrintHandler(a){this._printHandler=a}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(a,n){const l=this._identifier(a,[48,126]);this._escHandlers[l]===void 0&&(this._escHandlers[l]=[]);const _=this._escHandlers[l];return _.push(n),{dispose:()=>{const S=_.indexOf(n);S!==-1&&_.splice(S,1)}}}clearEscHandler(a){this._escHandlers[this._identifier(a,[48,126])]&&delete this._escHandlers[this._identifier(a,[48,126])]}setEscHandlerFallback(a){this._escHandlerFb=a}setExecuteHandler(a,n){this._executeHandlers[a.charCodeAt(0)]=n}clearExecuteHandler(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]}setExecuteHandlerFallback(a){this._executeHandlerFb=a}registerCsiHandler(a,n){const l=this._identifier(a);this._csiHandlers[l]===void 0&&(this._csiHandlers[l]=[]);const _=this._csiHandlers[l];return _.push(n),{dispose:()=>{const S=_.indexOf(n);S!==-1&&_.splice(S,1)}}}clearCsiHandler(a){this._csiHandlers[this._identifier(a)]&&delete this._csiHandlers[this._identifier(a)]}setCsiHandlerFallback(a){this._csiHandlerFb=a}registerDcsHandler(a,n){return this._dcsParser.registerHandler(this._identifier(a),n)}clearDcsHandler(a){this._dcsParser.clearHandler(this._identifier(a))}setDcsHandlerFallback(a){this._dcsParser.setHandlerFallback(a)}registerOscHandler(a,n){return this._oscParser.registerHandler(a,n)}clearOscHandler(a){this._oscParser.clearHandler(a)}setOscHandlerFallback(a){this._oscParser.setHandlerFallback(a)}setErrorHandler(a){this._errorHandler=a}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(a,n,l,_,S){this._parseStack.state=a,this._parseStack.handlers=n,this._parseStack.handlerPos=l,this._parseStack.transition=_,this._parseStack.chunkPos=S}parse(a,n,l){let _,S=0,C=0,b=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,b=this._parseStack.chunkPos+1;else{if(l===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let E=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(l===!1&&E>-1){for(;E>=0&&(_=w[E](this._params),_!==!0);E--)if(_ instanceof Promise)return this._parseStack.handlerPos=E,_}this._parseStack.handlers=[];break;case 4:if(l===!1&&E>-1){for(;E>=0&&(_=w[E](),_!==!0);E--)if(_ instanceof Promise)return this._parseStack.handlerPos=E,_}this._parseStack.handlers=[];break;case 6:if(S=a[this._parseStack.chunkPos],_=this._dcsParser.unhook(S!==24&&S!==26,l),_)return _;S===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(S=a[this._parseStack.chunkPos],_=this._oscParser.end(S!==24&&S!==26,l),_)return _;S===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.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let w=b;w<n;++w){switch(S=a[w],C=this._transitions.table[this.currentState<<8|(S<160?S:x)],C>>4){case 2:for(let L=w+1;;++L){if(L>=n||(S=a[L])<32||S>126&&S<x){this._printHandler(a,w,L),w=L-1;break}if(++L>=n||(S=a[L])<32||S>126&&S<x){this._printHandler(a,w,L),w=L-1;break}if(++L>=n||(S=a[L])<32||S>126&&S<x){this._printHandler(a,w,L),w=L-1;break}if(++L>=n||(S=a[L])<32||S>126&&S<x){this._printHandler(a,w,L),w=L-1;break}}break;case 3:this._executeHandlers[S]?this._executeHandlers[S]():this._executeHandlerFb(S),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:w,code:S,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const E=this._csiHandlers[this._collect<<8|S];let P=E?E.length-1:-1;for(;P>=0&&(_=E[P](this._params),_!==!0);P--)if(_ instanceof Promise)return this._preserveStack(3,E,P,C,w),_;P<0&&this._csiHandlerFb(this._collect<<8|S,this._params),this.precedingJoinState=0;break;case 8:do switch(S){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(S-48)}while(++w<n&&(S=a[w])>47&&S<60);w--;break;case 9:this._collect<<=8,this._collect|=S;break;case 10:const O=this._escHandlers[this._collect<<8|S];let M=O?O.length-1:-1;for(;M>=0&&(_=O[M](),_!==!0);M--)if(_ instanceof Promise)return this._preserveStack(4,O,M,C,w),_;M<0&&this._escHandlerFb(this._collect<<8|S),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|S,this._params);break;case 13:for(let L=w+1;;++L)if(L>=n||(S=a[L])===24||S===26||S===27||S>127&&S<x){this._dcsParser.put(a,w,L),w=L-1;break}break;case 14:if(_=this._dcsParser.unhook(S!==24&&S!==26),_)return this._preserveStack(6,[],0,C,w),_;S===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let L=w+1;;L++)if(L>=n||(S=a[L])<32||S>127&&S<x){this._oscParser.put(a,w,L),w=L-1;break}break;case 6:if(_=this._oscParser.end(S!==24&&S!==26),_)return this._preserveStack(5,[],0,C,w),_;S===27&&(C|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&C}}}o.EscapeSequenceParser=m},6242:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OscHandler=o.OscParser=void 0;const f=c(5770),g=c(482),d=[];o.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(p,y){this._handlers[p]===void 0&&(this._handlers[p]=[]);const x=this._handlers[p];return x.push(y),{dispose:()=>{const m=x.indexOf(y);m!==-1&&x.splice(m,1)}}}clearHandler(p){this._handlers[p]&&delete this._handlers[p]}setHandlerFallback(p){this._handlerFb=p}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=d}reset(){if(this._state===2)for(let p=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;p>=0;--p)this._active[p].end(!1);this._stack.paused=!1,this._active=d,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||d,this._active.length)for(let p=this._active.length-1;p>=0;p--)this._active[p].start();else this._handlerFb(this._id,"START")}_put(p,y,x){if(this._active.length)for(let m=this._active.length-1;m>=0;m--)this._active[m].put(p,y,x);else this._handlerFb(this._id,"PUT",(0,g.utf32ToString)(p,y,x))}start(){this.reset(),this._state=1}put(p,y,x){if(this._state!==3){if(this._state===1)for(;y<x;){const m=p[y++];if(m===59){this._state=2,this._start();break}if(m<48||57<m)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+m-48}this._state===2&&x-y>0&&this._put(p,y,x)}}end(p,y=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let x=!1,m=this._active.length-1,u=!1;if(this._stack.paused&&(m=this._stack.loopPosition-1,x=y,u=this._stack.fallThrough,this._stack.paused=!1),!u&&x===!1){for(;m>=0&&(x=this._active[m].end(p),x!==!0);m--)if(x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!1,x;m--}for(;m>=0;m--)if(x=this._active[m].end(!1),x instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=m,this._stack.fallThrough=!0,x}else this._handlerFb(this._id,"END",p);this._active=d,this._id=-1,this._state=0}}},o.OscHandler=class{constructor(p){this._handler=p,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(p,y,x){this._hitLimit||(this._data+=(0,g.utf32ToString)(p,y,x),this._data.length>f.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(p){let y=!1;if(this._hitLimit)y=!1;else if(p&&(y=this._handler(this._data),y instanceof Promise))return y.then(x=>(this._data="",this._hitLimit=!1,x));return this._data="",this._hitLimit=!1,y}}},8742:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.Params=void 0;const c=2147483647;class f{static fromArray(d){const p=new f;if(!d.length)return p;for(let y=Array.isArray(d[0])?1:0;y<d.length;++y){const x=d[y];if(Array.isArray(x))for(let m=0;m<x.length;++m)p.addSubParam(x[m]);else p.addParam(x)}return p}constructor(d=32,p=32){if(this.maxLength=d,this.maxSubParamsLength=p,p>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(d),this.length=0,this._subParams=new Int32Array(p),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 p=0;p<this.length;++p){d.push(this.params[p]);const y=this._subParamsIdx[p]>>8,x=255&this._subParamsIdx[p];x-y>0&&d.push(Array.prototype.slice.call(this._subParams,y,x))}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>c?c: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>c?c:d,this._subParamsIdx[this.length-1]++}}hasSubParams(d){return(255&this._subParamsIdx[d])-(this._subParamsIdx[d]>>8)>0}getSubParams(d){const p=this._subParamsIdx[d]>>8,y=255&this._subParamsIdx[d];return y-p>0?this._subParams.subarray(p,y):null}getSubParamsAll(){const d={};for(let p=0;p<this.length;++p){const y=this._subParamsIdx[p]>>8,x=255&this._subParamsIdx[p];x-y>0&&(d[p]=this._subParams.slice(y,x))}return d}addDigit(d){let p;if(this._rejectDigits||!(p=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const y=this._digitIsSub?this._subParams:this.params,x=y[p-1];y[p-1]=~x?Math.min(10*x+d,c):d}}o.Params=f},5741:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.AddonManager=void 0,o.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let c=this._addons.length-1;c>=0;c--)this._addons[c].instance.dispose()}loadAddon(c,f){const g={instance:f,dispose:f.dispose,isDisposed:!1};this._addons.push(g),f.dispose=()=>this._wrappedAddonDispose(g),f.activate(c)}_wrappedAddonDispose(c){if(c.isDisposed)return;let f=-1;for(let g=0;g<this._addons.length;g++)if(this._addons[g]===c){f=g;break}if(f===-1)throw new Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0,c.dispose.apply(c.instance),this._addons.splice(f,1)}}},8771:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferApiView=void 0;const f=c(3785),g=c(511);o.BufferApiView=class{constructor(d,p){this._buffer=d,this.type=p}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 p=this._buffer.lines.get(d);if(p)return new f.BufferLineApiView(p)}getNullCell(){return new g.CellData}}},3785:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferLineApiView=void 0;const f=c(511);o.BufferLineApiView=class{constructor(g){this._line=g}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(g,d){if(!(g<0||g>=this._line.length))return d?(this._line.loadCell(g,d),d):this._line.loadCell(g,new f.CellData)}translateToString(g,d,p){return this._line.translateToString(g,d,p)}}},8285:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.BufferNamespaceApi=void 0;const f=c(8771),g=c(8460),d=c(844);class p extends d.Disposable{constructor(x){super(),this._core=x,this._onBufferChange=this.register(new g.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)}}o.BufferNamespaceApi=p},7975:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.ParserApi=void 0,o.ParserApi=class{constructor(c){this._core=c}registerCsiHandler(c,f){return this._core.registerCsiHandler(c,g=>f(g.toArray()))}addCsiHandler(c,f){return this.registerCsiHandler(c,f)}registerDcsHandler(c,f){return this._core.registerDcsHandler(c,(g,d)=>f(g,d.toArray()))}addDcsHandler(c,f){return this.registerDcsHandler(c,f)}registerEscHandler(c,f){return this._core.registerEscHandler(c,f)}addEscHandler(c,f){return this.registerEscHandler(c,f)}registerOscHandler(c,f){return this._core.registerOscHandler(c,f)}addOscHandler(c,f){return this.registerOscHandler(c,f)}}},7090:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeApi=void 0,o.UnicodeApi=class{constructor(c){this._core=c}register(c){this._core.unicodeService.register(c)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(c){this._core.unicodeService.activeVersion=c}}},744:function(v,o,c){var f=this&&this.__decorate||function(u,a,n,l){var _,S=arguments.length,C=S<3?a:l===null?l=Object.getOwnPropertyDescriptor(a,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,a,n,l);else for(var b=u.length-1;b>=0;b--)(_=u[b])&&(C=(S<3?_(C):S>3?_(a,n,C):_(a,n))||C);return S>3&&C&&Object.defineProperty(a,n,C),C},g=this&&this.__param||function(u,a){return function(n,l){a(n,l,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.BufferService=o.MINIMUM_ROWS=o.MINIMUM_COLS=void 0;const d=c(8460),p=c(844),y=c(5295),x=c(2585);o.MINIMUM_COLS=2,o.MINIMUM_ROWS=1;let m=o.BufferService=class extends p.Disposable{get buffer(){return this.buffers.active}constructor(u){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(u.rawOptions.cols||0,o.MINIMUM_COLS),this.rows=Math.max(u.rawOptions.rows||0,o.MINIMUM_ROWS),this.buffers=this.register(new y.BufferSet(u,this))}resize(u,a){this.cols=u,this.rows=a,this.buffers.resize(u,a),this._onResize.fire({cols:u,rows:a})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(u,a=!1){const n=this.buffer;let l;l=this._cachedBlankLine,l&&l.length===this.cols&&l.getFg(0)===u.fg&&l.getBg(0)===u.bg||(l=n.getBlankLine(u,a),this._cachedBlankLine=l),l.isWrapped=a;const _=n.ybase+n.scrollTop,S=n.ybase+n.scrollBottom;if(n.scrollTop===0){const C=n.lines.isFull;S===n.lines.length-1?C?n.lines.recycle().copyFrom(l):n.lines.push(l.clone()):n.lines.splice(S+1,0,l.clone()),C?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{const C=S-_+1;n.lines.shiftElements(_+1,C-1,-1),n.lines.set(S,l.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(u,a,n){const l=this.buffer;if(u<0){if(l.ydisp===0)return;this.isUserScrolling=!0}else u+l.ydisp>=l.ybase&&(this.isUserScrolling=!1);const _=l.ydisp;l.ydisp=Math.max(Math.min(l.ydisp+u,l.ybase),0),_!==l.ydisp&&(a||this._onScroll.fire(l.ydisp))}};o.BufferService=m=f([g(0,x.IOptionsService)],m)},7994:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.CharsetService=void 0,o.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(c){this.glevel=c,this.charset=this._charsets[c]}setgCharset(c,f){this._charsets[c]=f,this.glevel===c&&(this.charset=f)}}},1753:function(v,o,c){var f=this&&this.__decorate||function(l,_,S,C){var b,w=arguments.length,E=w<3?_:C===null?C=Object.getOwnPropertyDescriptor(_,S):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(l,_,S,C);else for(var P=l.length-1;P>=0;P--)(b=l[P])&&(E=(w<3?b(E):w>3?b(_,S,E):b(_,S))||E);return w>3&&E&&Object.defineProperty(_,S,E),E},g=this&&this.__param||function(l,_){return function(S,C){_(S,C,l)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreMouseService=void 0;const d=c(2585),p=c(8460),y=c(844),x={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:l=>l.button!==4&&l.action===1&&(l.ctrl=!1,l.alt=!1,l.shift=!1,!0)},VT200:{events:19,restrict:l=>l.action!==32},DRAG:{events:23,restrict:l=>l.action!==32||l.button!==3},ANY:{events:31,restrict:l=>!0}};function m(l,_){let S=(l.ctrl?16:0)|(l.shift?4:0)|(l.alt?8:0);return l.button===4?(S|=64,S|=l.action):(S|=3&l.button,4&l.button&&(S|=64),8&l.button&&(S|=128),l.action===32?S|=32:l.action!==0||_||(S|=3)),S}const u=String.fromCharCode,a={DEFAULT:l=>{const _=[m(l,!1)+32,l.col+32,l.row+32];return _[0]>255||_[1]>255||_[2]>255?"":`\x1B[M${u(_[0])}${u(_[1])}${u(_[2])}`},SGR:l=>{const _=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${m(l,!0)};${l.col};${l.row}${_}`},SGR_PIXELS:l=>{const _=l.action===0&&l.button!==4?"m":"M";return`\x1B[<${m(l,!0)};${l.x};${l.y}${_}`}};let n=o.CoreMouseService=class extends y.Disposable{constructor(l,_){super(),this._bufferService=l,this._coreService=_,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new p.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const S of Object.keys(x))this.addProtocol(S,x[S]);for(const S of Object.keys(a))this.addEncoding(S,a[S]);this.reset()}addProtocol(l,_){this._protocols[l]=_}addEncoding(l,_){this._encodings[l]=_}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(l){if(!this._protocols[l])throw new Error(`unknown protocol "${l}"`);this._activeProtocol=l,this._onProtocolChange.fire(this._protocols[l].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(l){if(!this._encodings[l])throw new Error(`unknown encoding "${l}"`);this._activeEncoding=l}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(l){if(l.col<0||l.col>=this._bufferService.cols||l.row<0||l.row>=this._bufferService.rows||l.button===4&&l.action===32||l.button===3&&l.action!==32||l.button!==4&&(l.action===2||l.action===3)||(l.col++,l.row++,l.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,l,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(l))return!1;const _=this._encodings[this._activeEncoding](l);return _&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(_):this._coreService.triggerDataEvent(_,!0)),this._lastEvent=l,!0}explainEvents(l){return{down:!!(1&l),up:!!(2&l),drag:!!(4&l),move:!!(8&l),wheel:!!(16&l)}}_equalEvents(l,_,S){if(S){if(l.x!==_.x||l.y!==_.y)return!1}else if(l.col!==_.col||l.row!==_.row)return!1;return l.button===_.button&&l.action===_.action&&l.ctrl===_.ctrl&&l.alt===_.alt&&l.shift===_.shift}};o.CoreMouseService=n=f([g(0,d.IBufferService),g(1,d.ICoreService)],n)},6975:function(v,o,c){var f=this&&this.__decorate||function(n,l,_,S){var C,b=arguments.length,w=b<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(n,l,_,S);else for(var E=n.length-1;E>=0;E--)(C=n[E])&&(w=(b<3?C(w):b>3?C(l,_,w):C(l,_))||w);return b>3&&w&&Object.defineProperty(l,_,w),w},g=this&&this.__param||function(n,l){return function(_,S){l(_,S,n)}};Object.defineProperty(o,"__esModule",{value:!0}),o.CoreService=void 0;const d=c(1439),p=c(8460),y=c(844),x=c(2585),m=Object.freeze({insertMode:!1}),u=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let a=o.CoreService=class extends y.Disposable{constructor(n,l,_){super(),this._bufferService=n,this._logService=l,this._optionsService=_,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new p.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new p.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new p.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new p.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,d.clone)(m),this.decPrivateModes=(0,d.clone)(u)}reset(){this.modes=(0,d.clone)(m),this.decPrivateModes=(0,d.clone)(u)}triggerDataEvent(n,l=!1){if(this._optionsService.rawOptions.disableStdin)return;const _=this._bufferService.buffer;l&&this._optionsService.rawOptions.scrollOnUserInput&&_.ybase!==_.ydisp&&this._onRequestScrollToBottom.fire(),l&&this._onUserInput.fire(),this._logService.debug(`sending data "${n}"`,()=>n.split("").map(S=>S.charCodeAt(0))),this._onData.fire(n)}triggerBinaryEvent(n){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${n}"`,()=>n.split("").map(l=>l.charCodeAt(0))),this._onBinary.fire(n))}};o.CoreService=a=f([g(0,x.IBufferService),g(1,x.ILogService),g(2,x.IOptionsService)],a)},9074:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.DecorationService=void 0;const f=c(8055),g=c(8460),d=c(844),p=c(6106);let y=0,x=0;class m extends d.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new p.SortedList(n=>n==null?void 0:n.marker.line),this._onDecorationRegistered=this.register(new g.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new g.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,d.toDisposable)(()=>this.reset()))}registerDecoration(n){if(n.marker.isDisposed)return;const l=new u(n);if(l){const _=l.marker.onDispose(()=>l.dispose());l.onDispose(()=>{l&&(this._decorations.delete(l)&&this._onDecorationRemoved.fire(l),_.dispose())}),this._decorations.insert(l),this._onDecorationRegistered.fire(l)}return l}reset(){for(const n of this._decorations.values())n.dispose();this._decorations.clear()}*getDecorationsAtCell(n,l,_){let S=0,C=0;for(const b of this._decorations.getKeyIterator(l))S=b.options.x??0,C=S+(b.options.width??1),n>=S&&n<C&&(!_||(b.options.layer??"bottom")===_)&&(yield b)}forEachDecorationAtCell(n,l,_,S){this._decorations.forEachByKey(l,C=>{y=C.options.x??0,x=y+(C.options.width??1),n>=y&&n<x&&(!_||(C.options.layer??"bottom")===_)&&S(C)})}}o.DecorationService=m;class u 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(n){super(),this.options=n,this.onRenderEmitter=this.register(new g.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new g.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=n.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.InstantiationService=o.ServiceCollection=void 0;const f=c(2585),g=c(8343);class d{constructor(...y){this._entries=new Map;for(const[x,m]of y)this.set(x,m)}set(y,x){const m=this._entries.get(y);return this._entries.set(y,x),m}forEach(y){for(const[x,m]of this._entries.entries())y(x,m)}has(y){return this._entries.has(y)}get(y){return this._entries.get(y)}}o.ServiceCollection=d,o.InstantiationService=class{constructor(){this._services=new d,this._services.set(f.IInstantiationService,this)}setService(p,y){this._services.set(p,y)}getService(p){return this._services.get(p)}createInstance(p,...y){const x=(0,g.getServiceDependencies)(p).sort((a,n)=>a.index-n.index),m=[];for(const a of x){const n=this._services.get(a.id);if(!n)throw new Error(`[createInstance] ${p.name} depends on UNKNOWN service ${a.id}.`);m.push(n)}const u=x.length>0?x[0].index:y.length;if(y.length!==u)throw new Error(`[createInstance] First service dependency of ${p.name} at position ${u+1} conflicts with ${y.length} static arguments`);return new p(...y,...m)}}},7866:function(v,o,c){var f=this&&this.__decorate||function(u,a,n,l){var _,S=arguments.length,C=S<3?a:l===null?l=Object.getOwnPropertyDescriptor(a,n):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(u,a,n,l);else for(var b=u.length-1;b>=0;b--)(_=u[b])&&(C=(S<3?_(C):S>3?_(a,n,C):_(a,n))||C);return S>3&&C&&Object.defineProperty(a,n,C),C},g=this&&this.__param||function(u,a){return function(n,l){a(n,l,u)}};Object.defineProperty(o,"__esModule",{value:!0}),o.traceCall=o.setTraceLogger=o.LogService=void 0;const d=c(844),p=c(2585),y={trace:p.LogLevelEnum.TRACE,debug:p.LogLevelEnum.DEBUG,info:p.LogLevelEnum.INFO,warn:p.LogLevelEnum.WARN,error:p.LogLevelEnum.ERROR,off:p.LogLevelEnum.OFF};let x,m=o.LogService=class extends d.Disposable{get logLevel(){return this._logLevel}constructor(u){super(),this._optionsService=u,this._logLevel=p.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),x=this}_updateLogLevel(){this._logLevel=y[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(u){for(let a=0;a<u.length;a++)typeof u[a]=="function"&&(u[a]=u[a]())}_log(u,a,n){this._evalLazyOptionalParams(n),u.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+a,...n)}trace(u,...a){var n;this._logLevel<=p.LogLevelEnum.TRACE&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.trace.bind(this._optionsService.options.logger))??console.log,u,a)}debug(u,...a){var n;this._logLevel<=p.LogLevelEnum.DEBUG&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.debug.bind(this._optionsService.options.logger))??console.log,u,a)}info(u,...a){var n;this._logLevel<=p.LogLevelEnum.INFO&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.info.bind(this._optionsService.options.logger))??console.info,u,a)}warn(u,...a){var n;this._logLevel<=p.LogLevelEnum.WARN&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.warn.bind(this._optionsService.options.logger))??console.warn,u,a)}error(u,...a){var n;this._logLevel<=p.LogLevelEnum.ERROR&&this._log(((n=this._optionsService.options.logger)==null?void 0:n.error.bind(this._optionsService.options.logger))??console.error,u,a)}};o.LogService=m=f([g(0,p.IOptionsService)],m),o.setTraceLogger=function(u){x=u},o.traceCall=function(u,a,n){if(typeof n.value!="function")throw new Error("not supported");const l=n.value;n.value=function(..._){if(x.logLevel!==p.LogLevelEnum.TRACE)return l.apply(this,_);x.trace(`GlyphRenderer#${l.name}(${_.map(C=>JSON.stringify(C)).join(", ")})`);const S=l.apply(this,_);return x.trace(`GlyphRenderer#${l.name} return`,S),S}}},7302:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.OptionsService=o.DEFAULT_OPTIONS=void 0;const f=c(8460),g=c(844),d=c(6114);o.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const p=["normal","bold","100","200","300","400","500","600","700","800","900"];class y extends g.Disposable{constructor(m){super(),this._onOptionChange=this.register(new f.EventEmitter),this.onOptionChange=this._onOptionChange.event;const u={...o.DEFAULT_OPTIONS};for(const a in m)if(a in u)try{const n=m[a];u[a]=this._sanitizeAndValidateOption(a,n)}catch(n){console.error(n)}this.rawOptions=u,this.options={...u},this._setupOptions(),this.register((0,g.toDisposable)(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(m,u){return this.onOptionChange(a=>{a===m&&u(this.rawOptions[m])})}onMultipleOptionChange(m,u){return this.onOptionChange(a=>{m.indexOf(a)!==-1&&u()})}_setupOptions(){const m=a=>{if(!(a in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);return this.rawOptions[a]},u=(a,n)=>{if(!(a in o.DEFAULT_OPTIONS))throw new Error(`No option with key "${a}"`);n=this._sanitizeAndValidateOption(a,n),this.rawOptions[a]!==n&&(this.rawOptions[a]=n,this._onOptionChange.fire(a))};for(const a in this.rawOptions){const n={get:m.bind(this,a),set:u.bind(this,a)};Object.defineProperty(this.options,a,n)}}_sanitizeAndValidateOption(m,u){switch(m){case"cursorStyle":if(u||(u=o.DEFAULT_OPTIONS[m]),!function(a){return a==="block"||a==="underline"||a==="bar"}(u))throw new Error(`"${u}" is not a valid value for ${m}`);break;case"wordSeparator":u||(u=o.DEFAULT_OPTIONS[m]);break;case"fontWeight":case"fontWeightBold":if(typeof u=="number"&&1<=u&&u<=1e3)break;u=p.includes(u)?u:o.DEFAULT_OPTIONS[m];break;case"cursorWidth":u=Math.floor(u);case"lineHeight":case"tabStopWidth":if(u<1)throw new Error(`${m} cannot be less than 1, value: ${u}`);break;case"minimumContrastRatio":u=Math.max(1,Math.min(21,Math.round(10*u)/10));break;case"scrollback":if((u=Math.min(u,4294967295))<0)throw new Error(`${m} cannot be less than 0, value: ${u}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(u<=0)throw new Error(`${m} cannot be less than or equal to 0, value: ${u}`);break;case"rows":case"cols":if(!u&&u!==0)throw new Error(`${m} must be numeric, value: ${u}`);break;case"windowsPty":u=u??{}}return u}}o.OptionsService=y},2660:function(v,o,c){var f=this&&this.__decorate||function(y,x,m,u){var a,n=arguments.length,l=n<3?x:u===null?u=Object.getOwnPropertyDescriptor(x,m):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(y,x,m,u);else for(var _=y.length-1;_>=0;_--)(a=y[_])&&(l=(n<3?a(l):n>3?a(x,m,l):a(x,m))||l);return n>3&&l&&Object.defineProperty(x,m,l),l},g=this&&this.__param||function(y,x){return function(m,u){x(m,u,y)}};Object.defineProperty(o,"__esModule",{value:!0}),o.OscLinkService=void 0;const d=c(2585);let p=o.OscLinkService=class{constructor(y){this._bufferService=y,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(y){const x=this._bufferService.buffer;if(y.id===void 0){const _=x.addMarker(x.ybase+x.y),S={data:y,id:this._nextId++,lines:[_]};return _.onDispose(()=>this._removeMarkerFromLink(S,_)),this._dataByLinkId.set(S.id,S),S.id}const m=y,u=this._getEntryIdKey(m),a=this._entriesWithId.get(u);if(a)return this.addLineToLink(a.id,x.ybase+x.y),a.id;const n=x.addMarker(x.ybase+x.y),l={id:this._nextId++,key:this._getEntryIdKey(m),data:m,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(l,n)),this._entriesWithId.set(l.key,l),this._dataByLinkId.set(l.id,l),l.id}addLineToLink(y,x){const m=this._dataByLinkId.get(y);if(m&&m.lines.every(u=>u.line!==x)){const u=this._bufferService.buffer.addMarker(x);m.lines.push(u),u.onDispose(()=>this._removeMarkerFromLink(m,u))}}getLinkData(y){var x;return(x=this._dataByLinkId.get(y))==null?void 0:x.data}_getEntryIdKey(y){return`${y.id};;${y.uri}`}_removeMarkerFromLink(y,x){const m=y.lines.indexOf(x);m!==-1&&(y.lines.splice(m,1),y.lines.length===0&&(y.data.id!==void 0&&this._entriesWithId.delete(y.key),this._dataByLinkId.delete(y.id)))}};o.OscLinkService=p=f([g(0,d.IBufferService)],p)},8343:(v,o)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.createDecorator=o.getServiceDependencies=o.serviceRegistry=void 0;const c="di$target",f="di$dependencies";o.serviceRegistry=new Map,o.getServiceDependencies=function(g){return g[f]||[]},o.createDecorator=function(g){if(o.serviceRegistry.has(g))return o.serviceRegistry.get(g);const d=function(p,y,x){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(m,u,a){u[c]===u?u[f].push({id:m,index:a}):(u[f]=[{id:m,index:a}],u[c]=u)})(d,p,x)};return d.toString=()=>g,o.serviceRegistry.set(g,d),d}},2585:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.IDecorationService=o.IUnicodeService=o.IOscLinkService=o.IOptionsService=o.ILogService=o.LogLevelEnum=o.IInstantiationService=o.ICharsetService=o.ICoreService=o.ICoreMouseService=o.IBufferService=void 0;const f=c(8343);var g;o.IBufferService=(0,f.createDecorator)("BufferService"),o.ICoreMouseService=(0,f.createDecorator)("CoreMouseService"),o.ICoreService=(0,f.createDecorator)("CoreService"),o.ICharsetService=(0,f.createDecorator)("CharsetService"),o.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"}(g||(o.LogLevelEnum=g={})),o.ILogService=(0,f.createDecorator)("LogService"),o.IOptionsService=(0,f.createDecorator)("OptionsService"),o.IOscLinkService=(0,f.createDecorator)("OscLinkService"),o.IUnicodeService=(0,f.createDecorator)("UnicodeService"),o.IDecorationService=(0,f.createDecorator)("DecorationService")},1480:(v,o,c)=>{Object.defineProperty(o,"__esModule",{value:!0}),o.UnicodeService=void 0;const f=c(8460),g=c(225);class d{static extractShouldJoin(y){return(1&y)!=0}static extractWidth(y){return y>>1&3}static extractCharKind(y){return y>>3}static createPropertyValue(y,x,m=!1){return(16777215&y)<<3|(3&x)<<1|(m?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new f.EventEmitter,this.onChange=this._onChange.event;const y=new g.UnicodeV6;this.register(y),this._active=y.version,this._activeProvider=y}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(y){if(!this._providers[y])throw new Error(`unknown Unicode version "${y}"`);this._active=y,this._activeProvider=this._providers[y],this._onChange.fire(y)}register(y){this._providers[y.version]=y}wcwidth(y){return this._activeProvider.wcwidth(y)}getStringCellWidth(y){let x=0,m=0;const u=y.length;for(let a=0;a<u;++a){let n=y.charCodeAt(a);if(55296<=n&&n<=56319){if(++a>=u)return x+this.wcwidth(n);const S=y.charCodeAt(a);56320<=S&&S<=57343?n=1024*(n-55296)+S-56320+65536:x+=this.wcwidth(S)}const l=this.charProperties(n,m);let _=d.extractWidth(l);d.extractShouldJoin(l)&&(_-=d.extractWidth(m)),x+=_,m=l}return x}charProperties(y,x){return this._activeProvider.charProperties(y,x)}}o.UnicodeService=d}},i={};function s(v){var o=i[v];if(o!==void 0)return o.exports;var c=i[v]={exports:{}};return r[v].call(c.exports,c,c.exports,s),c.exports}var h={};return(()=>{var v=h;Object.defineProperty(v,"__esModule",{value:!0}),v.Terminal=void 0;const o=s(9042),c=s(3236),f=s(844),g=s(5741),d=s(8285),p=s(7975),y=s(7090),x=["cols","rows"];class m extends f.Disposable{constructor(a){super(),this._core=this.register(new c.Terminal(a)),this._addonManager=this.register(new g.AddonManager),this._publicOptions={...this._core.options};const n=_=>this._core.options[_],l=(_,S)=>{this._checkReadonlyOptions(_),this._core.options[_]=S};for(const _ in this._core.options){const S={get:n.bind(this,_),set:l.bind(this,_)};Object.defineProperty(this._publicOptions,_,S)}}_checkReadonlyOptions(a){if(x.includes(a))throw new Error(`Option "${a}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new p.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new y.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 a=this._core.coreService.decPrivateModes;let n="none";switch(this._core.coreMouseService.activeProtocol){case"X10":n="x10";break;case"VT200":n="vt200";break;case"DRAG":n="drag";break;case"ANY":n="any"}return{applicationCursorKeysMode:a.applicationCursorKeys,applicationKeypadMode:a.applicationKeypad,bracketedPasteMode:a.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:n,originMode:a.origin,reverseWraparoundMode:a.reverseWraparound,sendFocusMode:a.sendFocus,wraparoundMode:a.wraparound}}get options(){return this._publicOptions}set options(a){for(const n in a)this._publicOptions[n]=a[n]}blur(){this._core.blur()}focus(){this._core.focus()}input(a,n=!0){this._core.input(a,n)}resize(a,n){this._verifyIntegers(a,n),this._core.resize(a,n)}open(a){this._core.open(a)}attachCustomKeyEventHandler(a){this._core.attachCustomKeyEventHandler(a)}attachCustomWheelEventHandler(a){this._core.attachCustomWheelEventHandler(a)}registerLinkProvider(a){return this._core.registerLinkProvider(a)}registerCharacterJoiner(a){return this._checkProposedApi(),this._core.registerCharacterJoiner(a)}deregisterCharacterJoiner(a){this._checkProposedApi(),this._core.deregisterCharacterJoiner(a)}registerMarker(a=0){return this._verifyIntegers(a),this._core.registerMarker(a)}registerDecoration(a){return this._checkProposedApi(),this._verifyPositiveIntegers(a.x??0,a.width??0,a.height??0),this._core.registerDecoration(a)}hasSelection(){return this._core.hasSelection()}select(a,n,l){this._verifyIntegers(a,n,l),this._core.select(a,n,l)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(a,n){this._verifyIntegers(a,n),this._core.selectLines(a,n)}dispose(){super.dispose()}scrollLines(a){this._verifyIntegers(a),this._core.scrollLines(a)}scrollPages(a){this._verifyIntegers(a),this._core.scrollPages(a)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(a){this._verifyIntegers(a),this._core.scrollToLine(a)}clear(){this._core.clear()}write(a,n){this._core.write(a,n)}writeln(a,n){this._core.write(a),this._core.write(`\r
|
|
64
|
+
`,n)}paste(a){this._core.paste(a)}refresh(a,n){this._verifyIntegers(a,n),this._core.refresh(a,n)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(a){this._addonManager.loadAddon(this,a)}static get strings(){return o}_verifyIntegers(...a){for(const n of a)if(n===1/0||isNaN(n)||n%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...a){for(const n of a)if(n&&(n===1/0||isNaN(n)||n%1!=0||n<0))throw new Error("This API only accepts positive integers")}}v.Terminal=m})(),h})())})(fd);var W_=fd.exports,_d={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(s){this._terminal=s}dispose(){}fit(){const s=this.proposeDimensions();if(!s||!this._terminal||isNaN(s.cols)||isNaN(s.rows))return;const h=this._terminal._core;this._terminal.rows===s.rows&&this._terminal.cols===s.cols||(h._renderService.clear(),this._terminal.resize(s.cols,s.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const s=this._terminal._core,h=s._renderService.dimensions;if(h.css.cell.width===0||h.css.cell.height===0)return;const v=this._terminal.options.scrollback===0?0:s.viewport.scrollBarWidth,o=window.getComputedStyle(this._terminal.element.parentElement),c=parseInt(o.getPropertyValue("height")),f=Math.max(0,parseInt(o.getPropertyValue("width"))),g=window.getComputedStyle(this._terminal.element),d=c-(parseInt(g.getPropertyValue("padding-top"))+parseInt(g.getPropertyValue("padding-bottom"))),p=f-(parseInt(g.getPropertyValue("padding-right"))+parseInt(g.getPropertyValue("padding-left")))-v;return{cols:Math.max(2,Math.floor(p/h.css.cell.width)),rows:Math.max(1,Math.floor(d/h.css.cell.height))}}}})(),r})())})(_d);var jc=_d.exports,vd={exports:{}};(function(e,t){(function(r,i){e.exports=i()})(self,()=>(()=>{var r={6:(v,o)=>{function c(g){try{const d=new URL(g),p=d.password&&d.username?`${d.protocol}//${d.username}:${d.password}@${d.host}`:d.username?`${d.protocol}//${d.username}@${d.host}`:`${d.protocol}//${d.host}`;return g.toLocaleLowerCase().startsWith(p.toLocaleLowerCase())}catch{return!1}}Object.defineProperty(o,"__esModule",{value:!0}),o.LinkComputer=o.WebLinkProvider=void 0,o.WebLinkProvider=class{constructor(g,d,p,y={}){this._terminal=g,this._regex=d,this._handler=p,this._options=y}provideLinks(g,d){const p=f.computeLink(g,this._regex,this._terminal,this._handler);d(this._addCallbacks(p))}_addCallbacks(g){return g.map(d=>(d.leave=this._options.leave,d.hover=(p,y)=>{if(this._options.hover){const{range:x}=d;this._options.hover(p,y,x)}},d))}};class f{static computeLink(d,p,y,x){const m=new RegExp(p.source,(p.flags||"")+"g"),[u,a]=f._getWindowedLineStrings(d-1,y),n=u.join("");let l;const _=[];for(;l=m.exec(n);){const S=l[0];if(!c(S))continue;const[C,b]=f._mapStrIdx(y,a,0,l.index),[w,E]=f._mapStrIdx(y,C,b,S.length);if(C===-1||b===-1||w===-1||E===-1)continue;const P={start:{x:b+1,y:C+1},end:{x:E,y:w+1}};_.push({range:P,text:S,activate:x})}return _}static _getWindowedLineStrings(d,p){let y,x=d,m=d,u=0,a="";const n=[];if(y=p.buffer.active.getLine(d)){const l=y.translateToString(!0);if(y.isWrapped&&l[0]!==" "){for(u=0;(y=p.buffer.active.getLine(--x))&&u<2048&&(a=y.translateToString(!0),u+=a.length,n.push(a),y.isWrapped&&a.indexOf(" ")===-1););n.reverse()}for(n.push(l),u=0;(y=p.buffer.active.getLine(++m))&&y.isWrapped&&u<2048&&(a=y.translateToString(!0),u+=a.length,n.push(a),a.indexOf(" ")===-1););}return[n,x]}static _mapStrIdx(d,p,y,x){const m=d.buffer.active,u=m.getNullCell();let a=y;for(;x;){const n=m.getLine(p);if(!n)return[-1,-1];for(let l=a;l<n.length;++l){n.getCell(l,u);const _=u.getChars();if(u.getWidth()&&(x-=_.length||1,l===n.length-1&&_==="")){const S=m.getLine(p+1);S&&S.isWrapped&&(S.getCell(0,u),u.getWidth()===2&&(x+=1))}if(x<0)return[p,l]}p++,a=0}return[p,a]}}o.LinkComputer=f}},i={};function s(v){var o=i[v];if(o!==void 0)return o.exports;var c=i[v]={exports:{}};return r[v](c,c.exports,s),c.exports}var h={};return(()=>{var v=h;Object.defineProperty(v,"__esModule",{value:!0}),v.WebLinksAddon=void 0;const o=s(6),c=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function f(g,d){const p=window.open();if(p){try{p.opener=null}catch{}p.location.href=d}else console.warn("Opening link blocked as opener could not be cleared")}v.WebLinksAddon=class{constructor(g=f,d={}){this._handler=g,this._options=d}activate(g){this._terminal=g;const d=this._options,p=d.urlRegex||c;this._linkProvider=this._terminal.registerLinkProvider(new o.WebLinkProvider(this._terminal,p,this._handler,d))}dispose(){var g;(g=this._linkProvider)==null||g.dispose()}}})(),h})())})(vd);var U_=vd.exports;/**
|
|
65
|
+
* Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
|
|
66
|
+
* @license MIT
|
|
67
|
+
*
|
|
68
|
+
* Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
|
|
69
|
+
* @license MIT
|
|
70
|
+
*
|
|
71
|
+
* Originally forked from (with the author's permission):
|
|
72
|
+
* Fabrice Bellard's javascript vt100 for jslinux:
|
|
73
|
+
* http://bellard.org/jslinux/
|
|
74
|
+
* Copyright (c) 2011 Fabrice Bellard
|
|
75
|
+
*/var $_=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Nc.isErrorNoTelemetry(e)?new Nc(e.message+`
|
|
76
|
+
|
|
77
|
+
`+e.stack):new Error(e.message+`
|
|
78
|
+
|
|
79
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},K_=new $_;function co(e){V_(e)||K_.onUnexpectedError(e)}var fa="Canceled";function V_(e){return e instanceof q_?!0:e instanceof Error&&e.name===fa&&e.message===fa}var q_=class extends Error{constructor(){super(fa),this.name=this.message}},Nc=class pa extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof pa)return t;let r=new pa;return r.message=t.message,r.stack=t.stack,r}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},G_;(e=>{function t(h){return h<0}e.isLessThan=t;function r(h){return h<=0}e.isLessThanOrEqual=r;function i(h){return h>0}e.isGreaterThan=i;function s(h){return h===0}e.isNeitherLessOrGreaterThan=s,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(G_||(G_={}));function X_(e,t){let r=this,i=!1,s;return function(){return i||(i=!0,t||(s=e.apply(r,arguments))),s}}var gd;(e=>{function t(_){return _&&typeof _=="object"&&typeof _[Symbol.iterator]=="function"}e.is=t;let r=Object.freeze([]);function i(){return r}e.empty=i;function*s(_){yield _}e.single=s;function h(_){return t(_)?_:s(_)}e.wrap=h;function v(_){return _||r}e.from=v;function*o(_){for(let S=_.length-1;S>=0;S--)yield _[S]}e.reverse=o;function c(_){return!_||_[Symbol.iterator]().next().done===!0}e.isEmpty=c;function f(_){return _[Symbol.iterator]().next().value}e.first=f;function g(_,S){let C=0;for(let b of _)if(S(b,C++))return!0;return!1}e.some=g;function d(_,S){for(let C of _)if(S(C))return C}e.find=d;function*p(_,S){for(let C of _)S(C)&&(yield C)}e.filter=p;function*y(_,S){let C=0;for(let b of _)yield S(b,C++)}e.map=y;function*x(_,S){let C=0;for(let b of _)yield*S(b,C++)}e.flatMap=x;function*m(..._){for(let S of _)yield*S}e.concat=m;function u(_,S,C){let b=C;for(let w of _)b=S(b,w);return b}e.reduce=u;function*a(_,S,C=_.length){for(S<0&&(S+=_.length),C<0?C+=_.length:C>_.length&&(C=_.length);S<C;S++)yield _[S]}e.slice=a;function n(_,S=Number.POSITIVE_INFINITY){let C=[];if(S===0)return[C,_];let b=_[Symbol.iterator]();for(let w=0;w<S;w++){let E=b.next();if(E.done)return[C,e.empty()];C.push(E.value)}return[C,{[Symbol.iterator](){return b}}]}e.consume=n;async function l(_){let S=[];for await(let C of _)S.push(C);return Promise.resolve(S)}e.asyncToArray=l})(gd||(gd={}));function Oi(e){if(gd.is(e)){let t=[];for(let r of e)if(r)try{r.dispose()}catch(i){t.push(i)}if(t.length===1)throw t[0];if(t.length>1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function md(...e){return ai(()=>Oi(e))}function ai(e){return{dispose:X_(()=>{e()})}}var yd=class Sd{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Oi(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Sd.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};yd.DISABLE_DISPOSED_WARNING=!1;var _l=yd,ir=class{constructor(){this._store=new _l,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};ir.None=Object.freeze({dispose(){}});var pn=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){var t;this._isDisposed||e===this._value||((t=this._value)==null||t.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){var e;this._isDisposed=!0,(e=this._value)==null||e.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},Q_=globalThis.performance&&typeof globalThis.performance.now=="function",Y_=class wd{static create(t){return new wd(t)}constructor(t){this._now=Q_&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},vl;(e=>{e.None=()=>ir.None;function t(M,L){return d(M,()=>{},0,void 0,!0,void 0,L)}e.defer=t;function r(M){return(L,I=null,F)=>{let H=!1,U;return U=M(N=>{if(!H)return U?U.dispose():H=!0,L.call(I,N)},null,F),H&&U.dispose(),U}}e.once=r;function i(M,L,I){return f((F,H=null,U)=>M(N=>F.call(H,L(N)),null,U),I)}e.map=i;function s(M,L,I){return f((F,H=null,U)=>M(N=>{L(N),F.call(H,N)},null,U),I)}e.forEach=s;function h(M,L,I){return f((F,H=null,U)=>M(N=>L(N)&&F.call(H,N),null,U),I)}e.filter=h;function v(M){return M}e.signal=v;function o(...M){return(L,I=null,F)=>{let H=md(...M.map(U=>U(N=>L.call(I,N))));return g(H,F)}}e.any=o;function c(M,L,I,F){let H=I;return i(M,U=>(H=L(H,U),H),F)}e.reduce=c;function f(M,L){let I,F={onWillAddFirstListener(){I=M(H.fire,H)},onDidRemoveLastListener(){I==null||I.dispose()}},H=new xt(F);return L==null||L.add(H),H.event}function g(M,L){return L instanceof Array?L.push(M):L&&L.add(M),M}function d(M,L,I=100,F=!1,H=!1,U,N){let k,T,A,B=0,$,V={leakWarningThreshold:U,onWillAddFirstListener(){k=M(J=>{B++,T=L(T,J),F&&!A&&(Y.fire(T),T=void 0),$=()=>{let j=T;T=void 0,A=void 0,(!F||B>1)&&Y.fire(j),B=0},typeof I=="number"?(clearTimeout(A),A=setTimeout($,I)):A===void 0&&(A=0,queueMicrotask($))})},onWillRemoveListener(){H&&B>0&&($==null||$())},onDidRemoveLastListener(){$=void 0,k.dispose()}},Y=new xt(V);return N==null||N.add(Y),Y.event}e.debounce=d;function p(M,L=0,I){return e.debounce(M,(F,H)=>F?(F.push(H),F):[H],L,void 0,!0,void 0,I)}e.accumulate=p;function y(M,L=(F,H)=>F===H,I){let F=!0,H;return h(M,U=>{let N=F||!L(U,H);return F=!1,H=U,N},I)}e.latch=y;function x(M,L,I){return[e.filter(M,L,I),e.filter(M,F=>!L(F),I)]}e.split=x;function m(M,L=!1,I=[],F){let H=I.slice(),U=M(T=>{H?H.push(T):k.fire(T)});F&&F.add(U);let N=()=>{H==null||H.forEach(T=>k.fire(T)),H=null},k=new xt({onWillAddFirstListener(){U||(U=M(T=>k.fire(T)),F&&F.add(U))},onDidAddFirstListener(){H&&(L?setTimeout(N):N())},onDidRemoveLastListener(){U&&U.dispose(),U=null}});return F&&F.add(k),k.event}e.buffer=m;function u(M,L){return(I,F,H)=>{let U=L(new n);return M(function(N){let k=U.evaluate(N);k!==a&&I.call(F,k)},void 0,H)}}e.chain=u;let a=Symbol("HaltChainable");class n{constructor(){this.steps=[]}map(L){return this.steps.push(L),this}forEach(L){return this.steps.push(I=>(L(I),I)),this}filter(L){return this.steps.push(I=>L(I)?I:a),this}reduce(L,I){let F=I;return this.steps.push(H=>(F=L(F,H),F)),this}latch(L=(I,F)=>I===F){let I=!0,F;return this.steps.push(H=>{let U=I||!L(H,F);return I=!1,F=H,U?H:a}),this}evaluate(L){for(let I of this.steps)if(L=I(L),L===a)break;return L}}function l(M,L,I=F=>F){let F=(...k)=>N.fire(I(...k)),H=()=>M.on(L,F),U=()=>M.removeListener(L,F),N=new xt({onWillAddFirstListener:H,onDidRemoveLastListener:U});return N.event}e.fromNodeEventEmitter=l;function _(M,L,I=F=>F){let F=(...k)=>N.fire(I(...k)),H=()=>M.addEventListener(L,F),U=()=>M.removeEventListener(L,F),N=new xt({onWillAddFirstListener:H,onDidRemoveLastListener:U});return N.event}e.fromDOMEventEmitter=_;function S(M){return new Promise(L=>r(M)(L))}e.toPromise=S;function C(M){let L=new xt;return M.then(I=>{L.fire(I)},()=>{L.fire(void 0)}).finally(()=>{L.dispose()}),L.event}e.fromPromise=C;function b(M,L){return M(I=>L.fire(I))}e.forward=b;function w(M,L,I){return L(I),M(F=>L(F))}e.runAndSubscribe=w;class E{constructor(L,I){this._observable=L,this._counter=0,this._hasChanged=!1;let F={onWillAddFirstListener:()=>{L.addObserver(this)},onDidRemoveLastListener:()=>{L.removeObserver(this)}};this.emitter=new xt(F),I&&I.add(this.emitter)}beginUpdate(L){this._counter++}handlePossibleChange(L){}handleChange(L,I){this._hasChanged=!0}endUpdate(L){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function P(M,L){return new E(M,L).emitter.event}e.fromObservable=P;function O(M){return(L,I,F)=>{let H=0,U=!1,N={beginUpdate(){H++},endUpdate(){H--,H===0&&(M.reportChanges(),U&&(U=!1,L.call(I)))},handlePossibleChange(){},handleChange(){U=!0}};M.addObserver(N),M.reportChanges();let k={dispose(){M.removeObserver(N)}};return F instanceof _l?F.add(k):Array.isArray(F)&&F.push(k),k}}e.fromObservableLight=O})(vl||(vl={}));var _a=class va{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${va._idPool++}`,va.all.add(this)}start(t){this._stopWatch=new Y_,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};_a.all=new Set,_a._idPool=0;var J_=_a,Z_=-1,Cd=class xd{constructor(t,r,i=(xd._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=r,this.name=i,this._warnCountdown=0}dispose(){var t;(t=this._stacks)==null||t.clear()}check(t,r){let i=this.threshold;if(i<=0||r<i)return;this._stacks||(this._stacks=new Map);let s=this._stacks.get(t.value)||0;if(this._stacks.set(t.value,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=i*.5;let[h,v]=this.getMostFrequentStack(),o=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${v}):`;console.warn(o),console.warn(h);let c=new rv(o,h);this._errorHandler(c)}return()=>{let h=this._stacks.get(t.value)||0;this._stacks.set(t.value,h-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,r=0;for(let[i,s]of this._stacks)(!t||r<s)&&(t=[i,s],r=s);return t}};Cd._idPool=1;var ev=Cd,tv=class bd{constructor(t){this.value=t}static create(){let t=new Error;return new bd(t.stack??"")}print(){console.warn(this.value.split(`
|
|
80
|
+
`).slice(2).join(`
|
|
81
|
+
`))}},rv=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},iv=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},sv=0,uo=class{constructor(e){this.value=e,this.id=sv++}},nv=2,ov,xt=class{constructor(e){var t,r,i,s;this._size=0,this._options=e,this._leakageMon=(t=this._options)!=null&&t.leakWarningThreshold?new ev((e==null?void 0:e.onListenerError)??co,((r=this._options)==null?void 0:r.leakWarningThreshold)??Z_):void 0,this._perfMon=(i=this._options)!=null&&i._profName?new J_(this._options._profName):void 0,this._deliveryQueue=(s=this._options)==null?void 0:s.deliveryQueue}dispose(){var e,t,r,i;this._disposed||(this._disposed=!0,((e=this._deliveryQueue)==null?void 0:e.current)===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),(r=(t=this._options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t),(i=this._leakageMon)==null||i.dispose())}get event(){return this._event??(this._event=(e,t,r)=>{var v,o,c,f,g;if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let d=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(d);let p=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],y=new iv(`${d}. HINT: Stack shows most frequent listener (${p[1]}-times)`,p[0]);return(((v=this._options)==null?void 0:v.onListenerError)||co)(y),ir.None}if(this._disposed)return ir.None;t&&(e=e.bind(t));let i=new uo(e),s;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(i.stack=tv.create(),s=this._leakageMon.check(i.stack,this._size+1)),this._listeners?this._listeners instanceof uo?(this._deliveryQueue??(this._deliveryQueue=new av),this._listeners=[this._listeners,i]):this._listeners.push(i):((c=(o=this._options)==null?void 0:o.onWillAddFirstListener)==null||c.call(o,this),this._listeners=i,(g=(f=this._options)==null?void 0:f.onDidAddFirstListener)==null||g.call(f,this)),this._size++;let h=ai(()=>{s==null||s(),this._removeListener(i)});return r instanceof _l?r.add(h):Array.isArray(r)&&r.push(h),h}),this._event}_removeListener(e){var s,h,v,o;if((h=(s=this._options)==null?void 0:s.onWillRemoveListener)==null||h.call(s,this),!this._listeners)return;if(this._size===1){this._listeners=void 0,(o=(v=this._options)==null?void 0:v.onDidRemoveLastListener)==null||o.call(v,this),this._size=0;return}let t=this._listeners,r=t.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[r]=void 0;let i=this._deliveryQueue.current===this;if(this._size*nv<=t.length){let c=0;for(let f=0;f<t.length;f++)t[f]?t[c++]=t[f]:i&&(this._deliveryQueue.end--,c<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=c}}_deliver(e,t){var i;if(!e)return;let r=((i=this._options)==null?void 0:i.onListenerError)||co;if(!r){e.value(t);return}try{e.value(t)}catch(s){r(s)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){var t,r,i,s;if((t=this._deliveryQueue)!=null&&t.current&&(this._deliverQueue(this._deliveryQueue),(r=this._perfMon)==null||r.stop()),(i=this._perfMon)==null||i.start(this._size),this._listeners)if(this._listeners instanceof uo)this._deliver(this._listeners,e);else{let h=this._deliveryQueue;h.enqueue(this,e,this._listeners.length),this._deliverQueue(h)}(s=this._perfMon)==null||s.stop()}hasListeners(){return this._size>0}},av=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,r){this.i=0,this.end=r,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},kd=Object.freeze(function(e,t){let r=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(r)}}}),lv;(e=>{function t(r){return r===e.None||r===e.Cancelled||r instanceof cv?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:vl.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:kd})})(lv||(lv={}));var cv=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?kd:(this._emitter||(this._emitter=new xt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},Wr="en",ho=!1,ks,Hs=Wr,Fc=Wr,uv,pt,mr=globalThis,Ae,$c;typeof mr.vscode<"u"&&typeof mr.vscode.process<"u"?Ae=mr.vscode.process:typeof process<"u"&&typeof(($c=process==null?void 0:process.versions)==null?void 0:$c.node)=="string"&&(Ae=process);var Kc,hv=typeof((Kc=Ae==null?void 0:Ae.versions)==null?void 0:Kc.electron)=="string",dv=hv&&(Ae==null?void 0:Ae.type)==="renderer",Vc;if(typeof Ae=="object"){Ae.platform,Ae.platform,ho=Ae.platform==="linux",ho&&Ae.env.SNAP&&Ae.env.SNAP_REVISION,Ae.env.CI||Ae.env.BUILD_ARTIFACTSTAGINGDIRECTORY,ks=Wr,Hs=Wr;let e=Ae.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);ks=t.userLocale,Fc=t.osLocale,Hs=t.resolvedLanguage||Wr,uv=(Vc=t.languagePack)==null?void 0:Vc.translationsConfigFile}catch{}}else typeof navigator=="object"&&!dv?(pt=navigator.userAgent,pt.indexOf("Windows")>=0,pt.indexOf("Macintosh")>=0,(pt.indexOf("Macintosh")>=0||pt.indexOf("iPad")>=0||pt.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,ho=pt.indexOf("Linux")>=0,(pt==null?void 0:pt.indexOf("Mobi"))>=0,Hs=globalThis._VSCODE_NLS_LANGUAGE||Wr,ks=navigator.language.toLowerCase(),Fc=ks):console.error("Unable to resolve platform.");var Lt=pt,Ft=Hs,fv;(e=>{function t(){return Ft}e.value=t;function r(){return Ft.length===2?Ft==="en":Ft.length>=3?Ft[0]==="e"&&Ft[1]==="n"&&Ft[2]==="-":!1}e.isDefaultVariant=r;function i(){return Ft==="en"}e.isDefault=i})(fv||(fv={}));var pv=typeof mr.postMessage=="function"&&!mr.importScripts;(()=>{if(pv){let e=[];mr.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let i=0,s=e.length;i<s;i++){let h=e[i];if(h.id===r.data.vscodeScheduleAsyncWork){e.splice(i,1),h.callback();return}}});let t=0;return r=>{let i=++t;e.push({id:i,callback:r}),mr.postMessage({vscodeScheduleAsyncWork:i},"*")}}return e=>setTimeout(e)})();var _v=!!(Lt&&Lt.indexOf("Chrome")>=0);Lt&&Lt.indexOf("Firefox")>=0;!_v&&Lt&&Lt.indexOf("Safari")>=0;Lt&&Lt.indexOf("Edg/")>=0;Lt&&Lt.indexOf("Android")>=0;function Ed(e,t=0,r){let i=setTimeout(()=>{e()},t);return ai(()=>{clearTimeout(i)})}var vv;(e=>{async function t(i){let s,h=await Promise.all(i.map(v=>v.then(o=>o,o=>{s||(s=o)})));if(typeof s<"u")throw s;return h}e.settled=t;function r(i){return new Promise(async(s,h)=>{try{await i(s,h)}catch(v){h(v)}})}e.withAsyncBody=r})(vv||(vv={}));var Hc=class nt{static fromArray(t){return new nt(r=>{r.emitMany(t)})}static fromPromise(t){return new nt(async r=>{r.emitMany(await t)})}static fromPromises(t){return new nt(async r=>{await Promise.all(t.map(async i=>r.emitOne(await i)))})}static merge(t){return new nt(async r=>{await Promise.all(t.map(async i=>{for await(let s of i)r.emitOne(s)}))})}constructor(t,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new xt,queueMicrotask(async()=>{let i={emitOne:s=>this.emitOne(s),emitMany:s=>this.emitMany(s),reject:s=>this.reject(s)};try{await Promise.resolve(t(i)),this.resolve()}catch(s){this.reject(s)}finally{i.emitOne=void 0,i.emitMany=void 0,i.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t<this._results.length)return{done:!1,value:this._results[t++]};if(this._state===1)return{done:!0,value:void 0};await vl.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>{var r;return(r=this._onReturn)==null||r.call(this),{done:!0,value:void 0}}}}static map(t,r){return new nt(async i=>{for await(let s of t)i.emitOne(r(s))})}map(t){return nt.map(this,t)}static filter(t,r){return new nt(async i=>{for await(let s of t)r(s)&&i.emitOne(s)})}filter(t){return nt.filter(this,t)}static coalesce(t){return nt.filter(t,r=>!!r)}coalesce(){return nt.coalesce(this)}static async toPromise(t){let r=[];for await(let i of t)r.push(i);return r}toPromise(){return nt.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Hc.EMPTY=Hc.fromArray([]);var gv=class extends ir{constructor(e){super(),this._terminal=e,this._linesCacheTimeout=this._register(new pn),this._linesCacheDisposables=this._register(new pn),this._register(ai(()=>this._destroyLinesCache()))}initLinesCache(){this._linesCache||(this._linesCache=new Array(this._terminal.buffer.active.length),this._linesCacheDisposables.value=md(this._terminal.onLineFeed(()=>this._destroyLinesCache()),this._terminal.onCursorMove(()=>this._destroyLinesCache()),this._terminal.onResize(()=>this._destroyLinesCache()))),this._linesCacheTimeout.value=Ed(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._linesCacheDisposables.clear(),this._linesCacheTimeout.clear()}getLineFromCache(e){var t;return(t=this._linesCache)==null?void 0:t[e]}setLineInCache(e,t){this._linesCache&&(this._linesCache[e]=t)}translateBufferLineToStringWithWrap(e,t){var h;let r=[],i=[0],s=this._terminal.buffer.active.getLine(e);for(;s;){let v=this._terminal.buffer.active.getLine(e+1),o=v?v.isWrapped:!1,c=s.translateToString(!o&&t);if(o&&v){let f=s.getCell(s.length-1);f&&f.getCode()===0&&f.getWidth()===1&&((h=v.getCell(0))==null?void 0:h.getWidth())===2&&(c=c.slice(0,-1))}if(r.push(c),o)i.push(i[i.length-1]+c.length);else break;e++,s=v}return[r.join(""),i]}},mv=class{get cachedSearchTerm(){return this._cachedSearchTerm}set cachedSearchTerm(e){this._cachedSearchTerm=e}get lastSearchOptions(){return this._lastSearchOptions}set lastSearchOptions(e){this._lastSearchOptions=e}isValidSearchTerm(e){return!!(e&&e.length>0)}didOptionsChange(e){return this._lastSearchOptions?e?this._lastSearchOptions.caseSensitive!==e.caseSensitive||this._lastSearchOptions.regex!==e.regex||this._lastSearchOptions.wholeWord!==e.wholeWord:!1:!0}shouldUpdateHighlighting(e,t){return t!=null&&t.decorations?this._cachedSearchTerm===void 0||e!==this._cachedSearchTerm||this.didOptionsChange(t):!1}clearCachedTerm(){this._cachedSearchTerm=void 0}reset(){this._cachedSearchTerm=void 0,this._lastSearchOptions=void 0}},yv=class{constructor(e,t){this._terminal=e,this._lineCache=t}find(e,t,r,i){if(!e||e.length===0){this._terminal.clearSelection();return}if(r>this._terminal.cols)throw new Error(`Invalid col: ${r} to search in terminal of ${this._terminal.cols} cols`);this._lineCache.initLinesCache();let s={startRow:t,startCol:r},h=this._findInLine(e,s,i);if(!h)for(let v=t+1;v<this._terminal.buffer.active.baseY+this._terminal.rows&&(s.startRow=v,s.startCol=0,h=this._findInLine(e,s,i),!h);v++);return h}findNextWithSelection(e,t,r){if(!e||e.length===0){this._terminal.clearSelection();return}let i=this._terminal.getSelectionPosition();this._terminal.clearSelection();let s=0,h=0;i&&(r===e?(s=i.end.x,h=i.end.y):(s=i.start.x,h=i.start.y)),this._lineCache.initLinesCache();let v={startRow:h,startCol:s},o=this._findInLine(e,v,t);if(!o)for(let c=h+1;c<this._terminal.buffer.active.baseY+this._terminal.rows&&(v.startRow=c,v.startCol=0,o=this._findInLine(e,v,t),!o);c++);if(!o&&h!==0)for(let c=0;c<h&&(v.startRow=c,v.startCol=0,o=this._findInLine(e,v,t),!o);c++);return!o&&i&&(v.startRow=i.start.y,v.startCol=0,o=this._findInLine(e,v,t)),o}findPreviousWithSelection(e,t,r){if(!e||e.length===0){this._terminal.clearSelection();return}let i=this._terminal.getSelectionPosition();this._terminal.clearSelection();let s=this._terminal.buffer.active.baseY+this._terminal.rows-1,h=this._terminal.cols,v=!0;this._lineCache.initLinesCache();let o={startRow:s,startCol:h},c;if(i&&(o.startRow=s=i.start.y,o.startCol=h=i.start.x,r!==e&&(c=this._findInLine(e,o,t,!1),c||(o.startRow=s=i.end.y,o.startCol=h=i.end.x))),c||(c=this._findInLine(e,o,t,v)),!c){o.startCol=Math.max(o.startCol,this._terminal.cols);for(let f=s-1;f>=0&&(o.startRow=f,c=this._findInLine(e,o,t,v),!c);f--);}if(!c&&s!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let f=this._terminal.buffer.active.baseY+this._terminal.rows-1;f>=s&&(o.startRow=f,c=this._findInLine(e,o,t,v),!c);f--);return c}_isWholeWord(e,t,r){return(e===0||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e-1]))&&(e+r.length===t.length||" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?".includes(t[e+r.length]))}_findInLine(e,t,r={},i=!1){var y;let s=t.startRow,h=t.startCol;if((y=this._terminal.buffer.active.getLine(s))!=null&&y.isWrapped){if(i){t.startCol+=this._terminal.cols;return}return t.startRow--,t.startCol+=this._terminal.cols,this._findInLine(e,t,r)}let v=this._lineCache.getLineFromCache(s);v||(v=this._lineCache.translateBufferLineToStringWithWrap(s,!0),this._lineCache.setLineInCache(s,v));let[o,c]=v,f=this._bufferColsToStringOffset(s,h),g=e,d=o;r.regex||(g=r.caseSensitive?e:e.toLowerCase(),d=r.caseSensitive?o:o.toLowerCase());let p=-1;if(r.regex){let x=RegExp(g,r.caseSensitive?"g":"gi"),m;if(i)for(;m=x.exec(d.slice(0,f));)p=x.lastIndex-m[0].length,e=m[0],x.lastIndex-=e.length-1;else m=x.exec(d.slice(f)),m&&m[0].length>0&&(p=f+(x.lastIndex-m[0].length),e=m[0])}else i?f-g.length>=0&&(p=d.lastIndexOf(g,f-g.length)):p=d.indexOf(g,f);if(p>=0){if(r.wholeWord&&!this._isWholeWord(p,d,e))return;let x=0;for(;x<c.length-1&&p>=c[x+1];)x++;let m=x;for(;m<c.length-1&&p+e.length>=c[m+1];)m++;let u=p-c[x],a=p+e.length-c[m],n=this._stringLengthToBufferSize(s+x,u),l=this._stringLengthToBufferSize(s+m,a)-n+this._terminal.cols*(m-x);return{term:e,col:n,row:s+x,size:l}}}_stringLengthToBufferSize(e,t){let r=this._terminal.buffer.active.getLine(e);if(!r)return 0;for(let i=0;i<t;i++){let s=r.getCell(i);if(!s)break;let h=s.getChars();h.length>1&&(t-=h.length-1);let v=r.getCell(i+1);v&&v.getWidth()===0&&t++}return t}_bufferColsToStringOffset(e,t){let r=e,i=0,s=this._terminal.buffer.active.getLine(r);for(;t>0&&s;){for(let h=0;h<t&&h<this._terminal.cols;h++){let v=s.getCell(h);if(!v)break;v.getWidth()&&(i+=v.getCode()===0?1:v.getChars().length)}if(r++,s=this._terminal.buffer.active.getLine(r),s&&!s.isWrapped)break;t-=this._terminal.cols}return i}},Sv=class extends ir{constructor(e){super(),this._terminal=e,this._highlightDecorations=[],this._highlightedLines=new Set,this._register(ai(()=>this.clearHighlightDecorations()))}createHighlightDecorations(e,t){this.clearHighlightDecorations();for(let r of e){let i=this._createResultDecorations(r,t,!1);if(i)for(let s of i)this._storeDecoration(s,r)}}createActiveDecoration(e,t){let r=this._createResultDecorations(e,t,!0);if(r)return{decorations:r,match:e,dispose(){Oi(r)}}}clearHighlightDecorations(){Oi(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear()}_storeDecoration(e,t){this._highlightedLines.add(e.marker.line),this._highlightDecorations.push({decoration:e,match:t,dispose(){e.dispose()}})}_applyStyles(e,t,r){e.classList.contains("xterm-find-result-decoration")||(e.classList.add("xterm-find-result-decoration"),t&&(e.style.outline=`1px solid ${t}`)),r&&e.classList.add("xterm-find-active-result-decoration")}_createResultDecorations(e,t,r){let i=[],s=e.col,h=e.size,v=-this._terminal.buffer.active.baseY-this._terminal.buffer.active.cursorY+e.row;for(;h>0;){let c=Math.min(this._terminal.cols-s,h);i.push([v,s,c]),s=0,h-=c,v++}let o=[];for(let c of i){let f=this._terminal.registerMarker(c[0]),g=this._terminal.registerDecoration({marker:f,x:c[1],width:c[2],backgroundColor:r?t.activeMatchBackground:t.matchBackground,overviewRulerOptions:this._highlightedLines.has(f.line)?void 0:{color:r?t.activeMatchColorOverviewRuler:t.matchOverviewRuler,position:"center"}});if(g){let d=[];d.push(f),d.push(g.onRender(p=>this._applyStyles(p,r?t.activeMatchBorder:t.matchBorder,!1))),d.push(g.onDispose(()=>Oi(d))),o.push(g)}}return o.length===0?void 0:o}},wv=class extends ir{constructor(){super(...arguments),this._searchResults=[],this._onDidChangeResults=this._register(new xt)}get onDidChangeResults(){return this._onDidChangeResults.event}get searchResults(){return this._searchResults}get selectedDecoration(){return this._selectedDecoration}set selectedDecoration(e){this._selectedDecoration=e}updateResults(e,t){this._searchResults=e.slice(0,t)}clearResults(){this._searchResults=[]}clearSelectedDecoration(){this._selectedDecoration&&(this._selectedDecoration.dispose(),this._selectedDecoration=void 0)}findResultIndex(e){for(let t=0;t<this._searchResults.length;t++){let r=this._searchResults[t];if(r.row===e.row&&r.col===e.col&&r.size===e.size)return t}return-1}fireResultsChanged(e){if(!e)return;let t=-1;this._selectedDecoration&&(t=this.findResultIndex(this._selectedDecoration.match)),this._onDidChangeResults.fire({resultIndex:t,resultCount:this._searchResults.length})}reset(){this.clearSelectedDecoration(),this.clearResults()}},Cv=class extends ir{constructor(e){super(),this._highlightTimeout=this._register(new pn),this._lineCache=this._register(new pn),this._state=new mv,this._resultTracker=this._register(new wv),this._highlightLimit=(e==null?void 0:e.highlightLimit)??1e3}get onDidChangeResults(){return this._resultTracker.onDidChangeResults}activate(e){this._terminal=e,this._lineCache.value=new gv(e),this._engine=new yv(e,this._lineCache.value),this._decorationManager=new Sv(e),this._register(this._terminal.onWriteParsed(()=>this._updateMatches())),this._register(this._terminal.onResize(()=>this._updateMatches())),this._register(ai(()=>this.clearDecorations()))}_updateMatches(){var e;this._highlightTimeout.clear(),this._state.cachedSearchTerm&&((e=this._state.lastSearchOptions)!=null&&e.decorations)&&(this._highlightTimeout.value=Ed(()=>{let t=this._state.cachedSearchTerm;this._state.clearCachedTerm(),this.findPrevious(t,{...this._state.lastSearchOptions,incremental:!0},{noScroll:!0})},200))}clearDecorations(e){var t;this._resultTracker.clearSelectedDecoration(),(t=this._decorationManager)==null||t.clearHighlightDecorations(),this._resultTracker.clearResults(),e||this._state.clearCachedTerm()}clearActiveDecoration(){this._resultTracker.clearSelectedDecoration()}findNext(e,t,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let i=this._findNextAndSelect(e,t,r);return this._fireResults(t),this._state.cachedSearchTerm=e,i}_highlightAllMatches(e,t){if(!this._terminal||!this._engine||!this._decorationManager)throw new Error("Cannot use addon until it has been loaded");if(!this._state.isValidSearchTerm(e)){this.clearDecorations();return}this.clearDecorations(!0);let r=[],i,s=this._engine.find(e,0,0,t);for(;s&&((i==null?void 0:i.row)!==s.row||(i==null?void 0:i.col)!==s.col)&&!(r.length>=this._highlightLimit);)i=s,r.push(i),s=this._engine.find(e,i.col+i.term.length>=this._terminal.cols?i.row+1:i.row,i.col+i.term.length>=this._terminal.cols?0:i.col+1,t);this._resultTracker.updateResults(r,this._highlightLimit),t.decorations&&this._decorationManager.createHighlightDecorations(r,t.decorations)}_findNextAndSelect(e,t,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let i=this._engine.findNextWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(i,t==null?void 0:t.decorations,r==null?void 0:r.noScroll)}findPrevious(e,t,r){if(!this._terminal||!this._engine)throw new Error("Cannot use addon until it has been loaded");this._state.lastSearchOptions=t,this._state.shouldUpdateHighlighting(e,t)&&this._highlightAllMatches(e,t);let i=this._findPreviousAndSelect(e,t,r);return this._fireResults(t),this._state.cachedSearchTerm=e,i}_fireResults(e){this._resultTracker.fireResultsChanged(!!(e!=null&&e.decorations))}_findPreviousAndSelect(e,t,r){if(!this._terminal||!this._engine)return!1;if(!this._state.isValidSearchTerm(e))return this._terminal.clearSelection(),this.clearDecorations(),!1;let i=this._engine.findPreviousWithSelection(e,t,this._state.cachedSearchTerm);return this._selectResult(i,t==null?void 0:t.decorations,r==null?void 0:r.noScroll)}_selectResult(e,t,r){if(!this._terminal||!this._decorationManager)return!1;if(this._resultTracker.clearSelectedDecoration(),!e)return this._terminal.clearSelection(),!1;if(this._terminal.select(e.col,e.row,e.size),t){let i=this._decorationManager.createActiveDecoration(e,t);i&&(this._resultTracker.selectedDecoration=i)}if(!r&&(e.row>=this._terminal.buffer.active.viewportY+this._terminal.rows||e.row<this._terminal.buffer.active.viewportY)){let i=e.row-this._terminal.buffer.active.viewportY;i-=Math.floor(this._terminal.rows/2),this._terminal.scrollLines(i)}return!0}};function zc(){const e=ee.getState().theme;return da(e)==="light"?N_:j_}const ga=new Set,ma=new Map,gl=new Map,zs=new Map;function Es(e){return gl.get(e)}const ya=new Map;function xv(e,t){ya.set(e,t)}function bv(e){const t=ya.get(e);return t!==void 0?(ya.delete(e),t):null}function kv({terminalId:e,projectId:t,cwd:r}){const i=q.useRef(null),s=q.useRef(null),h=q.useRef(null),v=q.useRef(null),o=ue(p=>p.setTerminalInstance),c=ue(p=>p.createSession),f=ee(p=>p.setFocusedTerminal);q.useEffect(()=>{const p=i.current;if(!p)return;p.innerHTML="";const y=ue.getState().sessions[e],x=ma.get(e);if(y!=null&&y.terminal&&x){const S=y.terminal;s.current=S,p.appendChild(x);let C=zs.get(e);return C||(C=new jc.FitAddon,S.loadAddon(C),zs.set(e,C)),h.current=C,requestAnimationFrame(()=>{try{C.fit(),S.scrollToBottom();const{cols:b,rows:w}=S;v.current={cols:b,rows:w},De({type:"pty:resize",terminalId:e,cols:b,rows:w})}catch{}}),()=>{}}const m=zc(),u=da(ee.getState().theme)==="light",a=new W_.Terminal({theme:m,fontFamily:"'JetBrains Mono', 'Fira Code', 'SF Mono', 'Menlo', monospace",fontSize:13,lineHeight:1.2,cursorBlink:!0,cursorStyle:"block",allowProposedApi:!0,scrollback:1e4,minimumContrastRatio:u?7:1}),n=new jc.FitAddon,l=new U_.WebLinksAddon,_=new Cv;return a.loadAddon(n),a.loadAddon(l),a.loadAddon(_),a.open(p),zs.set(e,n),gl.set(e,_),s.current=a,h.current=n,a.element&&ma.set(e,a.element),c(e,t),o(e,a),a.attachCustomKeyEventHandler(S=>{if(S.key==="Enter"&&S.shiftKey)return S.type==="keydown"&&De({type:"pty:input",terminalId:e,data:`
|
|
82
|
+
`}),!1;if(S.metaKey&&!S.altKey&&!S.ctrlKey&&!S.shiftKey&&S.type==="keydown"){if(S.key==="ArrowLeft")return De({type:"pty:input",terminalId:e,data:""}),!1;if(S.key==="ArrowRight")return De({type:"pty:input",terminalId:e,data:""}),!1;if(S.key==="Backspace")return De({type:"pty:input",terminalId:e,data:""}),!1}return!(S.metaKey&&S.key==="f"&&!S.altKey&&!S.ctrlKey||S.metaKey&&S.key==="p"&&!S.altKey&&!S.ctrlKey||["ArrowLeft","ArrowRight","ArrowUp","ArrowDown"].includes(S.key)&&S.shiftKey&&!S.metaKey&&!S.altKey)}),a.onData(S=>{De({type:"pty:input",terminalId:e,data:S})}),a.onTitleChange(S=>{ue.getState().setTitle(e,S)}),ga.has(e)||(ga.add(e),requestAnimationFrame(()=>{try{n.fit()}catch{}De({type:"pty:spawn",terminalId:e,projectId:t,cwd:r}),De({type:"pty:resize",terminalId:e,cols:a.cols,rows:a.rows}),v.current={cols:a.cols,rows:a.rows},a.focus(),f(e)})),()=>{}},[e,t,r,c,o]),q.useEffect(()=>{const p=()=>{const a=s.current;if(a){const n=da(ee.getState().theme)==="light";a.options.theme=zc(),a.options.minimumContrastRatio=n?7:1}};let y=ee.getState().theme;const x=ee.subscribe(a=>{a.theme!==y&&(y=a.theme,p())}),m=window.matchMedia("(prefers-color-scheme: light)"),u=()=>{ee.getState().theme==="system"&&p()};return m.addEventListener("change",u),()=>{x(),m.removeEventListener("change",u)}},[]);const g=q.useCallback(()=>{const p=h.current,y=s.current;if(!(!p||!y))try{p.fit(),y.scrollToBottom();const{cols:x,rows:m}=y,u=v.current;(!u||u.cols!==x||u.rows!==m)&&(v.current={cols:x,rows:m},De({type:"pty:resize",terminalId:e,cols:x,rows:m}))}catch{}},[e]),d=q.useCallback(()=>{var p;(p=s.current)==null||p.focus(),f(e)},[e,f]);return{containerRef:i,fit:g,focus:d,terminalRef:s}}function ns(e){ga.delete(e),ma.delete(e),zs.delete(e),gl.delete(e)}let ot=null;function Ev(){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`}function De(e){(ot==null?void 0:ot.readyState)===WebSocket.OPEN&&ot.send(JSON.stringify(e))}function Lv(){const e=ee(h=>h.setConnectionStatus),t=ae(h=>h.addProject),r=ae(h=>h.setActiveProject),i=q.useRef(),s=q.useCallback(()=>{if((ot==null?void 0:ot.readyState)===WebSocket.OPEN||(ot==null?void 0:ot.readyState)===WebSocket.CONNECTING)return;e("connecting");const h=new WebSocket(Ev());ot=h,h.onopen=()=>{e("connected")},h.onmessage=v=>{var o,c,f;try{const g=JSON.parse(v.data);if(g.type==="pty:output"){const d=ue.getState().sessions[g.terminalId];(o=d==null?void 0:d.terminal)==null||o.write(g.data);const p=bv(g.terminalId);p&&De({type:"pty:input",terminalId:g.terminalId,data:p});return}if(g.type==="pty:exit"){const d=g.terminalId,p=ue.getState().sessions[d],y=p==null?void 0:p.projectId;if((c=p==null?void 0:p.terminal)==null||c.dispose(),ue.getState().removeSession(d),ns(d),y){re.getState().removePaneFromProject(y,d),ae.getState().removeTerminalFromProject(y,d);const x=de(re.getState().getLayout(y)),m=ee.getState().focusedTerminalId;if(m===d&&x.length>0){const u=x[0];ee.getState().setFocusedTerminal(u);const a=ue.getState().sessions[u];(f=a==null?void 0:a.terminal)==null||f.focus()}else m===d&&ee.getState().setFocusedTerminal(null)}return}if(g.type==="project:spawned"){const d=Object.values(ae.getState().projects).find(p=>p.cwd===g.cwd);d?r(d.id):(t({id:g.projectId,name:g.name,cwd:g.cwd,terminalIds:[]}),r(g.projectId));return}if(g.type==="port:status"){ue.getState().setActivePorts(g.ports);return}if(g.type==="claude:status"){ue.getState().setClaudeStatus(g.statuses);return}if(g.type==="git:branch"){ue.getState().setGitBranches(g.branches);return}if(g.type==="editor:active"){if(!ee.getState().editorSyncEnabled)return;const{projects:d,activeProjectId:p}=ae.getState(),y=Object.values(d).find(x=>{const m=x.cwd.replace(/\/$/,"").split("/").pop();return x.name===g.projectName||m===g.projectName});y&&y.id!==p&&(ee.getState().showSyncToast(y.name),r(y.id))}}catch{}},h.onclose=()=>{e("disconnected"),ue.getState().setActivePorts({}),ue.getState().setClaudeStatus({}),ue.getState().setGitBranches({}),ot=null,i.current=setTimeout(s,2e3)},h.onerror=()=>{h.close()}},[e,t,r]);q.useEffect(()=>(s(),()=>{clearTimeout(i.current)}),[s])}const Dv=new Set(["n","w","t","d","r","f","p"]);function Rv(){const e=ee(r=>r.toggleSidebar),t=ee(r=>r.setFocusedTerminal);q.useEffect(()=>{const r=i=>{var p,y,x;const s=i.key.toLowerCase();if(i.ctrlKey&&i.shiftKey&&!i.metaKey&&!i.altKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(s)){i.preventDefault(),i.stopPropagation();const m=ae.getState().activeProjectId;if(!m)return;const u=re.getState().getLayout(m),a=ee.getState().focusedTerminalId;if(!a||!u)return;const l=Ic(u,a,s==="arrowleft"?"left":s==="arrowright"?"right":s==="arrowup"?"up":"down");if(l){t(l);const _=ue.getState().sessions[l];(p=_==null?void 0:_.terminal)==null||p.focus()}return}if(i.shiftKey&&!i.ctrlKey&&!i.metaKey&&!i.altKey&&["arrowleft","arrowright","arrowup","arrowdown"].includes(s)){i.preventDefault(),i.stopPropagation();const m=ae.getState().activeProjectId;if(!m)return;const u=re.getState().getLayout(m),a=ee.getState().focusedTerminalId;if(!a||!u)return;const l=Ic(u,a,s==="arrowleft"?"left":s==="arrowright"?"right":s==="arrowup"?"up":"down");l&&re.getState().swapPanesInProject(m,a,l);return}if(!(navigator.platform.startsWith("Mac")?i.metaKey:i.ctrlKey))return;if((s==="="||s==="+"||s==="-"||s==="0")&&!i.shiftKey&&!("chrome"in window)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent)){i.preventDefault(),i.stopPropagation();const u=parseFloat(document.documentElement.style.zoom||"1");s==="="||s==="+"?document.documentElement.style.zoom=String(Math.min(u+.1,2)):s==="-"?document.documentElement.style.zoom=String(Math.max(u-.1,.5)):document.documentElement.style.zoom="1",window.dispatchEvent(new Event("resize"));return}(Dv.has(s)||s>="1"&&s<="9")&&(i.preventDefault(),i.stopPropagation());const o=ae.getState().activeProjectId;if(!o)return;const c=re.getState().getLayout(o),f=ee.getState().focusedTerminalId,g=ae.getState().projects[o];if(s==="p"&&!i.shiftKey){ee.getState().toggleCommandPalette();return}if(s==="f"&&!i.shiftKey){f&&ee.getState().openSearch(f);return}if(s==="d"&&!i.shiftKey){e();return}if(s==="n"){if(!g)return;const m=crypto.randomUUID(),u=de(c);if(u.length>0){const a=f??u[u.length-1],n=i.shiftKey?"horizontal":"vertical";re.getState().addPaneToProject(o,a,m,n)}else re.getState().setLayout(o,{type:"leaf",terminalId:m});ae.getState().addTerminalToProject(o,m),t(m);return}if(s==="w"&&!i.shiftKey){if(!f||!c)return;De({type:"pty:kill",terminalId:f}),re.getState().removePaneFromProject(o,f),ae.getState().removeTerminalFromProject(o,f);const m=ue.getState().sessions[f];(y=m==null?void 0:m.terminal)==null||y.dispose(),ue.getState().removeSession(f),ns(f);const u=de(re.getState().getLayout(o));t(u[0]??null);return}if(s==="t"&&!i.shiftKey){if(!g)return;const m=de(c);m.length>0&&re.getState().cyclePreset(o,m);return}if(s==="r"&&!i.shiftKey){const m=de(c);if(m.length===0)return;let u;m.length<=2?u="even-vertical":m.length===3?u="main-left":u="grid";const a=br(m,u);a&&re.getState().setLayout(o,a);return}const d=parseInt(s);if(d>=1&&d<=9){const u=de(c)[d-1];if(u){t(u);const a=ue.getState().sessions[u];(x=a==null?void 0:a.terminal)==null||x.focus()}return}};return window.addEventListener("keydown",r,{capture:!0}),()=>window.removeEventListener("keydown",r,{capture:!0})},[e,t])}const Vt=ss()((e,t)=>({favourites:{},addFavourite:r=>{e(i=>({favourites:{...i.favourites,[r.id]:r}})),Ai({favourites:{...t().favourites}})},updateFavourite:(r,i)=>{e(s=>{const h=s.favourites[r];return h?{favourites:{...s.favourites,[r]:{...h,...i}}}:s}),Ai({favourites:{...t().favourites}})},removeFavourite:r=>{e(i=>{const{[r]:s,...h}=i.favourites;return{favourites:h}}),Ai({favourites:{...t().favourites}})},hydrateFromServer:async()=>{try{const i=await(await fetch("/api/settings")).json();i.favourites&&e({favourites:i.favourites})}catch{}}}));/**
|
|
83
|
+
* @license lucide-react v0.400.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const Tv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Ld=(...e)=>e.filter((t,r,i)=>!!t&&i.indexOf(t)===r).join(" ");/**
|
|
88
|
+
* @license lucide-react v0.400.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/var Pv={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
93
|
+
* @license lucide-react v0.400.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const Mv=q.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:i,className:s="",children:h,iconNode:v,...o},c)=>q.createElement("svg",{ref:c,...Pv,width:t,height:t,stroke:e,strokeWidth:i?Number(r)*24/Number(t):r,className:Ld("lucide",s),...o},[...v.map(([f,g])=>q.createElement(f,g)),...Array.isArray(h)?h:[h]]));/**
|
|
98
|
+
* @license lucide-react v0.400.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const oe=(e,t)=>{const r=q.forwardRef(({className:i,...s},h)=>q.createElement(Mv,{ref:h,iconNode:t,className:Ld(`lucide-${Tv(e)}`,i),...s}));return r.displayName=`${e}`,r};/**
|
|
103
|
+
* @license lucide-react v0.400.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const Av=oe("Brush",[["path",{d:"m9.06 11.9 8.07-8.06a2.85 2.85 0 1 1 4.03 4.03l-8.06 8.08",key:"1styjt"}],["path",{d:"M7.07 14.94c-1.66 0-3 1.35-3 3.02 0 1.33-2.5 1.52-2 2.02 1.08 1.1 2.49 2.02 4 2.02 2.2 0 4-1.8 4-4.04a3.01 3.01 0 0 0-3-3.02z",key:"z0l1mu"}]]);/**
|
|
108
|
+
* @license lucide-react v0.400.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const Dd=oe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
113
|
+
* @license lucide-react v0.400.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const Ov=oe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
118
|
+
* @license lucide-react v0.400.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const Bv=oe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
|
|
123
|
+
* @license lucide-react v0.400.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const Iv=oe("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]]);/**
|
|
128
|
+
* @license lucide-react v0.400.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const jv=oe("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
|
|
133
|
+
* @license lucide-react v0.400.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const An=oe("Columns2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
|
|
138
|
+
* @license lucide-react v0.400.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const Rd=oe("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/**
|
|
143
|
+
* @license lucide-react v0.400.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const Nv=oe("GitBranch",[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]]);/**
|
|
148
|
+
* @license lucide-react v0.400.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const ml=oe("Grid2x2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M12 3v18",key:"108xh3"}]]);/**
|
|
153
|
+
* @license lucide-react v0.400.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const Fv=oe("GripHorizontal",[["circle",{cx:"12",cy:"9",r:"1",key:"124mty"}],["circle",{cx:"19",cy:"9",r:"1",key:"1ruzo2"}],["circle",{cx:"5",cy:"9",r:"1",key:"1a8b28"}],["circle",{cx:"12",cy:"15",r:"1",key:"1e56xg"}],["circle",{cx:"19",cy:"15",r:"1",key:"1a92ep"}],["circle",{cx:"5",cy:"15",r:"1",key:"5r1jwy"}]]);/**
|
|
158
|
+
* @license lucide-react v0.400.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const Hv=oe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
163
|
+
* @license lucide-react v0.400.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const Td=oe("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
|
|
168
|
+
* @license lucide-react v0.400.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const zv=oe("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
|
|
173
|
+
* @license lucide-react v0.400.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const _n=oe("MonitorSmartphone",[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]]);/**
|
|
178
|
+
* @license lucide-react v0.400.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const Wv=oe("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
|
|
183
|
+
* @license lucide-react v0.400.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const Uv=oe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);/**
|
|
188
|
+
* @license lucide-react v0.400.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const Pd=oe("PanelLeftClose",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m16 15-3-3 3-3",key:"14y99z"}]]);/**
|
|
193
|
+
* @license lucide-react v0.400.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const $v=oe("PanelLeftOpen",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);/**
|
|
198
|
+
* @license lucide-react v0.400.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const yl=oe("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
203
|
+
* @license lucide-react v0.400.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const Sl=oe("PanelTop",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}]]);/**
|
|
208
|
+
* @license lucide-react v0.400.0 - ISC
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the ISC license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/const Kv=oe("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
|
|
213
|
+
* @license lucide-react v0.400.0 - ISC
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the ISC license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/const Md=oe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
218
|
+
* @license lucide-react v0.400.0 - ISC
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the ISC license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/const Ji=oe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
223
|
+
* @license lucide-react v0.400.0 - ISC
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the ISC license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/const On=oe("Rows2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 12h18",key:"1i2n21"}]]);/**
|
|
228
|
+
* @license lucide-react v0.400.0 - ISC
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the ISC license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/const Vv=oe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
233
|
+
* @license lucide-react v0.400.0 - ISC
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the ISC license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/const Bn=oe("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
|
|
238
|
+
* @license lucide-react v0.400.0 - ISC
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the ISC license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/const qv=oe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
|
|
243
|
+
* @license lucide-react v0.400.0 - ISC
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the ISC license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/const wl=oe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);/**
|
|
248
|
+
* @license lucide-react v0.400.0 - ISC
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the ISC license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/const Cl=oe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
253
|
+
* @license lucide-react v0.400.0 - ISC
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the ISC license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/const Gv=oe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
258
|
+
* @license lucide-react v0.400.0 - ISC
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the ISC license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/const Lr=oe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Wc(e){const t=re.getState().getLayout(e);de(t).forEach(i=>{var h;const s=ue.getState().sessions[i];(h=s==null?void 0:s.terminal)==null||h.dispose(),ue.getState().removeSession(i),ns(i)}),De({type:"project:kill",projectId:e}),re.getState().setLayout(e,null),ae.getState().clearProjectTerminals(e)}function Xv({project:e,isActive:t,hasActivePorts:r,claudeStatus:i,gitBranch:s,onClick:h,onKill:v,onRemove:o}){const c=e.terminalIds.length;return R.jsxs("div",{onClick:h,className:`
|
|
263
|
+
group flex items-center gap-2 px-3 py-2 mx-2 mb-1 rounded-lg cursor-pointer
|
|
264
|
+
transition-colors duration-100
|
|
265
|
+
${t?"bg-[var(--surface-2)] text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--surface-2)] hover:text-[var(--text-primary)]"}
|
|
266
|
+
`,children:[R.jsx(Rd,{size:14,className:t?"text-accent":"text-[var(--text-muted)]"}),R.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[R.jsxs("div",{className:"text-xs font-medium truncate flex items-center gap-1.5",children:[e.name,i&&R.jsx("span",{className:`shrink-0 text-[8px] font-bold leading-none px-1 py-0.5 rounded ${i==="active"?"bg-purple-500/20 text-purple-400 animate-pulse":"bg-purple-500/10 text-purple-400/50"}`,title:i==="active"?"Agent is working":"Agent session open",children:"AI"}),r&&R.jsx("span",{className:"shrink-0 w-1.5 h-1.5 rounded-full bg-[var(--success)]",title:"Dev server running"})]}),s&&R.jsx("div",{className:"flex items-center gap-0.5",children:R.jsxs("span",{className:"inline-flex items-center gap-0.5 px-1 py-0 rounded bg-[var(--surface-3)] text-[var(--text-muted)] text-[10px] font-medium truncate max-w-full",children:[R.jsx(Nv,{size:8,className:"shrink-0"}),R.jsx("span",{className:"truncate",children:s})]})}),R.jsx("div",{className:"text-[10px] text-[var(--text-muted)] truncate font-mono",children:e.cwd})]}),c>0&&R.jsxs("span",{className:"text-[10px] tabular-nums px-1.5 py-0.5 rounded-full bg-[var(--surface-3)] text-[var(--text-muted)] flex items-center gap-0.5",children:[R.jsx(wl,{size:8}),c]}),R.jsxs("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[c>0&&R.jsx("button",{onClick:f=>{f.stopPropagation(),v()},title:"Kill all terminals",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:R.jsx(jv,{size:12})}),R.jsx("button",{onClick:f=>{f.stopPropagation(),o()},title:"Remove project",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:R.jsx(Cl,{size:12})})]})]})}function Qv({open:e,onClose:t,onCreate:r,initialName:i,initialCwd:s}){const[h,v]=q.useState(""),[o,c]=q.useState("~"),[f,g]=q.useState(null),[d,p]=q.useState(!1),y=q.useRef(null);q.useEffect(()=>{e&&(v(i??""),c(s??"~"),g(null),setTimeout(()=>{var m;return(m=y.current)==null?void 0:m.focus()},50))},[e,i,s]);const x=q.useCallback(async m=>{if(m.preventDefault(),!h.trim())return;const u=o.trim()||"~",n=Object.values(ae.getState().projects).find(l=>l.cwd===u);if(n){g(`Project "${n.name}" already uses this directory`);return}p(!0),g(null);try{const l=await fetch("/api/validate-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:u})}),{valid:_}=await l.json();if(!_){g("Directory does not exist"),p(!1);return}}catch{g("Could not validate path"),p(!1);return}p(!1),r(h.trim(),u),t()},[h,o,r,t]);return e?R.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:R.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[400px] shadow-2xl animate-fade-in",onClick:m=>m.stopPropagation(),children:[R.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[R.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"New Project"}),R.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:R.jsx(Lr,{size:14})})]}),R.jsxs("form",{onSubmit:x,className:"p-4 space-y-4",children:[R.jsxs("div",{children:[R.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Project Name"}),R.jsx("input",{ref:y,value:h,onChange:m=>v(m.target.value),placeholder:"my-project",className:`
|
|
267
|
+
w-full px-3 py-2 text-sm
|
|
268
|
+
bg-[var(--surface-0)] border border-[var(--border)]
|
|
269
|
+
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
270
|
+
rounded-lg outline-none
|
|
271
|
+
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
272
|
+
transition-colors
|
|
273
|
+
`})]}),R.jsxs("div",{children:[R.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Working Directory"}),R.jsx("input",{value:o,onChange:m=>{c(m.target.value),g(null)},placeholder:"/path/to/project",className:`
|
|
274
|
+
w-full px-3 py-2 text-sm font-mono
|
|
275
|
+
bg-[var(--surface-0)] border
|
|
276
|
+
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
277
|
+
rounded-lg outline-none
|
|
278
|
+
transition-colors
|
|
279
|
+
${f?"border-[var(--danger)] focus:border-[var(--danger)] focus:ring-1 focus:ring-[var(--danger)]/30":"border-[var(--border)] focus:border-accent focus:ring-1 focus:ring-accent/30"}
|
|
280
|
+
`}),f&&R.jsx("p",{className:"mt-1.5 text-[11px] text-[var(--danger)]",children:f})]}),R.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[R.jsx("button",{type:"button",onClick:t,className:`
|
|
281
|
+
px-3 py-1.5 text-xs text-[var(--text-secondary)]
|
|
282
|
+
hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
|
|
283
|
+
rounded-lg transition-colors
|
|
284
|
+
`,children:"Cancel"}),R.jsx("button",{type:"submit",disabled:!h.trim()||d,className:`
|
|
285
|
+
px-3 py-1.5 text-xs font-medium
|
|
286
|
+
bg-accent hover:bg-accent/80
|
|
287
|
+
disabled:opacity-40 disabled:cursor-not-allowed
|
|
288
|
+
text-white rounded-lg transition-colors
|
|
289
|
+
`,children:d?"Checking...":"Create"})]})]})]})}):null}const Yv={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function Jv({favourite:e,onLaunch:t,onEdit:r,onDelete:i}){const s=`${Yv[e.preset]??e.preset}, ${e.slots.length} terminal${e.slots.length!==1?"s":""}`;return R.jsxs("div",{className:`
|
|
290
|
+
group flex items-center gap-2 px-3 py-2 mx-2 rounded-lg cursor-pointer
|
|
291
|
+
text-[var(--text-secondary)] hover:bg-[var(--surface-2)] hover:text-[var(--text-primary)]
|
|
292
|
+
transition-colors duration-100
|
|
293
|
+
`,onClick:t,children:[R.jsx(Bn,{size:14,className:"text-[var(--text-muted)] flex-shrink-0"}),R.jsxs("div",{className:"flex-1 min-w-0",children:[R.jsx("div",{className:"text-xs font-medium truncate",children:e.name}),R.jsxs("div",{className:"text-[10px] text-[var(--text-muted)] truncate flex items-center gap-0.5",children:[R.jsx(wl,{size:8}),s]})]}),R.jsxs("div",{className:"hidden group-hover:flex items-center gap-0.5",children:[R.jsx("button",{onClick:h=>{h.stopPropagation(),t()},title:"Launch",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--success)] hover:bg-green-500/10 transition-colors",children:R.jsx(Md,{size:12})}),R.jsx("button",{onClick:h=>{h.stopPropagation(),r()},title:"Edit",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:R.jsx(Kv,{size:12})}),R.jsx("button",{onClick:h=>{h.stopPropagation(),i()},title:"Delete",className:"p-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:R.jsx(Cl,{size:12})})]})]})}function Zv({favourites:e,onLaunch:t,onEdit:r,onDelete:i}){const[s,h]=q.useState(!1);return e.length===0?null:R.jsxs("div",{children:[R.jsxs("button",{onClick:()=>h(!s),className:`
|
|
294
|
+
flex items-center gap-1 w-full px-4 py-1.5
|
|
295
|
+
text-[10px] font-semibold uppercase tracking-wider
|
|
296
|
+
text-[var(--text-muted)] hover:text-[var(--text-secondary)]
|
|
297
|
+
transition-colors
|
|
298
|
+
`,children:[s?R.jsx(Ov,{size:10}):R.jsx(Dd,{size:10}),"Favourites"]}),!s&&R.jsx("div",{children:e.map(v=>R.jsx(Jv,{favourite:v,onLaunch:()=>t(v),onEdit:()=>r(v),onDelete:()=>i(v.id)},v.id))})]})}const eg={"even-horizontal":R.jsx(On,{size:16}),"even-vertical":R.jsx(An,{size:16}),"main-left":R.jsx(yl,{size:16}),"main-top":R.jsx(Sl,{size:16}),grid:R.jsx(ml,{size:16})},Uc={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function Ad({open:e,onClose:t,onSave:r,editingFavourite:i,defaultPreset:s,defaultSlotCount:h}){const[v,o]=q.useState(""),[c,f]=q.useState("even-horizontal"),[g,d]=q.useState([{label:"",command:""}]),p=q.useRef(null);if(q.useEffect(()=>{if(e){if(i)o(i.name),f(i.preset),d(i.slots.map(a=>({...a})));else{o(""),f(s??"even-horizontal");const a=h??1;d(Array.from({length:a},()=>({label:"",command:""})))}setTimeout(()=>{var a;return(a=p.current)==null?void 0:a.focus()},50)}},[e,i,s,h]),!e)return null;const y=a=>{a.preventDefault(),!(!v.trim()||g.length===0)&&(r(v.trim(),c,g),t())},x=()=>{d([...g,{label:"",command:""}])},m=a=>{g.length<=1||d(g.filter((n,l)=>l!==a))},u=(a,n,l)=>{d(g.map((_,S)=>S===a?{..._,[n]:l}:_))};return R.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:R.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[440px] shadow-2xl animate-fade-in max-h-[80vh] flex flex-col",onClick:a=>a.stopPropagation(),children:[R.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[R.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:i?"Edit Favourite":"Save Favourite"}),R.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:R.jsx(Lr,{size:14})})]}),R.jsxs("form",{onSubmit:y,className:"p-4 space-y-4 overflow-y-auto",children:[R.jsxs("div",{children:[R.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Name"}),R.jsx("input",{ref:p,value:v,onChange:a=>o(a.target.value),placeholder:"My Workspace",className:`
|
|
299
|
+
w-full px-3 py-2 text-sm
|
|
300
|
+
bg-[var(--surface-0)] border border-[var(--border)]
|
|
301
|
+
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
302
|
+
rounded-lg outline-none
|
|
303
|
+
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
304
|
+
transition-colors
|
|
305
|
+
`})]}),R.jsxs("div",{children:[R.jsx("label",{className:"block text-xs text-[var(--text-secondary)] mb-1.5",children:"Layout"}),R.jsx("div",{className:"flex gap-1",children:Xr.map(a=>R.jsxs("button",{type:"button",onClick:()=>f(a),className:`
|
|
306
|
+
flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors
|
|
307
|
+
${c===a?"bg-accent/15 text-accent border border-accent/30":"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] border border-transparent"}
|
|
308
|
+
`,title:Uc[a],children:[eg[a],R.jsx("span",{className:"hidden sm:inline",children:Uc[a]})]},a))})]}),R.jsxs("div",{children:[R.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[R.jsx("label",{className:"text-xs text-[var(--text-secondary)]",children:"Terminal Slots"}),R.jsxs("button",{type:"button",onClick:x,className:"flex items-center gap-0.5 text-[10px] text-accent hover:text-accent/80 transition-colors",children:[R.jsx(Ji,{size:10}),"Add"]})]}),R.jsx("div",{className:"space-y-2",children:g.map((a,n)=>R.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-[var(--surface-0)] border border-[var(--border)]",children:[R.jsxs("div",{className:"flex-1 space-y-1.5",children:[R.jsx("input",{value:a.label,onChange:l=>u(n,"label",l.target.value),placeholder:`Terminal ${n+1}`,className:`
|
|
309
|
+
w-full px-2 py-1 text-xs
|
|
310
|
+
bg-transparent border border-[var(--border)]
|
|
311
|
+
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
312
|
+
rounded outline-none
|
|
313
|
+
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
314
|
+
transition-colors
|
|
315
|
+
`}),R.jsx("input",{value:a.command,onChange:l=>u(n,"command",l.target.value),placeholder:"Command (optional)",className:`
|
|
316
|
+
w-full px-2 py-1 text-xs font-mono
|
|
317
|
+
bg-transparent border border-[var(--border)]
|
|
318
|
+
text-[var(--text-primary)] placeholder:text-[var(--text-muted)]
|
|
319
|
+
rounded outline-none
|
|
320
|
+
focus:border-accent focus:ring-1 focus:ring-accent/30
|
|
321
|
+
transition-colors
|
|
322
|
+
`})]}),g.length>1&&R.jsx("button",{type:"button",onClick:()=>m(n),className:"p-1 mt-0.5 rounded text-[var(--text-muted)] hover:text-[var(--danger)] hover:bg-[var(--danger-dim)] transition-colors",children:R.jsx(Cl,{size:12})})]},n))})]}),R.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[R.jsx("button",{type:"button",onClick:t,className:`
|
|
323
|
+
px-3 py-1.5 text-xs text-[var(--text-secondary)]
|
|
324
|
+
hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
|
|
325
|
+
rounded-lg transition-colors
|
|
326
|
+
`,children:"Cancel"}),R.jsx("button",{type:"submit",disabled:!v.trim()||g.length===0,className:`
|
|
327
|
+
px-3 py-1.5 text-xs font-medium
|
|
328
|
+
bg-accent hover:bg-accent/80
|
|
329
|
+
disabled:opacity-40 disabled:cursor-not-allowed
|
|
330
|
+
text-white rounded-lg transition-colors
|
|
331
|
+
`,children:i?"Update":"Save"})]})]})]})})}function tg({open:e,onClose:t,onConfirm:r,terminalCount:i,favouriteName:s}){return e?R.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:R.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[380px] shadow-2xl animate-fade-in",onClick:h=>h.stopPropagation(),children:[R.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[R.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Launch Favourite"}),R.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:R.jsx(Lr,{size:14})})]}),R.jsxs("div",{className:"p-4 space-y-4",children:[R.jsxs("div",{className:"flex items-start gap-3",children:[R.jsx("div",{className:"p-2 rounded-lg bg-yellow-500/10",children:R.jsx(Gv,{size:16,className:"text-yellow-500"})}),R.jsxs("div",{className:"text-sm text-[var(--text-secondary)]",children:["Launching ",R.jsx("span",{className:"font-medium text-[var(--text-primary)]",children:s})," will close ",i," existing terminal",i!==1?"s":"",". Continue?"]})]}),R.jsxs("div",{className:"flex justify-end gap-2",children:[R.jsx("button",{onClick:t,className:`
|
|
332
|
+
px-3 py-1.5 text-xs text-[var(--text-secondary)]
|
|
333
|
+
hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]
|
|
334
|
+
rounded-lg transition-colors
|
|
335
|
+
`,children:"Cancel"}),R.jsx("button",{onClick:()=>{r(),t()},className:`
|
|
336
|
+
px-3 py-1.5 text-xs font-medium
|
|
337
|
+
bg-accent hover:bg-accent/80
|
|
338
|
+
text-white rounded-lg transition-colors
|
|
339
|
+
`,children:"Launch"})]})]})]})}):null}function rg(){const[e,t]=q.useState(!1),[r,i]=q.useState(!1),[s,h]=q.useState(!1),[v,o]=q.useState(null),[c,f]=q.useState(null),[g,d]=q.useState(null),[p,y]=q.useState(!1),[x,m]=q.useState(null);q.useEffect(()=>{fetch("/api/version").then(W=>W.json()).then(W=>{W.latest&&ig(W.latest,W.current)&&m({current:W.current,latest:W.latest})}).catch(()=>{})},[]);const u=ae(W=>W.projects),a=ae(W=>W.activeProjectId),n=ae(W=>W.setActiveProject),l=ae(W=>W.addProject),_=ae(W=>W.removeProject),S=ae(W=>W.addTerminalToProject),C=ee(W=>W.sidebarOpen),b=ee(W=>W.sidebarWidth),w=ee(W=>W.setSidebarWidth),E=ee(W=>W.toggleSidebar),P=ee(W=>W.connectionStatus),O=q.useRef(!1),M=ee(W=>W.editorSyncEnabled),L=ee(W=>W.toggleEditorSync),I=ee(W=>W.theme),F=ee(W=>W.cycleTheme),H=ue(W=>W.activePorts),U=ue(W=>W.claudeStatus),N=ue(W=>W.gitBranches),k=Vt(W=>W.favourites);Vt(W=>W.addFavourite);const T=Vt(W=>W.updateFavourite),A=Vt(W=>W.removeFavourite),B=ee(W=>W.pendingFavouriteLaunchId),$=ee(W=>W.clearPendingFavouriteLaunch),[V,Y]=q.useState(null),[J,j]=q.useState(null),D=q.useCallback(()=>{fetch("/api/cleanup-projects").then(W=>W.json()).then(W=>{W.stale.length===0?(Y([]),setTimeout(()=>Y(null),2e3)):Y(W.stale)}).catch(()=>{})},[]),K=q.useCallback(()=>{fetch("/api/cleanup-projects",{method:"POST"}).then(W=>W.json()).then(W=>{for(const he of Object.values(u))W.removed.includes(he.name)&&(re.getState().removeProjectLayout(he.id),_(he.id));Y(null)}).catch(()=>{})},[u,_]),z=(W,he)=>{const le=Object.values(u).find(Pe=>Pe.cwd===he);if(le){n(le.id);return}const We=crypto.randomUUID();l({id:We,name:W,cwd:he,terminalIds:[]}),De({type:"project:create",projectId:We,name:W,cwd:he}),n(We)},Q=W=>{Wc(W)},X=W=>{j(W)},se=()=>{J&&(Q(J),De({type:"project:remove",projectId:J}),re.getState().removeProjectLayout(J),_(J),j(null))},fe=q.useCallback(W=>{if(!a||!u[a])return;Wc(a);const le=W.slots.map(()=>crypto.randomUUID());W.slots.forEach((Pe,cr)=>{Pe.command.trim()&&xv(le[cr],Pe.command+`
|
|
340
|
+
`)});const We=br(le,W.preset);re.getState().setLayout(a,We),le.forEach(Pe=>{S(a,Pe)}),le.length>0&&ee.getState().setFocusedTerminal(le[0])},[a,u,S]),pe=q.useCallback(W=>{if(!a)return;const he=re.getState().getLayout(a);de(he).length>0?(f(W),h(!0)):fe(W)},[a,fe]);q.useEffect(()=>{if(!B)return;const W=k[B];$(),W&&pe(W)},[B,k,$,pe]);const Ie=W=>{o(W),i(!0)},te=(W,he,le)=>{v&&T(v.id,{name:W,preset:he,slots:le}),o(null)},ar=q.useCallback(W=>{W.dataTransfer.types.includes("Files")&&(W.preventDefault(),W.dataTransfer.dropEffect="copy",y(!0))},[]),li=q.useCallback(W=>{W.currentTarget.contains(W.relatedTarget)||y(!1)},[]),ci=q.useCallback(W=>{W.preventDefault(),O.current=!0;const he=We=>{w(We.clientX)},le=()=>{O.current=!1,window.removeEventListener("mousemove",he),window.removeEventListener("mouseup",le),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",window.addEventListener("mousemove",he),window.addEventListener("mouseup",le)},[w]),ui=q.useCallback(W=>{if(y(!1),!W.dataTransfer.types.includes("Files")||W.dataTransfer.files.length===0)return;W.preventDefault(),W.stopPropagation();const he=W.dataTransfer.files[0];fetch("/api/resolve-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:he.name,size:he.size,lastModified:he.lastModified})}).then(le=>le.json()).then(le=>{if(!le.path||!le.isDirectory)return;const We=le.path,Pe=We.split("/").pop()||he.name;d({name:Pe,cwd:We}),t(!0)}).catch(()=>{})},[]);if(!C)return null;const lr=Object.values(u),ze=Object.values(k),st=(a?u[a]:null)?de(re.getState().getLayout(a)).length:0;return R.jsxs("div",{className:`relative flex-shrink-0 bg-[var(--surface-1)] border-r border-[var(--border)] flex flex-col h-full ${p?"ring-2 ring-inset ring-[var(--accent)]":""}`,style:{width:b},onDragOver:ar,onDragLeave:li,onDrop:ui,children:[R.jsx("div",{className:"absolute top-0 right-0 w-1 h-full cursor-col-resize z-10 hover:bg-[var(--accent)] active:bg-[var(--accent)] opacity-0 hover:opacity-40 active:opacity-60 transition-opacity",onMouseDown:ci}),R.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("span",{className:"text-sm font-semibold tracking-tight text-[var(--text-primary)]",children:"Paneful"}),R.jsx("span",{className:`w-1.5 h-1.5 rounded-full ${P==="connected"?"bg-[var(--success)]":P==="connecting"?"bg-yellow-500 animate-pulse":"bg-[var(--danger)]"}`,title:P})]}),R.jsxs("div",{className:"flex items-center gap-1",children:[R.jsx("button",{onClick:F,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:`Theme: ${I}. Click to cycle.`,children:I==="light"?R.jsx(qv,{size:14}):I==="dark"?R.jsx(Uv,{size:14}):R.jsx(Wv,{size:14})}),R.jsx("button",{onClick:L,className:`p-1 rounded transition-colors ${M?"text-[var(--accent)] hover:bg-[var(--surface-3)]":"text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)]"}`,title:M?"Editor sync ON — auto-switches project based on your active editor. Click to disable.":"Editor sync OFF — click to enable. Requires: (1) Paneful (or Terminal, if running from CLI) in System Settings → Privacy & Security → Accessibility, (2) Editor window title includes folder name (default in VS Code/Cursor). Note: after updating paneful, you may need to remove and re-add it in Accessibility settings.",children:R.jsx(_n,{size:14})}),R.jsx("button",{onClick:D,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Clean up stale projects",children:R.jsx(Av,{size:14})}),R.jsx("button",{onClick:E,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Hide sidebar",children:R.jsx(Pd,{size:14})})]})]}),R.jsx("div",{className:"flex-1 overflow-y-auto py-2",children:lr.length===0&&ze.length===0?R.jsx("div",{className:"px-4 py-8 text-center",children:R.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"No projects yet"})}):R.jsxs(R.Fragment,{children:[lr.map(W=>{var he;return R.jsx(Xv,{project:W,isActive:W.id===a,hasActivePorts:(((he=H[W.id])==null?void 0:he.length)??0)>0,claudeStatus:U[W.id]??null,gitBranch:N[W.id]??null,onClick:()=>n(W.id),onKill:()=>Q(W.id),onRemove:()=>X(W.id)},W.id)}),R.jsx(Zv,{favourites:ze,onLaunch:pe,onEdit:Ie,onDelete:A})]})}),R.jsxs("div",{className:"mx-3 mb-2 px-3 py-2.5 rounded-lg bg-[var(--surface-2)] text-[10px] text-[var(--text-muted)] leading-relaxed flex flex-col items-center gap-1.5 text-center",children:[R.jsx(zv,{size:12,className:"text-yellow-500"}),"Drag a folder into this sidebar to create a project"]}),R.jsx("div",{className:"p-2 border-t border-[var(--border)]",children:R.jsxs("button",{onClick:()=>t(!0),className:`
|
|
341
|
+
w-full flex items-center justify-center gap-1.5
|
|
342
|
+
px-3 py-2 text-xs
|
|
343
|
+
text-[var(--text-secondary)] hover:text-[var(--text-primary)]
|
|
344
|
+
bg-[var(--surface-2)] hover:bg-[var(--surface-3)]
|
|
345
|
+
rounded-lg transition-colors
|
|
346
|
+
`,children:[R.jsx(Ji,{size:14}),"New Project"]})}),x&&R.jsxs("div",{className:"px-4 py-3 border-t border-[var(--border)]",children:[R.jsxs("a",{href:"https://www.npmjs.com/package/paneful",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 text-xs text-[var(--accent)] hover:underline",children:[R.jsx(Iv,{size:14}),R.jsxs("span",{children:["v",x.latest," available (current: v",x.current,")"]})]}),R.jsx("p",{className:"text-[10px] text-[var(--text-muted)] mt-1",children:"paneful update"})]}),R.jsx(Qv,{open:e,onClose:()=>{t(!1),d(null)},onCreate:z,initialName:g==null?void 0:g.name,initialCwd:g==null?void 0:g.cwd}),R.jsx(Ad,{open:r,onClose:()=>{i(!1),o(null)},onSave:te,editingFavourite:v}),R.jsx(tg,{open:s,onClose:()=>{h(!1),f(null)},onConfirm:()=>{c&&fe(c)},terminalCount:st,favouriteName:(c==null?void 0:c.name)??""}),V!==null&&R.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>Y(null),children:R.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl p-5 w-80 shadow-xl",onClick:W=>W.stopPropagation(),children:[R.jsx("h3",{className:"text-sm font-semibold text-[var(--text-primary)] mb-3",children:"Clean Up Projects"}),V.length===0?R.jsx("p",{className:"text-xs text-[var(--text-muted)]",children:"All projects have valid directories."}):R.jsxs(R.Fragment,{children:[R.jsxs("p",{className:"text-xs text-[var(--text-secondary)] mb-3",children:[V.length," project",V.length>1?"s":""," with missing directories:"]}),R.jsx("div",{className:"space-y-1.5 mb-4 max-h-40 overflow-y-auto",children:V.map(W=>R.jsxs("div",{className:"text-xs px-2 py-1.5 rounded bg-[var(--surface-2)]",children:[R.jsx("div",{className:"font-medium text-[var(--text-primary)]",children:W.name}),R.jsx("div",{className:"text-[10px] text-[var(--text-muted)] font-mono truncate",children:W.cwd})]},W.id))}),R.jsxs("div",{className:"flex gap-2 justify-end",children:[R.jsx("button",{onClick:()=>Y(null),className:"px-3 py-1.5 text-xs rounded-lg text-[var(--text-secondary)] hover:bg-[var(--surface-2)] transition-colors",children:"Cancel"}),R.jsxs("button",{onClick:K,className:"px-3 py-1.5 text-xs rounded-lg bg-[var(--danger)] text-white hover:opacity-90 transition-opacity",children:["Remove ",V.length," project",V.length>1?"s":""]})]})]})]})}),J&&u[J]&&R.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>j(null),children:R.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl p-5 w-80 shadow-xl",onClick:W=>W.stopPropagation(),children:[R.jsx("h3",{className:"text-sm font-semibold text-[var(--text-primary)] mb-3",children:"Remove Project"}),R.jsxs("p",{className:"text-xs text-[var(--text-secondary)] mb-4",children:["Remove ",R.jsx("strong",{children:u[J].name}),"? This will kill all its terminals."]}),R.jsxs("div",{className:"flex gap-2 justify-end",children:[R.jsx("button",{onClick:()=>j(null),className:"px-3 py-1.5 text-xs rounded-lg text-[var(--text-secondary)] hover:bg-[var(--surface-2)] transition-colors",children:"Cancel"}),R.jsx("button",{onClick:se,className:"px-3 py-1.5 text-xs rounded-lg bg-[var(--danger)] text-white hover:opacity-90 transition-opacity",children:"Remove"})]})]})})]})}function ig(e,t){const r=e.split(".").map(Number),i=t.split(".").map(Number);for(let s=0;s<3;s++){if((r[s]||0)>(i[s]||0))return!0;if((r[s]||0)<(i[s]||0))return!1}return!1}const sg="border border-[var(--border)] rounded-md px-1.5 py-0.5 bg-[var(--surface-0)] text-[11px] font-mono min-w-[24px] text-center inline-flex items-center justify-center shadow-[0_1px_0_var(--border)]",ng=[{keys:["⌘","P"],action:"Command palette"},{keys:["⌘","F"],action:"Search terminal"},{keys:["⌘","N"],action:"New pane (vertical)"},{keys:["⌘","⇧","N"],action:"New pane (horizontal)"},{keys:["⌘","W"],action:"Close pane"},{keys:["⌘","D"],action:"Toggle sidebar"},{keys:["⌘","T"],action:"Cycle layout"},{keys:["⌘","R"],action:"Auto reorganize"},{keys:["⌘","1-9"],action:"Focus pane by number"},{keys:["⌘","←→↑↓"],action:"Move focus"},{keys:["⌘","⇧","←→↑↓"],action:"Swap panes"},{keys:["⌥","←→↑↓"],action:"Swap panes"},{keys:["Shift","Enter"],action:"Insert new line"}];function og({open:e,onClose:t}){return e?R.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:t,children:R.jsxs("div",{className:"bg-[var(--surface-1)] border border-[var(--border)] rounded-xl w-[440px] shadow-2xl animate-fade-in",onClick:r=>r.stopPropagation(),children:[R.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-[var(--border)]",children:[R.jsx("h3",{className:"text-sm font-medium text-[var(--text-primary)]",children:"Keyboard Shortcuts"}),R.jsx("button",{onClick:t,className:"p-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",children:R.jsx(Lr,{size:14})})]}),R.jsx("div",{className:"p-4 space-y-2",children:ng.map((r,i)=>R.jsxs("div",{className:"flex items-center justify-between py-1",children:[R.jsx("div",{className:"flex items-center gap-1",children:r.keys.map((s,h)=>R.jsx("kbd",{className:sg,children:s},h))}),R.jsx("span",{className:"text-xs text-[var(--text-secondary)]",children:r.action})]},i))})]})}):null}const ag={"even-horizontal":R.jsx(On,{size:14}),"even-vertical":R.jsx(An,{size:14}),"main-left":R.jsx(yl,{size:14}),"main-top":R.jsx(Sl,{size:14}),grid:R.jsx(ml,{size:14})},lg={"even-horizontal":"Rows","even-vertical":"Columns","main-left":"Main + Stack","main-top":"Main + Row",grid:"Grid"};function cg({onNewPane:e}){const[t,r]=q.useState(!1),[i,s]=q.useState(!1),h=ee(u=>u.sidebarOpen),v=ee(u=>u.toggleSidebar),o=ae(u=>u.activeProjectId),c=re(u=>u.currentPresetIndex),f=re(u=>u.cyclePreset),g=Vt(u=>u.addFavourite),d=()=>{if(!o)return;const u=re.getState().getLayout(o),a=de(u);a.length>0&&f(o,a)},p=()=>{if(!o)return;const u=re.getState().getLayout(o),a=de(u);if(a.length===0)return;let n;a.length<=2?n="even-vertical":a.length===3?n="main-left":n="grid";const l=br(a,n);l&&re.getState().setLayout(o,l)},y=(u,a,n)=>{g({id:crypto.randomUUID(),name:u,preset:a,slots:n})},x=Xr[c],m=o?de(re.getState().getLayout(o)).length:0;return R.jsxs("div",{className:"h-9 flex-shrink-0 flex items-center px-2 gap-1 bg-[var(--surface-1)] border-b border-[var(--border)]",children:[!h&&R.jsx("button",{onClick:v,className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Show sidebar (Cmd+D)",children:R.jsx($v,{size:14})}),R.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),R.jsx("button",{onClick:()=>e("vertical"),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Split vertical (Cmd+N)",children:R.jsx(An,{size:14})}),R.jsx("button",{onClick:()=>e("horizontal"),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Split horizontal (Cmd+Shift+N)",children:R.jsx(On,{size:14})}),R.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),R.jsxs("button",{onClick:d,className:"flex items-center gap-1.5 px-2 py-1 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors text-xs",title:"Cycle layout (Cmd+T)",children:[ag[x],R.jsx("span",{className:"hidden sm:inline",children:lg[x]})]}),R.jsx("button",{onClick:p,className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Auto reorganize (Cmd+R)",children:R.jsx(Td,{size:14})}),R.jsx("div",{className:"w-px h-4 bg-[var(--border)] mx-1"}),R.jsx("button",{onClick:()=>r(!0),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-yellow-400 hover:bg-[var(--surface-3)] transition-colors",title:"Save as favourite",children:R.jsx(Bn,{size:14})}),R.jsx("div",{className:"flex-1"}),R.jsx("button",{onClick:()=>s(!0),className:"p-1.5 rounded text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Keyboard shortcuts",children:R.jsx(Hv,{size:14})}),R.jsx(Ad,{open:t,onClose:()=>r(!1),onSave:y,defaultPreset:x,defaultSlotCount:Math.max(m,1)}),R.jsx(og,{open:i,onClose:()=>s(!1)})]})}function ug(e,t){const r=q.useRef();q.useEffect(()=>{const i=e.current;if(!i)return;const s=new ResizeObserver(()=>{clearTimeout(r.current),r.current=setTimeout(t,I_)});return s.observe(i),()=>{s.disconnect(),clearTimeout(r.current)}},[e,t])}function hg(e,t){const r=ee(p=>p.setDragging),i=ee(p=>p.setDropTarget),s=ee(p=>p.draggingTerminalId),h=re(p=>p.movePaneInProject),v=re(p=>p.swapPanesInProject),o=q.useCallback(p=>{p.dataTransfer.setData("text/plain",e),p.dataTransfer.effectAllowed="move",r(e)},[e,r]),c=q.useCallback(()=>{r(null),i(null)},[r,i]),f=q.useCallback(p=>{if(p.preventDefault(),p.dataTransfer.dropEffect="move",!s||s===e){i(null);return}const y=p.currentTarget.getBoundingClientRect(),x=(p.clientX-y.left)/y.width,m=(p.clientY-y.top)/y.height;let u="center";const a=.2;x<a?u="left":x>1-a?u="right":m<a?u="top":m>1-a&&(u="bottom"),i({terminalId:e,edge:u})},[e,s,i]),g=q.useCallback(()=>{i(null)},[i]),d=q.useCallback(p=>{p.preventDefault();const y=p.dataTransfer.getData("text/plain");if(!y||y===e)return;const x=ee.getState().dropTarget;x&&(x.edge==="center"?v(t,y,e):h(t,y,e,x.edge),r(null),i(null))},[e,t,h,v,r,i]);return{onDragStart:o,onDragEnd:c,onDragOver:f,onDragLeave:g,onDrop:d}}function dg({terminalId:e,projectId:t,isFocused:r,onClose:i,dragProps:s}){const h=ue(d=>d.sessions[e]),v=(h==null?void 0:h.title)??"Terminal",o=(h==null?void 0:h.alive)??!0,c=re(d=>d.getLayout(t)),g=de(c).indexOf(e)+1;return R.jsxs("div",{draggable:!0,onDragStart:s.onDragStart,onDragEnd:s.onDragEnd,className:`
|
|
347
|
+
flex items-center h-7 px-2 gap-1.5 flex-shrink-0
|
|
348
|
+
border-b transition-colors duration-100
|
|
349
|
+
select-none cursor-grab active:cursor-grabbing
|
|
350
|
+
${r?"bg-[var(--surface-3)] border-[var(--accent)]":"bg-[var(--surface-2)] border-[var(--border)]"}
|
|
351
|
+
`,children:[R.jsx("div",{className:"text-[var(--text-muted)]",children:R.jsx(Fv,{size:12})}),R.jsx("span",{className:"text-[10px] font-medium text-[var(--text-muted)] tabular-nums",children:g}),R.jsx("span",{className:"text-xs text-[var(--text-secondary)] truncate flex-1",children:v}),!o&&R.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--danger)]"}),R.jsx("button",{onClick:d=>{d.stopPropagation(),i()},onMouseDown:d=>d.stopPropagation(),draggable:!1,className:`
|
|
352
|
+
p-0.5 rounded text-[var(--text-muted)]
|
|
353
|
+
hover:text-[var(--danger)] hover:bg-[var(--danger-dim)]
|
|
354
|
+
transition-colors
|
|
355
|
+
`,children:R.jsx(Lr,{size:12})})]})}const fo={matchBackground:void 0,matchBorder:"#facc15aa",matchOverviewRuler:"#facc15",activeMatchBackground:"#694d00",activeMatchBorder:"#fde047",activeMatchColorOverviewRuler:"#facc15"};function fg({terminalId:e,onClose:t}){const r=q.useRef(null),[i,s]=q.useState("");q.useEffect(()=>{var g;(g=r.current)==null||g.focus()},[]);const h=q.useCallback(()=>{const g=Es(e);g&&i&&g.findNext(i,{regex:!1,caseSensitive:!1,incremental:!1,decorations:fo})},[e,i]),v=q.useCallback(()=>{const g=Es(e);g&&i&&g.findPrevious(i,{regex:!1,caseSensitive:!1,incremental:!1,decorations:fo})},[e,i]),o=q.useCallback(()=>{const g=Es(e);g==null||g.clearDecorations(),t()},[e,t]),c=g=>{const d=g.target.value;s(d);const p=Es(e);p&&(d?p.findNext(d,{regex:!1,caseSensitive:!1,incremental:!0,decorations:fo}):p.clearDecorations())},f=g=>{if(g.key==="Escape"){g.stopPropagation(),o();return}g.key==="Enter"&&(g.preventDefault(),g.shiftKey?v():h())};return R.jsxs("div",{className:"flex items-center gap-2 px-3 py-2 bg-[var(--surface-2)] border-b border-[var(--border)]",onClick:g=>g.stopPropagation(),children:[R.jsx("input",{ref:r,type:"text",value:i,onChange:c,onKeyDown:f,placeholder:"Search...",className:"flex-1 min-w-0 bg-[var(--surface-0)] text-[var(--text-primary)] text-sm px-3 py-1.5 rounded-md border border-[var(--border)] outline-none focus:border-[var(--accent)] placeholder:text-[var(--text-muted)]"}),R.jsx("button",{onClick:v,className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Previous match (Shift+Enter)",children:R.jsx(Bv,{size:16})}),R.jsx("button",{onClick:h,className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Next match (Enter)",children:R.jsx(Dd,{size:16})}),R.jsx("button",{onClick:o,className:"p-1.5 rounded-md text-[var(--text-muted)] hover:text-[var(--text-primary)] hover:bg-[var(--surface-3)] transition-colors",title:"Close (Escape)",children:R.jsx(Lr,{size:16})})]})}function pg({terminalId:e}){const t=ee(h=>h.dropTarget);if(!t||t.terminalId!==e)return null;const r=t.edge,i=r==="center",s={left:"left-0 top-0 bottom-0 w-1/2",right:"right-0 top-0 bottom-0 w-1/2",top:"left-0 right-0 top-0 h-1/2",bottom:"left-0 right-0 bottom-0 h-1/2",center:"inset-0"};return R.jsx("div",{className:`
|
|
356
|
+
absolute ${s[r]??"inset-0"}
|
|
357
|
+
pointer-events-none z-20
|
|
358
|
+
${i?"bg-accent/15 border-2 border-accent/40":"bg-accent/20 border-2 border-accent/50"}
|
|
359
|
+
rounded-sm transition-all duration-100
|
|
360
|
+
`})}function _g({terminalId:e,projectId:t,cwd:r}){const i=ee(u=>u.focusedTerminalId),s=ee(u=>u.draggingTerminalId),h=ee(u=>u.searchTerminalId),v=i===e,o=s===e,c=h===e,{containerRef:f,fit:g,focus:d}=kv({terminalId:e,projectId:t,cwd:r}),p=hg(e,t);ug(f,g);const y=q.useCallback(()=>{var n;De({type:"pty:kill",terminalId:e}),re.getState().removePaneFromProject(t,e),ae.getState().removeTerminalFromProject(t,e);const u=ue.getState().sessions[e];(n=u==null?void 0:u.terminal)==null||n.dispose(),ue.getState().removeSession(e),ns(e);const a=de(re.getState().getLayout(t));ee.getState().setFocusedTerminal(a[0]??null)},[e,t]),x=q.useCallback(u=>{if(!(ee.getState().draggingTerminalId!=null)&&(u.dataTransfer.types.includes("codefiles")||u.dataTransfer.types.includes("text/plain"))){const n=u.dataTransfer.getData("codefiles");let l=[];if(n)try{l=JSON.parse(n)}catch{}if(l.length===0){const _=u.dataTransfer.getData("text/plain").trim();_&&_.startsWith("/")&&(l=_.split(`
|
|
361
|
+
`).map(S=>S.trim()).filter(Boolean))}if(l.length>0&&!u.dataTransfer.types.includes("Files")){u.preventDefault(),u.stopPropagation();const _=l.map(S=>/[ ()'"]/.test(S)?`'${S.replace(/'/g,"'\\''")}'`:S);De({type:"pty:input",terminalId:e,data:_.join(" ")}),d();return}}if(u.dataTransfer.types.includes("Files")&&u.dataTransfer.files.length>0){u.preventDefault(),u.stopPropagation();const n=Array.from(u.dataTransfer.files);Promise.all(n.map(l=>fetch("/api/resolve-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:l.name,size:l.size,lastModified:l.lastModified})}).then(_=>_.json()).then(_=>_.path).catch(()=>null))).then(l=>{const _=l.filter(Boolean);if(_.length>0){const S=_.map(C=>/[ ()'"]/.test(C)?`'${C.replace(/'/g,"'\\''")}'`:C);De({type:"pty:input",terminalId:e,data:S.join(" ")}),d()}});return}p.onDrop(u)},[e,p,d]),m=q.useCallback(u=>{if(ee.getState().draggingTerminalId!=null){p.onDragOver(u);return}if(u.dataTransfer.types.includes("Files")||u.dataTransfer.types.includes("codefiles")||u.dataTransfer.types.includes("text/plain")){u.preventDefault(),u.dataTransfer.dropEffect="copy";return}p.onDragOver(u)},[p]);return R.jsxs("div",{style:{borderColor:v?"var(--accent)":"transparent"},className:`
|
|
362
|
+
flex flex-col h-full w-full relative border
|
|
363
|
+
${o?"opacity-40":""}
|
|
364
|
+
transition-colors duration-100
|
|
365
|
+
`,onClick:d,onDragOver:m,onDragLeave:p.onDragLeave,onDrop:x,children:[R.jsx(dg,{terminalId:e,projectId:t,isFocused:v,onClose:y,dragProps:{onDragStart:p.onDragStart,onDragEnd:p.onDragEnd}}),c&&R.jsx(fg,{terminalId:e,onClose:()=>{ee.getState().closeSearch(),d()}}),R.jsx("div",{ref:f,className:"flex-1 min-h-0 min-w-0 overflow-hidden"}),R.jsx(pg,{terminalId:e})]})}function vg({projectId:e,path:t,direction:r}){const i=re(v=>v.resizePaneInProject),s=q.useRef(null);return{onMouseDown:q.useCallback(v=>{var p;v.preventDefault(),v.stopPropagation();const o=(p=s.current)==null?void 0:p.parentElement;if(!o)return;const c=o.getBoundingClientRect();r==="vertical"?v.clientX:v.clientY;const f=r==="vertical"?c.width:c.height,g=y=>{const x=r==="vertical"?y.clientX:y.clientY,m=r==="vertical"?c.left:c.top,u=(x-m)/f;i(e,t,u)},d=()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",d),document.body.style.cursor="",document.body.style.userSelect=""};document.addEventListener("mousemove",g),document.addEventListener("mouseup",d),document.body.style.cursor=r==="vertical"?"col-resize":"row-resize",document.body.style.userSelect="none"},[e,t,r,i]),containerRef:s}}function gg({projectId:e,path:t,direction:r}){const{onMouseDown:i,containerRef:s}=vg({projectId:e,path:t,direction:r}),h=r==="vertical";return R.jsxs("div",{ref:s,className:`
|
|
366
|
+
relative z-10 flex-shrink-0
|
|
367
|
+
${h?"w-[4px] cursor-col-resize":"h-[4px] cursor-row-resize"}
|
|
368
|
+
group
|
|
369
|
+
`,onMouseDown:i,children:[R.jsx("div",{className:`
|
|
370
|
+
absolute
|
|
371
|
+
${h?"inset-y-0 -left-[2px] w-[8px]":"inset-x-0 -top-[2px] h-[8px]"}
|
|
372
|
+
transition-colors duration-150
|
|
373
|
+
hover:bg-accent/40
|
|
374
|
+
group-active:bg-accent/60
|
|
375
|
+
`}),R.jsx("div",{className:`
|
|
376
|
+
${h?"w-full h-full":"h-full w-full"}
|
|
377
|
+
bg-[var(--border)]
|
|
378
|
+
transition-colors duration-150
|
|
379
|
+
group-hover:bg-accent/60
|
|
380
|
+
group-active:bg-accent
|
|
381
|
+
`})]})}function Sa({node:e,projectId:t,cwd:r,path:i=[]}){if(e.type==="leaf")return R.jsx(_g,{terminalId:e.terminalId,projectId:t,cwd:r});const s=e.direction==="vertical",h=`${e.ratio*100}%`,v=`${(1-e.ratio)*100}%`;return R.jsxs("div",{className:`flex ${s?"flex-row":"flex-col"} h-full w-full`,children:[R.jsx("div",{style:{flexBasis:h,minWidth:0,minHeight:0,overflow:"hidden"},className:"flex",children:R.jsx(Sa,{node:e.first,projectId:t,cwd:r,path:[...i,0]})}),R.jsx(gg,{projectId:t,path:i,direction:e.direction}),R.jsx("div",{style:{flexBasis:v,minWidth:0,minHeight:0,overflow:"hidden"},className:"flex",children:R.jsx(Sa,{node:e.second,projectId:t,cwd:r,path:[...i,1]})})]})}function mg(){const[e,t]=q.useState(null);return q.useEffect(()=>{let r=!1;return Math.random()<.5?fetch("https://dummyjson.com/quotes/random").then(s=>s.json()).then(s=>{!r&&(s!=null&&s.quote)&&t({text:s.quote,attribution:s.author})}).catch(()=>{}):fetch("https://uselessfacts.jsph.pl/api/v2/facts/random?language=en").then(s=>s.json()).then(s=>{!r&&(s!=null&&s.text)&&t({text:s.text})}).catch(()=>{}),()=>{r=!0}},[]),e}function yg({onNewTerminal:e,projectName:t}){const r=mg(),i=Vt(h=>h.favourites),s=Object.values(i);return R.jsx("div",{className:"h-full w-full flex items-center justify-center bg-[var(--surface-0)]",children:R.jsxs("div",{className:"flex flex-col items-center gap-8 text-center max-w-md px-8",children:[R.jsxs("div",{className:"flex flex-col items-center gap-4",children:[R.jsx("div",{className:"w-16 h-16 rounded-2xl bg-[var(--surface-2)] border border-[var(--border)] flex items-center justify-center",children:R.jsx(wl,{size:28,className:"text-[var(--text-muted)]"})}),R.jsxs("div",{children:[R.jsx("h2",{className:"text-lg font-medium text-[var(--text-primary)] mb-1",children:t??"No project selected"}),R.jsx("p",{className:"text-sm text-[var(--text-muted)]",children:t?"This project has no active terminals.":"Create a project to get started."})]}),t&&R.jsxs("button",{onClick:e,className:`
|
|
382
|
+
flex items-center gap-2 px-5 py-2.5
|
|
383
|
+
bg-accent hover:bg-accent/80
|
|
384
|
+
text-white text-sm font-medium
|
|
385
|
+
rounded-lg transition-colors
|
|
386
|
+
`,children:[R.jsx(Ji,{size:16}),"New Terminal"]})]}),t&&s.length>0&&R.jsxs("div",{className:"w-full rounded-xl bg-[var(--surface-1)] border border-[var(--border)] p-4",children:[R.jsxs("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-[var(--text-muted)] mb-3 text-left flex items-center gap-1.5",children:[R.jsx(Bn,{size:11}),"Favourites"]}),R.jsx("div",{className:"space-y-1.5",children:s.map(h=>R.jsxs("button",{onClick:()=>ee.getState().requestFavouriteLaunch(h.id),className:`
|
|
387
|
+
group w-full flex items-center gap-2.5 px-3 py-2.5
|
|
388
|
+
bg-[var(--surface-2)] hover:bg-[var(--surface-3)]
|
|
389
|
+
text-sm text-[var(--text-secondary)] hover:text-[var(--text-primary)]
|
|
390
|
+
rounded-lg transition-colors text-left
|
|
391
|
+
`,children:[R.jsx(Md,{size:12,className:"text-[var(--text-muted)] group-hover:text-[var(--accent)] shrink-0 transition-colors"}),R.jsx("span",{className:"truncate font-medium",children:h.name}),R.jsxs("span",{className:"ml-auto text-[10px] text-[var(--text-muted)] tabular-nums shrink-0",children:[h.slots.length," pane",h.slots.length!==1?"s":""]})]},h.id))})]}),r&&R.jsxs("div",{className:"max-w-sm",children:[R.jsxs("p",{className:"text-sm italic text-[var(--text-muted)] leading-relaxed",children:['"',r.text,'"']}),r.attribution&&R.jsxs("p",{className:"text-xs text-[var(--text-muted)]/60 mt-2",children:["— ",r.attribution]})]})]})})}function Sg(){const e=ee(s=>s.syncToast),t=ee(s=>s.dismissSyncToast),[r,i]=q.useState(!1);return q.useEffect(()=>{if(!e){i(!1);return}requestAnimationFrame(()=>i(!0));const s=setTimeout(()=>{i(!1),setTimeout(t,200)},3e3);return()=>clearTimeout(s)},[e==null?void 0:e.id]),e?R.jsxs("div",{onClick:()=>{i(!1),setTimeout(t,200)},style:{position:"absolute",top:16,left:"50%",zIndex:9999,display:"flex",alignItems:"center",gap:8,padding:"8px 14px",borderRadius:8,background:"var(--surface-2)",color:"var(--text-primary)",border:"1px solid var(--border)",fontSize:13,cursor:"pointer",boxShadow:"0 4px 12px rgba(0,0,0,0.15)",opacity:r?1:0,transform:r?"translate(-50%, 0)":"translate(-50%, -8px)",transition:"opacity 200ms ease, transform 200ms ease",pointerEvents:r?"auto":"none"},children:[R.jsx(_n,{size:15,style:{color:"var(--accent)",flexShrink:0}}),R.jsxs("span",{children:["Synced to ",R.jsx("strong",{children:e.projectName})]})]}):null}function wg(){const e=ee(r=>r.commandPaletteOpen),t=ee(r=>r.closeCommandPalette);return e?R.jsx(Cg,{onClose:t}):null}function Cg({onClose:e}){const[t,r]=q.useState(""),[i,s]=q.useState(0),h=q.useRef(null),v=q.useRef(null);q.useEffect(()=>{var d;(d=h.current)==null||d.focus()},[]);const o=q.useMemo(()=>xg(),[e]),c=q.useMemo(()=>{if(!t.trim())return o;const d=t.toLowerCase();return o.filter(p=>p.label.toLowerCase().includes(d))},[o,t]);q.useEffect(()=>{s(0)},[t]);const f=q.useCallback(d=>{d.action(),e()},[e]),g=d=>{if(d.key==="Escape"){d.preventDefault(),d.stopPropagation(),e();return}if(d.key==="ArrowDown"){d.preventDefault(),s(p=>Math.min(p+1,c.length-1));return}if(d.key==="ArrowUp"){d.preventDefault(),s(p=>Math.max(p-1,0));return}if(d.key==="Enter"){d.preventDefault(),c[i]&&f(c[i]);return}};return q.useEffect(()=>{const d=v.current;if(!d)return;const p=d.children[i];p==null||p.scrollIntoView({block:"nearest"})},[i]),R.jsx("div",{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm",onClick:e,children:R.jsxs("div",{className:"max-w-lg mx-auto mt-[20vh] bg-[var(--surface-1)] border border-[var(--border)] rounded-xl shadow-2xl overflow-hidden",onClick:d=>d.stopPropagation(),children:[R.jsxs("div",{className:"flex items-center gap-2 px-4 py-3 border-b border-[var(--border)]",children:[R.jsx(Vv,{size:16,className:"text-[var(--text-muted)] shrink-0"}),R.jsx("input",{ref:h,type:"text",value:t,onChange:d=>r(d.target.value),onKeyDown:g,placeholder:"Search commands...",className:"flex-1 bg-transparent text-sm text-[var(--text-primary)] outline-none placeholder:text-[var(--text-muted)]"}),R.jsx("kbd",{className:"hidden sm:inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded bg-[var(--surface-3)] text-[10px] text-[var(--text-muted)] font-mono",children:"ESC"})]}),R.jsx("div",{ref:v,className:"max-h-72 overflow-y-auto py-1",children:c.length===0?R.jsx("div",{className:"px-4 py-6 text-center text-xs text-[var(--text-muted)]",children:"No matching commands"}):c.map((d,p)=>R.jsxs("button",{onClick:()=>f(d),onMouseEnter:()=>s(p),className:`
|
|
392
|
+
w-full flex items-center gap-3 px-4 py-2 text-left transition-colors
|
|
393
|
+
${p===i?"bg-[var(--surface-2)] text-[var(--text-primary)]":"text-[var(--text-secondary)] hover:bg-[var(--surface-2)]"}
|
|
394
|
+
`,children:[R.jsx("span",{className:"shrink-0 text-[var(--text-muted)]",children:d.icon}),R.jsx("span",{className:"flex-1 text-xs truncate",children:d.label}),R.jsx("span",{className:"shrink-0 text-[9px] px-1.5 py-0.5 rounded bg-[var(--surface-3)] text-[var(--text-muted)]",children:d.category}),d.shortcut&&R.jsx("kbd",{className:"shrink-0 text-[10px] px-1.5 py-0.5 rounded bg-[var(--surface-3)] text-[var(--text-muted)] font-mono",children:d.shortcut})]},d.id))})]})})}function xg(e){const t=[],r=ae.getState().projects,i=Vt.getState().favourites,s=ae.getState().activeProjectId;for(const v of Object.values(r))t.push({id:`project:${v.id}`,label:`Switch to ${v.name}`,category:"Project",icon:R.jsx(Rd,{size:14}),action:()=>{ae.getState().setActiveProject(v.id)}});for(const v of Object.values(i))t.push({id:`fav:${v.id}`,label:`Launch ${v.name}`,category:"Favourite",icon:R.jsx(Bn,{size:14}),action:()=>{ee.getState().requestFavouriteLaunch(v.id)}});const h={"even-horizontal":{label:"Layout: Rows",icon:R.jsx(On,{size:14})},"even-vertical":{label:"Layout: Columns",icon:R.jsx(An,{size:14})},"main-left":{label:"Layout: Main + Stack",icon:R.jsx(yl,{size:14})},"main-top":{label:"Layout: Main + Row",icon:R.jsx(Sl,{size:14})},grid:{label:"Layout: Grid",icon:R.jsx(ml,{size:14})}};for(const v of Xr){const o=h[v];t.push({id:`layout:${v}`,label:o.label,category:"Layout",icon:o.icon,action:()=>{if(!s)return;const c=re.getState().getLayout(s),f=de(c);if(f.length===0)return;const g=br(f,v);g&&re.getState().setLayout(s,g)}})}return t.push({id:"action:new-pane-v",label:"New pane (vertical)",category:"Action",icon:R.jsx(Ji,{size:14}),shortcut:"⌘N",action:()=>{if(!s)return;const v=re.getState().getLayout(s),o=de(v),c=ee.getState().focusedTerminalId,f=crypto.randomUUID(),g=c??o[o.length-1];g?re.getState().addPaneToProject(s,g,f,"vertical"):re.getState().setLayout(s,{type:"leaf",terminalId:f}),ae.getState().addTerminalToProject(s,f),ee.getState().setFocusedTerminal(f)}}),t.push({id:"action:new-pane-h",label:"New pane (horizontal)",category:"Action",icon:R.jsx(Ji,{size:14}),shortcut:"⌘⇧N",action:()=>{if(!s)return;const v=re.getState().getLayout(s),o=de(v),c=ee.getState().focusedTerminalId,f=crypto.randomUUID(),g=c??o[o.length-1];g?re.getState().addPaneToProject(s,g,f,"horizontal"):re.getState().setLayout(s,{type:"leaf",terminalId:f}),ae.getState().addTerminalToProject(s,f),ee.getState().setFocusedTerminal(f)}}),t.push({id:"action:close-pane",label:"Close pane",category:"Action",icon:R.jsx(Lr,{size:14}),shortcut:"⌘W",action:()=>{var f;if(!s)return;const v=ee.getState().focusedTerminalId;if(!v)return;De({type:"pty:kill",terminalId:v}),re.getState().removePaneFromProject(s,v),ae.getState().removeTerminalFromProject(s,v);const o=ue.getState().sessions[v];(f=o==null?void 0:o.terminal)==null||f.dispose(),ue.getState().removeSession(v),ns(v);const c=de(re.getState().getLayout(s));ee.getState().setFocusedTerminal(c[0]??null)}}),t.push({id:"action:toggle-sidebar",label:"Toggle sidebar",category:"Action",icon:R.jsx(Pd,{size:14}),shortcut:"⌘D",action:()=>{ee.getState().toggleSidebar()}}),t.push({id:"action:cycle-theme",label:"Cycle theme",category:"Action",icon:R.jsx(_n,{size:14}),action:()=>{ee.getState().cycleTheme()}}),t.push({id:"action:toggle-editor-sync",label:"Toggle editor sync",category:"Action",icon:R.jsx(_n,{size:14}),action:()=>{ee.getState().toggleEditorSync()}}),t.push({id:"action:auto-reorganize",label:"Auto reorganize",category:"Action",icon:R.jsx(Td,{size:14}),shortcut:"⌘R",action:()=>{if(!s)return;const v=re.getState().getLayout(s),o=de(v);if(o.length===0)return;let c;o.length<=2?c="even-vertical":o.length===3?c="main-left":c="grid";const f=br(o,c);f&&re.getState().setLayout(s,f)}}),t}function bg(){Lv(),Rv(),q.useEffect(()=>{ae.getState().hydrateFromServer(),Vt.getState().hydrateFromServer(),ee.getState().hydrateFromServer()},[]);const e=ae(c=>c.activeProjectId),t=ae(c=>c.activeProjectId?c.projects[c.activeProjectId]:null),r=re(c=>e?c.getLayout(e):null),i=ee(c=>c.focusedTerminalId),s=ee(c=>c.setFocusedTerminal),h=ae(c=>c.addTerminalToProject),v=q.useCallback(c=>{if(!e||!t)return;const f=crypto.randomUUID(),g=de(r),d=i??g[0];d?re.getState().addPaneToProject(e,d,f,c):re.getState().setLayout(e,{type:"leaf",terminalId:f}),h(e,f),s(f)},[e,t,r,i,h,s]),o=q.useCallback(()=>{v("vertical")},[v]);return R.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-[var(--surface-0)]",children:[R.jsx(rg,{}),R.jsx(wg,{}),R.jsxs("div",{className:"relative flex-1 flex flex-col min-w-0",children:[R.jsx(Sg,{}),R.jsx(cg,{onNewPane:v}),R.jsx("div",{className:"flex-1 min-h-0 min-w-0",children:r?R.jsx(Sa,{node:r,projectId:e,cwd:(t==null?void 0:t.cwd)??"/"},e):R.jsx(yg,{onNewTerminal:o,projectName:t==null?void 0:t.name})})]})]})}po.createRoot(document.getElementById("root")).render(R.jsx(su.StrictMode,{children:R.jsx(bg,{})}));
|